DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
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 
32 //---Constant and macro definitions for public use-----------------------------
33 #define MAX_HW_SECT_FILT_LEN 8
34 
35 #define STB_DMX_PID_FILTER_INVALID 0xffff
36 #define STB_DMX_SECT_FILTER_INVALID 0xffff
37 
38 #define STB_TPID_CBUFF_PRIORITY 10
39 
40 //---Enumerations for public use-----------------------------------------------
41 
42 // definitions for the descrambler
43 typedef enum
44 {
45  DESC_TRACK_AUDIO,
46  DESC_TRACK_VIDEO,
47  DESC_TRACK_TEXT,
48  DESC_NUM_TRACKS
49 } E_STB_DMX_DESC_TRACK;
50 
51 typedef enum
52 {
53  KEY_PARITY_EVEN,
54  KEY_PARITY_ODD
55 } E_STB_DMX_DESC_KEY_PARITY;
56 
57 typedef enum
58 {
59  DESC_TYPE_DVB,
60  DESC_TYPE_AES,
61  DESC_TYPE_AES_SCTE_52,
62  DESC_TYPE_DES,
63  DESC_TYPE_TDES
64 } E_STB_DMX_DESC_TYPE;
65 
66 typedef enum
67 {
68  KEY_USAGE_PES,
69  KEY_USAGE_TRANSPORT,
70  KEY_USAGE_ALL
71 } E_STB_DMX_KEY_USAGE;
72 
73 typedef enum
74 {
75  DMX_TUNER,
76  DMX_1394,
77  DMX_MEMORY
78 } E_STB_DMX_DEMUX_SOURCE;
79 
80 typedef enum
81 {
82  DMX_CAPS_LIVE = 0x0001, /* Demux can be used to watch live TV */
83  DMX_CAPS_PIP = 0x0002, /* Demux can be used for picture-in-picture */
84  DMX_CAPS_RECORDING = 0x0004, /* Demux can be used for PVR recording */
85  DMX_CAPS_PLAYBACK = 0x0008, /* Demux can be used for PVR playback */
86  DMX_CAPS_MONITOR_SI = 0x0010 /* Demux can be used to monitor SI data from a tuner */
87 } E_STB_DMX_CAPS;
88 
89 //---Global type defs for public use-------------------------------------------
90 
91 typedef void (*FILTER_CALLBACK)( U8BIT path, U16BIT bytes, U16BIT pfilt_id );
92 
93 //---Global Function prototypes for public use---------------------------------
94 
100 void STB_DMXInitialise(U8BIT paths, BOOLEAN inc_pes_collection);
101 
107 U16BIT STB_DMXGetCapabilities(U8BIT path);
108 
113 U8BIT STB_DMXGetMaxSectionFilters(void);
114 
121 void STB_DMXSetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE source, U8BIT param);
122 
129 void STB_DMXGetDemuxSource(U8BIT path, E_STB_DMX_DEMUX_SOURCE *source, U8BIT *param);
130 
137 void STB_DMXReadTextPES(U8BIT path, U8BIT **buffer, U32BIT *num_bytes);
138 
148 void STB_DMXChangeDecodePIDs(U8BIT path, U16BIT pcr_pid, U16BIT video_pid, U16BIT audio_pid,
149  U16BIT text_pid, U16BIT data_pid, U16BIT ad_pid);
150 
156 void STB_DMXChangeTextPID(U8BIT path, U16BIT text_pid);
157 
166 U16BIT STB_DMXGrabPIDFilter(U8BIT path, U16BIT pid, FILTER_CALLBACK func);
167 
177 BOOLEAN STB_DMXCopyPIDFilterSect(U8BIT path, U8BIT *buffer, U16BIT size, U16BIT pfilt_id);
178 
184 void STB_DMXSkipPIDFilterSect(U8BIT path, U16BIT pfilt_id);
185 
192 U16BIT STB_DMXGrabSectFilter(U8BIT path, U16BIT pfilt_id);
193 
203 void STB_DMXSetupSectFilter(U8BIT path, U16BIT sfilt_id, U8BIT *match_ptr, U8BIT *mask_ptr,
204  U8BIT not_equal_byte_index, BOOLEAN crc);
205 
211 void STB_DMXStartPIDFilter(U8BIT path, U16BIT pfilt_id);
212 
218 void STB_DMXStopPIDFilter(U8BIT path, U16BIT pfilt_id);
219 
225 void STB_DMXReleasePIDFilter(U8BIT path, U16BIT pfilt_id);
226 
232 void STB_DMXReleaseSectFilter(U8BIT path, U16BIT sfilt_id);
233 
240 BOOLEAN STB_DMXGetDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track);
241 
248 BOOLEAN STB_DMXFreeDescramblerKey(U8BIT path, E_STB_DMX_DESC_TRACK track);
249 
259 BOOLEAN STB_DMXSetDescramblerKeyData(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_KEY_PARITY parity, U8BIT *data);
260 
270 BOOLEAN STB_DMXGetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE *key_usage);
271 
280 BOOLEAN STB_DMXSetKeyUsage(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_KEY_USAGE key_usage);
281 
289 BOOLEAN STB_DMXGetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE *type);
290 
297 BOOLEAN STB_DMXSetDescramblerType(U8BIT path, E_STB_DMX_DESC_TRACK track, E_STB_DMX_DESC_TYPE type);
298 
305 void STB_DMXWriteDemux(U8BIT path, U8BIT *data, U32BIT size);
306 
307 #endif // _STBHWDMX_H
308 
void STB_DMXStopPIDFilter(U8BIT path, U16BIT pfilt_id)
Stop Specified PID Filter Collecting Data.
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.
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.
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.