iekc64_video.h
来自「TI公司的算法标准 Framework5的源代码」· C头文件 代码 · 共 801 行 · 第 1/3 页
H
801 行
*/
typedef struct
{
/*! This field holds the video standard present at input
*/
IEKC64_VIDEO_STANDARD Standard;
/*! This field holds the resolution at which the frames have to
be captured
*/
IEKC64_VIDEO_RESOLUTION Resolution;
/*! This field holds the frame format in which frames have to be
stored
*/
IEKC64_VIDEO_FRAME_FORMAT FrameFormat;
/*! This field selects the board input on which video will be captured
*/
IEKC64_VIDEO_INOUT_SELECT VideoInSelect;
/*! This field indicates if all frames from the video input have
to be captured or if a temporal decimation have to be applied. If this
parameter is set to N, then only 1 picture over N will be captured.
Value range is from 1 to 63.
*/
Uint8 nTemporalDecimationFactor;
/*! This field activates the one-shot mode in which frames are
captured at request
*/
Bool isOneShot;
/*! This field tells to the VIN module the length of the capture
buffer in number of frames
*/
Uint32 nFramesInBuffer;
/*! This field tells the VIN module how many frames have to be kept
in the capture buffer before overrun
*/
Uint32 nFramesToKeep;
/*! This field tells to the VIN module where begins the buffer to
store captured frames
*/
Uint32* pCaptureBuffer;
}
IEKC64_VIDEOIN;
/*--------------------------------------------------------------------------*/
/*! Initialization parameters for VOUT_open().
All fields have to be set before the call.
*/
typedef struct
{
/*! This field holds the video standard present at input
*/
IEKC64_VIDEO_STANDARD Standard;
/*! This field holds the resolution at which the frames have to
be captured
*/
IEKC64_VIDEO_RESOLUTION Resolution;
/*! This field holds the frame format in which frames have to be
stored
*/
IEKC64_VIDEO_FRAME_FORMAT FrameFormat;
/*! This field selects the board output on which video will be generated
*/
IEKC64_VIDEO_INOUT_SELECT VideoOutSelect;
}
IEKC64_VIDEOOUT;
/*--------------------------------------------------------------------------*/
/*! Module error codes.<br>
If status returned from a module call is negative (or
IEKC64_SUCCESS(return code) is false), the value represents en error
from the list below
*/
enum IEKC64_VIDEO_STATUS
{
//! Generic error code
IEKC64_ERR_VIDEO = IEKC64_ERR_CODE( IEKC64_VIDEO, 1 ),
//! The BT835 video initialization failed
IEKC64_ERR_VIDEO_BT835 = IEKC64_ERR_CODE( IEKC64_VIDEO, 2 ),
//! A blocking call has returned because of timeout
IEKC64_ERR_VIDEO_TIMEOUT = IEKC64_ERR_CODE( IEKC64_VIDEO, 3 ),
//! Can't allocate base table for EDMA transfert
IEKC64_ERR_VIDEO_PARAMTABLE = IEKC64_ERR_CODE( IEKC64_VIDEO, 4 ),
//! Can't allocate reload table for EDMA transfert
IEKC64_ERR_VIDEO_LINKPARAMTABLE = IEKC64_ERR_CODE( IEKC64_VIDEO, 5 ),
//! No frame is available in the capture buffer
IEKC64_ERR_VIDEOIN_NO_FRAME_AVAILABLE = IEKC64_ERR_CODE( IEKC64_VIDEO, 6 ),
//! Video In hardware initialization failed
IEKC64_ERR_VIDEOIN_HWINIT = IEKC64_ERR_CODE( IEKC64_VIDEO, 7 ),
//! Video Out hardware initialization failed
IEKC64_ERR_VIDEOOUT_HWINIT = IEKC64_ERR_CODE( IEKC64_VIDEO, 8 ),
//! Video in buffer is too small
IEKC64_ERR_VIDEOIN_BUFFER_TOO_SMALL = IEKC64_ERR_CODE( IEKC64_VIDEO, 9 ),
//! TCC of EDMA channel used for video is already used
IEKC64_ERR_VIDEO_BADTCC = IEKC64_ERR_CODE( IEKC64_VIDEO, 10 ),
//! Video input is not running
IEKC64_ERR_VIDEOIN_NOT_YET_RUNNING = IEKC64_ERR_CODE( IEKC64_VIDEO, 11 ),
//! Video parameters are not supported
IEKC64_ERR_VIDEO_BAD_FORMAT = IEKC64_ERR_CODE( IEKC64_VIDEO, 12 ),
//! Video Output BT864 initialization error
IEKC64_ERR_VIDEOOUT_BT864_INIT = IEKC64_ERR_CODE( IEKC64_VIDEO, 13 ),
//! Video Output BT864 configuration error
IEKC64_ERR_VIDEOOUT_BT864_CONFIG = IEKC64_ERR_CODE( IEKC64_VIDEO, 14 ),
//! Video Output FPGA out configuration error
IEKC64_ERR_VIDEOOUT_FPGA_CONFIG = IEKC64_ERR_CODE( IEKC64_VIDEO, 15 ),
//! Video Output semaphore init error
IEKC64_ERR_VIDEOOUT_SEM = IEKC64_ERR_CODE( IEKC64_VIDEO, 16 ),
//! Video Handle allocation failed
IEKC64_ERR_CANNOTALLOCATE_HANDLE = IEKC64_ERR_CODE( IEKC64_VIDEO, 17 ),
//! Video input semaphore init fail
IEKC64_ERR_VIN_SEM_CREATE_FAIL = IEKC64_ERR_CODE( IEKC64_VIDEO, 18 ),
//! No frame available
IEKC64_GET_FRAME_TIMEOUT = IEKC64_ERR_CODE( IEKC64_VIDEO, 19 ),
//! No frame available
IEKC64_GET_FRAME_NOT_AVAILABLE = IEKC64_ERR_CODE( IEKC64_VIDEO, 20 )
};
/*--------------------------------------------------------------------------*/
/*! Special timeout values for VIN_getFrame(), VOUT_putFrame() and
VOUT_waitDisplayed()
*/
enum IEKC64_VIDEO_WAIT
{
//! Tell the API no to wait until the function is complete
IEKC64_VIDEO_NO_WAIT = 0,
//! Tell the API to wait until the function complete
IEKC64_VIDEO_WAIT_INFINITE
};
/*--------------------------------------------------------------------------*/
/*! Opens and initializes the video capture module
\param pVideoInConfig
This should point to a IEKC64_VIDEOIN parameters
structure that the user should fill before the call.
You need at least 3 video input buffer.
\param pVideoInHandle
This should point to a Handle that will be filled
by the call. This handle should be used in every next calls to
the VIN module.
\return A IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
IEKC64_STATUS status;
IEKC64_VIDEOIN vinParams;
Handle vinHandle;
Uint32 *pCaptureBuffer = malloc( enough size );
// ... initialize all fields
vinParams.Standard = PAL;
....
vinParams.pCaptureBuffer = pCaptureBuffer;
status = VIN_open( &vinParams, &vinHandle );
if ( !IEKC64_SUCCESS(status) )
{
printf( "VIN_open() returned error %08X\n", status );
exit( 1 );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_video">example/loopback_video</a>
/<a href="../../example/loopback_video/loopback_video.c">loopback_video.c</a>.
*/
IEKC64_STATUS VIN_open( IEKC64_VIDEOIN* pVideoInConfig, Handle *pVideoInHandle );
/*--------------------------------------------------------------------------*/
/*! Starts the capture process
\param videoInHandle
A handle to a VIN object returned by VIN_open().
\return A IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
status = VIN_start( vinHandle );
if ( !IEKC64_SUCCESS(status) )
{
printf( "VIN_start() returned error %08X\n", status );
exit( 1 );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_video">example/loopback_video</a>
/<a href="../../example/loopback_video/loopback_video.c">loopback_video.c</a>.
*/
IEKC64_STATUS VIN_start( Handle videoInHandle );
/*--------------------------------------------------------------------------*/
/*! Pause the capture process
\param videoInHandle
A handle to a VIN object returned by VIN_open().
\return A IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
status = VIN_stop( vinHandle );
if ( !IEKC64_SUCCESS(status) )
{
printf( "VIN_stop() returned error %08X\n", status );
exit( 1 );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_video">example/loopback_video</a>
/<a href="../../example/loopback_video/loopback_video.c">loopback_video.c</a>.
*/
IEKC64_STATUS VIN_stop( Handle videoInHandle );
/*--------------------------------------------------------------------------*/
/*! Close the module and free any allocated resource
\param videoInHandle
A handle to a VIN object returned by VIN_open().
\return A IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
status = VIN_close( vinHandle );
if ( !IEKC64_SUCCESS(status) )
{
printf( "VIN_close() returned error %08X\n", status );
exit( 1 );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_video">example/loopback_video</a>
/<a href="../../example/loopback_video/loopback_video.c">loopback_video.c</a>.
*/
IEKC64_STATUS VIN_close( Handle videoInHandle );
/*--------------------------------------------------------------------------*/
/*! Get the next frame from the capture buffer
\param videoInHandle
A handle to a VIN object returned by VIN_open().
\param pPtrFrame
A pointer passed by reference to receive the pointer
to the next frame
\param nWaitTimeout
A timeout to specify how long the call should wait
for a new captured frame. Value should be specified in
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?