MHEG5  18.9.0
MHEG5 Documentation
asn1_createRTGraphics.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  *******************************************************************************/
27 /*---includes for this file--------------------------------------------------*/
28 #include <stdio.h>
29 #include "vpa1_sys.h"
30 #include "vpa1_tgs.h"
31 #include "fpa1_syn.h"
32 #include "asn1_sys.h"
33 
34 #include "mh5base.h"
35 #include "mh5rtgraphics.h"
36 #include "asn1_createExtras.h"
37 #include "asn1_createVisible.h"
38 
39 
40 /*---constant definitions for this file--------------------------------------*/
41 
42 
43 /*---local typedef structs for this file-------------------------------------*/
44 
45 /*---local (static) variable declarations for this file----------------------*/
46 
47 /*---local function definitions----------------------------------------------*/
48 
49 /*---global function definitions---------------------------------------------*/
50 
51 #ifndef ASN1UKPROFILE
52 
61 {
62  MHEG5RTGraphics *rtGraphics;
63  MHEG5Int tempInt = 0;
64  fpa1_syntaxList *currItem;
65 
66  DPL5((">> asn1_decodeRTGraphics(%X)\n", listPtr));
67 
68  assert( listPtr );
69 
70  rtGraphics = (MHEG5RTGraphics *)MHEG5getMem( sizeof(MHEG5RTGraphics));
71  if (rtGraphics)
72  {
73  /* defaults */
74  memset(rtGraphics, 0, sizeof(MHEG5RTGraphics));
75  rtGraphics->ingredient.root.class = MHEG5VIDEO;
76 
77  /* searches current set of tags for local tags */
78  currItem = listPtr->children;
79  while (currItem != NULL)
80  {
81  switch (currItem->tag)
82  {
83  case COMPTAG:
84  asn1_decodeInteger(currItem, &rtGraphics->componentTag);
85  break;
86  case TERMIN:
87  /* TERMIN is an enumerated type where 1=terminate, 2=dissapear */
88  asn1_decodeInteger(currItem, &tempInt);
89  if (tempInt == 1) /*ie. freeze */
90  {
91  rtGraphics->terminationFreeze = MHEG5TRUE;
92  }
93  /* else defaults to MHEG5FALSE */
94  break;
95 
96  default:
97  break;
98  }
99  currItem = currItem->next;
100  }
101  /* decode inherited tags */
102  if (asn1_decodeVisible(listPtr, &rtGraphics->visible) != ASN_NO_ERROR)
103  {
104  #if (DPLEVEL >= 2)
105  DPL2(("WARNING:[ASN.1] asn1_createAudio() Fails\n"));
106  #endif /* DPLEVEL >= 2 */
107  MHEG5freeMem(rtGraphics);
108  rtGraphics = NULL;
109  }
110  }
111 
112  DPL5(("<< asn1_decodeRTGraphics() %X\n", rtGraphics));
113 
114  return (MHEG5Ingredient *)rtGraphics;
115 }
116 
117 #endif /* ASN1UKPROFILE */
Basis MHEG5 data types.
MHEG5Int componentTag
Definition: mh5rtgraphics.h:54
Implementation of the RTGraphics class Description Defines the attributes and behaviour of non-persis...
Miscellaneous functions for decoding ASN.1 types.
#define COMPTAG
Definition: vpa1_tgs.h:147
#define TERMIN
Definition: vpa1_tgs.h:149
MHEG5Bool terminationFreeze
Definition: mh5rtgraphics.h:53
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
#define MHEG5getMem
Definition: glue_memory.h:93
MHEG5Ingredient * asn1_createRTGraphics(fpa1_syntaxList *listPtr, MHEG5Stream *stream)
Decodes RTGraphics class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
struct fpa1_syntaxItem * children
Definition: fpa1_syn.h:53
#define ASN_NO_ERROR
Definition: asn1_sys.h:36
#define DPL5(x)
Definition: glue_debug.h:167
typedefs etc for the whole object creation section.
long MHEG5Int
Definition: mh5base.h:73
Contains macros for MHEG-5 ASN.1 tags and structures.
#define MHEG5freeMem
Definition: glue_memory.h:94
MHEG5Visible visible
Definition: mh5rtgraphics.h:50
#define DPL2(x)
Definition: glue_debug.h:185
asnErr asn1_decodeVisible(fpa1_syntaxList *listPtr, MHEG5Visible *visible)
Decodes Visible class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
#define MHEG5TRUE
Definition: mh5base.h:49
Functions to create a MHEG5Visible from a MHEG5 script (in the form of a list of fpa1_syntaxList stru...
asnErr asn1_decodeInteger(fpa1_syntaxList *listPtr, MHEG5Int *decodedInt)
decodes Integer type
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52