DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
stbsiflt.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  *******************************************************************************/
25 // pre-processor mechanism so multiple inclusions don't cause compilation error
26 
27 #ifndef _STBSIFLT_H
28 #define _STBSIFLT_H
29 
30 #include "techtype.h"
31 
32 //---Constant and macro definitions for public use-----------------------------
33 
34 // macros for use in calls to STB_SIRequestTable
35 #define SI_BUFFER_1K 1024
36 #define SI_BUFFER_2K 2048
37 #define SI_BUFFER_4K 4096
38 #define SI_BUFFER_8K 8192
39 #define SI_BUFFER_16K 16384
40 #define SI_BUFFER_32K 32768
41 #define SI_BUFFER_64K 65535
42 #define SI_XTID_MATCH_DONT_CARE 0x0000
43 #define SI_XTID_MASK_DONT_CARE 0x0000
44 
45 
46 
47 //---Enumerations for public use-----------------------------------------------
48 
49 // SI events passed to the application event handler
50 typedef enum
51 {
52  STOP_SI,
53  START_SI_SEARCHING,
54  START_SI_UPDATING_NEW_TRANSPORT,
55  START_SI_UPDATING_SAME_TRANSPORT,
56  SI_TIMEOUT
57 } E_APP_SI_EVENT_TYPE;
58 
59 // enumerations used to define filter requests
60 typedef enum
61 {
62  ONE_SHOT_REQUEST,
63  CONTINUOUS_REQUEST
64 } E_SI_REQUEST_TYPE;
65 
66 typedef enum
67 {
68  SINGLE_SECT, // single section tables have short header up to section length only e.g. TOT
69  MULTI_SECT // multi section table headers include version num, section num and last section e.g. PAT
70 } E_SI_TABLE_FORMAT_TYPE;
71 
72 
73 
74 //------------------------
75 // Table record structures
76 typedef struct si_section_record
77 {
78  struct si_section_record *next;
79  U8BIT sect_num;
80  U16BIT data_len;
81  U8BIT data_start;
83 
84 typedef struct si_table_record
85 {
86  U8BIT path;
87  U8BIT tid;
88  U16BIT xtid;
89  U16BIT pid;
90  U8BIT version;
91  U16BIT num_sect;
92  SI_SECTION_RECORD *section_list;
94 
95 typedef void (*F_AppSiEventHandler)(U8BIT, E_APP_SI_EVENT_TYPE);
96 
97 //---Global type defs for public use-------------------------------------------
98 
99 //---Global Function prototypes for public use---------------------------------
100 
101 void STB_SIReportCurrentPmt(U16BIT service_id, SI_TABLE_RECORD *table_rec, BOOLEAN new_serv,
102  BOOLEAN new_pmt_version);
103 
111 F_AppSiEventHandler STB_SIRegisterAppSiEventHandler(F_AppSiEventHandler func_ptr);
112 
113 void *STB_SIRequestTable(U8BIT path, U16BIT pid, U8BIT tid_match, U8BIT tid_mask,
114  E_SI_TABLE_FORMAT_TYPE format, U16BIT expected_tables,
115  U16BIT xtid_match, U16BIT xtid_mask, E_SI_REQUEST_TYPE req_type,
116  U16BIT buff_size, BOOLEAN crc, BOOLEAN low_priority,
117  void (*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param);
118 
119 void STB_SIModifyTableRequest(void *filter_handle, U8BIT tid_match, U8BIT tid_mask,
120  U16BIT xtid_match, U16BIT xtid_mask, U16BIT expected_tables);
121 
122 void STB_SIRestartTableRequest(void *filter_handle);
123 
124 void STB_SICancelTableRequest(void *filter_ptr);
125 
127 
128 void STB_SISearchComplete(U8BIT path, BOOLEAN success, void *event_data, U32BIT data_size);
129 
135 BOOLEAN STB_SIReportCat(SI_TABLE_RECORD *table_rec);
136 
142 BOOLEAN STB_SIReportBat(SI_TABLE_RECORD *table_rec);
143 
149 BOOLEAN STB_SIReportNit(SI_TABLE_RECORD *table_rec);
150 
151 #endif // _STBSIFLT_H
152 
153 //*****************************************************************************
154 // End of file
155 //*****************************************************************************
156 
void STB_SIModifyTableRequest(void *filter_handle, U8BIT tid_match, U8BIT tid_mask, U16BIT xtid_match, U16BIT xtid_mask, U16BIT expected_tables)
modifies the section filtering on an existing filter
Definition: stbsiflt.c:2378
BOOLEAN STB_SIReportCat(SI_TABLE_RECORD *table_rec)
Reports the CAT has been received so it can be passed on to other modules.
Definition: stbsiflt.c:2603
void STB_SIRestartTableRequest(void *filter_handle)
restarts the section filtering on an existing filter without changing and pid or match/mask filter se...
Definition: stbsiflt.c:2419
BOOLEAN STB_SIReportNit(SI_TABLE_RECORD *table_rec)
Reports the NIT has been received so it can be passed on to other modules.
Definition: stbsiflt.c:2687
BOOLEAN STB_SIReportBat(SI_TABLE_RECORD *table_rec)
Reports the BAT has been received so it can be passed on to other modules.
Definition: stbsiflt.c:2650
Definition: stbsiflt.h:84
Definition: stbsiflt.h:76
void STB_SIReleaseTableRecord(SI_TABLE_RECORD *table_rec)
Frees the memory used in a table record passed to the application.
Definition: stbsiflt.c:2463
void STB_SISearchComplete(U8BIT path, BOOLEAN success, void *event_data, U32BIT data_size)
Indicates SI search is complete.
Definition: stbsiflt.c:2509
void STB_SIReportCurrentPmt(U16BIT service_id, SI_TABLE_RECORD *table_rec, BOOLEAN new_serv, BOOLEAN new_pmt_version)
Reports current pmt has arrived so that it can be passed on to interested parties.
Definition: stbsiflt.c:2542
System Wide Global Technical Data Type Definitions.
void * STB_SIRequestTable(U8BIT path, U16BIT pid, U8BIT tid_match, U8BIT tid_mask, E_SI_TABLE_FORMAT_TYPE format, U16BIT expected_tables, U16BIT xtid_match, U16BIT xtid_mask, E_SI_REQUEST_TYPE req_type, U16BIT buff_size, BOOLEAN crc, BOOLEAN low_priority, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Sets up filter for SI table.
Definition: stbsiflt.c:2297
void STB_SICancelTableRequest(void *filter_ptr)
Stops filtering for SI table.
Definition: stbsiflt.c:2336
F_AppSiEventHandler STB_SIRegisterAppSiEventHandler(F_AppSiEventHandler func_ptr)
Registers a function to be called to handle SI events. The currently registered event handler is retu...