MHEG5  18.9.0
MHEG5 Documentation
asn1_createVideo.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 "mh5video.h"
36 #include "asn1_createExtras.h"
37 #include "asn1_createVisible.h"
38 #include "asn1_createVideo.h"
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 
60 {
61  MHEG5Video *video;
62  fpa1_syntaxList *currItem;
63 
64  DPL5((">> asn1_createVideo(%X,%X)\n", listPtr, video));
65 
66  assert(listPtr);
67 
68  video = (MHEG5Video *)MHEG5getMem( sizeof(MHEG5Video));
69  if (video)
70  {
71  /* defaults */
72  memset(video, 0, sizeof(MHEG5Video));
74  /* video->terminationFreeze = MHEG5FALSE; */
75 
76  /* parent points to the MHEG5Stream object containing the MHEG5Video */
77  video->parent = stream;
78 
79  /* searches current set of tags for local tags */
80  currItem = listPtr->children;
81  while (currItem != NULL)
82  {
83  /* most objects will have more than one local tag */
84  switch (currItem->tag)
85  {
86  case COMPTAG:
87  video->componentTag = currItem->data.intData;
88  break;
89  case TERMIN:
90  if (currItem->data.intData == 1)
91  {
93  }
94  /* else default to MHEG5FALSE (disapear)*/
95  break;
96  default:
97  break;
98  }
99  currItem = currItem->next;
100  }
101  /* decode inherited tags */
102  if (asn1_decodeVisible(listPtr, &video->visible) != ASN_NO_ERROR)
103  {
104  #if (DPLEVEL >= 2)
105  DPL2(("WARNING:[ASN.1] asn1_createVideo() Fails\n"));
106  #endif /* DPLEVEL >= 2 */
107  MHEG5freeMem(video);
108  video = NULL;
109  }
110  }
111 
112  DPL5(("<< asn1_createVideo() %X\n", video));
113 
114  return (MHEG5Ingredient *)video;
115 }
116 
Basis MHEG5 data types.
MHEG5Ingredient * asn1_createVideo(fpa1_syntaxList *listPtr, MHEG5Stream *stream)
Decodes Video class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Miscellaneous functions for decoding ASN.1 types.
Implementation of the Video class Description Defines the attributes and behaviour of an elementary v...
#define COMPTAG
Definition: vpa1_tgs.h:147
#define TERMIN
Definition: vpa1_tgs.h:149
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
#define MHEG5getMem
Definition: glue_memory.h:93
MHEG5Final clazz
Definition: mh5root.h:55
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
syntaxItemData data
Definition: fpa1_syn.h:57
Functions to create a MHEG5Video from a MHEG5 script (in the form of a list of fpa1_syntaxList struct...
#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.
#define MHEG5freeMem
Definition: glue_memory.h:94
MHEG5Int componentTag
Definition: mh5video.h:63
MHEG5Stream * parent
Definition: mh5video.h:65
#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...
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
MHEG5Visible visible
Definition: mh5video.h:49
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
MHEG5Bool terminationFreeze
Definition: mh5video.h:62
MHEG5Int intData
Definition: fpa1_syn.h:45