📄 tskvideoinput1.c
字号:
/*
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2006-2008 Beijing, pengzhen (pengzhenxp@yahoo.com.cn) //
// //
///////////////////////////////////////////////////////////////////////////////
*/
#include "tskVideoInput0.c"
void tskVideoInput()
{
//LCK_Handle m_hViInMutex = LCK_create( NULL ) ; /* Mutex */
FVID_Frame *capFrameBuf;
FVID_alloc(m_hVi, &capFrameBuf);
while(1)
{
/* acquire Semaphore */
//SemPend( m_hViInSem , SYS_FOREVER ) ;
/* acquire Mutex */
//LCK_pend( m_hViInMutex, SYS_FOREVER ) ;
/* Yuv420 */
if( image_height > (image_max_height>>1) ) /* D1 */
{
m_dvp_de_interlace( m_Yuv420_In->m_pBuf_y, image_width,
capFrameBuf->frame.iFrm.y1, image_width, image_width, image_height ) ;
m_dvp_de_interlace( m_Yuv420_In->m_pBuf_u, image_width>>1,
capFrameBuf->frame.iFrm.cb1, image_width, image_width>>1, image_height>>1 ) ;
m_dvp_de_interlace( m_Yuv420_In->m_pBuf_v, image_width>>1,
capFrameBuf->frame.iFrm.cr1, image_width, image_width>>1, image_height>>1 ) ;
}
else
{
#if 0
dma_copy_420_c( m_Yuv420_In, capFrameBuf, image_width, image_height ) ;
#else
scale_422_to_420_c( m_Yuv420_In, capFrameBuf, image_width, image_height ) ;
#endif /* 0 */
}
/* get next buffer */
m_Yuv420_In = m_Yuv420_In->m_pNext ; m_Yuv420_Cnt -- ;
if(m_Yuv420_Cnt) SemPost( m_hViOutSem ) ; /* video encode */
else SemPend( m_hViInSem , SYS_FOREVER ) ; /* Vi */ /* no buffer ; wait for video encoder */
//CACHE_clean(CACHE_L2ALL, 0, 0);
/* Get a new frame from the capture driver */
FVID_exchange(m_hVi, &capFrameBuf);
/*release Mutex*/
//LCK_post( m_hViInMutex ) ;
} /* while(1) */
//LCK_delete( m_hViInMutex ) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -