2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 //
37 //
38 // Stacking Input Buffer Driver declarations
39 //
40 // Derived from /c/ti/c6000/include/dgs.h
42 #ifndef DIB_H
43 #define DIB_H
45 #include <xdc/std.h>
47 #include <dev2.h>
48 #include <sio2.h>
49 #include <ti/xdais/xdas.h>
51 #include <inpbuf.h>
52 #include <pafdec.h>
53 #include <pafsio.h>
54 #include <pafsio_ialg.h>
55 #include <paftyp.h>
58 // .............................................................................
59 //Function table defs
61 typedef Int (*DIB_TgetSync)(DEV2_Handle, PAF_InpBufConfig *);
62 typedef Int (*DIB_TinitFrame)(DEV2_Handle, PAF_InpBufConfig *);
63 typedef Int (*DIB_TrequestFrame)(DEV2_Handle, PAF_InpBufConfig *);
64 typedef Int (*DIB_TissueChild)(DEV2_Handle, PAF_InpBufConfig *, Int, Int);
65 typedef Int (*DIB_TreclaimChild)(DEV2_Handle, PAF_InpBufConfig *);
66 typedef Int (*DIB_Treset)(DEV2_Handle, PAF_InpBufConfig *);
67 typedef Int (*DIB_TsyncScan)(DEV2_Handle, PAF_InpBufConfig *, XDAS_UInt32 *);
68 typedef Int (*DIB_TwaitForData)(DEV2_Handle, PAF_InpBufConfig *, XDAS_UInt32);
69 typedef Int (*DIB_TsyncScanDTS)(DEV2_Handle, PAF_InpBufConfig *, XDAS_UInt32 *, XDAS_UInt16 *);
71 typedef struct DIB_Fxns {
72 //common (must be same as DEV2_Fxns)
73 DEV2_Tclose close;
74 DEV2_Tctrl ctrl;
75 DEV2_Tidle idle;
76 DEV2_Tissue issue;
77 DEV2_Topen open;
78 DEV2_Tready ready;
79 DEV2_Treclaim reclaim;
81 //DIB specific
82 DIB_TgetSync getSync;
83 DIB_TinitFrame initFrame;
84 DIB_TrequestFrame requestFrame;
85 DIB_TissueChild issueChild;
86 DIB_TreclaimChild reclaimChild;
87 DIB_Treset reset;
88 DIB_TsyncScan syncScan;
89 DIB_TwaitForData waitForData;
90 DIB_TsyncScanDTS syncScanDTS;
91 } DIB_Fxns;
93 extern DIB_Fxns DIB_FXNS;
94 extern Void DIB_init( Void );
96 // .............................................................................
98 typedef struct DIB_DeviceExtension {
99 SIO2_Obj child;
101 DIB_Fxns *pFxns;
102 XDAS_UInt16 *pIECFrameLength;
104 XDAS_UInt32 zeroCount;
105 XDAS_Int8 sourceSelect;
106 XDAS_Int8 sourceProgram;
107 XDAS_Int16 numSamplesExtra; // no. samples issued but not yet needed
109 XDAS_Int16 headerSize; // in bytes (contains sync so >= sizeofSync)
110 XDAS_Int16 autoRequestSize;
112 XDAS_Int8 syncState;
113 XDAS_Int8 scanState;
114 XDAS_Int8 running;
115 XDAS_Int8 unused;
117 // second buffer info
118 XDAS_Int32 frameLength;
119 XDAS_Int32 lengthofData;
120 PAF_UnionPointer pSync;
122 PAF_UnionPointer lastDTSCDSyncDuringPCM;
124 XDAS_Int32 pcmFrameLength;
125 XDAS_UInt32 pcmTimeout;
126 XDAS_UInt32 numSamplesSinceDTS;
128 //hack
129 PAF_InpBufStatus *pInpBufStatus;
130 PAF_DecodeStatus *pDecodeStatus;
132 PAF_SIO_IALG_Obj *pSioIalg;
133 XDAS_Int32 deferredError;
135 PAF_InpBufConfig bufConfig;
137 } DIB_DeviceExtension;
139 // .............................................................................
141 #endif /* DIB_H */