DVBCore  22.3.0
Open Source DVB Engine
stbhwdmx.h
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  *
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  *******************************************************************************/
24 // pre-processor mechanism so multiple inclusions don't cause compilation error
25 
26 #ifndef _STBHWDMX_H
27 
28 #define _STBHWDMX_H
29 
30 #include "techtype.h"
31 #include "stbhwav.h"
32 
33 //---Constant and macro definitions for public use-----------------------------
34 #define MAX_HW_SECT_FILT_LEN 8
35 
36 #define STB_DMX_PID_FILTER_INVALID 0xffff
37 #define STB_DMX_SECT_FILTER_INVALID 0xffff
38 
39 #define STB_TPID_CBUFF_PRIORITY 10
40 
41 //---Enumerations for public use-----------------------------------------------
42 
43 // definitions for the descrambler
44 typedef enum
45 {
46  DESC_TRACK_AUDIO,
47  DESC_TRACK_VIDEO,
48  DESC_TRACK_TEXT,
49  DESC_NUM_TRACKS
50 } E_STB_DMX_DESC_TRACK;
51 
52 typedef enum
53 {
54  KEY_PARITY_EVEN,
55  KEY_PARITY_ODD
56 } E_STB_DMX_DESC_KEY_PARITY;
57 
58 typedef enum
59 {
60  DESC_TYPE_DVB,
61  DESC_TYPE_AES,
62  DESC_TYPE_AES_SCTE_52,
63  DESC_TYPE_DES,
64  DESC_TYPE_TDES
65 } E_STB_DMX_DESC_TYPE;
66 
67 typedef enum
68 {
69  KEY_USAGE_PES,
70  KEY_USAGE_TRANSPORT,
71  KEY_USAGE_ALL
72 } E_STB_DMX_KEY_USAGE;
73 
74 typedef enum
75 {
76  DMX_TUNER,
77  DMX_1394,
78  DMX_MEMORY
79 } E_STB_DMX_DEMUX_SOURCE;
80 
81 typedef enum
82 {
83  DMX_CAPS_LIVE = 0x0001, /* Demux can be used to watch live TV */
84  DMX_CAPS_PIP = 0x0002, /* Demux can be used for picture-in-picture */
85  DMX_CAPS_RECORDING = 0x0004, /* Demux can be used for PVR recording */
86  DMX_CAPS_PLAYBACK = 0x0008, /* Demux can be used for PVR playback */
87  DMX_CAPS_MONITOR_SI = 0x0010 /* Demux can be used to monitor SI data from a tuner */
88 } E_STB_DMX_CAPS;
89 
90 typedef enum
91 {
92  DMX_PID_TYPE_VIDEO,
93  DMX_PID_TYPE_AUDIO,
94  DMX_PID_TYPE_PCR,
95  DMX_PID_TYPE_SUBTITLES,
96  DMX_PID_TYPE_SECTION,
97  DMX_PID_TYPE_TELETEXT
98 } E_DMX_PID_TYPE;
99 
100 //---Global type defs for public use-------------------------------------------
101 
102 typedef void (*FILTER_CALLBACK)( U8BIT path, U16BIT bytes, U16BIT pfilt_id );
103 
104 typedef struct
105 {
106  E_DMX_PID_TYPE type;
107  U16BIT pid;
108  union
109  {
110  E_STB_AV_VIDEO_CODEC video_codec;
111  E_STB_AV_AUDIO_CODEC audio_codec;
112  } u;
114 
115 
116 //---Global Function prototypes for public use---------------------------------
117 
123 void STB_DMXInitialise(U8BIT paths, BOOLEAN inc_pes_collection);
124 
130 U16BIT STB_DMXGetCapabilities(U8BIT path);
131 
136 U8BIT STB_DMXGetMaxSectionFilters(void);
137 
144 void STB_DMXSetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE source, U8BIT param);
145 
152 void STB_DMXGetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE *source, U8BIT *param);
153 
160 void STB_DMXReadTextPES(U8BIT path, U8BIT **buffer, U32BIT *num_bytes);
161 
171 void STB_DMXChangeDecodePIDs(U8BIT path, U16BIT pcr_pid, U16BIT video_pid, U16BIT audio_pid,
172  U16BIT text_pid, U16BIT data_pid, U16BIT ad_pid);
173 
179 void STB_DMXChangeTextPID(U8BIT path, U16BIT text_pid);
180 
189 U16BIT STB_DMXGrabPIDFilter(U8BIT path, U16BIT pid, FILTER_CALLBACK func);
190 
200 BOOLEAN STB_DMXCopyPIDFilterSect(U8BIT path, U8BIT *buffer, U16BIT size, U16BIT pfilt_id);
201 
207 void STB_DMXSkipPIDFilterSect(U8BIT path, U16BIT pfilt_id);
208 
215 U16BIT STB_DMXGrabSectFilter(U8BIT path, U16BIT pfilt_id);
216 
226 void STB_DMXSetupSectFilter(U8BIT path, U16BIT sfilt_id, U8BIT *match_ptr, U8BIT *mask_ptr,
227  U8BIT not_equal_byte_index, BOOLEAN crc);
228 
234 void STB_DMXStartPIDFilter(U8BIT path, U16BIT pfilt_id);
235 
241 void STB_DMXStopPIDFilter(U8BIT path, U16BIT pfilt_id);
242 
248 void STB_DMXReleasePIDFilter(U8BIT path, U16BIT pfilt_id);
249 
255 void STB_DMXReleaseSectFilter(U8BIT path, U16BIT sfilt_id);
256 
263 BOOLEAN STB_DMXGetDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track);
264 
271 BOOLEAN STB_DMXFreeDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track);
272 
282 BOOLEAN STB_DMXSetDescramblerKeyData(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_KEY_PARITY parity, U8BIT *data);
283 
293 BOOLEAN STB_DMXGetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE *key_usage);
294 
303 BOOLEAN STB_DMXSetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE key_usage);
304 
312 BOOLEAN STB_DMXGetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE *type);
313 
320 BOOLEAN STB_DMXSetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE type);
321 
328 void STB_DMXWriteDemux(U8BIT path, U8BIT *data, U32BIT size);
329 
339 void STB_DMXSetServicePids(U8BIT path, U16BIT num_pids, S_DMX_PID_INFO *pid_array);
340 
341 #endif // _STBHWDMX_H
342 
void STB_DMXStopPIDFilter(U8BIT path, U16BIT pfilt_id)
Stop Specified PID Filter Collecting Data.
void STB_DMXSetServicePids(U8BIT path, U16BIT num_pids, S_DMX_PID_INFO *pid_array)
Sets the array of PIDs that make up a service and would be included in a single program transport str...
void STB_DMXSetupSectFilter(U8BIT path, U16BIT sfilt_id, U8BIT *match_ptr, U8BIT *mask_ptr, U8BIT not_equal_byte_index, BOOLEAN crc)
Configures a match and mask for a specified section filter.
BOOLEAN STB_DMXGetDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track)
Acquires a descrambler for the specified track on this path.
BOOLEAN STB_DMXGetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE *key_usage)
Get the descrambler key usage for the specified track on this path as set by STB_DMXSetKeyUsage.
void STB_DMXStartPIDFilter(U8BIT path, U16BIT pfilt_id)
Start Specified PID Filter Collecting Data.
BOOLEAN STB_DMXCopyPIDFilterSect(U8BIT path, U8BIT *buffer, U16BIT size, U16BIT pfilt_id)
Copies a filtered section to caller's buffer.
U16BIT STB_DMXGetCapabilities(U8BIT path)
Returns the capability flags of the given demux.
void STB_DMXChangeDecodePIDs(U8BIT path, U16BIT pcr_pid, U16BIT video_pid, U16BIT audio_pid, U16BIT text_pid, U16BIT data_pid, U16BIT ad_pid)
Changes the packet IDs for the PCR Video, Audio, Text and Data.
void STB_DMXGetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE *source, U8BIT *param)
Gets the current source of a given demux.
Header file - Function prototypes for A/V control.
void STB_DMXSetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE source, U8BIT param)
Configures the source of the demux.
void STB_DMXWriteDemux(U8BIT path, U8BIT *data, U32BIT size)
Writes data to the demux from memory.
BOOLEAN STB_DMXSetDescramblerKeyData(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_KEY_PARITY parity, U8BIT *data)
Set the descrambler key data for the specified track on this path.
void STB_DMXChangeTextPID(U8BIT path, U16BIT text_pid)
Changes just the teletext PID.
BOOLEAN STB_DMXSetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE type)
Set the descrambler type for the specified track on this path.
void STB_DMXInitialise(U8BIT paths, BOOLEAN inc_pes_collection)
Initialises the demux / programmable transport interface.
void STB_DMXReadTextPES(U8BIT path, U8BIT **buffer, U32BIT *num_bytes)
Reads Teletext PES data from the demux.
void STB_DMXSkipPIDFilterSect(U8BIT path, U16BIT pfilt_id)
Skips (discards) a section in the PID filter buffer.
BOOLEAN STB_DMXSetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE key_usage)
Set the descrambler key usage for the specified track on this path.
System Wide Global Technical Data Type Definitions.
U16BIT STB_DMXGrabSectFilter(U8BIT path, U16BIT pfilt_id)
Allocated a new section filter on the specified PID filter.
void STB_DMXReleaseSectFilter(U8BIT path, U16BIT sfilt_id)
Releases a previously allocated section filter.
BOOLEAN STB_DMXGetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE *type)
Get the descrambler type for the specified track on this path, as set by STB_DMXSetDescramblerType.
Definition: stbhwdmx.h:104
BOOLEAN STB_DMXFreeDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track)
Frees the descrambler for the specified track on this path.
U16BIT STB_DMXGrabPIDFilter(U8BIT path, U16BIT pid, FILTER_CALLBACK func)
Get a New PID Filter & Setup Associated Buffer and Callback Function Address.
U8BIT STB_DMXGetMaxSectionFilters(void)
Returns the maximum number of section filters available on this hw.
void STB_DMXReleasePIDFilter(U8BIT path, U16BIT pfilt_id)
Releases a previously allocated PID filter.