source: svn/trunk/newcon3bcm2_21bu/BSEAV/lib/bcmplayer/include/tsindexer.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 5.1 KB
RevLine 
[2]1/***************************************************************************
2 *     Copyright (c) 2002-2005, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: tsindexer.h $
11 * $brcm_Revision: Irvine_BSEAVSW_Devel/20 $
12 * $brcm_Date: 3/18/05 9:38a $
13 *
14 * Module Description: Software startcode index generator
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /SetTop/bcmplayer/tsindexer.h $
19 *
20 * Irvine_BSEAVSW_Devel/20   3/18/05 9:38a erickson
21 * PR14451: added 6 word SCT support
22 *
23 * Irvine_BSEAVSW_Devel/19   3/14/05 5:00p erickson
24 * PR14451: add 6-word SCT support, extend alloc/reset api, add AVC start
25 * code support
26 *
27 * Irvine_BSEAVSW_Devel/18   4/13/04 4:33p erickson
28 * PR10292: added docjet comments
29 *
30 * Irvine_BSEAVSW_Devel/17   2/20/03 4:36p marcusk
31 * Added support for VOB (DVD program stream) indexing.
32 *
33 * Irvine_HDDemo_Devel\16   4/16/02 10:33a marcusk
34 * Updated to use unified interface with bcmindexer.
35 *
36 * Irvine_HDDemo_Devel\1   4/16/02 12:54p erickson
37 * Moved from SetTop/dvrtable
38 * Added reset
39 * Added version to allocate/reset
40 *
41 *
42 ***************************************************************************/
43#ifndef TSINDEXER_H
44#define TSINDEXER_H
45
46#include "bcmsct_index.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/**
53Summary:
54Callback function tsindexer needs to write new SCT's back to the calling app
55**/
56typedef unsigned long (*INDEX_WRITE_CB)( const void *p_bfr, unsigned long numEntries, unsigned long entrySize, void *fp );
57
58/**
59Summary:
60Structure on a 4 four SCT entry.
61**/
62typedef BSCT_Entry sIndexEntry;
63
64/**
65Summary:
66Structure on a 6 word SCT entry.
67**/
68typedef BSCT_SixWord_Entry sSixWordIndexEntry;
69
70/**
71Summary:
72Main tsindexer object.
73**/
74typedef struct sTsIndexer sTsIndexer;
75
76/**
77Summary:
78Allocate new sTsIndexer.
79
80Return values:
81NULL on error
82New sTsIndexer object
83**/
84sTsIndexer      *tsindex_allocate(
85        INDEX_WRITE_CB cb,                      /* write callback. see tsindex_settings for details. */
86        void *fp,                                       /* file pointer. see tsindex_settings for details. */
87        unsigned short pid,                     /* video pid. see tsindex_settings for details. */
88        int version                                     /* Compatibility version. see tsindex_settings for details. */
89        );
90
91/**
92Summary:
93Reset sTsIndexer to post-allocate state.
94
95Return values:
96-1 if version is not supported
970 on success
98**/
99int tsindex_reset(
100        sTsIndexer      *p_tsi,
101        INDEX_WRITE_CB cb,                      /* write callback. see tsindex_settings for details. */
102        void *fp,                                       /* file pointer. see tsindex_settings for details. */
103        unsigned short pid,                     /* video pid. see tsindex_settings for details. */
104        int version                                     /* Compatibility version. see tsindex_settings for details. */
105        );
106
107/**
108Summary:
109Settings structure for initializing a tsindex object.
110**/
111typedef struct tsindex_settings {
112        INDEX_WRITE_CB cb;                      /* write callback. fwrite() is valid. */
113        void *fp;                                       /* file pointer to pass to callback. If you used fwrite(), this
114                                                                        will be FILE* */
115        unsigned short pid;                     /* video pid */
116        int version;                            /* Compatibility version. If version == -1, latest version is used.
117                                                                        Major #'s for tsindexer and tsplayer should match.
118
119                                                                        Current version supported:
120                                                                                0101
121                                                                 */
122        int entry_size;                         /* number of words in SCT entry. Default is 4 and you
123                                                                        should use sIndexEntry to parse the generated data.
124                                                                        The other supported value is 6 and you should then
125                                                                        use sSixWordIndexEntry to parse the generated data. */
126        unsigned short start_code_lo;
127        unsigned short start_code_hi;
128        int is_avc;                             /* This is an AVC stream, so don't interpret the
129                                                                        start codes. Just do raw capture. */
130} tsindex_settings;
131
132/**
133Summary:
134Initialize a settings struture to default values.
135Description:
136b, fp and pid cannot be defaulted.
137**/
138void tsindex_settings_init(
139        tsindex_settings *settings
140        );
141
142/**
143Summary:
144Allocate a tsindex object using the settings structure.
145Description:
146This is preferred to tsindex_allocate because it can be extended. The old
147API is fixed.
148**/
149sTsIndexer      *tsindex_allocate_ex(
150        const tsindex_settings *settings
151        );
152
153int tsindex_reset_ex(
154        sTsIndexer *p_tsi,
155        const tsindex_settings *settings
156        );
157
158/**
159Summary:
160Free a sTsIndexer.
161**/
162void            tsindex_free(
163        sTsIndexer *p_tsi
164        );
165
166/**
167Summary:
168Feed MPEG2 Transport into a sTsIndexer.
169
170Description:
171It will build the startcode table and write it out
172using the callback passed into tsindex_allocate().
173
174Return values:
175-1 on error
176Number of packets processed
177**/
178long            tsindex_feed( sTsIndexer * const p_tsi, const unsigned char *p_bfr, long numBytes );
179
180/**
181Summary:
182Set the PES id before calling tsindex_feedPes
183**/
184void            tsindex_setPesId( sTsIndexer *p_tsi, unsigned char pesStreamId );
185
186/**
187Summary:
188Feed PES mpeg data.
189**/
190long            tsindex_feedPes( sTsIndexer * const p_tsi, const unsigned char *p_bfr, long numBytes );
191
192/**
193Summary:
194Feed DVD VOB mpeg data.
195**/
196long            tsindex_feedVob( sTsIndexer * const p_tsi, const unsigned char *p_bfr, long numBytes );
197
198#ifdef __cplusplus
199}
200#endif
201
202#endif
Note: See TracBrowser for help on using the repository browser.