MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
dvb_service.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2012 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
38 #ifndef _DVB_SERVICE_H
39 #define _DVB_SERVICE_H
40 
41 #include "techtype.h"
42 #include "dtvstring.h"
43 #include "dmxtype.h"
44 #include "dvblocator.h"
45 #include "mherrors.h"
46 
47 /*---Constant and macro definitions for public use---------------------------*/
48 
49 /*---Enumerations for public use---------------------------------------------*/
50 
51 typedef enum
52 {
53  SRV_TYP_ALL, /* All or any service type */
54  SRV_TYP_TV_DATA, /* TV (including data) service type */
55  SRV_TYP_RADIO /* Radio service type */
56 } E_ServiceType;
57 
58 /*---Global type defs for public use-----------------------------------------*/
59 
60 /* Basic SI structure */
61 typedef struct
62 {
63  /* Identifier of original broadcast network */
64  U16BIT original_network_id;
65  /* Identifier of transport stream */
66  U16BIT transport_stream_id;
67  /* Service identification information */
68  U16BIT service_id;
69  /* Identifier of broadcast network */
70  U16BIT network_id;
72 
73 #if defined INCLUDE_SI_EXTENSION
74 typedef enum
75 {
76  /* Subtitle stream is present */
77  MHEG5_COMPONENT_SUBTITLES,
78 
79  /* Audio Description is available */
80  MHEG5_COMPONENT_AUDIO_DESC,
81 
82  /* The service contains audio streams with more than one audio language */
83  MHEG5_COMPONENT_ALT_LANG,
84 
85  /* Any audio stream is Dolby Digital or Dolby Digital Plus (AC-3/E-AC-3) */
86  MHEG5_COMPONENT_DOLBY,
87 
88  /* Video component is either MPEG-2 high definition video, or H.264 */
89  MHEG5_COMPONENT_HD
90 } E_ComponentKey;
91 
92 typedef struct
93 {
94  U32BIT serviceIndex;
95 
96  /* Service name, from the SDT service_descriptor */
97  S_STRING serviceName;
98 
99  /* Service Provider name, from the SDT service_descriptor */
100  S_STRING serviceProvider;
101 
102  /* Service type, from the SDT service_descriptor */
103  U16BIT serviceType;
104 
105  /* Allocated LCN for service */
106  U16BIT serviceLcn;
107 } S_ServiceDetails;
108 
109 typedef struct
110 {
111  U16BIT hours;
112  U8BIT minutes;
113  U8BIT seconds;
114 } S_Time;
115 
116 typedef struct s_eventdetails
117 {
118  void *dvb_user_data; /* Available for DVB stack - not used by MHEG5 */
119 
120  /* Event name, from the EIT short_event_descriptor */
121  S_STRING eventName;
122 
123  /* Event description, from the EIT short_event_descriptor */
124  S_STRING shortDescription;
125 
126  /* Event parental rating, from the EIT parental_rating_descriptor
127  formatted as it is in parental_rating_descriptor*/
128  U32BIT parentalRating;
129 
130  /* Event start date, in Modified Julian Date format - as per EIT field */
131  U32BIT startDate;
132 
133  /* Event start time, from the EIT start_time field*/
134  S_Time startTime;
135 
136  /* Event duration, from the EIT duration field,
137  as formatted in the EIT*/
138  S_Time duration;
139 
140  /* Event Category string, from the EIT content_descriptor (see Ref [2])
141  * ONLY give bytes containing
142  * 'content_nibble_level_1' and 'content_nibble_level_2'
143  * 'user_data' byte(s) should be ignored.
144  * Note that content_descriptor can have more than one iteration - depending
145  * on descriptor length.
146  */
147  S_STRING category;
148 
149  /* Free-content flag, TRUE if content is free, FALSE if content is CA controlled
150  from EIT free_CA_mode field*/
151  BOOLEAN freeNotCA;
152 } S_EventDetails;
153 
154 #endif /*SI Extension*/
155 
156 /*---Global Function prototypes for public use---------------------------------*/
157 
162 DMXREF DVB_MhegGetDemuxPath(void);
163 
171 E_MhegErr DVB_MhegGetTunedService(S32BIT *serviceIndex);
172 
186 E_MhegErr DVB_MhegDvbLocatorToIndex(S_DvbLocator *pDvbLocator, S32BIT *pServiceIndex);
187 
197 E_MhegErr DVB_MhegIndexToDvbLocator( S32BIT serviceIndex, S_DvbLocator *location );
198 
208 E_MhegErr DVB_MhegIndexToDvbLocation( S32BIT serviceIndex, S_DvbLocation *pDvbLocation );
209 
218 E_MhegErr DVB_MhegLcnToDvbLocator( U32BIT lcn, S_DvbLocator *pDvbLocator);
219 
233 E_MhegErr DVB_MhegTuneIndex(S32BIT serviceIndex);
234 
244 
252 
253 #ifdef INCLUDE_SI_EXTENSION
254 
267 E_MhegErr DVB_MhegGetServiceDetails( S32BIT serviceIndex,
268  S_ServiceDetails *details );
269 
277 void DVB_MhegReleaseServiceDetails( S_ServiceDetails *details );
278 
294 E_MhegErr DVB_MhegGetEventDetails( S32BIT serviceIndex, BOOLEAN porf,
295  S_EventDetails *details );
296 
304 void DVB_MhegReleaseEventDetails( S_EventDetails *details );
305 
306 #ifdef INCLUDE_SA_PROFILE
307 
320 E_MhegErr DVB_MhegGetNumberOfServices(S32BIT *number);
321 
343 E_MhegErr DVB_MhegPrevServiceIndex(S32BIT *serviceIndex, E_ServiceType type);
344 
366 E_MhegErr DVB_MhegNextServiceIndex(S32BIT *serviceIndex, E_ServiceType type);
367 
380 E_MhegErr DVB_MhegGetServiceRunningStatus(S32BIT serviceIndex,
381  U8BIT *runningStatus);
382 
396 E_MhegErr DVB_MhegGetChannelNumber(S32BIT serviceIndex, S32BIT *channelNum);
397 
409 E_MhegErr DVB_MhegGetEventId( S32BIT serviceIndex, BOOLEAN porf, S32BIT *eventId );
410 
438 E_MhegErr DVB_MhegSetEventIterator(S32BIT serviceIndex, S32BIT startDate,
439  S32BIT startTime, S32BIT *eventId);
440 
462 E_MhegErr DVB_MhegIncrementEventIterator(S32BIT *eventId);
463 
480 E_MhegErr DVB_MhegGetScheduledEventDetails(S32BIT serviceIndex,
481  S32BIT eventId,
482  BOOLEAN *result,
483  S_EventDetails *details);
484 
507 E_MhegErr DVB_MhegGetComponentInfo(S32BIT serviceIndex, S32BIT eventId,
508  BOOLEAN *result, E_ComponentKey key,
509  BOOLEAN *value);
510 
540 E_MhegErr DVB_MhegGetComponentData(S32BIT serviceIndex, S32BIT eventId,
541  BOOLEAN *result, U8BIT *strCont,
542  U8BIT *contType, U8BIT *lang);
543 
550 E_ServiceType DVB_MhegGetServiceMode(void);
551 
552 #endif /* INCLUDE_SA_PROFILE */
553 
554 #endif /* INCLUDE_SI_EXTENSION */
555 
556 #ifdef INCLUDE_FREESAT
557 
565 E_MhegErr DVB_MhegGetCurrentFSI(U16BIT *fsi);
566 
581 E_MhegErr DVB_MhegGetFSILocator(U16BIT fsi, S_DVB_LOCATOR *pDvbLocator);
582 
595 E_MhegErr DVB_MhegCurrentServiceIsInGroup(U16BIT groupIdentifier, BOOLEAN *inGroup);
596 
609 E_MhegErr DVB_MhegGetFSIServiceReference(S32BIT serviceIndex, U16BIT *fsi);
610 
611 #endif /*INCLUDE_FREESAT*/
612 
613 #endif /* _DVB_SERVICE_H */
E_MhegErr DVB_MhegTuneIndex(S32BIT serviceIndex)
Tunes to the specified service. This MUST be a non-blocking function If the tuner fails to tune to th...
Definition: dvb_service.h:61
Define MHEG5 String type.
Definition: dvblocator.h:30
E_MhegErr DVB_MhegIndexToDvbLocation(S32BIT serviceIndex, S_DvbLocation *pDvbLocation)
Convert Service index into full DVB location information. This being networkID, origNetworkID, transportStreamID, serviceID.
Define Demux type.
Definition: dtvstring.h:28
E_MhegErr DVB_MhegIndexToDvbLocator(S32BIT serviceIndex, S_DvbLocator *location)
Convert "service index" into DVB locator information. This being original network ID...
E_MhegErr DVB_MhegLcnToDvbLocator(U32BIT lcn, S_DvbLocator *pDvbLocator)
Convert Logical channel number into DVB locator information.
void DVB_MhegServiceRemovePmtListen(S_DvbLocator dvbLocator)
Advise DVB stack to remove prioritising of PMT for the service that was set up by DVB_MhegServiceAddP...
MHEG5 engine interface error codes.
DMXREF DVB_MhegGetDemuxPath(void)
Retrieve demux resource reference.
void DVB_MhegServiceAddPmtListen(S_DvbLocator dvbLocator)
Advise DVB stack that PMT may be required soon in DVB_MhegVideoPlayStream() or DVB_MhegAudioPlayStrea...
E_MhegErr DVB_MhegGetTunedService(S32BIT *serviceIndex)
Retrieve the DVB locator of the current tuned service. That is, the real service according to the DVB...
System Wide Global Technical Data Type Definitions.
Definition of DVB locator and DVB component types.
E_MhegErr DVB_MhegDvbLocatorToIndex(S_DvbLocator *pDvbLocator, S32BIT *pServiceIndex)
Get a DVB implementation dependant service index - an integer greater or equal to 0...