MHEG5  22.11.0
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 typedef enum {
59  SRV_NORMAL_TUNE,
60  SRV_QUIET_TUNE,
61  SRV_KEEP_APP_RUNING,
62  SRV_QUIET_KEEP_APP
63 } E_TuningFlags;
64 
65 /*---Global type defs for public use-----------------------------------------*/
66 
67 /* Basic SI structure */
68 typedef struct
69 {
70  /* Identifier of original broadcast network */
71  U16BIT original_network_id;
72  /* Identifier of transport stream */
73  U16BIT transport_stream_id;
74  /* Service identification information */
75  U16BIT service_id;
76  /* Identifier of broadcast network */
77  U16BIT network_id;
79 
85 typedef void (*F_NotifyDvbTuning)(S32BIT serviceIndex, E_TuningFlags flags);
86 
87 #if defined INCLUDE_SI_EXTENSION
88 typedef enum
89 {
90  /* Subtitle stream is present */
91  MHEG5_COMPONENT_SUBTITLES,
92 
93  /* Audio Description is available */
94  MHEG5_COMPONENT_AUDIO_DESC,
95 
96  /* The service contains audio streams with more than one audio language */
97  MHEG5_COMPONENT_ALT_LANG,
98 
99  /* Any audio stream is Dolby Digital or Dolby Digital Plus (AC-3/E-AC-3) */
100  MHEG5_COMPONENT_DOLBY,
101 
102  /* Video component is either MPEG-2 high definition video, or H.264 */
103  MHEG5_COMPONENT_HD
104 } E_ComponentKey;
105 
106 typedef struct
107 {
108  U32BIT serviceIndex;
109 
110  /* Service name, from the SDT service_descriptor */
111  S_STRING serviceName;
112 
113  /* Service Provider name, from the SDT service_descriptor */
114  S_STRING serviceProvider;
115 
116  /* Service type, from the SDT service_descriptor */
117  U16BIT serviceType;
118 
119  /* Allocated LCN for service */
120  U16BIT serviceLcn;
121 } S_ServiceDetails;
122 
123 typedef struct
124 {
125  U16BIT hours;
126  U8BIT minutes;
127  U8BIT seconds;
128 } S_Time;
129 
130 typedef struct s_eventdetails
131 {
132  void *dvb_user_data; /* Available for DVB stack - not used by MHEG5 */
133 
134  /* Event name, from the EIT short_event_descriptor */
135  S_STRING eventName;
136 
137  /* Event description, from the EIT short_event_descriptor */
138  S_STRING shortDescription;
139 
140  /* Event parental rating, from the EIT parental_rating_descriptor
141  formatted as it is in parental_rating_descriptor*/
142  U32BIT parentalRating;
143 
144  /* Event start date, in Modified Julian Date format - as per EIT field */
145  U32BIT startDate;
146 
147  /* Event start time, from the EIT start_time field*/
148  S_Time startTime;
149 
150  /* Event duration, from the EIT duration field,
151  as formatted in the EIT*/
152  S_Time duration;
153 
154  /* Event Category string, from the EIT content_descriptor (see Ref [2])
155  * ONLY give bytes containing
156  * 'content_nibble_level_1' and 'content_nibble_level_2'
157  * 'user_data' byte(s) should be ignored.
158  * Note that content_descriptor can have more than one iteration - depending
159  * on descriptor length.
160  */
161  S_STRING category;
162 
163  /* Free-content flag, TRUE if content is free, FALSE if content is CA controlled
164  from EIT free_CA_mode field*/
165  BOOLEAN freeNotCA;
166 } S_EventDetails;
167 
168 #endif /*SI Extension*/
169 
170 /*---Global Function prototypes for public use---------------------------------*/
171 
176 DMXREF DVB_MhegGetDemuxPath(void);
177 
185 E_MhegErr DVB_MhegGetTunedService(S32BIT *serviceIndex);
186 
200 E_MhegErr DVB_MhegDvbLocatorToIndex(S_DvbLocator *pDvbLocator, S32BIT *pServiceIndex);
201 
211 E_MhegErr DVB_MhegIndexToDvbLocator( S32BIT serviceIndex, S_DvbLocator *location );
212 
222 E_MhegErr DVB_MhegIndexToDvbLocation( S32BIT serviceIndex, S_DvbLocation *pDvbLocation );
223 
232 E_MhegErr DVB_MhegLcnToDvbLocator( U32BIT lcn, S_DvbLocator *pDvbLocator);
233 
247 E_MhegErr DVB_MhegTuneIndex(S32BIT serviceIndex);
248 
258 
266 
273 
274 #ifdef INCLUDE_SI_EXTENSION
275 
288 E_MhegErr DVB_MhegGetServiceDetails( S32BIT serviceIndex,
289  S_ServiceDetails *details );
290 
298 void DVB_MhegReleaseServiceDetails( S_ServiceDetails *details );
299 
315 E_MhegErr DVB_MhegGetEventDetails( S32BIT serviceIndex, BOOLEAN porf,
316  S_EventDetails *details );
317 
325 void DVB_MhegReleaseEventDetails( S_EventDetails *details );
326 
327 #ifdef INCLUDE_SA_PROFILE
328 
341 E_MhegErr DVB_MhegGetNumberOfServices(S32BIT *number);
342 
364 E_MhegErr DVB_MhegPrevServiceIndex(S32BIT *serviceIndex, E_ServiceType type);
365 
387 E_MhegErr DVB_MhegNextServiceIndex(S32BIT *serviceIndex, E_ServiceType type);
388 
401 E_MhegErr DVB_MhegGetServiceRunningStatus(S32BIT serviceIndex,
402  U8BIT *runningStatus);
403 
417 E_MhegErr DVB_MhegGetChannelNumber(S32BIT serviceIndex, S32BIT *channelNum);
418 
430 E_MhegErr DVB_MhegGetEventId( S32BIT serviceIndex, BOOLEAN porf, S32BIT *eventId );
431 
459 E_MhegErr DVB_MhegSetEventIterator(S32BIT serviceIndex, S32BIT startDate,
460  S32BIT startTime, S32BIT *eventId);
461 
483 E_MhegErr DVB_MhegIncrementEventIterator(S32BIT *eventId);
484 
501 E_MhegErr DVB_MhegGetScheduledEventDetails(S32BIT serviceIndex,
502  S32BIT eventId,
503  BOOLEAN *result,
504  S_EventDetails *details);
505 
528 E_MhegErr DVB_MhegGetComponentInfo(S32BIT serviceIndex, S32BIT eventId,
529  BOOLEAN *result, E_ComponentKey key,
530  BOOLEAN *value);
531 
561 E_MhegErr DVB_MhegGetComponentData(S32BIT serviceIndex, S32BIT eventId,
562  BOOLEAN *result, U8BIT *strCont,
563  U8BIT *contType, U8BIT *lang);
564 
571 E_ServiceType DVB_MhegGetServiceMode(void);
572 
573 #endif /* INCLUDE_SA_PROFILE */
574 
575 #endif /* INCLUDE_SI_EXTENSION */
576 
577 #ifdef INCLUDE_FREESAT
578 
586 E_MhegErr DVB_MhegGetCurrentFSI(U16BIT *fsi);
587 
602 E_MhegErr DVB_MhegGetFSILocator(U16BIT fsi, S_DVB_LOCATOR *pDvbLocator);
603 
616 E_MhegErr DVB_MhegCurrentServiceIsInGroup(U16BIT groupIdentifier, BOOLEAN *inGroup);
617 
630 E_MhegErr DVB_MhegGetFSIServiceReference(S32BIT serviceIndex, U16BIT *fsi);
631 
632 #endif /*INCLUDE_FREESAT*/
633 
634 #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:68
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(* F_NotifyDvbTuning)(S32BIT serviceIndex, E_TuningFlags flags)
Notify that DVB is about to tune to service as requested by CI-CAM.
Definition: dvb_service.h:85
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...
void DVB_MhegRegisterDvbTuning(F_NotifyDvbTuning cb_func)
Register callback function to notify start of tuning process due to CI tune request.
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...