MHEG5  18.9.0
MHEG5 Documentation
asn1_createVisible.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 "mh5group.h"
36 #include "mh5visible.h"
37 #include "asn1_createExtras.h"
38 #include "asn1_createIngredient.h"
39 #include "asn1_createGroup.h"
40 #include "asn1_createVisible.h"
41 
42 /*---constant definitions for this file--------------------------------------*/
43 
44 
45 /*---local typedef structs for this file-------------------------------------*/
46 
47 /*---local (static) variable declarations for this file----------------------*/
48 
49 /*---local function definitions----------------------------------------------*/
50 
51 /*---global function definitions---------------------------------------------*/
52 
62 {
63  asnErr errVal = 0;
64  fpa1_syntaxList *currItem;
65 
66  DPL5((">> asn1_decodeVisible(%X,%X)\n", listPtr, visible));
67 
68  assert(visible);
69  assert(listPtr);
70 
71  currItem = listPtr->children;
72 
73  /* defaults */
74  visible->originalPosition[0] = 0;
75  visible->originalPosition[1] = 0;
76 
77  /* searches current set of tags for local tags */
78  while (currItem != NULL)
79  {
80  /* most objects will have more than one local tag */
81  switch (currItem->tag)
82  {
83  case OBOXSIZE:
84  if ((currItem->children != NULL) && (currItem->children->next != NULL))
85  {
86  visible->originalBoxSize[0] = currItem->children->data.intData;
87  visible->originalBoxSize[1] = currItem->children->next->data.intData;
88  }
89  else
90  {
91  errVal |= 0x01;
92  }
93  break;
94  case OPOSITION:
95  if ((currItem->children != NULL) && (currItem->children->next != NULL))
96  {
97  visible->originalPosition[0] = currItem->children->data.intData;
98  visible->originalPosition[1] = currItem->children->next->data.intData;
99  }
100  else
101  {
102  errVal |= 0x01;
103  }
104  break;
105 #ifndef ASN1UKPROFILE
106  case OPALREF: /* Palette not in UK1 profile */
107  if (currItem->children->tag == EXTERNAL_REFERENCE_TYPE)
108  {
109  errVal |= asn1_decodeOctetString(currItem->children->children,
111  errVal |= asn1_decodeInteger(currItem->children->children->next,
112  &visible->originalPaletteRefID);
113  }
114  else /* must be Integer type */
115  {
116  visible->originalPaletteRefGROUPID.len = 0;
118  errVal |= asn1_decodeInteger(currItem->children, &visible->originalPaletteRefID);
119  }
120  break;
121 #endif /* ASN1UKPROFILE */
122  default:
123  break;
124  }
125  currItem = currItem->next;
126  }
127  /* decode inherited tags */
128  errVal |= asn1_decodeIngredient(listPtr, &visible->ingredient);
129 
130 #if (DPLEVEL >= 2)
131  if (errVal != 0)
132  {
133  DPL2(("WARNING:[ASN.1] asn1_decodeVisible() returns errVal = %d\n", errVal));
134  }
135 #endif /* DPLEVEL >= 2 */
136 
137  DPL5(("<< asn1_decodeVisible() Returns %d\n", errVal));
138 
139  return errVal;
140 }
141 
Basis MHEG5 data types.
asnErr asn1_decodeOctetString(fpa1_syntaxList *listPtr, MHEG5String *decodedString)
decodes String type
MH5GroupRef originalPaletteRefGROUPID
Definition: mh5visible.h:55
Functions to create a MHEG5Ingredient from a MHEG5 script (in the form of a list of fpa1_syntaxList s...
MH5GroupPtr asn1_mainGroupPtr
Miscellaneous functions for decoding ASN.1 types.
MHEG5Int originalBoxSize[2]
Definition: mh5visible.h:52
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.
struct fpa1_syntaxItem * children
Definition: fpa1_syn.h:53
#define OPOSITION
Definition: vpa1_tgs.h:126
Implementation of the Group class Description Defines the structure and behaviour of objects used as ...
syntaxItemData data
Definition: fpa1_syn.h:57
#define DPL5(x)
Definition: glue_debug.h:167
typedefs etc for the whole object creation section.
Contains macros for MHEG-5 ASN.1 tags and structures.
MHEG5Int originalPosition[2]
Definition: mh5visible.h:53
asnErr asn1_decodeIngredient(fpa1_syntaxList *listPtr, MHEG5Ingredient *ingredient)
Decodes Ingredient class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
asnErr asn1_decodeVisible(fpa1_syntaxList *listPtr, MHEG5Visible *visible)
Decodes Visible class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
#define OBOXSIZE
Definition: vpa1_tgs.h:125
Implement the MHEG5 Visible Class Defines the behaviour of Presentables that have a visual representa...
#define DPL2(x)
Definition: glue_debug.h:185
Functions to create a MHEG5Visible from a MHEG5 script (in the form of a list of fpa1_syntaxList stru...
MHEG5Int len
Definition: mh5base.h:99
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
asnErr asn1_decodeInteger(fpa1_syntaxList *listPtr, MHEG5Int *decodedInt)
decodes Integer type
int asnErr
Definition: asn1_sys.h:41
MH5GroupPtr group
Definition: mh5base.h:103
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
MHEG5Int originalPaletteRefID
Definition: mh5visible.h:54
MHEG5Int intData
Definition: fpa1_syn.h:45
#define OPALREF
Definition: vpa1_tgs.h:127