MHEG5  18.9.0
MHEG5 Documentation
asn1_createAction.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
29 /*---includes for this file--------------------------------------------------*/
30 #include <stdio.h>
31 #include "vpa1_sys.h"
32 #include "vpa1_tgs.h"
33 #include "fpa1_syn.h"
34 #include "fpa1_rdf.h"
35 #include "asn1_sys.h"
36 
37 #include "mh5action.h"
38 #include "mh5profile.h"
39 #include "mh5support.h"
40 #include "asn1_createAction.h"
41 #include "asn1_createExtras.h"
42 #include "asn1_createGroup.h" /*for asn1_mainGroupPtr*/
43 
45 
46 /*---constant definitions for this file--------------------------------------*/
47 
48 #define AssignNextParam(gl) if (asn1_GroupParamCount < fpa1_GroupParamCount) { \
49  gl = asn1_GroupParamPtr++; asn1_GroupParamCount++; } else { \
50  gl = NULL; }
51 
52 
53 
54 /*---local typedef structs for this file-------------------------------------*/
55 
56 /*---local (static) variable declarations for this file----------------------*/
59 
62 
63 /*---local function definitions----------------------------------------------*/
64 
65 /*---global function definitions---------------------------------------------*/
66 
74 {
75  MHEG5GList *newGList;
76 
77  DPL5((">> asn1_addNewGList(%X)\n", gList));
78 
80  {
81  newGList = asn1_GroupParamPtr++;
83  newGList->next = NULL;
84  if (gList != NULL) /* ie. Not first item in GList */
85  {
86  gList->next = newGList;
87  }
88  }
89  else
90  {
91  DPL1(("ERROR:[ASN.1] asn1_addNewGList(), Failed to allocate %d bytes\n",
92  sizeof(MHEG5GList)));
93  newGList = NULL;
94  }
95 
96  DPL5(("<< asn1_addNewGList() Returns %X\n", newGList));
97  return newGList;
98 }
99 
107 static MHEG5GList* asn1_addNewActionParameter(MHEG5Action *action)
108 {
109  MHEG5GList *newParam, *currParam = action->firstParam;
110 
111  DPL5((">> asn1_addNewActionParameter(%X)\n", action));
112  assert(action);
113 
114  /* create new parameter */
116  {
117  newParam = asn1_GroupParamPtr++;
119 
120  /* if it's the first item in the list */
121  if (action->firstParam == NULL)
122  {
123  action->firstParam = newParam;
124  }
125  else
126  {
127  /* find end of list */
128  while (currParam->next != NULL)
129  {
130  currParam = currParam->next;
131  }
132  currParam->next = newParam;
133  }
134  }
135  else
136  {
137  newParam = NULL;
138  DPL1(("ERROR:[ASN.1] asn1_addNewActionParameter() failed to allocate %d bytes\n",
139  sizeof(MHEG5GList)));
140  }
141 
142  DPL5(("<< asn1_addNewActionParameter() Returns %X\n", newParam));
143 
144  /* returns NULL on failure */
145  return newParam;
146 }
147 
161 {
162  asnErr errVal = 0;
163 
164  if ((listPtr == NULL) || (gList == NULL))
165  {
166  /* Cannot proceed because of invalid parameter */
167  TRACE(TERROR, ("invalid pointer %p %p", listPtr, gList))
168  errVal = 0x01;
169  }
170  else
171  {
172  switch (listPtr->tag)
173  {
174  case INTEGER:
175  /* Local reference (just an integer) */
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; /* App or Scene being parsed */
180  break;
181 
183  /* An external reference */
184  listPtr = listPtr->children;
185  if (listPtr != NULL && listPtr->next != NULL)
186  {
187  gList->generic.type = MHEG5OBJREFEXT;
188  gList->generic.value.o.id = listPtr->next->data.intData;
189  (void)asn1_decodeOctetString(listPtr, (MHEG5String *)&gList->generic.value.o.gref);
190  }
191  else
192  {
193  TRACE(TERROR, ("ext ref children null; listPtr=%p", listPtr))
194  }
195  break;
196 
197  default:
198  TRACE(TERROR, ("listPtr->tag=%d", listPtr->tag))
199  errVal = 0x01;
200  }
201  }
202  return errVal;
203 }
204 
212  MHEG5GList *gList)
213 {
214  asnErr errVal = 0;
215  fpa1_syntaxList *currItem;
216 
217  DPL5((">> asn1_decodeGenericObjectReference(%X,%X)\n", listPtr, gList));
218  if ((listPtr == NULL) || (gList == NULL))
219  {
220  /* Cannot proceed because of invalid parameter */
221  DPL5(("<< asn1_decodeGenericObjectReference() Returned early\n"));
222  return 1;
223  }
224 
225  currItem = listPtr;
226 
227  if (currItem->tag == INDIRECT) /* Indirect object reference */
228  {
229  errVal |= asn1_decodeObjectReference(currItem->children, gList);
230  gList->generic.indirect = MHEG5TRUE; /* overides the default */
231  }
232  else /* must be a direct objectReference */
233  {
234  errVal |= asn1_decodeObjectReference(currItem, gList);
235  }
236  /* if asn1_decodeObjectReference() fails, we just return the error */
237 
238 #if (DPLEVEL >= 2)
239  if (errVal != 0)
240  {
241  DPL2(("WARNING:[ASN.1] asn1_decodeGenericObjectReference() returns errVal = %d\n", errVal));
242  }
243 #endif /* DPLEVEL >= 2 */
244 
245  DPL5(("<< asn1_decodeGenericObjectReference() Returns %d\n", errVal));
246  return errVal;
247 }
248 
258 {
259  asnErr errVal = 0;
260  fpa1_syntaxList *currItem;
261 
262  DPL5((">> asn1_decodeGenericInteger(%X,%X)\n", listPtr, gList));
263  if ((listPtr == NULL) || (gList == NULL))
264  {
265  /* Cannot proceed because of invalid parameter */
266  DPL5(("<< asn1_decodeGenericInteger() Returned early\n"));
267  return 1;
268  }
269 
270  currItem = listPtr;
271 
272  /* Indirect reference */
273  if (currItem->tag == INDIRECT)
274  {
275  errVal |= asn1_decodeObjectReference(currItem->children, gList);
276  gList->generic.indirect = MHEG5TRUE; /* overides the default */
277  }
278  else /* must be a direct integer */
279  {
280  gList->generic.value.i = currItem->data.intData;
281  gList->generic.type = MHEG5INT;
282  }
283  /* if asn1_decodeObjectReference() fails, we just return the error */
284 
285 #if (DPLEVEL >= 2)
286  if (errVal != 0)
287  {
288  DPL2(("WARNING:[ASN.1] asn1_decodeGenericInteger() returns errVal = %d\n", errVal));
289  }
290 #endif /* DPLEVEL >= 2 */
291 
292  DPL5(("<< asn1_decodeGenericInteger() Returns %d\n", errVal));
293  return errVal;
294 }
295 
305 {
306  asnErr errVal = 0;
307  fpa1_syntaxList *currItem;
308 
309  DPL5((">> asn1_decodeGenericBoolean(%X,%X)\n", listPtr, gList));
310  if ((listPtr == NULL) || (gList == NULL))
311  {
312  /* Cannot proceed because of invalid parameter */
313  DPL5(("<< asn1_decodeGenericBoolean() Returned early\n"));
314  return 1;
315  }
316 
317  currItem = listPtr;
318 
319  if (currItem->tag == INDIRECT)
320  {
321  errVal |= asn1_decodeObjectReference(currItem->children, gList);
322  gList->generic.indirect = MHEG5TRUE; /* overides the default */
323  }
324  else /* must be a direct boolean */
325  {
326  gList->generic.value.b = (currItem->data.boolData == 0) ? MHEG5FALSE : MHEG5TRUE;
327  gList->generic.type = MHEG5BOOL;
328  }
329  /* if asn1_decodeObjectReference() fails, we just return the error */
330 
331 #if (DPLEVEL >= 2)
332  if (errVal != 0)
333  {
334  DPL2(("WARNING:[ASN.1] asn1_decodeGenericBoolean() returns errVal = %d\n", errVal));
335  }
336 #endif /* DPLEVEL >= 2 */
337 
338  DPL5(("<< asn1_decodeGenericBoolean() Returns %d\n", errVal));
339  return errVal;
340 }
341 
351 {
352  asnErr errVal = 0;
353  fpa1_syntaxList *currItem;
354 
355  DPL5((">> asn1_decodeGenericOctetString(%X,%X)\n", listPtr, gList));
356  if ((listPtr == NULL) || (gList == NULL))
357  {
358  /* Cannot proceed because of invalid parameter */
359  DPL5(("<< asn1_decodeGenericOctetString() Returned early\n"));
360  return 1;
361  }
362  currItem = listPtr;
363 
364  if (currItem->tag == INDIRECT)
365  {
366  errVal |= asn1_decodeObjectReference(currItem->children, gList);
367  gList->generic.indirect = MHEG5TRUE; /* overides the default */
368  }
369  else /* must be a direct string */
370  {
371  errVal |= asn1_decodeOctetString(currItem, &gList->generic.value.s);
372  gList->generic.type = MHEG5OCTETSTRING;
373  }
374  /* if asn1_decodeObjectReference() fails, we just return the error */
375 
376 #if (DPLEVEL >= 2)
377  if (errVal != 0)
378  {
379  DPL2(("WARNING:[ASN.1] asn1_decodeGenericOctetString() returns errVal = %d\n", errVal));
380  }
381 #endif /* DPLEVEL >= 2 */
382 
383  DPL5(("<< asn1_decodeGenericOctetString() Returns %d\n", errVal));
384  return errVal;
385 }
386 
396 {
397  asnErr errVal = 0;
398  fpa1_syntaxList *currItem;
399 
400  DPL5((">> asn1_decodeGenericContentReference(%X,%X)\n", listPtr, gList));
401  if ((listPtr == NULL) || (gList == NULL))
402  {
403  /* Cannot proceed because of invalid parameter */
404  DPL5(("<< asn1_decodeGenericContentReference() Returned early\n"));
405  return 1;
406  }
407 
408  currItem = listPtr;
409 
410  if (currItem->tag == INDIRECT)
411  {
412  errVal |= asn1_decodeObjectReference(currItem->children, gList);
413  gList->generic.indirect = MHEG5TRUE; /* overides the default */
414  }
415  else /* must be a direct contentReference (=OctetString) */
416  {
417  errVal |= asn1_decodeOctetString(currItem, &gList->generic.value.s);
418  gList->generic.type = MHEG5CONTENTREF;
419  }
420  /* if asn1_decodeObjectReference() fails, we just return the error */
421 
422 #if (DPLEVEL >= 2)
423  if (errVal != 0)
424  {
425  DPL2(("WARNING:[ASN.1] asn1_decodeGenericContentReference() returns errVal = %d\n", errVal));
426  }
427 #endif /* DPLEVEL >= 2 */
428 
429  DPL5(("<< asn1_decodeGenericContentReference() Returns %d\n", errVal));
430  return errVal;
431 }
432 
445 {
446  asnErr elemActionErr = 0;
447  fpa1_syntaxList *tmpItem, *tmpItem2, *currItem;
448  MHEG5GList *currParam;
449  MHEG5Action *currAction; /* Used as tempory pointer to the current action */
450  MHEG5Bool isOnSomething;
451  int action_count = 0;
452 
453  DPL5((">> asn1_decodeAction(%X)\n", listPtr));
454  assert(listPtr);
455  assert(asn1_GroupActionPtr);
456 
457  isOnSomething = (listPtr->tag == EFFECT || listPtr->tag == SEQ_SIZE_OF_ELEMENTARY_ACTION) ? MHEG5FALSE : MHEG5TRUE;
458 
459  p_actions->a_ptr = asn1_GroupActionPtr;
460 
461  currItem = listPtr->children;
462 
463  /* decode the whole list of actions. Each action is a list of elementaryActions.*/
464  while (currItem != NULL && asn1_GroupActionCount != fpa1_GroupActionCount)
465  {
467  /* create a new action and link it to the previous one */
468  currAction = asn1_GroupActionPtr;
469  assert( currAction->firstParam == NULL );
470  /* each action type has a GenericObjectRef as it's first param so decode it outside
471  the switch */
472  currParam = asn1_addNewActionParameter(currAction);
473  currAction->origFirstParam = currAction->firstParam;
474  currParam->generic.isfirst = MHEG5TRUE;
475  elemActionErr |= asn1_decodeGenericObjectReference(currItem->children, currParam);
476  if (elemActionErr == 0)
477  {
478  /* currItem->children cannot be NULL as asn1_decodeGenericObjectReference would
479  have returned an error */
480  tmpItem = currItem->children->next; /* Points to second parameter if it exists */
481 
482  switch (currItem->tag)
483  {
484  case LAUNCH:
485  case SPAWN:
486  case QUIT:
487  if (isOnSomething)
488  {
489  /* UK prof 1.06 corrigenda 1 (sec 3.1 & 4.3) */
490  elemActionErr |= 0x10;
491  }
492  /* GenericObjectReference types */
493  case ACTIVATE:
494  case BRINGTOFRONT:
495  case CLEAR:
496  case DEACTIVATE:
497  case DESELECT:
498  case LOCKSCREEN:
499  case PRELOAD:
500  case RUN:
501  case SELECT:
502  case SENDTOBACK:
503  case STOP:
504  case TOGGLE:
505  case UNLOAD:
506  case UNLOCKSCREEN:
507  /* Just a GenericObjRef, decoded above. Don't need to do anything here. */
508  break;
509 
510 
511  /* GenericObjectReference and GenericInteger pair */
512  case ADD:
513  case CALLACTIONSLOT:
514  case CLOSECONNECTION:
515  case DESELECTITEM:
516  case DIVIDE:
517  case MODULO:
518  case MOVE:
519  case MOVETO:
520  case MULTIPLY:
521  case SCROLLITEMS:
522  case SELECTITEM:
523  case SETCACHEPRIORITY:
525  case SETCOUNTERPOSITION:
526  case SETENTRYPOINT:
527  case SETFIRSTITEM:
528  case SETFOCUSPOSITION:
529  case SETINPUTREGISTER:
530  case SETLINESTYLE:
531  case SETLINEWIDTH:
532  case SETPORTION:
533  case SETSLIDERVALUE:
534  case SETTRANSPARENCY:
535  case SETVOLUME:
536  case STEP:
537  case SUBTRACT:
538  case TOGGLEITEM:
539  currParam = asn1_addNewActionParameter(currAction);
540  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
541  break;
542 
543 
544  /* GenericObjectReference + ObjectReference */
545  case CLONE:
547  case GETENTRYPOINT:
548  case GETFILLCOLOUR:
549  case GETFIRSTITEM:
550  case GETFOCUSPOSITION:
551  case GETHIGHLIGHTSTATUS:
553  case GETLABEL:
554  case GETLASTANCHORFIRED:
555  case GETLINECOLOUR:
556  case GETLINESTYLE:
557  case GETLINEWIDTH:
558  case GETLISTSIZE:
559  case GETOVERWRITEMODE:
560  case GETPORTION:
561  case GETRUNNINGSTATUS:
562  case GETSELECTIONSTATUS:
563  case GETSLIDERVALUE:
564  case GETTEXTCONTENT:
565  case GETTEXTDATA:
566  case GETTOKENPOSITION:
567  case GETVOLUME:
568  currParam = asn1_addNewActionParameter(currAction);
569  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
570  break;
571 
572  /* GenericObjectReference + GenericOctetString */
573  case APPEND:
574  case SETLABEL:
575  case SETFONTATTRIBUTES:
576  case SETINPUTMASK:
577  currParam = asn1_addNewActionParameter(currAction);
578  elemActionErr |= asn1_decodeGenericOctetString(tmpItem, currParam);
579  break;
580 
581  /* GenericObjectReference + GenericBoolean */
582  case SETHIGHLIGHTSTATUS:
584  case SETOVERWRITEMODE:
585  currParam = asn1_addNewActionParameter(currAction);
586  elemActionErr |= asn1_decodeGenericBoolean(tmpItem, currParam);
587  break;
588 
589  /* GenericObjectReference + GenericObjectReference */
590  case DELITEM:
591  case GETCOUNTERPOSITION:
593  case PUTBEFORE:
594  case PUTBEHIND:
595  case SETPALETTEREF:
596  currParam = asn1_addNewActionParameter(currAction);
597  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem, currParam);
598  break;
599 
600  /* GenericObjectReference + GenericInteger + GenericObjectReference */
601  case ADDITEM:
602  if (tmpItem != NULL)
603  {
604  currParam = asn1_addNewActionParameter(currAction);
605  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
606  currParam = asn1_addNewActionParameter(currAction);
607  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem->next, currParam);
608  }
609  else
610  {
611  elemActionErr |= 0x01;
612  }
613  break;
614 
615  /* GenericObjectReference + GenericInteger + GenericInteger */
616  case SCALEBITMAP:
617  case SCALEVIDEO:
618  case SETBOXSIZE:
619  case SETCURSORPOSITION:
620  case SETPOSITION:
623  if (tmpItem != NULL)
624  {
625  currParam = asn1_addNewActionParameter(currAction);
626  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
627  currParam = asn1_addNewActionParameter(currAction);
628  elemActionErr |= asn1_decodeGenericInteger(tmpItem->next, currParam);
629  }
630  else
631  {
632  elemActionErr |= 0x01;
633  }
634  break;
635 
636  /* GenericObjectReference + ObjectReference + ObjectReference */
637  case GETBOXSIZE:
638  case GETCURSORPOSITION:
639  case GETPOSITION:
642  if (tmpItem != NULL)
643  {
644  currParam = asn1_addNewActionParameter(currAction);
645  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
646  currParam = asn1_addNewActionParameter(currAction);
647  elemActionErr |= asn1_decodeObjectReference(tmpItem->next, currParam);
648  }
649  else
650  {
651  elemActionErr |= 0x01;
652  }
653  break;
654 
655  /* GenericObjectReference + GenericInteger + ObjectReference */
656  case GETCELLITEM:
657  case GETITEMSTATUS:
658  case GETLISTITEM:
659  if (tmpItem != NULL)
660  {
661  currParam = asn1_addNewActionParameter(currAction);
662  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
663  currParam = asn1_addNewActionParameter(currAction);
664  elemActionErr |= asn1_decodeObjectReference(tmpItem->next, currParam);
665  }
666  else
667  {
668  elemActionErr |= 0x01;
669  }
670  break;
671 
672  /* GenericObjectReference + GenericOctetString + ObjectReference */
673  case GETENGINESUPPORT:
674  if (tmpItem != NULL)
675  {
676  currParam = asn1_addNewActionParameter(currAction);
677  elemActionErr |= asn1_decodeGenericOctetString(tmpItem, currParam);
678  currParam = asn1_addNewActionParameter(currAction);
679  elemActionErr |= asn1_decodeObjectReference(tmpItem->next, currParam);
680  }
681  else
682  {
683  elemActionErr |= 0x01;
684  }
685  break;
686 
687  /* GenericObjectReference + GenericInteger + GenericInteger + GenericInteger */
688  case SETSLIDERPARAMETERS:
689  case SETCELLPOSITION:
690  if (tmpItem != NULL)
691  {
692  currParam = asn1_addNewActionParameter(currAction);
693  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
694  tmpItem = tmpItem->next;
695  currParam = asn1_addNewActionParameter(currAction);
696  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
697  tmpItem = tmpItem->next;
698  currParam = asn1_addNewActionParameter(currAction);
699  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
700  }
701  else
702  {
703  elemActionErr |= 0x01;
704  }
705  break;
706 
707  /* More complex sequences (fixed length)*/
708  case DRAWARC:
709  case DRAWSECTOR:
710  if (tmpItem != NULL) /* Check for NULL pointer */
711  {
712  currParam = asn1_addNewActionParameter(currAction);
713  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* x */
714  tmpItem = tmpItem->next;
715  if (tmpItem != NULL) /* Check for NULL pointer */
716  {
717  currParam = asn1_addNewActionParameter(currAction);
718  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* y */
719  tmpItem = tmpItem->next;
720  if (tmpItem != NULL) /* Check for NULL pointer */
721  {
722  currParam = asn1_addNewActionParameter(currAction);
723  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* ellipse-width */
724  tmpItem = tmpItem->next;
725  if (tmpItem != NULL) /* Check for NULL pointer */
726  {
727  currParam = asn1_addNewActionParameter(currAction);
728  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* ellipse-height */
729  tmpItem = tmpItem->next;
730  if (tmpItem != NULL) /* Check for NULL pointer */
731  {
732  currParam = asn1_addNewActionParameter(currAction);
733  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* start-angle */
734  tmpItem = tmpItem->next;
735  currParam = asn1_addNewActionParameter(currAction);
736  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* arc-angle */
737  }
738  else
739  {
740  elemActionErr |= 0x01;
741  }
742  }
743  else
744  {
745  elemActionErr |= 0x01;
746  }
747  }
748  else
749  {
750  elemActionErr |= 0x01;
751  }
752  }
753  else
754  {
755  elemActionErr |= 0x01;
756  }
757  }
758  else
759  {
760  elemActionErr |= 0x01;
761  }
762  break;
763 
764  case DRAWLINE:
765  case DRAWOVAL:
766  case DRAWRECTANGLE:
767  if (tmpItem != NULL)
768  {
769  currParam = asn1_addNewActionParameter(currAction);
770  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
771  tmpItem = tmpItem->next;
772  if (tmpItem != NULL)
773  {
774  currParam = asn1_addNewActionParameter(currAction);
775  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
776  tmpItem = tmpItem->next;
777  if (tmpItem != NULL)
778  {
779  currParam = asn1_addNewActionParameter(currAction);
780  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
781  tmpItem = tmpItem->next;
782  currParam = asn1_addNewActionParameter(currAction);
783  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
784  }
785  else
786  {
787  elemActionErr |= 0x01;
788  }
789  }
790  else
791  {
792  elemActionErr |= 0x01;
793  }
794  }
795  else
796  {
797  elemActionErr |= 0x01;
798  }
799  break;
800 
801  #ifndef ASN1UKPROFILE
802  case OPENCONNECTION: /* not supported in UK Profile */
803  if (tmpItem != NULL)
804  {
805  currParam = asn1_addNewActionParameter(currAction);
806  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
807  tmpItem = tmpItem->next;
808  if (tmpItem != NULL)
809  {
810  currParam = asn1_addNewActionParameter(currAction);
811  elemActionErr |= asn1_decodeGenericOctetString(tmpItem, currParam);
812  tmpItem = tmpItem->next;
813  if (tmpItem != NULL)
814  {
815  currParam = asn1_addNewActionParameter(currAction);
816  elemActionErr |= asn1_decodeGenericOctetString(tmpItem, currParam);
817  tmpItem = tmpItem->next;
818  currParam = asn1_addNewActionParameter(currAction);
819  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
820  }
821  else
822  {
823  elemActionErr |= 0x01;
824  }
825  }
826  else
827  {
828  elemActionErr |= 0x01;
829  }
830  }
831  else
832  {
833  elemActionErr |= 0x01;
834  }
835  break;
836  #endif /* ASN1UKPROFILE */
837 
838  /* some more complicated sequences (Variable length) */
839  case CALL:
840  case FORK:
841  if (tmpItem != NULL)
842  {
843  currParam = asn1_addNewActionParameter(currAction);
844  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
845  tmpItem = tmpItem->next;
846  if (tmpItem != NULL)
847  {
848  if (tmpItem->tag == SEQ_SIZE_OF_PARAMETER) /* optional */
849  {
850  tmpItem = tmpItem->children;
851  while (tmpItem != NULL)
852  {
853  currParam = asn1_addNewActionParameter(currAction);
854  switch (tmpItem->tag)
855  {
856  case GBOOL:
857  elemActionErr |= asn1_decodeGenericBoolean(tmpItem->children, currParam);
858  break;
859  case GINT:
860  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
861  break;
862  case GOSTRING:
863  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
864  break;
865  case GOBJREF:
866  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem->children, currParam);
867  break;
868  case GCONTREF:
869  elemActionErr |= asn1_decodeGenericContentReference(tmpItem->children, currParam);
870  break;
871  default:
872  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Invalid tag in FORK\n"));
873  elemActionErr |= 0x01;
874  break;
875  }
876  tmpItem = tmpItem->next;
877  }
878  }
879  }
880  }
881  else
882  {
883  elemActionErr |= 0x01;
884  }
885  break;
886 
887  case DRAWPOLYGON:
888  case DRAWPOLYLINE:
889  if (tmpItem != NULL)
890  {
891  currParam = asn1_addNewActionParameter(currAction);
892  if (currParam)
893  {
894  currParam->generic.type = MHEG5BRACKETOPEN;
895 
896  tmpItem = tmpItem->children; /* Skip SEQ_SIZE_OF_POINT tag */
897  while (tmpItem != NULL)
898  {
899  if (tmpItem->tag == POINT_TYPE)
900  {
901  currParam = asn1_addNewActionParameter(currAction);
902  if (!currParam)
903  {
904  /* Malloc failed - get out of the while loop */
905  elemActionErr |= 0x01;
906  break;
907  }
908  currParam->generic.type = MHEG5BRACKETOPEN;
909 
910  currParam = asn1_addNewActionParameter(currAction);
911  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
912 
913  currParam = asn1_addNewActionParameter(currAction);
914  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children->next, currParam);
915 
916  currParam = asn1_addNewActionParameter(currAction);
917  if (!currParam)
918  {
919  /* Malloc failed - get out of the while loop */
920  elemActionErr |= 0x01;
921  break;
922  }
923  currParam->generic.type = MHEG5BRACKETCLOSE;
924  tmpItem = tmpItem->next;
925  }
926  }
927 
928  currParam = asn1_addNewActionParameter(currAction);
929  if (currParam)
930  {
931  currParam->generic.type = MHEG5BRACKETCLOSE;
932  }
933  else
934  {
935  /* Malloc failed - get out of the while loop */
936  elemActionErr |= 0x01;
937  break;
938  }
939  }
940  else
941  {
942  /* Malloc failed */
943  elemActionErr |= 0x01;
944  }
945  }
946  else
947  {
948  elemActionErr |= 0x01;
949  }
950  break;
951 
952  case READPERSISTENT:
953  case STOREPERSISTENT:
954  if (tmpItem != NULL)
955  {
956  currParam = asn1_addNewActionParameter(currAction);
957  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
958  tmpItem = tmpItem->next;
959  /* tmpItem2 used to find the position of the "in-file-names" tag after decoding
960  the "out-variables" */
961  tmpItem2 = tmpItem;
962 
963  if (tmpItem != NULL)
964  {
965  /* Brackets surround out-variables */
966  currParam = asn1_addNewActionParameter(currAction);
967  if (currParam)
968  {
969  currParam->generic.type = MHEG5BRACKETOPEN;
970  if (tmpItem->tag == SEQ_SIZE_OF_OBJECT_REFERENCE)
971  {
972  tmpItem = tmpItem->children;
973  while (tmpItem != NULL) /* out-variables */
974  {
975  currParam = asn1_addNewActionParameter(currAction);
976  elemActionErr |= asn1_decodeObjectReference(tmpItem, currParam);
977  tmpItem = tmpItem->next;
978  }
979  }
980  currParam = asn1_addNewActionParameter(currAction);
981  if (currParam)
982  {
983  currParam->generic.type = MHEG5BRACKETCLOSE;
984 
985  currParam = asn1_addNewActionParameter(currAction);
986  elemActionErr |= asn1_decodeGenericOctetString(tmpItem2->next, currParam); /* in-file-names */
987  }
988  else
989  {
990  elemActionErr |= 0x01;
991  }
992  }
993  else
994  {
995  elemActionErr |= 0x01;
996  }
997  }
998  else
999  {
1000  elemActionErr |= 0x01;
1001  }
1002  }
1003  else
1004  {
1005  elemActionErr |= 0x01;
1006  }
1007  break;
1008 
1009  case SENDEVENT:
1010  if (tmpItem != NULL)
1011  {
1012  currParam = asn1_addNewActionParameter(currAction);
1013  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem, currParam);
1014  tmpItem = tmpItem->next;
1015  if (tmpItem != NULL)
1016  {
1017  currParam = asn1_addNewActionParameter(currAction);
1018  if (currParam)
1019  {
1020  currParam->generic.value.e = asn1_decodeEventType( tmpItem->data.intData );
1021  currParam->generic.type = MHEG5EVENT;
1022  tmpItem = tmpItem->next;
1023  if (tmpItem != NULL) /* optional parameter */
1024  {
1025  currParam = asn1_addNewActionParameter(currAction);
1026  switch (tmpItem->tag)
1027  {
1028  case GBOOL:
1029  elemActionErr |= asn1_decodeGenericBoolean(tmpItem->children, currParam);
1030  break;
1031  case GINT:
1032  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1033  break;
1034  case GOSTRING:
1035  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1036  break;
1037  default:
1038  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SENDEVENT\n"));
1039  elemActionErr |= 0x01;
1040  break;
1041  }
1042  }
1043  }
1044  else
1045  {
1046  elemActionErr |= 1;
1047  }
1048  }
1049  else
1050  {
1051  elemActionErr |= 0x01;
1052  }
1053  }
1054  else
1055  {
1056  elemActionErr |= 0x01;
1057  }
1058  break;
1059 
1060  case SETCOUNTERTRIGGER:
1061  if (tmpItem != NULL)
1062  {
1063  currParam = asn1_addNewActionParameter(currAction);
1064  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1065  tmpItem = tmpItem->next;
1066  if (tmpItem != NULL) /* optional */
1067  {
1068  currParam = asn1_addNewActionParameter(currAction);
1069  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1070  }
1071  }
1072  else
1073  {
1074  elemActionErr |= 0x01;
1075  }
1076  break;
1077 
1078  #ifndef ASN1UKPROFILE
1079  case SETCURSORSHAPE: /* CursorShape not UK1 profile */
1080  if (tmpItem != NULL) /* optional */
1081  {
1082  currParam = asn1_addNewActionParameter(currAction);
1083  elemActionErr |= asn1_decodeGenericObjectReference(currItem->children->next, currParam);
1084  }
1085  break;
1086  #endif /* ASN1UKPROFILE */
1087 
1088  /* SetData constructed as follows: */
1089  /* SetData: SEQUENCE: */
1090  /* GenericObjectReference */
1091  /* NewContent */
1092  /* NewContent: CHOICE: */
1093  /* NewReferencedContent */
1094  /* GenericOctetString */
1095  /* NewReferencedContent: SEQUENCE: */
1096  /* GenericContentReference */
1097  /* NewContentSize */
1098  /* GenericInteger (optional) */
1099  /* NewContentSize: CHOICE: */
1100  /* GenericInteger */
1101  /* Null */
1102 
1103  case SETDATA:
1104  if (tmpItem != NULL)
1105  {
1106  currParam = asn1_addNewActionParameter(currAction);
1107  if (currParam)
1108  {
1109  /* NewContent--NewReferencedContent */
1110  if (tmpItem->tag == NEW_REFERENCED_CONTENT)
1111  {
1112  tmpItem = tmpItem->children;
1113  if (tmpItem != NULL)
1114  {
1115  /* NewReferencedContent--GenericContentReference */
1116  elemActionErr |= asn1_decodeGenericContentReference(tmpItem, currParam); /* generic content ref */
1117  tmpItem = tmpItem->next;
1118  if (tmpItem != NULL)
1119  {
1120  /* NewReferencedContent--NewContentSize */
1121  if ((tmpItem->tag == NEWCSIZE) && (tmpItem->children != NULL))
1122  {
1123  currParam = asn1_addNewActionParameter(currAction);
1124  if (currParam)
1125  {
1126  if (tmpItem->children->tag == MHEG_NULL)
1127  {
1128  /* The Text parser will not generate a NULL type but treats new-content-size as
1129  optional instead. */
1130  currParam->generic.type = MHEG5NULL;
1131  }
1132  else /* GenericInteger */
1133  {
1134  /*
1135  * asn1_decodeGenericInteger sets the
1136  * type to MHEG5INT, so no need to do
1137  * the following:
1138  * currParam->generic.type = MHEG5CONTENTSIZE;
1139  */
1140  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1141  }
1142 
1143  tmpItem = tmpItem->next;
1144  if (tmpItem != NULL) /* optional generic integer */
1145  {
1146  if ((tmpItem->tag == NEWCPRIO) && (tmpItem->children != NULL))
1147  {
1148  currParam = asn1_addNewActionParameter(currAction);
1149  if (currParam)
1150  {
1151  /*
1152  * asn1_decodeGenericInteger sets the
1153  * type to MHEG5INT, so no need to do
1154  * the following:
1155  * currParam->generic.type = MHEG5CONTENTCCP;
1156  */
1157  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1158  }
1159  else
1160  {
1161  elemActionErr |= 0x01;
1162  }
1163  }
1164  else
1165  {
1166  elemActionErr |= 0x01;
1167  }
1168  }
1169  }
1170  else
1171  {
1172  elemActionErr |= 0x01;
1173  }
1174  }
1175  else
1176  {
1177  elemActionErr |= 0x01;
1178  }
1179  }
1180  else
1181  {
1182  elemActionErr |= 0x01;
1183  }
1184  }
1185  else
1186  {
1187  elemActionErr |= 0x01;
1188  }
1189  }
1190  /* NewContent--GenericOctetString */
1191  else
1192  {
1193  elemActionErr |= asn1_decodeGenericOctetString(tmpItem, currParam);
1194  }
1195  }
1196  else
1197  {
1198  elemActionErr |= 0x01;
1199  }
1200  }
1201  else
1202  {
1203  elemActionErr |= 0x01;
1204  }
1205  break;
1206 
1207  case SETFILLCOLOUR:
1208  if (tmpItem != NULL) /* optional NewColour */
1209  {
1210  currParam = asn1_addNewActionParameter(currAction);
1211  switch (tmpItem->tag)
1212  {
1213  #ifndef ASN1UKPROFILE
1214  case NEWCOLIND:
1215  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1216  break;
1217  #endif /* ASN1UKPROFILE */
1218  case NEWABSCOL:
1219  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1220  break;
1221  default:
1222  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag (%d) in SETFILLCOLOUR\n",tmpItem->tag));
1223  elemActionErr |= 0x01;
1224  break;
1225  }
1226  }
1227  break;
1228 
1229  case SETFONTREF:
1230  if (MH5_SupportFontClass())
1231  {
1232  if (tmpItem != NULL)
1233  {
1234  currParam = asn1_addNewActionParameter(currAction);
1235  switch (tmpItem->tag) /* NewFont */
1236  {
1237  case NEWFONTNAME:
1238  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1239  break;
1240  case NEWFONTREF:
1241  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem->children, currParam);
1242  break;
1243  default:
1244  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETFONTREF\n"));
1245  elemActionErr |= 0x01;
1246  break;
1247  }
1248  }
1249  else
1250  {
1251  elemActionErr |= 0x01;
1252  }
1253  }
1254  break;
1255 
1256  case SETLINECOLOUR:
1257  case SETTEXTCOLOUR:
1258  case SETBACKGROUNDCOLOUR:
1259  case SETDESKTOPCOLOUR:
1260  if (tmpItem != NULL)
1261  {
1262  currParam = asn1_addNewActionParameter(currAction);
1263  switch (tmpItem->tag)
1264  {
1265  #ifndef ASN1UKPROFILE
1266  case NEWCOLIND:
1267  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1268  break;
1269  #endif /* ASN1UKPROFILE */
1270  case NEWABSCOL:
1271  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1272  break;
1273  default:
1274  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETLINECOLOUR\n"));
1275  elemActionErr |= 0x01;
1276  break;
1277  }
1278  }
1279  else
1280  {
1281  elemActionErr |= 0x01;
1282  }
1283  break;
1284 
1285  case SETSPEED:
1286  if (tmpItem != NULL)
1287  {
1288  if (tmpItem->tag == RATIONAL_TYPE)
1289  {
1290  tmpItem = tmpItem->children;
1291  currParam = asn1_addNewActionParameter(currAction);
1292  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1293  tmpItem = tmpItem->next;
1294  if (tmpItem != NULL)
1295  {
1296  currParam = asn1_addNewActionParameter(currAction);
1297  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam); /* optional */
1298  }
1299  }
1300  else
1301  {
1302  elemActionErr |= 0x01;
1303  }
1304  }
1305  else
1306  {
1307  elemActionErr |= 0x01;
1308  }
1309  break;
1310 
1311  case SETTIMER:
1312  if (tmpItem != NULL)
1313  {
1314  currParam = asn1_addNewActionParameter(currAction);
1315  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1316  tmpItem = tmpItem->next;
1317  if (tmpItem != NULL) /* optional */
1318  {
1319  tmpItem = tmpItem->children; /* children of the NEW_TIMER tag */
1320  currParam = asn1_addNewActionParameter(currAction);
1321  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1322  tmpItem = tmpItem->next;
1323  if (tmpItem != NULL) /* absoluteTime optional */
1324  {
1325  /* Engine expects 'absoluteTime' string here */
1326  currParam = asn1_addNewActionParameter(currAction);
1327  if (currParam)
1328  {
1329  elemActionErr |= asn1_decodeGenericBoolean(tmpItem, currParam);
1330  }
1331  else
1332  {
1333  elemActionErr |= 0x01;
1334  }
1335  }
1336  }
1337  }
1338  else
1339  {
1340  elemActionErr |= 0x01;
1341  }
1342  break;
1343 
1344  case SETVARIABLE:
1345  if (tmpItem != NULL)
1346  {
1347  currParam = asn1_addNewActionParameter(currAction);
1348  switch (tmpItem->tag)
1349  {
1350  case GINT:
1351  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1352  break;
1353  case GBOOL:
1354  elemActionErr |= asn1_decodeGenericBoolean(tmpItem->children, currParam);
1355  break;
1356  case GOSTRING:
1357  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1358  break;
1359  case GOBJREF:
1360  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem->children, currParam);
1361  break;
1362  case GCONTREF:
1363  elemActionErr |= asn1_decodeGenericContentReference(tmpItem->children, currParam);
1364  break;
1365  default:
1366  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in SETVARIABLE\n"));
1367  elemActionErr |= 0x01;
1368  break;
1369  }
1370  }
1371  else
1372  {
1373  elemActionErr |= 0x01;
1374  }
1375  break;
1376 
1377  case TESTVARIABLE:
1378  if (tmpItem != NULL)
1379  {
1380  currParam = asn1_addNewActionParameter(currAction);
1381  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1382  tmpItem = tmpItem->next;
1383  if (tmpItem != NULL)
1384  {
1385  currParam = asn1_addNewActionParameter(currAction);
1386  switch (tmpItem->tag)
1387  {
1388  case GINT:
1389  elemActionErr |= asn1_decodeGenericInteger(tmpItem->children, currParam);
1390  break;
1391  case GBOOL:
1392  elemActionErr |= asn1_decodeGenericBoolean(tmpItem->children, currParam);
1393  break;
1394  case GOSTRING:
1395  elemActionErr |= asn1_decodeGenericOctetString(tmpItem->children, currParam);
1396  break;
1397  case GOBJREF:
1398  elemActionErr |= asn1_decodeGenericObjectReference(tmpItem->children, currParam);
1399  break;
1400  case GCONTREF:
1401  elemActionErr |= asn1_decodeGenericContentReference(tmpItem->children, currParam);
1402  break;
1403  default:
1404  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected tag in TESTVARIABLE\n"));
1405  elemActionErr |= 0x01;
1406  break;
1407  }
1408  }
1409  }
1410  else
1411  {
1412  elemActionErr |= 0x01;
1413  }
1414  break;
1415 
1416  case TRANSITIONTO:
1417  if (isOnSomething)
1418  {
1419  /* UK prof 1.06 corrigenda 1 (sec 3.1 & 4.3) */
1420  elemActionErr |= 0x10;
1421  }
1422  else if (tmpItem == NULL)
1423  {
1424  elemActionErr |= 0x01;
1425  }
1426  else if (tmpItem->tag == INTEGER)
1427  {
1428  currParam = asn1_addNewActionParameter(currAction);
1429  if (currParam)
1430  {
1431  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1432  }
1433  tmpItem = tmpItem->next;
1434  /* optional TransitionEffect tag */
1435  #ifndef ASN1UKPROFILE
1436  if (tmpItem != NULL)
1437  {
1438  currParam = asn1_addNewActionParameter(currAction);
1439  elemActionErr |= asn1_decodeGenericInteger(tmpItem, currParam);
1440  }
1441  #endif /* ASN1UKPROFILE */
1442  }
1443  break;
1444 
1445  default:
1446  DPL2(("WARNING:[ASN.1] asn1_decodeAction(). Unexpected Action Tag\n"));
1447  elemActionErr |= 0x01;
1448  break;
1449  }
1450  }
1451  if (elemActionErr == 0)
1452  {
1453  /* set Type, use tag as index in the enumerated type */
1454  /* Enumerated type 0 is has unused value */
1455  currAction->type = (MHEG5ElemActionType) (currItem->tag - ACTIVATE + MHEG5ACTIVATE);
1456  asn1_GroupActionPtr++;
1457  action_count++;
1458  }
1459  else
1460  {
1461  /* there has been an error in decoding the elementary action, destroy it
1462  and get on with the next one */
1463  DPL2(("WARNING:[ASN.1] asn1_decodeAction() failed to decode an elementary action [tag = %d]\n", currItem->tag));
1464  if (currAction->firstParam)
1465  {
1466  MHEG5gListDestruct(currAction->firstParam);
1467  currAction->firstParam = NULL;
1468  }
1469  currAction->origFirstParam = NULL;
1470  elemActionErr = 0;
1471  /* now action_count will be less than listPtr->childCount[0] */
1472  }
1473  currItem = currItem->next;
1474  }
1475 
1476  assert( action_count <= listPtr->childCount[0] );
1477 
1478  p_actions->total = action_count;
1479 
1480  DPL5(("<< asn1_decodeAction() Returns %X\n", p_actions->a_ptr));
1481 }
1482 
1496 {
1497  fpa1_syntaxList *currItem;
1498  fpa1_syntaxList *tempItem;
1499  MHEG5GList *listTop = NULL;
1500  MHEG5Int total = 0;
1501 
1502  assert( listPtr != NULL );
1503 
1504  p_scenes->params = asn1_GroupParamPtr;
1505  asn1_GroupParamPtr->generic.isfirst = MHEG5TRUE;
1506 
1507  currItem = listPtr;
1508 
1509  while (currItem != NULL && (asn1_GroupParamCount + 4) < fpa1_GroupParamCount)
1510  {
1511  tempItem = currItem->children;
1512  if (currItem->tag == NEXT_SCENE_TYPE && tempItem != NULL && tempItem->next != NULL)
1513  {
1514  total += 4;
1515 
1516  /* OPEN BRACKET */
1517  listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1518  listTop->generic.type = MHEG5BRACKETOPEN;
1519  listTop->next = asn1_GroupParamPtr;
1520 
1521  /* OCTETSTRING */
1522  listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1523  listTop->generic.type = MHEG5OCTETSTRING;
1524  (void)asn1_decodeOctetString(tempItem, &listTop->generic.value.s);
1525  listTop->next = asn1_GroupParamPtr;
1526 
1527  /* INTEGER */
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;
1532 
1533  /* CLOSEBRACKET */
1534  listTop = asn1_GroupParamPtr++; asn1_GroupParamCount++;
1535  listTop->generic.type = MHEG5BRACKETCLOSE;
1536  listTop->next = asn1_GroupParamPtr;
1537  }
1538  currItem = currItem->next;
1539  }
1540  p_scenes->total = total;
1541  if (listTop != NULL)
1542  {
1543  listTop->next = NULL;
1544  }
1545 }
1546 
#define NEWCSIZE
Definition: vpa1_tgs.h:287
#define SETSLIDERVALUE
Definition: vpa1_tgs.h:259
U8BIT indirect
Definition: mh5base.h:149
#define SETINTERACTIONSTATUS
Definition: vpa1_tgs.h:250
#define SETFONTATTRIBUTES
Definition: vpa1_tgs.h:296
#define DRAWPOLYGON
Definition: vpa1_tgs.h:184
MH5GroupRef gref
Definition: mh5base.h:110
#define SETCURSORSHAPE
Definition: vpa1_tgs.h:243
#define UNLOAD
Definition: vpa1_tgs.h:274
#define SETINPUTREGISTER
Definition: vpa1_tgs.h:294
int fpa1_GroupActionCount
Definition: fpa1_rdf.c:67
#define NEWCPRIO
Definition: vpa1_tgs.h:288
#define SETLINESTYLE
Definition: vpa1_tgs.h:253
#define SETLABEL
Definition: vpa1_tgs.h:251
#define GETLINESTYLE
Definition: vpa1_tgs.h:203
void asn1_decodeActions(fpa1_syntaxList *listPtr, MHEG5ActionList *p_actions)
Decodes action class Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
#define GETVIDEODECODEOFFSET
Definition: vpa1_tgs.h:298
#define GETHIGHLIGHTSTATUS
Definition: vpa1_tgs.h:197
U8BIT isfirst
Definition: mh5base.h:150
#define DESELECTITEM
Definition: vpa1_tgs.h:179
asnErr asn1_decodeOctetString(fpa1_syntaxList *listPtr, MHEG5String *decodedString)
decodes String type
#define GETENTRYPOINT
Definition: vpa1_tgs.h:194
#define MOVE
Definition: vpa1_tgs.h:220
#define GETVOLUME
Definition: vpa1_tgs.h:216
Contains functions/globals used to read MHEG-5 ASN.1 scripts.
#define PUTBEFORE
Definition: vpa1_tgs.h:225
Functions to create a MHEG5Action from a MHEG5 script (in the form of a list of fpa1_syntaxList struc...
#define SETPOSITION
Definition: vpa1_tgs.h:258
#define SUBTRACT
Definition: vpa1_tgs.h:269
MHEG5Action * asn1_GroupActionPtr
#define BRINGTOFRONT
Definition: vpa1_tgs.h:170
#define GETBITMAPDECODEOFFSET
Definition: vpa1_tgs.h:302
MHEG5Int i
Definition: mh5base.h:154
MH5GroupPtr asn1_mainGroupPtr
MHEG5String s
Definition: mh5base.h:156
#define INTEGER
Definition: vpa1_tgs.h:40
#define TRANSITIONTO
Definition: vpa1_tgs.h:273
#define SETCOUNTERENDPOSITION
Definition: vpa1_tgs.h:239
#define ACTIVATE
Definition: vpa1_tgs.h:166
Miscellaneous functions for decoding ASN.1 types.
#define NEWFONTREF
Definition: vpa1_tgs.h:286
MHEG5ObjectReference o
Definition: mh5base.h:159
U16BIT type
Definition: mh5base.h:151
#define CLOSECONNECTION
Definition: vpa1_tgs.h:175
#define DRAWOVAL
Definition: vpa1_tgs.h:183
#define GETCOUNTERPOSITION
Definition: vpa1_tgs.h:312
#define DRAWRECTANGLE
Definition: vpa1_tgs.h:186
#define INDIRECT
Definition: vpa1_tgs.h:289
#define SELECT
Definition: vpa1_tgs.h:233
#define GETAVAILABILITYSTATUS
Definition: vpa1_tgs.h:189
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...
MHEG5Bool b
Definition: mh5base.h:155
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
union sMH5GroupRef::@5 ptr
struct fpa1_syntaxItem * children
Definition: fpa1_syn.h:53
#define GETLISTITEM
Definition: vpa1_tgs.h:205
#define PUTBEHIND
Definition: vpa1_tgs.h:226
MHEG5Short MHEG5ElemActionType
Definition: mh5action.h:184
MHEG5ElemActionType type
Definition: mh5action.h:195
syntaxItemData data
Definition: fpa1_syn.h:57
union MHEG5Generic::@6 value
#define GETINTERACTIONSTATUS
Definition: vpa1_tgs.h:198
#define DEACTIVATE
Definition: vpa1_tgs.h:176
asnErr asn1_decodeGenericObjectReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
#define DPL5(x)
Definition: glue_debug.h:167
MHEG5EventType
Definition: mh5base.h:114
#define SETVOLUME
Definition: vpa1_tgs.h:264
int asn1_GroupActionCount
unsigned short childCount[3]
Definition: fpa1_syn.h:59
typedefs etc for the whole object creation section.
#define MOVETO
Definition: vpa1_tgs.h:221
#define NEWABSCOL
Definition: vpa1_tgs.h:284
#define GETTEXTDATA
Definition: vpa1_tgs.h:214
#define GETTEXTCONTENT
Definition: vpa1_tgs.h:213
#define DRAWARC
Definition: vpa1_tgs.h:181
long MHEG5Int
Definition: mh5base.h:73
Contains macros for MHEG-5 ASN.1 tags and structures.
#define NEWFONTNAME
Definition: vpa1_tgs.h:285
MHEG5GList * firstParam
Definition: mh5action.h:193
#define SETPORTION
Definition: vpa1_tgs.h:257
#define SETTEXTCOLOUR
Definition: vpa1_tgs.h:295
#define GETBOXSIZE
Definition: vpa1_tgs.h:190
asnErr asn1_decodeGenericBoolean(fpa1_syntaxList *listPtr, MHEG5GList *gList)
#define READPERSISTENT
Definition: vpa1_tgs.h:228
#define STEP
Definition: vpa1_tgs.h:266
void MHEG5gListDestruct(MHEG5GList *item)
Destruct a list of MHEG5Generic objects.
Definition: mh5base.c:933
#define SETFONTREF
Definition: vpa1_tgs.h:248
#define SETDATA
Definition: vpa1_tgs.h:244
#define SETBITMAPDECODEOFFSET
Definition: vpa1_tgs.h:301
asnErr asn1_decodeGenericContentReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
#define SETDESKTOPCOLOUR
Definition: vpa1_tgs.h:311
MHEG5GList * asn1_GroupParamPtr
#define NEWCOLIND
Definition: vpa1_tgs.h:283
MHEG5GList * asn1_addNewGList(MHEG5GList *gList)
Creates a new MHEG5GList element and adds it to the end of the supplied list.
MHEG5Action * a_ptr
Definition: mh5action.h:201
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...
#define SETOVERWRITEMODE
Definition: vpa1_tgs.h:255
#define SETCELLPOSITION
Definition: vpa1_tgs.h:293
#define SETFIRSTITEM
Definition: vpa1_tgs.h:247
MHEG5Bool boolData
Definition: fpa1_syn.h:44
asnErr asn1_decodeObjectReference(fpa1_syntaxList *listPtr, MHEG5GList *gList)
Decodes a MHEG object reference to a MHEG5GList. This function can cope with listPtr being NULL...
#define SETCOUNTERTRIGGER
Definition: vpa1_tgs.h:241
#define UNLOCKSCREEN
Definition: vpa1_tgs.h:275
#define GETLINEWIDTH
Definition: vpa1_tgs.h:204
#define TESTVARIABLE
Definition: vpa1_tgs.h:270
short MHEG5Bool
Definition: mh5base.h:71
#define DELITEM
Definition: vpa1_tgs.h:177
#define ADDITEM
Definition: vpa1_tgs.h:168
#define CALLACTIONSLOT
Definition: vpa1_tgs.h:172
#define DESELECT
Definition: vpa1_tgs.h:178
#define SETTRANSPARENCY
Definition: vpa1_tgs.h:262
#define GCONTREF
Definition: vpa1_tgs.h:282
asnErr asn1_decodeGenericInteger(fpa1_syntaxList *listPtr, MHEG5GList *gList)
#define SETPALETTEREF
Definition: vpa1_tgs.h:256
#define EFFECT
Definition: vpa1_tgs.h:112
#define DRAWPOLYLINE
Definition: vpa1_tgs.h:185
#define PRELOAD
Definition: vpa1_tgs.h:224
#define DPL1(x)
Definition: glue_debug.h:191
#define SELECTITEM
Definition: vpa1_tgs.h:234
#define SETVARIABLE
Definition: vpa1_tgs.h:263
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...
#define CLONE
Definition: vpa1_tgs.h:174
#define DPL2(x)
Definition: glue_debug.h:185
#define QUIT
Definition: vpa1_tgs.h:227
#define SETBACKGROUNDCOLOUR
Definition: vpa1_tgs.h:292
#define MHEG5TRUE
Definition: mh5base.h:49
#define SCALEBITMAP
Definition: vpa1_tgs.h:230
#define GOBJREF
Definition: vpa1_tgs.h:281
#define TOGGLEITEM
Definition: vpa1_tgs.h:272
#define SCALEVIDEO
Definition: vpa1_tgs.h:231
#define SETCOUNTERPOSITION
Definition: vpa1_tgs.h:240
#define GETFOCUSPOSITION
Definition: vpa1_tgs.h:299
#define GETLINECOLOUR
Definition: vpa1_tgs.h:202
#define GETFIRSTITEM
Definition: vpa1_tgs.h:196
#define LOCKSCREEN
Definition: vpa1_tgs.h:218
#define CALL
Definition: vpa1_tgs.h:171
#define SETSPEED
Definition: vpa1_tgs.h:260
MHEG5Int len
Definition: mh5base.h:99
#define FORK
Definition: vpa1_tgs.h:188
#define SENDEVENT
Definition: vpa1_tgs.h:235
#define STOP
Definition: vpa1_tgs.h:267
#define GINT
Definition: vpa1_tgs.h:279
#define RUN
Definition: vpa1_tgs.h:229
#define SETCACHEPRIORITY
Definition: vpa1_tgs.h:238
#define GOSTRING
Definition: vpa1_tgs.h:280
#define SETFOCUSPOSITION
Definition: vpa1_tgs.h:300
MHEG5Int total
Definition: mh5base.h:181
int asn1_GroupParamCount
#define GETSLIDERVALUE
Definition: vpa1_tgs.h:212
#define ADD
Definition: vpa1_tgs.h:167
#define SCROLLITEMS
Definition: vpa1_tgs.h:232
#define SENDTOBACK
Definition: vpa1_tgs.h:236
#define SETENTRYPOINT
Definition: vpa1_tgs.h:245
#define GETSELECTIONSTATUS
Definition: vpa1_tgs.h:211
#define GETENGINESUPPORT
Definition: vpa1_tgs.h:193
int asnErr
Definition: asn1_sys.h:41
#define GETFILLCOLOUR
Definition: vpa1_tgs.h:195
MH5GroupPtr group
Definition: mh5base.h:103
#define GETLASTANCHORFIRED
Definition: vpa1_tgs.h:201
MHEG5EventType e
Definition: mh5base.h:157
#define GETCURSORPOSITION
Definition: vpa1_tgs.h:192
#define SPAWN
Definition: vpa1_tgs.h:265
#define SETINPUTMASK
Definition: vpa1_tgs.h:321
#define GETPOSITION
Definition: vpa1_tgs.h:209
#define MHEG_NULL
Definition: vpa1_tgs.h:42
MHEG5GList * origFirstParam
Definition: mh5action.h:194
MHEG5GList * params
Definition: mh5base.h:182
#define DRAWSECTOR
Definition: vpa1_tgs.h:187
#define DIVIDE
Definition: vpa1_tgs.h:180
#define CLEAR
Definition: vpa1_tgs.h:173
#define SETCURSORPOSITION
Definition: vpa1_tgs.h:242
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
#define GBOOL
Definition: vpa1_tgs.h:278
#define STOREPERSISTENT
Definition: vpa1_tgs.h:268
#define SETLINEWIDTH
Definition: vpa1_tgs.h:254
#define SETBOXSIZE
Definition: vpa1_tgs.h:237
#define SETVIDEODECODEOFFSET
Definition: vpa1_tgs.h:297
#define SETHIGHLIGHTSTATUS
Definition: vpa1_tgs.h:249
#define SETFILLCOLOUR
Definition: vpa1_tgs.h:246
#define GETCOUNTERMAXPOSITION
Definition: vpa1_tgs.h:313
#define TOGGLE
Definition: vpa1_tgs.h:271
MHEG5Bool MH5_SupportFontClass(void)
Return whether font class is supported by current profile.
Definition: mh5support.c:560
#define GETPORTION
Definition: vpa1_tgs.h:208
#define SETTIMER
Definition: vpa1_tgs.h:261
#define GETCELLITEM
Definition: vpa1_tgs.h:191
MHEG5Int intData
Definition: fpa1_syn.h:45
#define GETRUNNINGSTATUS
Definition: vpa1_tgs.h:210
#define MULTIPLY
Definition: vpa1_tgs.h:222
#define GETITEMSTATUS
Definition: vpa1_tgs.h:199
#define GETTOKENPOSITION
Definition: vpa1_tgs.h:215
MHEG5EventType asn1_decodeEventType(MHEG5Int evt_val)
MHEG5Generic generic
Definition: mh5base.h:171
struct sMHEG5GList * next
Definition: mh5base.h:172
#define GETLABEL
Definition: vpa1_tgs.h:200
#define OPENCONNECTION
Definition: vpa1_tgs.h:223
#define MHEG5FALSE
Definition: mh5base.h:48
#define SETLINECOLOUR
Definition: vpa1_tgs.h:252
#define GETOVERWRITEMODE
Definition: vpa1_tgs.h:207
#define MODULO
Definition: vpa1_tgs.h:219
int fpa1_GroupParamCount
Definition: fpa1_rdf.c:68
#define GETLISTSIZE
Definition: vpa1_tgs.h:206
#define SETSLIDERPARAMETERS
Definition: vpa1_tgs.h:303
asnErr asn1_decodeGenericOctetString(fpa1_syntaxList *listPtr, MHEG5GList *gList)
Engine support utility functions for MHEG5.
#define DRAWLINE
Definition: vpa1_tgs.h:182
#define LAUNCH
Definition: vpa1_tgs.h:217
#define APPEND
Definition: vpa1_tgs.h:169
MHEG5Int total
Definition: mh5action.h:202
#define TRACE(t, x)
Definition: glue_debug.h:118