MHEG-5  19.3.0
MHEG-5 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,
110  (MHEG5String *)&visible->originalPaletteRefGROUPID);
111  errVal |= asn1_decodeInteger(currItem->children->children->next,
112  &visible->originalPaletteRefID);
113  }
114  else /* must be Integer type */
115  {
116  visible->originalPaletteRefGROUPID.len = 0;
117  visible->originalPaletteRefGROUPID.Ptr.group = asn1_mainGroupPtr;
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
Functions to create a MHEG5Ingredient from a MHEG5 script (in the form of a list of fpa1_syntaxList s...
Miscellaneous functions for decoding ASN.1 types.
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.
Implementation of the Group class Description Defines the structure and behaviour of objects used as ...
typedefs etc for the whole object creation section.
Contains macros for MHEG-5 ASN.1 tags and structures.
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...
Implement the MHEG5 Visible Class Defines the behaviour of Presentables that have a visual representa...
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