44 extern MHEG5EventType asn1_decodeEventType( MHEG5Int evt_val );
48 #define AssignNextParam(gl) if (asn1_GroupParamCount < fpa1_GroupParamCount) { \ 49 gl = asn1_GroupParamPtr++; asn1_GroupParamCount++; } else { \ 60 int asn1_GroupActionCount = 0;
61 int asn1_GroupParamCount = 0;
77 DPL5((
">> asn1_addNewGList(%X)\n", gList));
79 if (asn1_GroupParamCount < fpa1_GroupParamCount)
81 newGList = asn1_GroupParamPtr++;
82 asn1_GroupParamCount++;
83 newGList->next = NULL;
86 gList->next = newGList;
91 DPL1((
"ERROR:[ASN.1] asn1_addNewGList(), Failed to allocate %d bytes\n",
96 DPL5((
"<< asn1_addNewGList() Returns %X\n", newGList));
109 MHEG5GList *newParam, *currParam = action->firstParam;
111 DPL5((
">> asn1_addNewActionParameter(%X)\n", action));
115 if (asn1_GroupParamCount < fpa1_GroupParamCount)
117 newParam = asn1_GroupParamPtr++;
118 asn1_GroupParamCount++;
121 if (action->firstParam == NULL)
123 action->firstParam = newParam;
128 while (currParam->next != NULL)
130 currParam = currParam->next;
132 currParam->next = newParam;
138 DPL1((
"ERROR:[ASN.1] asn1_addNewActionParameter() failed to allocate %d bytes\n",
142 DPL5((
"<< asn1_addNewActionParameter() Returns %X\n", newParam));
164 if ((listPtr == NULL) || (gList == NULL))
167 TRACE(TERROR, (
"invalid pointer %p %p", listPtr, gList))
172 switch (listPtr->tag)
176 gList->generic.type = MHEG5OBJECTREF;
177 gList->generic.value.o.id = listPtr->data.intData;
178 assert( gList->generic.value.o.gref.len == 0 );
179 gList->generic.value.o.gref.ptr.group = asn1_mainGroupPtr;
182 case EXTERNAL_REFERENCE_TYPE:
184 listPtr = listPtr->children;
185 if (listPtr != NULL && listPtr->next != NULL)
187 gList->generic.type = MHEG5OBJREFEXT;
188 gList->generic.value.o.id = listPtr->next->data.intData;
193 TRACE(TERROR, (
"ext ref children null; listPtr=%p", listPtr))
198 TRACE(TERROR, (
"listPtr->tag=%d", listPtr->tag))
217 DPL5((
">> asn1_decodeGenericObjectReference(%X,%X)\n", listPtr, gList));
218 if ((listPtr == NULL) || (gList == NULL))
221 DPL5((
"<< asn1_decodeGenericObjectReference() Returned early\n"));
227 if (currItem->tag == INDIRECT)
230 gList->generic.indirect = MHEG5TRUE;
241 DPL2((
"WARNING:[ASN.1] asn1_decodeGenericObjectReference() returns errVal = %d\n", errVal));
245 DPL5((
"<< asn1_decodeGenericObjectReference() Returns %d\n", errVal));
262 DPL5((
">> asn1_decodeGenericInteger(%X,%X)\n", listPtr, gList));
263 if ((listPtr == NULL) || (gList == NULL))
266 DPL5((
"<< asn1_decodeGenericInteger() Returned early\n"));
273 if (currItem->tag == INDIRECT)
276 gList->generic.indirect = MHEG5TRUE;
280 gList->generic.value.i = currItem->data.intData;
281 gList->generic.type = MHEG5INT;
288 DPL2((
"WARNING:[ASN.1] asn1_decodeGenericInteger() returns errVal = %d\n", errVal));
292 DPL5((
"<< asn1_decodeGenericInteger() Returns %d\n", errVal));
309 DPL5((
">> asn1_decodeGenericBoolean(%X,%X)\n", listPtr, gList));
310 if ((listPtr == NULL) || (gList == NULL))
313 DPL5((
"<< asn1_decodeGenericBoolean() Returned early\n"));
319 if (currItem->tag == INDIRECT)
322 gList->generic.indirect = MHEG5TRUE;
326 gList->generic.value.b = (currItem->data.boolData == 0) ? MHEG5FALSE : MHEG5TRUE;
327 gList->generic.type = MHEG5BOOL;
334 DPL2((
"WARNING:[ASN.1] asn1_decodeGenericBoolean() returns errVal = %d\n", errVal));
338 DPL5((
"<< asn1_decodeGenericBoolean() Returns %d\n", errVal));
355 DPL5((
">> asn1_decodeGenericOctetString(%X,%X)\n", listPtr, gList));
356 if ((listPtr == NULL) || (gList == NULL))
359 DPL5((
"<< asn1_decodeGenericOctetString() Returned early\n"));
364 if (currItem->tag == INDIRECT)
367 gList->generic.indirect = MHEG5TRUE;
372 gList->generic.type = MHEG5OCTETSTRING;
379 DPL2((
"WARNING:[ASN.1] asn1_decodeGenericOctetString() returns errVal = %d\n", errVal));
383 DPL5((
"<< asn1_decodeGenericOctetString() Returns %d\n", errVal));
400 DPL5((
">> asn1_decodeGenericContentReference(%X,%X)\n", listPtr, gList));
401 if ((listPtr == NULL) || (gList == NULL))
404 DPL5((
"<< asn1_decodeGenericContentReference() Returned early\n"));
410 if (currItem->tag == INDIRECT)
413 gList->generic.indirect = MHEG5TRUE;
418 gList->generic.type = MHEG5CONTENTREF;
425 DPL2((
"WARNING:[ASN.1] asn1_decodeGenericContentReference() returns errVal = %d\n", errVal));
429 DPL5((
"<< asn1_decodeGenericContentReference() Returns %d\n", errVal));
446 asnErr elemActionErr = 0;
450 MHEG5Bool isOnSomething;
451 int action_count = 0;
453 DPL5((
">> asn1_decodeAction(%X)\n", listPtr));
455 assert(asn1_GroupActionPtr);
457 isOnSomething = (listPtr->tag == EFFECT || listPtr->tag == SEQ_SIZE_OF_ELEMENTARY_ACTION) ? MHEG5FALSE : MHEG5TRUE;
459 p_actions->a_ptr = asn1_GroupActionPtr;
461 currItem = listPtr->children;
464 while (currItem != NULL && asn1_GroupActionCount != fpa1_GroupActionCount)
466 asn1_GroupActionCount++;
468 currAction = asn1_GroupActionPtr;
469 assert( currAction->firstParam == NULL );
472 currParam = asn1_addNewActionParameter(currAction);
473 currAction->origFirstParam = currAction->firstParam;
474 currParam->generic.isfirst = MHEG5TRUE;
476 if (elemActionErr == 0)
480 tmpItem = currItem->children->next;
482 switch (currItem->tag)
490 elemActionErr |= 0x10;
514 case CLOSECONNECTION:
523 case SETCACHEPRIORITY:
524 case SETCOUNTERENDPOSITION:
525 case SETCOUNTERPOSITION:
528 case SETFOCUSPOSITION:
529 case SETINPUTREGISTER:
534 case SETTRANSPARENCY:
539 currParam = asn1_addNewActionParameter(currAction);
546 case GETAVAILABILITYSTATUS:
550 case GETFOCUSPOSITION:
551 case GETHIGHLIGHTSTATUS:
552 case GETINTERACTIONSTATUS:
554 case GETLASTANCHORFIRED:
559 case GETOVERWRITEMODE:
561 case GETRUNNINGSTATUS:
562 case GETSELECTIONSTATUS:
566 case GETTOKENPOSITION:
568 currParam = asn1_addNewActionParameter(currAction);
575 case SETFONTATTRIBUTES:
577 currParam = asn1_addNewActionParameter(currAction);
582 case SETHIGHLIGHTSTATUS:
583 case SETINTERACTIONSTATUS:
584 case SETOVERWRITEMODE:
585 currParam = asn1_addNewActionParameter(currAction);
591 case GETCOUNTERPOSITION:
592 case GETCOUNTERMAXPOSITION:
596 currParam = asn1_addNewActionParameter(currAction);
604 currParam = asn1_addNewActionParameter(currAction);
606 currParam = asn1_addNewActionParameter(currAction);
611 elemActionErr |= 0x01;
619 case SETCURSORPOSITION:
621 case SETBITMAPDECODEOFFSET:
622 case SETVIDEODECODEOFFSET:
625 currParam = asn1_addNewActionParameter(currAction);
627 currParam = asn1_addNewActionParameter(currAction);
632 elemActionErr |= 0x01;
638 case GETCURSORPOSITION:
640 case GETBITMAPDECODEOFFSET:
641 case GETVIDEODECODEOFFSET:
644 currParam = asn1_addNewActionParameter(currAction);
646 currParam = asn1_addNewActionParameter(currAction);
651 elemActionErr |= 0x01;
661 currParam = asn1_addNewActionParameter(currAction);
663 currParam = asn1_addNewActionParameter(currAction);
668 elemActionErr |= 0x01;
673 case GETENGINESUPPORT:
676 currParam = asn1_addNewActionParameter(currAction);
678 currParam = asn1_addNewActionParameter(currAction);
683 elemActionErr |= 0x01;
688 case SETSLIDERPARAMETERS:
689 case SETCELLPOSITION:
692 currParam = asn1_addNewActionParameter(currAction);
694 tmpItem = tmpItem->next;
695 currParam = asn1_addNewActionParameter(currAction);
697 tmpItem = tmpItem->next;
698 currParam = asn1_addNewActionParameter(currAction);
703 elemActionErr |= 0x01;
712 currParam = asn1_addNewActionParameter(currAction);
714 tmpItem = tmpItem->next;
717 currParam = asn1_addNewActionParameter(currAction);
719 tmpItem = tmpItem->next;
722 currParam = asn1_addNewActionParameter(currAction);
724 tmpItem = tmpItem->next;
727 currParam = asn1_addNewActionParameter(currAction);
729 tmpItem = tmpItem->next;
732 currParam = asn1_addNewActionParameter(currAction);
734 tmpItem = tmpItem->next;
735 currParam = asn1_addNewActionParameter(currAction);
740 elemActionErr |= 0x01;
745 elemActionErr |= 0x01;
750 elemActionErr |= 0x01;
755 elemActionErr |= 0x01;
760 elemActionErr |= 0x01;
769 currParam = asn1_addNewActionParameter(currAction);
771 tmpItem = tmpItem->next;
774 currParam = asn1_addNewActionParameter(currAction);
776 tmpItem = tmpItem->next;
779 currParam = asn1_addNewActionParameter(currAction);
781 tmpItem = tmpItem->next;
782 currParam = asn1_addNewActionParameter(currAction);
787 elemActionErr |= 0x01;
792 elemActionErr |= 0x01;
797 elemActionErr |= 0x01;
801 #ifndef ASN1UKPROFILE 805 currParam = asn1_addNewActionParameter(currAction);
807 tmpItem = tmpItem->next;
810 currParam = asn1_addNewActionParameter(currAction);
812 tmpItem = tmpItem->next;
815 currParam = asn1_addNewActionParameter(currAction);
817 tmpItem = tmpItem->next;
818 currParam = asn1_addNewActionParameter(currAction);
823 elemActionErr |= 0x01;
828 elemActionErr |= 0x01;
833 elemActionErr |= 0x01;
843 currParam = asn1_addNewActionParameter(currAction);
845 tmpItem = tmpItem->next;
848 if (tmpItem->tag == SEQ_SIZE_OF_PARAMETER)
850 tmpItem = tmpItem->children;
851 while (tmpItem != NULL)
853 currParam = asn1_addNewActionParameter(currAction);
854 switch (tmpItem->tag)
872 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Invalid tag in FORK\n"));
873 elemActionErr |= 0x01;
876 tmpItem = tmpItem->next;
883 elemActionErr |= 0x01;
891 currParam = asn1_addNewActionParameter(currAction);
894 currParam->generic.type = MHEG5BRACKETOPEN;
896 tmpItem = tmpItem->children;
897 while (tmpItem != NULL)
899 if (tmpItem->tag == POINT_TYPE)
901 currParam = asn1_addNewActionParameter(currAction);
905 elemActionErr |= 0x01;
908 currParam->generic.type = MHEG5BRACKETOPEN;
910 currParam = asn1_addNewActionParameter(currAction);
913 currParam = asn1_addNewActionParameter(currAction);
916 currParam = asn1_addNewActionParameter(currAction);
920 elemActionErr |= 0x01;
923 currParam->generic.type = MHEG5BRACKETCLOSE;
924 tmpItem = tmpItem->next;
928 currParam = asn1_addNewActionParameter(currAction);
931 currParam->generic.type = MHEG5BRACKETCLOSE;
936 elemActionErr |= 0x01;
943 elemActionErr |= 0x01;
948 elemActionErr |= 0x01;
953 case STOREPERSISTENT:
956 currParam = asn1_addNewActionParameter(currAction);
958 tmpItem = tmpItem->next;
966 currParam = asn1_addNewActionParameter(currAction);
969 currParam->generic.type = MHEG5BRACKETOPEN;
970 if (tmpItem->tag == SEQ_SIZE_OF_OBJECT_REFERENCE)
972 tmpItem = tmpItem->children;
973 while (tmpItem != NULL)
975 currParam = asn1_addNewActionParameter(currAction);
977 tmpItem = tmpItem->next;
980 currParam = asn1_addNewActionParameter(currAction);
983 currParam->generic.type = MHEG5BRACKETCLOSE;
985 currParam = asn1_addNewActionParameter(currAction);
990 elemActionErr |= 0x01;
995 elemActionErr |= 0x01;
1000 elemActionErr |= 0x01;
1005 elemActionErr |= 0x01;
1010 if (tmpItem != NULL)
1012 currParam = asn1_addNewActionParameter(currAction);
1014 tmpItem = tmpItem->next;
1015 if (tmpItem != NULL)
1017 currParam = asn1_addNewActionParameter(currAction);
1020 currParam->generic.value.e = asn1_decodeEventType( tmpItem->data.intData );
1021 currParam->generic.type = MHEG5EVENT;
1022 tmpItem = tmpItem->next;
1023 if (tmpItem != NULL)
1025 currParam = asn1_addNewActionParameter(currAction);
1026 switch (tmpItem->tag)
1038 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SENDEVENT\n"));
1039 elemActionErr |= 0x01;
1051 elemActionErr |= 0x01;
1056 elemActionErr |= 0x01;
1060 case SETCOUNTERTRIGGER:
1061 if (tmpItem != NULL)
1063 currParam = asn1_addNewActionParameter(currAction);
1065 tmpItem = tmpItem->next;
1066 if (tmpItem != NULL)
1068 currParam = asn1_addNewActionParameter(currAction);
1074 elemActionErr |= 0x01;
1078 #ifndef ASN1UKPROFILE 1079 case SETCURSORSHAPE:
1080 if (tmpItem != NULL)
1082 currParam = asn1_addNewActionParameter(currAction);
1104 if (tmpItem != NULL)
1106 currParam = asn1_addNewActionParameter(currAction);
1110 if (tmpItem->tag == NEW_REFERENCED_CONTENT)
1112 tmpItem = tmpItem->children;
1113 if (tmpItem != NULL)
1117 tmpItem = tmpItem->next;
1118 if (tmpItem != NULL)
1121 if ((tmpItem->tag == NEWCSIZE) && (tmpItem->children != NULL))
1123 currParam = asn1_addNewActionParameter(currAction);
1126 if (tmpItem->children->tag == MHEG_NULL)
1130 currParam->generic.type = MHEG5NULL;
1143 tmpItem = tmpItem->next;
1144 if (tmpItem != NULL)
1146 if ((tmpItem->tag == NEWCPRIO) && (tmpItem->children != NULL))
1148 currParam = asn1_addNewActionParameter(currAction);
1161 elemActionErr |= 0x01;
1166 elemActionErr |= 0x01;
1172 elemActionErr |= 0x01;
1177 elemActionErr |= 0x01;
1182 elemActionErr |= 0x01;
1187 elemActionErr |= 0x01;
1198 elemActionErr |= 0x01;
1203 elemActionErr |= 0x01;
1208 if (tmpItem != NULL)
1210 currParam = asn1_addNewActionParameter(currAction);
1211 switch (tmpItem->tag)
1213 #ifndef ASN1UKPROFILE 1222 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag (%d) in SETFILLCOLOUR\n",tmpItem->tag));
1223 elemActionErr |= 0x01;
1232 if (tmpItem != NULL)
1234 currParam = asn1_addNewActionParameter(currAction);
1235 switch (tmpItem->tag)
1244 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETFONTREF\n"));
1245 elemActionErr |= 0x01;
1251 elemActionErr |= 0x01;
1258 case SETBACKGROUNDCOLOUR:
1259 case SETDESKTOPCOLOUR:
1260 if (tmpItem != NULL)
1262 currParam = asn1_addNewActionParameter(currAction);
1263 switch (tmpItem->tag)
1265 #ifndef ASN1UKPROFILE 1274 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETLINECOLOUR\n"));
1275 elemActionErr |= 0x01;
1281 elemActionErr |= 0x01;
1286 if (tmpItem != NULL)
1288 if (tmpItem->tag == RATIONAL_TYPE)
1290 tmpItem = tmpItem->children;
1291 currParam = asn1_addNewActionParameter(currAction);
1293 tmpItem = tmpItem->next;
1294 if (tmpItem != NULL)
1296 currParam = asn1_addNewActionParameter(currAction);
1302 elemActionErr |= 0x01;
1307 elemActionErr |= 0x01;
1312 if (tmpItem != NULL)
1314 currParam = asn1_addNewActionParameter(currAction);
1316 tmpItem = tmpItem->next;
1317 if (tmpItem != NULL)
1319 tmpItem = tmpItem->children;
1320 currParam = asn1_addNewActionParameter(currAction);
1322 tmpItem = tmpItem->next;
1323 if (tmpItem != NULL)
1326 currParam = asn1_addNewActionParameter(currAction);
1333 elemActionErr |= 0x01;
1340 elemActionErr |= 0x01;
1345 if (tmpItem != NULL)
1347 currParam = asn1_addNewActionParameter(currAction);
1348 switch (tmpItem->tag)
1366 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETVARIABLE\n"));
1367 elemActionErr |= 0x01;
1373 elemActionErr |= 0x01;
1378 if (tmpItem != NULL)
1380 currParam = asn1_addNewActionParameter(currAction);
1382 tmpItem = tmpItem->next;
1383 if (tmpItem != NULL)
1385 currParam = asn1_addNewActionParameter(currAction);
1386 switch (tmpItem->tag)
1404 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in TESTVARIABLE\n"));
1405 elemActionErr |= 0x01;
1412 elemActionErr |= 0x01;
1420 elemActionErr |= 0x10;
1422 else if (tmpItem == NULL)
1424 elemActionErr |= 0x01;
1426 else if (tmpItem->tag == INTEGER)
1428 currParam = asn1_addNewActionParameter(currAction);
1433 tmpItem = tmpItem->next;
1435 #ifndef ASN1UKPROFILE 1436 if (tmpItem != NULL)
1438 currParam = asn1_addNewActionParameter(currAction);
1446 DPL2((
"WARNING:[ASN.1] asn1_decodeAction(). Unexpected Action Tag\n"));
1447 elemActionErr |= 0x01;
1451 if (elemActionErr == 0)
1455 currAction->type = (MHEG5ElemActionType) (currItem->tag - ACTIVATE + MHEG5ACTIVATE);
1456 asn1_GroupActionPtr++;
1463 DPL2((
"WARNING:[ASN.1] asn1_decodeAction() failed to decode an elementary action [tag = %d]\n", currItem->tag));
1464 if (currAction->firstParam)
1467 currAction->firstParam = NULL;
1469 currAction->origFirstParam = NULL;
1473 currItem = currItem->next;
1476 assert( action_count <= listPtr->childCount[0] );
1478 p_actions->total = action_count;
1480 DPL5((
"<< asn1_decodeAction() Returns %X\n", p_actions->a_ptr));
1502 assert( listPtr != NULL );
1504 p_scenes->params = asn1_GroupParamPtr;
1505 asn1_GroupParamPtr->generic.isfirst = MHEG5TRUE;
1509 while (currItem != NULL && (asn1_GroupParamCount + 4) < fpa1_GroupParamCount)
1511 tempItem = currItem->children;
1512 if (currItem->tag == NEXT_SCENE_TYPE && tempItem != NULL && tempItem->next != NULL)
1517 listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1518 listTop->generic.type = MHEG5BRACKETOPEN;
1519 listTop->next = asn1_GroupParamPtr;
1522 listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1523 listTop->generic.type = MHEG5OCTETSTRING;
1525 listTop->next = asn1_GroupParamPtr;
1528 listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1529 listTop->generic.type = MHEG5INT;
1530 listTop->generic.value.i = tempItem->next->data.intData;
1531 listTop->next = asn1_GroupParamPtr;
1534 listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1535 listTop->generic.type = MHEG5BRACKETCLOSE;
1536 listTop->next = asn1_GroupParamPtr;
1538 currItem = currItem->next;
1540 p_scenes->total = total;
1541 if (listTop != NULL)
1543 listTop->next = NULL;
void asn1_decodeActions(fpa1_syntaxList *listPtr, MHEG5ActionList *p_actions)
Decodes action class Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Contains functions/globals used to read MHEG-5 ASN.1 scripts.
Functions to create a MHEG5Action from a MHEG5 script (in the form of a list of fpa1_syntaxList struc...
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
Functions to create a MHEG5Group from a MHEG5 script (in the form of a list of fpa1_syntaxList struct...
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
asnErr asn1_decodeGenericObjectReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
typedefs etc for the whole object creation section.
Contains macros for MHEG-5 ASN.1 tags and structures.
asnErr asn1_decodeGenericBoolean(fpa1_syntaxList *listPtr, MHEG5GList *gList)
void MHEG5gListDestruct(MHEG5GList *item)
Destruct a list of MHEG5Generic objects.
asnErr asn1_decodeGenericContentReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
MHEG5GList * asn1_addNewGList(MHEG5GList *gList)
Creates a new MHEG5GList element and adds it to the end of the supplied list.
This file defines the profile for the MHEG engine.
Manage elementary actions Manage a table of all actions and call a specific action which is defined b...
asnErr asn1_decodeObjectReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
Decodes a MHEG object reference to a MHEG5GList. This function can cope with listPtr being NULL...
asnErr asn1_decodeGenericInteger(fpa1_syntaxList *listPtr, MHEG5GList *gList)
void asn1_decodeNextScenes(fpa1_syntaxList *listPtr, ParamList *p_scenes)
Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A, section[A.3] for details of ASN...
MHEG5Bool MH5_SupportFontClass(void)
Return whether font class is supported by current profile.
asnErr asn1_decodeGenericOctetString(fpa1_syntaxList *listPtr, MHEG5GList *gList)
Engine support utility functions for MHEG5.