⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iekc64_video.h

📁 一个小的测试程序
💻 H
📖 第 1 页 / 共 3 页
字号:
	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. It must be greater than nFramesToKeep + 3;
	*/
	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;
	/*! This field defines to the Video input EDMA priority 
  */
  Uint32 dwDmaPri;
  /*! This field defines to the Video input CIPR 
  */
  Uint32 dwInputTcc;
  /*! This field defines to the extern interrupt used for input video. It can be 
  set to IRQ_EVT_EXTINT4, IRQ_EVT_EXTINT5 or IRQ_EVT_EXTINT6 only.
  */
  Uint32 dwExtIntrVideoIn;
}
IEKC64_VIDEOIN;


/*--------------------------------------------------------------------------*/
/*! Initialization parameters for VOUT_open().
    All fields have to be set before the call.
*/
typedef struct
{
	/*! This field must contains the IEKC64_VIDEOOUT structure size 
	*/
	Uint32 dwSize;
	/*! 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;
	/*! This field defines to the Video output EDMA priority 
  */
  Uint32 dwDmaPri;
  /*! This field defines to the Video monitor output CIPR 
  */
  Uint32 dwMotinorTcc;
  /*! This field defines to the Video VGA output CIPR. The monitor CIPR and 
  the vga CIPR could be the same if monitor output and vga output are not used
  together
  */
  Uint32 dwVgaTcc;
  /*! This field defines to the extern interrupt used for monitor output video. 
  It can be set to IRQ_EVT_EXTINT4, IRQ_EVT_EXTINT5 or IRQ_EVT_EXTINT6 only. 
  */
  Uint32 dwExtIntrMonitorVideoOut;
  /*! This field defines to the extern interrupt used for vga output video. 
  It can be set to IRQ_EVT_EXTINT4, IRQ_EVT_EXTINT5 or IRQ_EVT_EXTINT6 only. 
  The monitor extern interrupt and the vga extern interrupt could be the same 
  if monitor output and vga output are not used together
  */
  Uint32 dwExtIntrVgaVideoOut;
}
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 an 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 failed
	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 ),
	//! The external interrupt is not allowed
	IEKC64_ERR_VIDEO_BAD_EXTINTR				= IEKC64_ERR_CODE( IEKC64_VIDEO,  21 ),	
  	//! Invalid video configuration structure size	
	IEKC64_ERR_STRUCT_SIZE						= IEKC64_ERR_CODE( IEKC64_VIDEO,  22 ),
	//! Video In start function failled. You may call the VIN_start function from the main function.
	IEKC64_ERR_VIDEOIN_START_ERROR				= IEKC64_ERR_CODE( IEKC64_VIDEO,  23 ),
	//! the nTemporalDecimationFactor must be greater than 0 and lower thna 64.
	IEKC64_ERR_VIDEOIN_DECIMATION_ERROR				= IEKC64_ERR_CODE( IEKC64_VIDEO,  24 )

};


/*--------------------------------------------------------------------------*/
/*! Special timeout values for VIN_getFrame(), VOUT_putFrame() and
	 VOUT_waitDisplayed()
*/
enum IEKC64_VIDEO_WAIT
{
	//! Tells the API no to wait until the function is completed
	IEKC64_VIDEO_NO_WAIT = 0,
	//! Tells the API to wait until the function completes
	IEKC64_VIDEO_WAIT_INFINITE = -1 
};

/*--------------------------------------------------------------------------*/
/*! This varaible contains the VIDEO IN default configuration
*/
extern const IEKC64_VIDEOIN IEKC64_VIDEOIN_DEFAULT;

/*--------------------------------------------------------------------------*/
/*! This varaible contains the VIDEO OUT default configuration
*/
extern const IEKC64_VIDEOOUT IEKC64_VIDEOOUT_DEFAULT;

/*--------------------------------------------------------------------------*/
/*! Opens and initializes the video capture module 

	\param pVideoInConfig
				This must point to a IEKC64_VIDEOIN parameters
				structure that the user must fill before the call.
				You need at least 3 video input buffer.

	\param pVideoInHandle
				This must point to a Handle that will be filled
				by the call. This handle must be used in every next calls to
				the VIN module.

	\return IEKC64_STATUS. If the call succeeds, 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 = IEKC64_VIDEOIN_DEFAULT;
	Handle			vinHandle;
	Uint32			*pCaptureBuffer = malloc( enough size );

	// ... initialize all fields
	vinParams.Standard = PAL;
	....
	vinParams.nFramesInBuffer = 5;
	vinParams.nFramesToKeep = 2;
	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	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	IEKC64_STATUS. If the call succeeds, 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	IEKC64_STATUS. If the call succeeds, 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>.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -