|
格式查询:
GetPDDPinInfo()函数,通过
m_pStrmInstances.pVideoFormat = SensorModeInfo.pVideoFormat;
指向了SensorModeInfo.pVideoFormat;
而SensorModeInfo 的信息是从GetSensorModeInfo来的,
GetSensorModeInfo()函数里把它指向了m_pModeVideoFormat
pSensorModeInfo->pVideoFormat = &m_pModeVideoFormat[ulModeType];
所以
数据流程:
m_pStrmInstances.pVideoFormat ? SensorModeInfo.pVideoFormat ? m_pModeVideoFormat
在PDDInit()函数里,对m_pModeVideoFormat结构进行了初始化,这些信息是用来给上层应用查询用的,
例如:有关preview的初始信息:
m_pModeVideoFormat[PREVIEW].pCsDataRangeVideo[0] = &DCAM_StreamMode_0;
m_pModeVideoFormat[PREVIEW].pCsDataRangeVideo[1] = &DCAM_StreamMode_1;
m_pModeVideoFormat[PREVIEW].pCsDataRangeVideo[2] = &DCAM_StreamMode_2;
m_pModeVideoFormat[PREVIEW].pCsDataRangeVideo[3] = &DCAM_StreamMode_3;
而在CE系统里,对DCAM_StreamMode_0 ~ DCAM_StreamMode_9的定义如下
Public\common\oak\drivers\capture\camera\layered\pdd_null\Sensorformats.h文件
MAKE_STREAM_MODE_RGB565(DCAM_StreamMode_0, 160, 120, 16, 30);
MAKE_STREAM_MODE_RGB565(DCAM_StreamMode_1, 176, 144, 16, 30);
MAKE_STREAM_MODE_RGB565(DCAM_StreamMode_2, 320, 240, 16, 15);
MAKE_STREAM_MODE_RGB565(DCAM_StreamMode_3, 320, 240, 16, 30);
MAKE_STREAM_MODE_RGB565(DCAM_StreamMode_4, 640, 480, 16, 15);
MAKE_STREAM_MODE_YV12(DCAM_StreamMode_5, 176, -144, 12, 15);
MAKE_STREAM_MODE_YV12(DCAM_StreamMode_6, 320, -240, 12, 30);
MAKE_STREAM_MODE_YUY2(DCAM_StreamMode_7, 176, -144, 16, 15);
MAKE_STREAM_MODE_YUY2(DCAM_StreamMode_8, 352, -288, 16, 15);
MAKE_STREAM_MODE_YV12(DCAM_StreamMode_9, 352, -288, 12, 15);
所以,在上层应用调用directShow的查询接口获得摄像头支持的输出格式
m_pCaptureStreamConfig->GetStreamCaps(i, &m_pamtCaptureStream, (BYTE*)&scc);
在AdapterHandlePinRequests()函数判断进入
case CSPROPERTY_PIN_DATARANGES:
memcpy( pCsDataRangeVideo, m_pStrmInstances[lPinId].pVideoFormat->pCsDataRangeVideo[iCount], sizeof (CS_DATARANGE_VIDEO) );
把驱动的支持信息传给应用。
|
|