726 lines
28 KiB
C
Executable File
726 lines
28 KiB
C
Executable File
/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
|
|
*
|
|
* NVIDIA Corporation and its licensors retain all intellectual property
|
|
* and proprietary rights in and to this software, related documentation
|
|
* and any modifications thereto. Any use, reproduction, disclosure or
|
|
* distribution of this software and related documentation without an
|
|
* express license agreement from NVIDIA Corporation is strictly prohibited.
|
|
*/
|
|
|
|
/** @file GFMxDemTS.h
|
|
GFSDK MPEG2 Transport Stream API (host) header file.
|
|
*/
|
|
|
|
#ifndef _GF_MPEG_TS__
|
|
#define _GF_MPEG_TS__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** @addtogroup groupMxDemTS MxDemTSAPI MPEG2 Transport Stream Demux API
|
|
|
|
This GFSDK component allows to create MPEG TS demux parsers either running
|
|
on the host or DSP side. TS data can be pushed from the application,
|
|
or be streamed from VIP.
|
|
|
|
The are multiple types of parser objects, see also GFMXDEMTSPARSERTYPE:
|
|
<pre>
|
|
GFMXDEMTSPARSERTYPE_HOST - demux running on host
|
|
GFMXDEMTSPARSERTYPE_DSP - demux running on DSP
|
|
GFMXDEMTSPARSERTYPE_DSPAVSYNC - demux running on DSP with additional AVSync functionality
|
|
</pre>
|
|
|
|
<b>Programming Sequence for Parsers running on Host, TS data from host</b>
|
|
|
|
- Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
|
|
parameters #GFMXDEMTSPARSERTYPE_HOST and #GFMXDEMTSPARSERDATASOURCE_PUSH,
|
|
pass callback functions to handle demuxed substreams
|
|
- Poll GFMxDemTSParserPushData() to pass the incoming TS stream
|
|
- Call GFMxDemTSParserDestroy() to destroy parser object
|
|
|
|
<b>Programming Sequence for Parsers running on DSP, TS data from host</b>
|
|
|
|
- Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
|
|
parameters #GFMXDEMTSPARSERTYPE_DSP and #GFMXDEMTSPARSERDATASOURCE_PUSH,
|
|
pass callback functions to handle demuxed substreams
|
|
- Poll GFMxDemTSParserPushData() to pass the incoming TS stream
|
|
- Call GFMxDemTSParserDestroy() to destroy parser object
|
|
- Destroy the DSP message handling thread
|
|
|
|
<b>Programming Sequence for Parser running on DSP, TS data from VIP</b>
|
|
|
|
Only one parser at a time can be created to capture data from VIP.
|
|
For this mode the parser must run on DSP.
|
|
*/
|
|
/*@{*/
|
|
|
|
/** GFMxDemTSParser Maximum number of supported Services.
|
|
For ISDB-T 1seg, the max is 8 according to ARIB TR-B14, p7-28
|
|
*/
|
|
#define GFMXDEMTS_MAX_SERVICE_NO 8
|
|
|
|
/** GFMxDemTSParser Maximum number of supported Audio PES.
|
|
For ISDB-T 1seg, the max is 2.
|
|
*/
|
|
#define GFMXDEMTS_MAX_AUDIO_PID_NO 2
|
|
|
|
/** Get TS Audio PID.
|
|
For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
|
|
@param audio (NvU32) Combined type and ID value
|
|
*/
|
|
#define GFMXDEMTS_GET_AUDIO_PID(audio) (audio & 0x1FFFU) // Get the lower 13 bits
|
|
|
|
/** Get TS Service Type.
|
|
For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
|
|
@param service (NvU32) Combined type and ID value
|
|
*/
|
|
#define GFMXDEMTS_GET_AUDIO_TYPE(audio) (audio >> 16)
|
|
|
|
/** TS Audio Pid List. */
|
|
typedef struct _GFMXDEMTSPARSERAUDIOPIDLIST
|
|
{
|
|
NvU32 uAudioPidList[GFMXDEMTS_MAX_AUDIO_PID_NO]; //!< low 16 bits Audio PID, high 16 bits Audio Type
|
|
NvU32 uNoOfAudioPids; //!< Number valid entries in uAudioPidList[]
|
|
|
|
} GFMXDEMTSPARSERAUDIOPIDLIST;
|
|
|
|
/** Get TS Service ID.
|
|
For detail see #GFMXDEMTSPARSERPMTPIDLIST.
|
|
@param service (NvU32) Combined type and ID value
|
|
*/
|
|
#define GFMXDEMTS_GET_PMT_PID(service) ((((NvU32)(service) & 0xffff00) >> 8) | 0x1FC8)
|
|
|
|
/** Get TS Service Type.
|
|
For detail see #GFMXDEMTSPARSERPMTPIDLIST.
|
|
@param service (NvU32) Combined type and ID value
|
|
*/
|
|
#define GFMXDEMTS_GET_PMT_PID_TYPE(service) ((NvU32)(service) & 0x0000ff)
|
|
|
|
/** TS Service List.
|
|
*/
|
|
typedef struct _GFMXDEMTSPARSERPMTPIDLIST
|
|
{
|
|
/** Array of services:
|
|
Array entries format:
|
|
<pre>
|
|
32 24 23 8 7 0
|
|
+---------+------------------------------+----------------+
|
|
| Invalid | Service ID |Service Type |
|
|
+---------+------------------------------+----------------+
|
|
</pre>
|
|
*/
|
|
NvU32 uPmtPidList[GFMXDEMTS_MAX_SERVICE_NO];
|
|
|
|
/** Number of valid entries in GFMXDEMTSPARSERPMTPIDLIST::uPmtPidList[]. */
|
|
NvU32 uNoOfServices;
|
|
|
|
} GFMXDEMTSPARSERPMTPIDLIST;
|
|
|
|
|
|
/** TS parser types, parameter values for GFMXDEMTSPARSEREQUEST. */
|
|
typedef enum
|
|
{
|
|
/** Parser running on host system.
|
|
|
|
Parser objects of this type run the TS demux on the host system.
|
|
In contrast to GFMXDEMTSPARSERTYPE_DSP no hardware resources are involved,
|
|
and any number of parser objects of this type can be created.
|
|
|
|
TS data source is always of type GFMXDEMTSPARSERDATASOURCE_PUSH, i.e.
|
|
it is provided by the application via GFMxDemTSParserProcessData().
|
|
*/
|
|
GFMXDEMTSPARSERTYPE_HOST = 0,
|
|
|
|
/** Parser running on DSP.
|
|
|
|
Parser objects of this type will instanciate a task on the DSP
|
|
to perform the demux processing. Demuxed data is returned to the host.
|
|
Demuxed audio data can optionally be processed entirely on DSP side
|
|
via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
|
|
|
|
This parser type is intended for verifying demux functionality.
|
|
|
|
TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
|
|
or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
|
|
*/
|
|
GFMXDEMTSPARSERTYPE_DSP,
|
|
|
|
/** Parser running on DSP with attached AVSync object.
|
|
|
|
Parser objects of this type will instanciate 2 tasks on the DSP,
|
|
one to perform the demux processing, and one to decode AV-synced H264 video.
|
|
Audio is processed on DSP side via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
|
|
|
|
TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
|
|
or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
|
|
*/
|
|
GFMXDEMTSPARSERTYPE_DSPAVSYNC
|
|
|
|
} GFMXDEMTSPARSERTYPE;
|
|
|
|
/** TS data sources, parameter values for GFMXDEMTSPARSEREQUEST. */
|
|
typedef enum
|
|
{
|
|
/** TS data is pushed by the application.
|
|
|
|
TS data is fed from the application via function calls to
|
|
GFMxDemTSParserProcessData().
|
|
*/
|
|
GFMXDEMTSPARSERDATASOURCE_PUSH = 0,
|
|
|
|
/** TS data is intercepted by the DSP task directly from VIP.
|
|
|
|
The TS parser task running on the DSP will open the VIP in Type-A
|
|
interface mode to receive TS data via an interrupt handler.
|
|
|
|
This setting can be used only for parsers running on the DSP
|
|
(#GFMXDEMTSPARSERTYPE is GFMXDEMTSPARSERTYPE_DSP).
|
|
*/
|
|
GFMXDEMTSPARSERDATASOURCE_VIP2DSP
|
|
|
|
} GFMXDEMTSPARSERDATASOURCE;
|
|
|
|
/** TS Parser object states. */
|
|
typedef enum
|
|
{
|
|
GFMXDEMTSDSPPARSERSTATE_INSTANTIATED=0, //!< Parser object instanciated, but not initialized
|
|
GFMXDEMTSDSPPARSERSTATE_READY, //!< Parser object initialized, ready to parse
|
|
GFMXDEMTSDSPPARSERSTATE_ERROR, //!< Parser object dead due to unrecoverable error (out of mem, etc)
|
|
GFMXDEMTSDSPPARSERSTATE_SHUTDOWN, //!< Parser object initialized, ready to parse, but shutdown initiated
|
|
GFMXDEMTSDSPPARSERSTATE_PAUSE //!< Parser object paused
|
|
|
|
} GFMXDEMTSPARSERSTATE;
|
|
|
|
/** TS Parser demux status bits. */
|
|
typedef enum
|
|
{
|
|
GFMXDEMTSPARSERSTATUS_PMT_READY = 0x01,
|
|
GFMXDEMTSPARSERSTATUS_NIT_READY = 0x02,
|
|
GFMXDEMTSPARSERSTATUS_VIDEO_FOUND = 0x04,
|
|
GFMXDEMTSPARSERSTATUS_AUDIO_FOUND = 0x08,
|
|
// if the number of status goes beyond 8, please change m_uStatus to 16 bits or 32 bits in #CNvTransportParser
|
|
|
|
} GFMXDEMTSPARSERSTATUS;
|
|
|
|
/** Parameter structure for GFMxDemTSParserGetStatus(). */
|
|
typedef struct
|
|
{
|
|
GFMXDEMTSPARSERSTATE state; //!< Parser object state
|
|
NvU32 status; //!< Parser status bitmask, see #GFMXDEMTSPARSERSTATUS
|
|
NvU32 frameDropCount; //!< Counts dropped frames in AVSync
|
|
|
|
} GFMxDemTSParserStatus;
|
|
|
|
/** TS parser notify reasoncodes for GFMXDEMTSPARSERREQUEST::OnNotify callback. */
|
|
typedef enum
|
|
{
|
|
/** Incoming TS starved. */
|
|
GFMXDEMTSPARSERNOTIFY_TSSTARVED = 0,
|
|
|
|
/** Overflow of TS data coming from VIP. */
|
|
GFMXDEMTSPARSERNOTIFY_TSOVERFLOW,
|
|
|
|
/** Underflow in audio buffer at demux output side. */
|
|
GFMXDEMTSPARSERNOTIFY_AUDIOUNDERFLOW,
|
|
|
|
/** Overflow in audio buffer at demux output side. */
|
|
GFMXDEMTSPARSERNOTIFY_AUDIOOVERFLOW,
|
|
|
|
/** Underflow in video buffer at demux output side. */
|
|
GFMXDEMTSPARSERNOTIFY_VIDEOUNDERFLOW,
|
|
|
|
/** Overflow in video buffer at demux output side. */
|
|
GFMXDEMTSPARSERNOTIFY_VIDEOOVERFLOW,
|
|
|
|
/** Parser detected PMT change.
|
|
Associated data:
|
|
<pre>
|
|
NvU32 new PMT PID
|
|
</pre
|
|
*/
|
|
GFMXDEMTSPARSERNOTIFY_TSPMTCHANGED,
|
|
|
|
/** Number of GFMXDEMTSPARSERNOTIFY codes. */
|
|
GFMXDEMTSPARSERNOTIFYCOUNT
|
|
|
|
} GFMXDEMTSPARSERNOTIFY;
|
|
|
|
/** Parameter structure for GFMxDemTSParserCreate(). */
|
|
typedef struct _GFMXDEMTSPARSEREQUEST
|
|
{
|
|
/** Specifies type of parser. */
|
|
GFMXDEMTSPARSERTYPE type;
|
|
|
|
/** Specifies source of TS data stream. */
|
|
GFMXDEMTSPARSERDATASOURCE datasource;
|
|
|
|
/** Size of TS input buffer to claim in GPU memory.
|
|
This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
Must be 188 bytes minimum, and a multiple of 188 bytes. Internally two buffers
|
|
of this size will be claimed in GPU memory to capture the input TS.
|
|
*/
|
|
NvU32 TSBufferSize;
|
|
|
|
/** Size of audio demux buffer to claim in GPU memory.
|
|
This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
Size must be power of 2.
|
|
Size depends on ADTS bitrate, and must be >= 2*max ADTS frame size.
|
|
*/
|
|
NvU32 AudioBufferSize;
|
|
|
|
/** Size of video demux buffer to claim in GPU memory.
|
|
This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
Size must be power of 2 and <=2^24 bytes.
|
|
Optimum size depends on H264 bitrate, and should big enough to hold multiple NAL units.
|
|
*/
|
|
NvU32 VideoBufferSize;
|
|
|
|
/** DSP-side handle (address to GFMXDECH264TABLE) of initialized GFMxDecH264 instance.
|
|
This address is in DSP address space.
|
|
|
|
This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
|
|
@internal
|
|
*/
|
|
NvU32 MxDecH264DSPHandle;
|
|
|
|
/** Video section callback.
|
|
Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
@param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
|
|
@param pllPTS Pointer to PTS, or NULL if not existent
|
|
@param pllDTS Pointer to DTS, or NULL if not existent
|
|
*/
|
|
GF_RETTYPE (*OnVideoData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
|
|
|
|
/** Audio section callback, or NULL to use shared DSP buffer.
|
|
|
|
Can be NULL for parser type GFMXDEMTSPARSERTYPE_DSP.
|
|
Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
|
|
|
@param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
|
|
@param pllPTS Pointer to PTS, or NULL if not existent
|
|
@param pllDTS Pointer to DTS, or NULL if not existent
|
|
*/
|
|
GF_RETTYPE (*OnAudioData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
|
|
|
|
/** PCR (Program Clock Reference) callback.
|
|
@param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
|
|
@param llPCRBase Clock
|
|
@param llPCRExt Clock
|
|
@param uDiscontinuity discontinuity flag
|
|
*/
|
|
void (*OnPCR)(void* user, NvS64 llPCRBase, NvU32 llPCRExt, NvU32 uDiscontinuity);
|
|
|
|
/** Parser object error and status notify callback.
|
|
@param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
|
|
@param notifycode Notify reasoncode, see GFMXDEMTSPARSERNOTIFY
|
|
@param data Data specific to a notifycode
|
|
*/
|
|
void (*OnNotify)(void* user, NvU32 notifycode, void* data);
|
|
|
|
/** Frame Decoded Callback
|
|
Will be called in sync with PTS of the frame. The passed surface will be locked, and the
|
|
application must unlock it later via GFMxDecH264Set() with feature ID GF_MXDEC_H264_SET_UNLOCK_SURFACE.
|
|
@param user Application defined parameter, forwarded from INvTransportParserCallback::user
|
|
@param surfaceID surface id
|
|
@param resolution high 16 bit for xres, low 16 bit for yres
|
|
@param pPTS Pointer to PTS of this frame
|
|
@param flags Flag bitmask, bit 0 set validity of PAN Scan Info
|
|
@param PanTopLeft Top-Left Offset for PAN Scan Rect, low 16 bit signed X, top 16 bit signed Y
|
|
@param PanBottomRight Bottom-Right Offset for PAN Scan Rect , low 16 bit signed X, top 16 bit signed Y
|
|
@param FrameType I/P Frame Type
|
|
*/
|
|
void (*OnFrameDecoded)(void* user, NvU32 sufaceID, NvU32 resolution, NvS64* pPTS, NvU32 flags, NvU32 PanTopLeft, NvU32 PanBottomRight, NvU32 FrameType);
|
|
|
|
/** TS data callback
|
|
@param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
|
|
@param data TS data
|
|
@param size TS data size
|
|
*/
|
|
void (*OnTS)(void* user, NvU8* data, NvU32 size);
|
|
|
|
/** Application private data, will be forwarded to callbacks */
|
|
void* user;
|
|
|
|
/** Returns address of circular buffer descriptor shared with audio decoder.
|
|
This address is in DSP address space.
|
|
This member is valid only, if GFMXDEMTSPARSERREQUEST::OnAudioData is NULL,
|
|
and if the parser is of type GFMXDEMTSPARSERTYPE_DSP.
|
|
*/
|
|
GF_RM_DSP_CIRCBUFFER* pAudioBufDesc;
|
|
|
|
} GFMXDEMTSPARSERREQUEST;
|
|
|
|
/** H264 Frame Type, the value is equal to Nal Type*/
|
|
typedef enum
|
|
{
|
|
MXDEMTS_H264_FRAME_IDR = 5,
|
|
MXDEMTS_H264_FRAME_P = 1,
|
|
MXDEMTS_H264_FRAME_INVALID = 0,
|
|
} MXDEMTS_H264_FRAME_TYPE;
|
|
|
|
// Typesafe functions for opening and closing this component
|
|
GF_RETTYPE GFMxDemTSOpen(GFRmHandle hRm, GFMxDemTSHandle *phMxDemTS,
|
|
GF_STATE_TYPE state, GFRmChHandle hCh);
|
|
void GFMxDemTSClose(GFMxDemTSHandle *phMxDemTS);
|
|
|
|
/** Create a TS parser.
|
|
|
|
This function creates a TS parser running on the host.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param pParserReq Parameter structure
|
|
@param pParserHandle Returns handle on success, unchanged on failure
|
|
|
|
@retval GF_SUCCESS Success
|
|
@retval GF_ERROR_OUT_MEMORY Out of memory
|
|
@retval GFMXDEMTS_ERROR_CREATEDSPPARSER Failed to create parse object on DSP side
|
|
@retval GFMXDEMTS_ERROR_NODSPSUPPORT No DSP support in GFSDK
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserCreate(GFMxDemTSHandle TsHandle, GFMXDEMTSPARSERREQUEST* pParserReq, GFMxDemTSParserHandle* pParserHandle);
|
|
|
|
/** Destroy TS parser.
|
|
|
|
Destroy an TS parser object previously created with GFMxDemTSParserCreate().
|
|
Save to call on NULL handle.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param pParserHandle Pointer to parser handle, will be reset to NULL on exit
|
|
*/
|
|
void GFMxDemTSParserDestroy(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle* pParserHandle);
|
|
|
|
/** Process a section of the TS stream.
|
|
|
|
The input Transport Stream is parsed and the section type handlers passed
|
|
with GFMXDEMTSPARSERREQUEST are called as their sections are encountered in
|
|
the stream.
|
|
|
|
A call of this function is usually triggered by an interrupt to feed the next
|
|
portion of an incoming Transport Stream.
|
|
|
|
On each call of this function at least 188 byte (TS packet size) must be passed.
|
|
The Transport Stream is parsed in entities of 188 byte packets. If the passed buffer
|
|
contains an incomplete packet at the end, it will be copied to an internal buffer
|
|
and automatically combined with the second part on the next function call.
|
|
|
|
Thus it is not required to pass in buffers aligned to TS packet starts, and the
|
|
buffer must not be a multiple of 188 bytes (TS packet size). However
|
|
doing so will guarant maximum demux performance since copying around incomplete packets
|
|
can be avoided.
|
|
|
|
This function may only be called for parses created with #GFMXDEMTSPARSERDATASOURCE_PUSH.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pData Pointer to buffer containing TS, the buffer must contain
|
|
at least 188 bytes of stream data. Buffer start does not
|
|
need to be aligned with the start of an TS package.
|
|
@param pSize Pointer to buffer size, must be 188 or larger, will be updated
|
|
on exit with the number of bytes in the buffer, which where consumed.
|
|
If the parser was created on the DSP, this size must
|
|
not exceed the buffersize passed in GFMXDEMTSPARSERREQUEST::TSBufferSize.
|
|
On success GFMxDemTSParserPushData() will always consume all data,
|
|
on failure *pSize returns the number of bytes that were successfully
|
|
consumed before the failure occured.
|
|
@param timeout Time in ms to wait until DSP parser object gets ready to accept new data,
|
|
or 0 to block forever, (NvU32)-1 to return immediately if busy.
|
|
Ignored for DSP objects created with #GFMXDEMTSPARSERTYPE_HOST.
|
|
|
|
@retval GF_SUCCESS Success
|
|
@retval GF_WAIT_TIME_OUT Timeout before data could be sent to DSP
|
|
@retval GF_ERROR_BUSY DSP was busy and data was not sent, call again,
|
|
returned only if \a timeout was (NvU32)-1
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserPushData(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU8* pData, NvU32* pSize, NvU32 timeout);
|
|
|
|
/** (Re-)Start VIP TS data capture and demux on DSP.
|
|
|
|
This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserDSPStart(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Pause VIP TS data capture and demux on DSP.
|
|
|
|
This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param onOff Indicate Pause on or off
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserDSPPause(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 onOff);
|
|
|
|
/** Step to the next Frame.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserDSPNextFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Step to the next I Frame.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserDSPNextIFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Get TS PmtPid List
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pPmtPidList Returns PMT PID List in current TS, with Service ID and Service Type combined
|
|
|
|
@retval GF_SUCCESS Success
|
|
@retval GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE NIT/PAT has not been parsed yet.
|
|
|
|
@see GFMxDemTSSetPmtPid()
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserGetPmtPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERPMTPIDLIST *pPmtPidList);
|
|
|
|
/** Set TS Service
|
|
|
|
PMT PID is set without any check. if the new PMT PID is successfully set, a
|
|
#GFMXDEMTSPARSERNOTIFY_TSPMTCHANGED notify will be sent to the caller application.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param uPmtPid uPmtPid to be set
|
|
|
|
@retval GF_SUCCESS Success *
|
|
@see GFMxDemTSGetPmtPidList()
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserSetPmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uPmtPid);
|
|
|
|
/** Get Active PmtPid
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pServiceID pointer to Active PmtPid.
|
|
|
|
@retval GF_SUCCESS Success *
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserGetActivePmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pPmtPid);
|
|
|
|
/** Get TS AudioPid List
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pAudioPidList Returns AUDIO PID List in current TS, with PID and Type combined
|
|
|
|
@retval GF_SUCCESS Success
|
|
@retval GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE NIT/PAT has not been parsed yet.
|
|
|
|
@see GFMxDemTSSetAudioPid()
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserGetAudioPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERAUDIOPIDLIST *pAudioPidList);
|
|
|
|
/** Set TS Audio Pid
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param uAudioPid uAudioPid to be set
|
|
|
|
@retval GF_SUCCESS Success
|
|
@retval GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE
|
|
@see GFMxDemTSGetAudioPidList()
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserSetAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uAudioPid);
|
|
|
|
/** Get Active AudioPid
|
|
|
|
Audio PID is set if this AUDIO PID exists in current streams. Otherwise return an error
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pAudioPid pointer to Active AudioPid.
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserGetActiveAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pAudioPid);
|
|
|
|
/** Reset All Table Version
|
|
|
|
Reset all Table Versions, including PAT, NIT, and PMT.
|
|
For reset only PMT table version, see GFMxDemTSParserResetPmtTableVersion
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserResetAllTableVersions(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Reset PMT Table Version
|
|
|
|
To reset all table version, see GFMxDemTSParserResetAllTableVersion
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserResetPmtTableVersion(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Set Play Speed
|
|
|
|
Just used for normal play, for trick play, see xxx.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param PlaySpeed Play speed to set in 1.0 * 10^6.
|
|
A value of 100000 plays at 100% of the current sample rate. 100100 plays at 1.1%,
|
|
100010 plays at 100.01%, the smallest increment 100001 plays at 100.001%.
|
|
Number less than 100000 will slow down the stream in the same way.
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserSetPlaySpeed(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 PlaySpeed);
|
|
|
|
/** Set VIP Capture
|
|
|
|
@deprecated Do not use, will be removed from public API
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param VxHandle the Vx handle for setting VIP
|
|
@retval GF_SUCCESS Success *
|
|
*/
|
|
GF_RETTYPE GFMxDemTSSetVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
|
|
|
|
/** VIP Capture on Host Side
|
|
|
|
@deprecated Do not use, will be removed from public API
|
|
|
|
it captures VIP data from host side, instead of DSP side.
|
|
For VIP Capture from DSP side, see #GFMXDEMTSPARSERREQUEST (GFMXDEMTSPARSERDATASOURCE_VIP2DSP)
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param pBuf Buffer to host VIP data
|
|
@param pBufSize Maximum buf size for input, and Number bytes captured for output
|
|
@retval GF_SUCCESS Success *
|
|
*/
|
|
GF_RETTYPE GFMxDemTSPollVIP(GFMxDemTSHandle TsHandle, NvU8* pBuf, NvU32 *pBufSize);
|
|
|
|
/** Close VIP Capture
|
|
|
|
@deprecated Do not use, will be removed from public API
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param VxHandle the Vx handle for setting VIP
|
|
@retval GF_SUCCESS Success *
|
|
*/
|
|
void GFMxDemTSCloseVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
|
|
|
|
/** Get demux object state and status.
|
|
|
|
Check Parser Status, can be called any time on the parser.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param pStatus Returns parser object state and status.
|
|
<table>
|
|
<tr><td>Bits 0-7 </td><td>Parser status bitmask, see #GFMXDEMTSPARSERSTATUS</td></tr>
|
|
<tr><td>Bits 8-24 </td><td>reserved for extension</td></tr>
|
|
<tr><td>Bits 23-31</td><td>Parser state, see #GFMXDEMTSPARSERSTATE</td></tr>
|
|
</table>
|
|
@retval GF_SUCCESS Success
|
|
@retval GFRM_ERROR_BAD_PARAMETER Invalid parser handle passed
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserGetStatus(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMxDemTSParserStatus* pStatus);
|
|
|
|
/** Clear Demux Buffers.
|
|
|
|
This will clear demux input TS buffers. For parsers of type
|
|
GFMXDEMTSPARSERTYPE_DSPAVSYNC it will also clear ES (video and audio) output buffers.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserClearBuffers(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
|
|
|
|
/** Enable or disable TS data to be returned from DSP to host.
|
|
|
|
If disabled the GFMXDEMTSPARSERREQUEST::OnTS callback won't be called anymore.
|
|
This function has effect for parsers with datasource GFMXDEMTSPARSERDATASOURCE_VIP2DSP only.
|
|
|
|
@param TsHandle Handle to TS component
|
|
@param ParserHandle Parser handle
|
|
@param enable 0 to disable, !=0 to enable
|
|
@retval GF_SUCCESS Success
|
|
*/
|
|
GF_RETTYPE GFMxDemTSParserDSPEnableOnTS(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, int enable);
|
|
|
|
/** GFMxDemTSAPI Error code: Create Parser object on DSP failed.
|
|
@see GFMxDemTSParserCreate()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_CREATEDSPPARSER (GFMXDEMTS_ERROR + 0)
|
|
|
|
/** GFMxDemTSAPI Error code: GFSDK not setup for DSP support.
|
|
@see GFMxDemTSParserCreate()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_NODSPSUPPORT (GFMXDEMTS_ERROR + 1)
|
|
|
|
/** GFMxDemTSAPI Error code: GFMxDemTSGetPmtPidList() called when NIT/PAT not parsed yet.
|
|
@see GFMxDemTSGetPmtPidList()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE (GFMXDEMTS_ERROR + 2)
|
|
|
|
/** GFMxDemTSAPI Error code: GFMxDemTSSetPmtPid() when a wrong PMT PID is passed.
|
|
@see GFMxDemTSSetPmtPid()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_SERVICEUNAVAILABLE (GFMXDEMTS_ERROR + 3)
|
|
|
|
/** GFMxDemTSAPI Error code: GFMxDemTSGetAudioPidList() called when PMT does not parsed yet, or
|
|
there is no Audio in current service.
|
|
@see GFMxDemTSGetAudioPidList()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE (GFMXDEMTS_ERROR + 4)
|
|
|
|
/** GFMxDemTSAPI Error code: GFMxDemTSSetAudioPid() when a wrong Audio PID is passed.
|
|
@see GFMxDemTSSetAudioPid()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE (GFMXDEMTS_ERROR + 5)
|
|
|
|
/** GFMxDemTSAPI Error code: Signal frame decoded.
|
|
@internal
|
|
*/
|
|
#define GFMXDEMTS_ERROR_AVSYNCFRAMEDECODED (GFMXDEMTS_ERROR + 6)
|
|
|
|
/** GFMxDemTSAPI Error code: Cannot claim VIP.
|
|
@see GFMxDemTSParserCreate()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_VIPUNAVAILABLE (GFMXDEMTS_ERROR + 7)
|
|
|
|
/** GFMxDemTSAPI Error code: GFMxDemTSParserGetActivePmtPid() called when there is pending PMT PID to be set.
|
|
@see GFMxDemTSParserGetActivePmtPid()
|
|
*/
|
|
#define GFMXDEMTS_ERROR_GETSERVICEPMTPID (GFMXDEMTS_ERROR + 8)
|
|
|
|
/** GFMxDemTSAPI Semaphore IDs.
|
|
These IDs can be used in the RmCreateSemaphore implementation of the
|
|
OS porting layer to identify GFMxDemTSAPI semaphores.
|
|
*/
|
|
typedef enum
|
|
{
|
|
GFMXDEMTS_SEMAPHORE_TSBUF = GF_MXDEMTSAPI<<24
|
|
|
|
} GFMXDEMTS_SEMAPHORE;
|
|
|
|
/*@}*/
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _GF_MPEG_TS__ */
|