44 moDsFramework::moDsFramework() {
50 moDsFramework::~moDsFramework() {
52 if (m_pDevEnum!=NULL) {
53 m_pDevEnum->Release();
65 moDsFramework::ShowError( HRESULT hr ) {
68 TCHAR szErr[MAX_ERROR_TEXT_LEN];
69 DWORD res = AMGetErrorText(hr, szErr, MAX_ERROR_TEXT_LEN);
72 wsprintf(szErr,
"Unknown Error: 0x%2x", hr);
74 MessageBox(0, szErr, TEXT(
"Error!"), MB_OK | MB_ICONERROR);
80 moCaptureDevices* moDsFramework::LoadCaptureDevices() {
86 if(m_pDevEnum==NULL) {
87 HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
88 CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
89 reinterpret_cast<void**>(&m_pDevEnum));
91 if(SUCCEEDED(hr) && m_pEnum==NULL)
94 hr = m_pDevEnum->CreateClassEnumerator(
95 CLSID_VideoInputDeviceCategory,
99 return &m_CaptureDevices;
107 printf(
"Capture devices: \n");
108 IMoniker *pMoniker = NULL;
109 while(m_pEnum->Next(1, &pMoniker, NULL) == S_OK)
111 IPropertyBag *pPropBag;
112 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
113 (
void**)(&pPropBag));
123 VARIANT varFriendlyName;
124 VARIANT varDescription;
125 VARIANT varDevicePath;
127 VariantInit(&varFriendlyName);
128 VariantInit(&varDescription);
129 VariantInit(&varDevicePath);
131 hr = pPropBag->Read(L
"FriendlyName", &varFriendlyName, 0);
132 if(SUCCEEDED(hr)) FriendlyName =(
short*)varFriendlyName.bstrVal;
134 hr = pPropBag->Read(L
"Description", &varDescription, 0);
135 if(SUCCEEDED(hr)) Description =(
short*)varDescription.bstrVal;
137 hr = pPropBag->Read(L
"DevicePath", &varDevicePath, 0);
138 if(SUCCEEDED(hr)) DevicePath =(
short*)varDevicePath.bstrVal;
143 m_CaptureDevices.Add( CapDev );
149 printf(
"WARNING: No capture devices available...\n");
150 return &m_CaptureDevices;
153 return &m_CaptureDevices;
159 moCaptureDevices* moDsFramework::UpdateCaptureDevices() {
165 for( K=0; K < m_CaptureDevices.Count(); K++) {
166 CapDev = m_CaptureDevices.GetRef(K);
168 m_CaptureDevices.Set( K , CapDev );
177 hr = m_pDevEnum->CreateClassEnumerator(
178 CLSID_VideoInputDeviceCategory,
186 IMoniker *pMoniker = NULL;
187 while(m_pEnum->Next(1, &pMoniker, NULL) == S_OK)
189 IPropertyBag *pPropBag;
190 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
191 (
void**)(&pPropBag));
201 VARIANT varFriendlyName;
202 VARIANT varDescription;
203 VARIANT varDevicePath;
205 VariantInit(&varFriendlyName);
206 VariantInit(&varDescription);
207 VariantInit(&varDevicePath);
209 hr = pPropBag->Read(L
"FriendlyName", &varFriendlyName, 0);
210 if(SUCCEEDED(hr)) FriendlyName =(
short*)varFriendlyName.bstrVal;
212 hr = pPropBag->Read(L
"Description", &varDescription, 0);
213 if(SUCCEEDED(hr)) Description =(
short*)varDescription.bstrVal;
215 hr = pPropBag->Read(L
"DevicePath", &varDevicePath, 0);
216 if(SUCCEEDED(hr)) DevicePath =(
short*)varDevicePath.bstrVal;
218 bool CapDevFounded =
false;
219 for( K=0; K < m_CaptureDevices.Count(); K++) {
220 if ( m_CaptureDevices.Get(K).GetPath() == DevicePath ) {
222 CapDev = m_CaptureDevices.GetRef(K);
224 m_CaptureDevices.Set( K , CapDev );
225 CapDevFounded =
true;
229 if (!CapDevFounded) {
231 m_CaptureDevices.Add(
moCaptureDevice( FriendlyName, Description, DevicePath ) );
239 return &m_CaptureDevices;
242 return &m_CaptureDevices;
248 moDsFramework::CheckCaptureDevice(
int i ) {
259 hr = m_pDevEnum->CreateClassEnumerator(
260 CLSID_VideoInputDeviceCategory,
268 IMoniker *pMoniker = NULL;
269 while(m_pEnum->Next(1, &pMoniker, NULL) == S_OK)
271 IPropertyBag *pPropBag;
272 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
273 (
void**)(&pPropBag));
283 VARIANT varFriendlyName;
284 VARIANT varDescription;
285 VARIANT varDevicePath;
287 VariantInit(&varFriendlyName);
288 VariantInit(&varDescription);
289 VariantInit(&varDevicePath);
291 hr = pPropBag->Read(L
"FriendlyName", &varFriendlyName, 0);
292 if(SUCCEEDED(hr)) FriendlyName =(
short*)varFriendlyName.bstrVal;
294 hr = pPropBag->Read(L
"Description", &varDescription, 0);
295 if(SUCCEEDED(hr)) Description =(
short*)varDescription.bstrVal;
297 hr = pPropBag->Read(L
"DevicePath", &varDevicePath, 0);
298 if(SUCCEEDED(hr)) DevicePath =(
short*)varDevicePath.bstrVal;
302 if ( DevicePath == m_CaptureDevices.Get(i).GetPath() )
319 moDsGraph::moDsGraph() {
321 m_pFilterGraph = NULL;
322 m_pMediaControl = NULL;
323 m_pMediaSeeking = NULL;
326 m_pQuicktimeFilter = NULL;
327 m_pColorSpaceConverter = NULL;
328 m_pCaptureFilter = NULL;
329 m_pSourceFilter = NULL;
330 m_pFileSourceFilter = NULL;
331 m_pAviSplitter = NULL;
335 m_pQuicktimeDecoder = NULL;
338 m_pFfdshowFilter = NULL;
341 m_pDVDecoderFilter = NULL;
343 m_pAVIDecompressorFilter = NULL;
346 m_pSampleGrabberBase = NULL;
347 m_pSampleGrabber = NULL;
348 m_pNullRenderer = NULL;
354 moDsGraph::~moDsGraph() {
361 moDsGraph::InitGraph() {
365 if(!m_pFilterGraph) {
367 hr = CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER,
368 IID_IGraphBuilder,(
void**)&m_pFilterGraph);
371 hr = m_pFilterGraph->QueryInterface(IID_IMediaControl,(
void**)&m_pMediaControl);
373 hr = m_pFilterGraph->QueryInterface(IID_IMediaSeeking,(
void**)&m_pMediaSeeking);
376 }
else ShowError(hr);
377 }
else ShowError(hr);
380 return(m_pFilterGraph!=NULL);
385 moDsGraph::FinishGraph() {
393 if(m_pSampleGrabberBase) {
394 if(m_pSampleGrabber) {
397 hr = m_pSampleGrabber->SetCallback( NULL , 1 );
399 return ShowError(hr);
401 rc = m_pSampleGrabberBase->Release();
402 m_pSampleGrabberBase = NULL;
403 m_pSampleGrabber = NULL;
406 if(m_pCaptureFilter) {
408 rc = m_pCaptureFilter->Release();
409 m_pCaptureFilter = NULL;
412 if (m_pFileSourceFilter) {
413 rc = m_pFileSourceFilter->Release();
414 m_pFileSourceFilter = NULL;
417 if(m_pSourceFilter) {
418 rc = m_pSourceFilter->Release();
419 m_pSourceFilter = NULL;
422 if(m_pQuicktimeDecoder) {
423 rc = m_pQuicktimeDecoder->Release();
424 m_pQuicktimeDecoder = NULL;
427 if(m_pFfdshowFilter) {
428 rc = m_pFfdshowFilter->Release();
429 m_pFfdshowFilter = NULL;
432 if(m_pDVDecoderFilter) {
433 rc = m_pDVDecoderFilter->Release();
434 m_pDVDecoderFilter = NULL;
437 if(m_pAVIDecompressorFilter) {
438 rc = m_pAVIDecompressorFilter->Release();
439 m_pAVIDecompressorFilter = NULL;
442 if(m_pNullRenderer) {
443 rc = m_pNullRenderer->Release();
444 m_pNullRenderer = NULL;
448 rc = m_pAviSplitter->Release();
449 m_pAviSplitter = NULL;
453 rc = m_pSplitter->Release();
457 if(m_pMediaControl) {
458 rc = m_pMediaControl->Release();
459 m_pMediaControl = NULL;
462 if(m_pMediaSeeking) {
463 rc = m_pMediaSeeking->Release();
464 m_pMediaSeeking = NULL;
468 rc = m_pFilterGraph->Release();
469 m_pFilterGraph = NULL;
472 return !(m_pFilterGraph && m_pCaptureFilter && m_pSampleGrabberBase);
477 moDsGraph::CreateCaptureDeviceByPath(
moText p_Path, IBaseFilter **ppF ) {
479 if (! ppF)
return false;
483 ICreateDevEnum *pDevEnum = NULL;
484 IEnumMoniker *pEnum = NULL;
487 HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
488 CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
489 reinterpret_cast<void**>(&pDevEnum));
494 hr = pDevEnum->CreateClassEnumerator(
495 CLSID_VideoInputDeviceCategory,
497 }
else return ShowError(hr);
501 printf(
"DirectShow filters: \n");
502 IMoniker *pMoniker = NULL;
503 while(pEnum->Next(1, &pMoniker, NULL) == S_OK)
505 IPropertyBag *pPropBag;
506 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
507 (
void**)(&pPropBag));
514 VariantInit(&varName);
515 hr = pPropBag->Read(L
"DevicePath", &varName, 0);
518 fname =(
short*)varName.bstrVal;
520 if( fname==p_Path ) {
521 hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter,(
void**)ppF);
527 return ShowError(hr);
543 printf(
"WARNING: No filter found with that path...\n");
553 moDsGraph::CreateFilterByName(
moText p_Name, IBaseFilter **ppF )
555 if (! ppF)
return false;
559 ICreateDevEnum *pDevEnum = NULL;
560 IEnumMoniker *pEnum = NULL;
563 HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
564 CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
565 reinterpret_cast<void**>(&pDevEnum));
570 hr = pDevEnum->CreateClassEnumerator(
571 CLSID_LegacyAmFilterCategory,
573 }
else return ShowError(hr);
577 printf(
"DirectShow filters: \n");
578 IMoniker *pMoniker = NULL;
579 while(pEnum->Next(1, &pMoniker, NULL) == S_OK)
581 IPropertyBag *pPropBag;
582 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
583 (
void**)(&pPropBag));
590 VariantInit(&varName);
591 hr = pPropBag->Read(L
"Description", &varName, 0);
593 hr = pPropBag->Read(L
"FriendlyName", &varName, 0);
594 printf(
"FriendlyName: " );
598 printf(
"Description: " );
604 fname =(
short*)varName.bstrVal;
606 if( fname==p_Name ) {
607 hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter,(
void**)ppF);
613 return ShowError(hr);
629 printf(
"WARNING: No filter found with that name...\n");
639 moDsGraph::SetCaptureDevice(
moText deviceport,
MOint idevice) {
641 ICreateDevEnum *pDevEnum = NULL;
642 IEnumMoniker *pEnum = NULL;
648 HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
649 CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
650 reinterpret_cast<void**>(&pDevEnum));
655 hr = pDevEnum->CreateClassEnumerator(
656 CLSID_VideoInputDeviceCategory,
658 }
else return ShowError(hr);
662 printf(
"Capture devices: \n");
663 IMoniker *pMoniker = NULL;
664 while(pEnum->Next(1, &pMoniker, NULL) == S_OK)
666 IPropertyBag *pPropBag;
667 hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
668 (
void**)(&pPropBag));
675 VariantInit(&varName);
676 hr = pPropBag->Read(L
"Description", &varName, 0);
678 hr = pPropBag->Read(L
"FriendlyName", &varName, 0);
679 printf(
"FriendlyName: " );
683 printf(
"Description: " );
689 fname =(
short*)varName.bstrVal;
691 hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter,(
void**)&m_pCaptureFilter);
697 return ShowError(hr);
742 printf(
"WARNING: No capture devices available...\n");
752 moDsGraph::ShowConfigureDialog(IBaseFilter *pFilter) {
755 ISpecifyPropertyPages *pProp;
756 HRESULT hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (
void **)&pProp);
760 FILTER_INFO FilterInfo;
761 hr = pFilter->QueryFilterInfo(&FilterInfo);
762 IUnknown *pFilterUnk;
763 pFilter->QueryInterface(IID_IUnknown, (
void **)&pFilterUnk);
767 pProp->GetPages(&caGUID);
769 OleCreatePropertyFrame(
782 pFilterUnk->Release();
783 FilterInfo.pGraph->Release();
784 CoTaskMemFree(caGUID.pElems);
799 IPin* pPinDecoderOut;
805 IEnumMediaTypes* ppEnum;
806 AM_MEDIA_TYPE* pMediaTypes;
811 if ( p_capdev.
GetPath() !=
"" ) {
813 if(CreateCaptureDeviceByPath( p_capdev.
GetPath(), &m_pCaptureFilter )) {
814 hr = m_pFilterGraph->AddFilter(m_pCaptureFilter, L
"Capture Device");
820 pPinSource = GetOutPin( m_pCaptureFilter ,0 );
822 }
else return ShowError(hr);
830 AM_MEDIA_TYPE MTPreferredResolution;
831 AM_MEDIA_TYPE MTDefaultResolution;
833 MTDefaultResolution.majortype = GUID_NULL;
834 MTPreferredResolution.majortype = GUID_NULL;
837 hr = pPinSource->EnumMediaTypes( &ppEnum);
841 while( ppEnum->Next( 1, &pMediaTypes, NULL) == S_OK ) {
843 if ( pMediaTypes->majortype == MEDIATYPE_Video ) {
845 if ( pMediaTypes->subtype == MEDIASUBTYPE_dvsl ||
846 pMediaTypes->subtype == MEDIASUBTYPE_dvsd ||
847 pMediaTypes->subtype == MEDIASUBTYPE_dvhd ) {
851 SetVideoFormat( pMediaTypes );
853 if (MTDefaultResolution.majortype == GUID_NULL)
854 MTDefaultResolution = (*pMediaTypes);
861 MTPreferredResolution = (*pMediaTypes);
866 LastFormat = m_VideoFormat;
869 if ( pMediaTypes->formattype == FORMAT_VideoInfo ) {
871 SetVideoFormat( pMediaTypes );
873 if (MTDefaultResolution.majortype == GUID_NULL)
874 MTDefaultResolution = (*pMediaTypes);
881 MTPreferredResolution = (*pMediaTypes);
886 LastFormat = m_VideoFormat;
898 if(!m_pDVDecoderFilter) {
899 hr = CoCreateInstance(CLSID_DVVideoCodec, NULL, CLSCTX_INPROC_SERVER,
900 IID_IBaseFilter,(
void**)&m_pDVDecoderFilter);
902 hr = m_pFilterGraph->AddFilter(m_pDVDecoderFilter, L
"DV Decoder");
906 pPinDecoderIn = GetInPin( m_pDVDecoderFilter ,0 );
907 pPinDecoderOut = GetOutPin( m_pDVDecoderFilter ,0 );
909 hr = m_pFilterGraph->Connect( pPinSource , pPinDecoderIn );
912 return ShowError(hr);
913 }
else return ShowError(hr);
914 }
else return ShowError(hr);
915 }
else return ShowError(hr);
920 if(!m_pAVIDecompressorFilter) {
921 hr = CoCreateInstance(CLSID_AVIDec, NULL, CLSCTX_INPROC_SERVER,
922 IID_IBaseFilter,(
void**)&m_pAVIDecompressorFilter);
924 hr = m_pFilterGraph->AddFilter(m_pAVIDecompressorFilter, L
"AVI Decompressor");
928 pPinDecoderIn = GetInPin( m_pAVIDecompressorFilter ,0 );
929 pPinDecoderOut = GetOutPin( m_pAVIDecompressorFilter ,0 );
933 if ( MTPreferredResolution.majortype != GUID_NULL ) {
934 hr = pPinSource->Connect( pPinDecoderIn , &MTPreferredResolution );
936 SetVideoFormat( &MTPreferredResolution );
938 hr = pPinSource->Connect( pPinDecoderIn , &MTDefaultResolution );
940 SetVideoFormat( &MTDefaultResolution );
942 hr = m_pFilterGraph->Connect( pPinSource, pPinDecoderIn );
945 if ( pPinDecoderIn->ConnectionMediaType(&mt) == S_OK ) {
946 SetVideoFormat( &mt );
952 hr = m_pFilterGraph->Connect( pPinSource, pPinDecoderIn );
958 return ShowError(hr);
959 }
else return ShowError(hr);
960 }
else return ShowError(hr);
961 }
else return ShowError(hr);
965 if(!m_pSampleGrabberBase) {
966 hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
967 IID_IBaseFilter,(
void**)&m_pSampleGrabberBase);
969 hr = m_pFilterGraph->AddFilter(m_pSampleGrabberBase, L
"Sample Grabber");
972 pGrabPinIn = GetInPin( m_pSampleGrabberBase ,0 );
973 pGrabPinOut = GetOutPin( m_pSampleGrabberBase ,0 );
974 m_pSampleGrabberBase->QueryInterface(IID_ISampleGrabber,(
void**)&m_pSampleGrabber);
978 GrabType.SetType( &MEDIATYPE_Video );
979 GrabType.SetSubtype( &MEDIASUBTYPE_RGB24 );
980 hr = m_pSampleGrabber->SetMediaType( &GrabType );
982 return ShowError(hr);
983 hr = m_pSampleGrabber->SetBufferSamples(FALSE);
985 return ShowError(hr);
988 m_CB.SetBucketsPool( pBucketsPool );
990 hr = m_pSampleGrabber->SetCallback( &m_CB, 1 );
992 return ShowError(hr);
993 hr = m_pFilterGraph->Connect( pPinDecoderOut , pGrabPinIn );
995 return ShowError(hr);
996 }
else return ShowError(hr);
997 }
else return ShowError(hr);
998 }
else return ShowError(hr);
1001 if(!m_pNullRenderer) {
1002 hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1003 IID_IBaseFilter,(
void**)&m_pNullRenderer);
1005 hr = m_pFilterGraph->AddFilter(m_pNullRenderer, L
"Null Renderer");
1007 pRendererPin = GetInPin( m_pNullRenderer, 0);
1009 hr = m_pFilterGraph->Connect( pGrabPinOut, pRendererPin);
1011 return ShowError(hr);
1014 if ( pRendererPin->ConnectionMediaType(&mt) == S_OK ) {
1015 SetVideoFormat( &mt );
1019 }
else return ShowError(hr);
1020 }
else return ShowError(hr);
1021 }
else return ShowError(hr);
1033 IPin* pPinDecoderIn;
1034 IPin* pPinDecoderOut;
1040 if( SetCaptureDevice(
"IEEE1394", idevice ) ) {
1041 hr = m_pFilterGraph->AddFilter(m_pCaptureFilter, L
"DV Cam");
1043 pPinSource = GetOutPin( m_pCaptureFilter ,0 );
1044 }
else return ShowError(hr);
1045 }
else return false;
1049 if(!m_pDVDecoderFilter) {
1050 hr = CoCreateInstance(CLSID_DVVideoCodec, NULL, CLSCTX_INPROC_SERVER,
1051 IID_IBaseFilter,(
void**)&m_pDVDecoderFilter);
1053 hr = m_pFilterGraph->AddFilter(m_pDVDecoderFilter, L
"DV Decoder");
1057 pPinDecoderIn = GetInPin( m_pDVDecoderFilter ,0 );
1058 pPinDecoderOut = GetOutPin( m_pDVDecoderFilter ,0 );
1060 hr = m_pFilterGraph->Connect( pPinSource , pPinDecoderIn );
1063 return ShowError(hr);
1064 }
else return ShowError(hr);
1065 }
else return ShowError(hr);
1066 }
else return ShowError(hr);
1070 if(!m_pSampleGrabberBase) {
1071 hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
1072 IID_IBaseFilter,(
void**)&m_pSampleGrabberBase);
1074 hr = m_pFilterGraph->AddFilter(m_pSampleGrabberBase, L
"Sample Grabber");
1077 pGrabPinIn = GetInPin( m_pSampleGrabberBase ,0 );
1078 pGrabPinOut = GetOutPin( m_pSampleGrabberBase ,0 );
1079 m_pSampleGrabberBase->QueryInterface(IID_ISampleGrabber,(
void**)&m_pSampleGrabber);
1082 CMediaType GrabType;
1083 GrabType.SetType( &MEDIATYPE_Video );
1084 GrabType.SetSubtype( &MEDIASUBTYPE_RGB24 );
1085 hr = m_pSampleGrabber->SetMediaType( &GrabType );
1086 if(FAILED(hr)) ShowError(hr);
1087 hr = m_pSampleGrabber->SetBufferSamples(FALSE);
1088 if(FAILED(hr)) ShowError(hr);
1091 m_CB.SetBucketsPool( pBucketsPool );
1093 hr = m_pSampleGrabber->SetCallback( &m_CB, 1 );
1094 if(FAILED(hr)) ShowError(hr);
1095 hr = m_pFilterGraph->Connect( pPinDecoderOut , pGrabPinIn );
1097 return ShowError(hr);
1098 }
else return ShowError(hr);
1099 }
else return ShowError(hr);
1100 }
else return ShowError(hr);
1103 if(!m_pNullRenderer) {
1104 hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1105 IID_IBaseFilter,(
void**)&m_pNullRenderer);
1107 hr = m_pFilterGraph->AddFilter(m_pNullRenderer, L
"Null Renderer");
1109 pRendererPin = GetInPin( m_pNullRenderer, 0);
1111 hr = m_pFilterGraph->Connect( pGrabPinOut, pRendererPin);
1113 return ShowError(hr);
1114 }
else return ShowError(hr);
1115 }
else return ShowError(hr);
1116 }
else return ShowError(hr);
1119 if ( pRendererPin->ConnectionMediaType(&mt) == S_OK ) {
1120 SetVideoFormat( &mt );
1134 IPin* pPinDecoderIn;
1135 IPin* pPinDecoderOut;
1141 if( SetCaptureDevice(
"WEBCAM", idevice) ) {
1142 hr = m_pFilterGraph->AddFilter(m_pCaptureFilter, L
"Web Cam");
1144 pPinSource = GetOutPin( m_pCaptureFilter ,0 );
1145 }
else return ShowError(hr);
1146 }
else return false;
1150 if(!m_pAVIDecompressorFilter) {
1151 hr = CoCreateInstance(CLSID_AVIDec, NULL, CLSCTX_INPROC_SERVER,
1152 IID_IBaseFilter,(
void**)&m_pAVIDecompressorFilter);
1154 hr = m_pFilterGraph->AddFilter(m_pAVIDecompressorFilter, L
"AVI Decompressor");
1158 pPinDecoderIn = GetInPin( m_pAVIDecompressorFilter ,0 );
1159 pPinDecoderOut = GetOutPin( m_pAVIDecompressorFilter ,0 );
1161 hr = m_pFilterGraph->Connect( pPinSource , pPinDecoderIn );
1164 return ShowError(hr);
1165 }
else return ShowError(hr);
1166 }
else return ShowError(hr);
1167 }
else return ShowError(hr);
1171 if(!m_pSampleGrabberBase) {
1172 hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
1173 IID_IBaseFilter,(
void**)&m_pSampleGrabberBase);
1175 hr = m_pFilterGraph->AddFilter(m_pSampleGrabberBase, L
"Sample Grabber");
1178 pGrabPinIn = GetInPin( m_pSampleGrabberBase ,0 );
1179 pGrabPinOut = GetOutPin( m_pSampleGrabberBase ,0 );
1180 m_pSampleGrabberBase->QueryInterface(IID_ISampleGrabber,(
void**)&m_pSampleGrabber);
1183 CMediaType GrabType;
1184 GrabType.SetType( &MEDIATYPE_Video );
1185 GrabType.SetSubtype( &MEDIASUBTYPE_RGB24 );
1186 hr = m_pSampleGrabber->SetMediaType( &GrabType );
1188 return ShowError(hr);
1189 hr = m_pSampleGrabber->SetBufferSamples(FALSE);
1191 return ShowError(hr);
1194 m_CB.SetBucketsPool( pBucketsPool );
1196 hr = m_pSampleGrabber->SetCallback( &m_CB, 1 );
1198 return ShowError(hr);
1199 hr = m_pFilterGraph->Connect( pPinDecoderOut , pGrabPinIn );
1201 return ShowError(hr);
1202 }
else return ShowError(hr);
1203 }
else return ShowError(hr);
1204 }
else return ShowError(hr);
1207 if(!m_pNullRenderer) {
1208 hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1209 IID_IBaseFilter,(
void**)&m_pNullRenderer);
1211 hr = m_pFilterGraph->AddFilter(m_pNullRenderer, L
"Null Renderer");
1213 pRendererPin = GetInPin( m_pNullRenderer, 0);
1215 hr = m_pFilterGraph->Connect( pGrabPinOut, pRendererPin);
1217 return ShowError(hr);
1218 }
else return ShowError(hr);
1219 }
else return ShowError(hr);
1220 }
else return ShowError(hr);
1231 IPin* pPinDecoderIn;
1232 IPin* pPinDecoderOut;
1237 bool bQTAlternative;
1241 if( !m_pQuicktimeFilter ) {
1243 QTFilter =
"CyberLink QuickTime Source Filter";
1244 bQTAlternative = CreateFilterByName( QTFilter, &m_pQuicktimeFilter );
1254 if ( bQTAlternative ) {
1255 hr = m_pQuicktimeFilter->QueryInterface(IID_IFileSourceFilter,(
void**)&m_pFileSourceFilter);
1257 WCHAR wFileName[MAX_PATH];
1258 MultiByteToWideChar(CP_ACP, 0, filename, -1, wFileName, MAX_PATH);
1260 hr = m_pFileSourceFilter->Load( wFileName, NULL );
1262 hr = m_pFilterGraph->AddFilter(m_pQuicktimeFilter, L
"File Source");
1264 pPinSource = GetOutPin( m_pQuicktimeFilter ,0 );
1265 }
else return ShowError(hr);
1266 }
else return ShowError(hr);
1268 }
else return false;
1274 if (QTFilter ==
"CyberLink QuickTime Source Filter") {
1276 if(!m_pColorSpaceConverter) {
1277 hr = CoCreateInstance( CLSID_Colour, NULL, CLSCTX_INPROC_SERVER,
1278 IID_IBaseFilter,(
void**)&m_pColorSpaceConverter);
1279 if( SUCCEEDED(hr) ) {
1280 hr = m_pFilterGraph->AddFilter( m_pColorSpaceConverter, L
"Color Space Converter");
1281 if( SUCCEEDED(hr) ) {
1284 pPinDecoderIn = GetInPin( m_pColorSpaceConverter ,0 );
1285 pPinDecoderOut = GetOutPin( m_pColorSpaceConverter ,0 );
1287 hr = m_pFilterGraph->Connect( pPinSource , pPinDecoderIn );
1290 return ShowError(hr);
1292 }
else return ShowError(hr);
1293 }
else return ShowError(hr);
1294 }
else return ShowError(hr);
1296 if (!m_pQuicktimeDecoder) {
1297 if ( CreateFilterByName(
moText(
"Nero QuickTime(tm) Video Decoder"), &m_pQuicktimeDecoder ) ) {
1298 hr = m_pFilterGraph->AddFilter( m_pQuicktimeDecoder, L
"Nero QuickTime(tm) Video Decoder");
1299 if( SUCCEEDED(hr) ) {
1302 pPinDecoderIn = GetInPin( m_pQuicktimeDecoder ,0 );
1303 pPinDecoderOut = GetOutPin( m_pQuicktimeDecoder ,0 );
1305 hr = m_pFilterGraph->Connect( pPinSource , pPinDecoderIn );
1308 return ShowError(hr);
1310 }
else return ShowError(hr);
1311 }
else return false;
1317 if(!m_pSampleGrabberBase) {
1318 hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
1319 IID_IBaseFilter,(
void**)&m_pSampleGrabberBase);
1321 hr = m_pFilterGraph->AddFilter(m_pSampleGrabberBase, L
"Sample Grabber");
1324 pGrabPinIn = GetInPin( m_pSampleGrabberBase ,0 );
1325 pGrabPinOut = GetOutPin( m_pSampleGrabberBase ,0 );
1326 m_pSampleGrabberBase->QueryInterface(IID_ISampleGrabber,(
void**)&m_pSampleGrabber);
1329 CMediaType GrabType;
1330 GrabType.SetType( &MEDIATYPE_Video );
1331 GrabType.SetSubtype( &MEDIASUBTYPE_RGB24 );
1332 hr = m_pSampleGrabber->SetMediaType( &GrabType );
1334 return ShowError(hr);
1335 hr = m_pSampleGrabber->SetBufferSamples(FALSE);
1337 return ShowError(hr);
1340 m_CB.SetBucketsPool( pBucketsPool );
1342 hr = m_pSampleGrabber->SetCallback( &m_CB, 1 );
1344 return ShowError(hr);
1345 hr = m_pFilterGraph->Connect( pPinDecoderOut , pGrabPinIn );
1347 return ShowError(hr);
1348 }
else return ShowError(hr);
1349 }
else return ShowError(hr);
1350 }
else return ShowError(hr);
1353 if(!m_pNullRenderer) {
1354 hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1355 IID_IBaseFilter,(
void**)&m_pNullRenderer);
1357 hr = m_pFilterGraph->AddFilter(m_pNullRenderer, L
"Null Renderer");
1359 pRendererPin = GetInPin( m_pNullRenderer, 0);
1360 hr = m_pFilterGraph->Connect( pGrabPinOut, pRendererPin);
1362 return ShowError(hr);
1363 }
else return ShowError(hr);
1364 }
else return ShowError(hr);
1365 }
else return ShowError(hr);
1368 if ( pRendererPin->ConnectionMediaType(&mt) == S_OK ) {
1369 SetVideoFormat( &mt );
1382 IPin* pPinSplitterIn;
1383 IPin* pPinSplitterOut;
1384 IPin* pPinDecoderIn;
1385 IPin* pPinDecoderOut;
1391 IEnumMediaTypes* ppEnum;
1392 AM_MEDIA_TYPE* pMediaTypes;
1395 if( !m_pSourceFilter ) {
1396 hr = CoCreateInstance(CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER,
1397 IID_IBaseFilter,(
void**)&m_pSourceFilter );
1399 hr = m_pSourceFilter->QueryInterface(IID_IFileSourceFilter,(
void**)&m_pFileSourceFilter);
1401 WCHAR wFileName[MAX_PATH];
1402 MultiByteToWideChar(CP_ACP, 0, filename, -1, wFileName, MAX_PATH);
1404 hr = m_pFileSourceFilter->Load( wFileName, NULL );
1406 hr = m_pFilterGraph->AddFilter(m_pSourceFilter, L
"File Source");
1408 pPinSource = GetOutPin( m_pSourceFilter ,0 );
1409 }
else return ShowError(hr);
1410 }
else return ShowError(hr);
1411 }
else return ShowError(hr);
1412 }
else return ShowError(hr);
1413 }
else return false;
1417 hr = pPinSource->EnumMediaTypes( &ppEnum);
1419 while( ppEnum->Next( 1, &pMediaTypes, NULL) == S_OK ) {
1420 if ( pMediaTypes->majortype == MEDIATYPE_Stream ) {
1422 bool passed =
false;
1424 if ( pMediaTypes->subtype == MEDIASUBTYPE_Avi ) {
1427 hr = CoCreateInstance( CLSID_AviSplitter, NULL, CLSCTX_INPROC_SERVER,
1428 IID_IBaseFilter,(
void**)&m_pSplitter);
1429 if (SUCCEEDED(hr)) passed =
true;
1430 }
else return ShowError(hr);
1431 }
else if ( pMediaTypes->subtype == MEDIASUBTYPE_MPEG1Video ||
1432 pMediaTypes->subtype == MEDIASUBTYPE_MPEG1System ||
1433 pMediaTypes->subtype == MEDIASUBTYPE_MPEG1VideoCD) {
1435 hr = CoCreateInstance( CLSID_MPEG1Splitter, NULL, CLSCTX_INPROC_SERVER,
1436 IID_IBaseFilter,(
void**)&m_pSplitter);
1437 if (SUCCEEDED(hr)) passed =
true;
1438 }
else return ShowError(hr);
1439 }
else if ( pMediaTypes->subtype == MEDIASUBTYPE_MPEG2_PROGRAM ) {
1445 if( SUCCEEDED(hr) ) {
1446 hr = m_pFilterGraph->AddFilter( m_pSplitter, L
"Splitter");
1447 if( SUCCEEDED(hr) ) {
1449 pPinSplitterIn = GetInPin( m_pSplitter ,0 );
1451 hr = m_pFilterGraph->Connect( pPinSource , pPinSplitterIn );
1454 return ShowError(hr);
1456 pPinSplitterOut = GetOutPin( m_pSplitter ,0 );
1458 }
else return ShowError(hr);
1459 }
else return ShowError(hr);
1469 if (pPinSplitterOut) {
1470 hr = pPinSplitterOut->EnumMediaTypes( &ppEnum);
1472 while( ppEnum->Next( 1, &pMediaTypes, NULL) == S_OK ) {
1473 if (pMediaTypes->majortype == MEDIATYPE_Video) {
1474 if ( pMediaTypes->subtype == MEDIASUBTYPE_dvsd ||
1475 pMediaTypes->subtype == MEDIASUBTYPE_dvsl ||
1476 pMediaTypes->subtype == MEDIASUBTYPE_dvhd ) {
1478 SetVideoFormat( pMediaTypes );
1480 }
else if ( pMediaTypes->formattype == FORMAT_MPEGVideo ) {
1481 SetVideoFormat( pMediaTypes );
1483 }
else if ( pMediaTypes->formattype == FORMAT_MPEG2Video ) {
1484 SetVideoFormat( pMediaTypes );
1486 }
else if ( pMediaTypes->formattype == FORMAT_VideoInfo ||
1487 pMediaTypes->formattype == FORMAT_VideoInfo2 ) {
1488 SetVideoFormat( pMediaTypes );
1495 }
else return false;
1500 bool bHighQuality =
true;
1504 if(!m_pDVDecoderFilter) {
1506 hr = CoCreateInstance(CLSID_AVIDec, NULL, CLSCTX_INPROC_SERVER,
1507 IID_IBaseFilter,(
void**)&m_pDVDecoderFilter);
1509 hr = CoCreateInstance( CLSID_DVVideoCodec, NULL, CLSCTX_INPROC_SERVER,
1510 IID_IBaseFilter,(
void**)&m_pDVDecoderFilter);
1512 if( SUCCEEDED(hr) ) {
1513 hr = m_pFilterGraph->AddFilter( m_pDVDecoderFilter, L
"DV Decoder");
1514 if( SUCCEEDED(hr) ) {
1517 pPinDecoderIn = GetInPin( m_pDVDecoderFilter ,0 );
1518 pPinDecoderOut = GetOutPin( m_pDVDecoderFilter ,0 );
1520 hr = m_pFilterGraph->Connect( pPinSplitterOut , pPinDecoderIn );
1523 return ShowError(hr);
1525 }
else return ShowError(hr);
1526 }
else return ShowError(hr);
1527 }
else return ShowError(hr);
1532 hr = CoCreateInstance(CLSID_AVIDec, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter,(
void**)&m_pFfdshowFilter);
1533 if (SUCCEEDED(hr)) {
1535 hr = m_pFilterGraph->AddFilter( m_pFfdshowFilter, L
"ffdshow MPEG-4 Video Decoder");
1537 if( SUCCEEDED(hr) ) {
1540 pPinDecoderIn = GetInPin( m_pFfdshowFilter ,0 );
1541 pPinDecoderOut = GetOutPin( m_pFfdshowFilter ,0 );
1543 hr = m_pFilterGraph->Connect( pPinSplitterOut , pPinDecoderIn );
1547 hr = m_pFilterGraph->RemoveFilter( m_pFfdshowFilter );
1549 m_pFfdshowFilter->Release();
1550 m_pFfdshowFilter = NULL;
1552 pPinDecoderIn->Release();
1553 pPinDecoderIn = NULL;
1555 pPinDecoderOut->Release();
1556 pPinDecoderOut = NULL;
1558 if (CreateFilterByName(
moText(
"ffdshow MPEG-4 Video Decoder"), &m_pFfdshowFilter)) {
1559 hr = m_pFilterGraph->AddFilter( m_pFfdshowFilter, L
"ffdshow MPEG-4 Video Decoder");
1561 printf(
"ffdshow Filter not found\n");
1566 return ShowError(hr);
1569 }
else return ShowError(hr);
1572 printf(
"Filter not found\n");
1578 if(!m_pSampleGrabberBase) {
1579 hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
1580 IID_IBaseFilter,(
void**)&m_pSampleGrabberBase);
1582 hr = m_pFilterGraph->AddFilter(m_pSampleGrabberBase, L
"Sample Grabber");
1585 pGrabPinIn = GetInPin( m_pSampleGrabberBase ,0 );
1586 pGrabPinOut = GetOutPin( m_pSampleGrabberBase ,0 );
1587 m_pSampleGrabberBase->QueryInterface(IID_ISampleGrabber,(
void**)&m_pSampleGrabber);
1590 CMediaType GrabType;
1591 GrabType.SetType( &MEDIATYPE_Video );
1592 GrabType.SetSubtype( &MEDIASUBTYPE_RGB24 );
1593 hr = m_pSampleGrabber->SetMediaType( &GrabType );
1595 return ShowError(hr);
1596 hr = m_pSampleGrabber->SetBufferSamples(FALSE);
1598 return ShowError(hr);
1601 m_CB.SetBucketsPool( pBucketsPool );
1603 hr = m_pSampleGrabber->SetCallback( &m_CB, 1 );
1605 return ShowError(hr);
1606 hr = m_pFilterGraph->Connect( pPinDecoderOut , pGrabPinIn );
1608 return ShowError(hr);
1609 }
else return ShowError(hr);
1610 }
else return ShowError(hr);
1611 }
else return ShowError(hr);
1614 if(!m_pNullRenderer) {
1615 hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1616 IID_IBaseFilter,(
void**)&m_pNullRenderer);
1618 hr = m_pFilterGraph->AddFilter(m_pNullRenderer, L
"Null Renderer");
1620 pRendererPin = GetInPin( m_pNullRenderer, 0);
1621 hr = m_pFilterGraph->Connect( pGrabPinOut, pRendererPin);
1623 return ShowError(hr);
1624 }
else return ShowError(hr);
1625 }
else return ShowError(hr);
1626 }
else return ShowError(hr);
1629 if ( pRendererPin->ConnectionMediaType(&mt) == S_OK ) {
1630 SetVideoFormat( &mt );
1643 if(m_pFilterGraph) {
1644 if(m_pMediaControl) {
1645 hr = m_pMediaControl->Run();
1655 if(m_pFilterGraph) {
1656 if(m_pMediaControl) {
1657 hr = m_pMediaControl->Stop();
1665 moDsGraph::Pause() {
1667 if(m_pFilterGraph) {
1668 if(m_pMediaControl) {
1669 hr = m_pMediaControl->Pause();
1677 moDsGraph::Seek(
MOuint frame ) {
1679 if(m_pFilterGraph) {
1680 if(m_pMediaControl) {
1681 if(m_pMediaSeeking) {
1682 hr = m_pMediaSeeking->IsFormatSupported(&TIME_FORMAT_FRAME);
1684 hr = m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_FRAME);
1688 LONGLONG rtNow = frame;
1689 hr = m_pMediaSeeking->SetPositions(
1690 &rtNow, AM_SEEKING_AbsolutePositioning,
1691 NULL, AM_SEEKING_NoPositioning);
1695 }
else if ( hr == S_FALSE ) {
1701 hr = m_pMediaSeeking->IsFormatSupported(&TIME_FORMAT_MEDIA_TIME);
1703 hr = m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME);
1707 LONGLONG rtNow = frame;
1709 rtNow = rtNow * m_VideoFormat.m_TimePerFrame;
1717 hr = m_pMediaSeeking->SetPositions(
1718 &rtNow, AM_SEEKING_AbsolutePositioning,
1719 NULL, AM_SEEKING_NoPositioning);
1723 }
else ShowError(hr);
1724 }
else ShowError(hr);
1731 moDsGraph::GetFramesLength() {
1734 if(m_pFilterGraph) {
1735 if(m_pMediaControl) {
1736 hr = m_pMediaSeeking->IsFormatSupported(&TIME_FORMAT_FRAME);
1738 hr = m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_FRAME);
1741 if(m_pMediaSeeking) {
1742 hr = m_pMediaSeeking->GetDuration(&dur);
1747 }
else ShowError(hr);
1748 }
else if (hr==S_FALSE) {
1749 hr = m_pMediaSeeking->IsFormatSupported(&TIME_FORMAT_MEDIA_TIME);
1751 hr = m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME);
1754 if(m_pMediaSeeking) {
1755 hr = m_pMediaSeeking->GetDuration(&dur);
1757 dur = dur / m_VideoFormat.m_TimePerFrame;
1766 }
else ShowError(hr);
1768 }
else ShowError(hr);
1769 }
else ShowError(hr);
1770 }
else ShowError(hr);
1777 moDsGraph::IsRunning() {
1779 if(m_pFilterGraph) {
1780 if(m_pMediaControl) {
1781 OAFilterState filterstate;
1782 hr = m_pMediaControl->GetState( 12, &filterstate);
1784 hr = m_pMediaControl->Pause();
1786 hr = m_pMediaControl->Run();
1787 }
else return false;
1789 return(filterstate == State_Running);
1791 }
else ShowError(hr);
1798 moDsGraph::GetFrameBuffer(
MOlong *size ) {
1820 moDsGraph::ShowError( HRESULT hr ) {
1823 TCHAR szErr[MAX_ERROR_TEXT_LEN];
1824 DWORD res = AMGetErrorText(hr, szErr, MAX_ERROR_TEXT_LEN);
1827 wsprintf(szErr,
"Unknown Error: 0x%2x", hr);
1829 MessageBox(0, szErr, TEXT(
"Error!"), MB_OK | MB_ICONERROR);
1835 moDsGraph::SetVideoFormat( AM_MEDIA_TYPE * pmt ) {
1837 if (pmt->cbFormat >=
sizeof(VIDEOINFOHEADER)) {
1839 if ( pmt->formattype == FORMAT_VideoInfo ) {
1841 VIDEOINFOHEADER *pVih =
reinterpret_cast<VIDEOINFOHEADER*
>(pmt->pbFormat);
1843 m_VideoFormat.m_Width = pVih->bmiHeader.biWidth;
1844 m_VideoFormat.m_Height = pVih->bmiHeader.biHeight;
1845 m_VideoFormat.m_BitCount = pVih->bmiHeader.biBitCount;
1846 m_VideoFormat.m_BitRate = pVih->dwBitRate;
1847 m_VideoFormat.m_TimePerFrame = pVih->AvgTimePerFrame;
1848 m_VideoFormat.m_BufferSize = pmt->lSampleSize;
1849 m_VideoFormat.SetVideoMode();
1851 }
else if (pmt->formattype == FORMAT_MPEGVideo) {
1852 MPEG1VIDEOINFO *pMh =
reinterpret_cast<MPEG1VIDEOINFO*
>(pmt->pbFormat);
1853 VIDEOINFOHEADER *pVih = &(pMh->hdr);
1855 m_VideoFormat.m_Width = pVih->bmiHeader.biWidth;
1856 m_VideoFormat.m_Height = pVih->bmiHeader.biHeight;
1857 m_VideoFormat.m_BitCount = pVih->bmiHeader.biBitCount;
1858 m_VideoFormat.m_BitRate = pVih->dwBitRate;
1859 m_VideoFormat.m_TimePerFrame = pVih->AvgTimePerFrame;
1860 m_VideoFormat.m_BufferSize = pVih->bmiHeader.biWidth * pVih->bmiHeader.biHeight * 3;
1861 m_VideoFormat.SetVideoMode();
1863 }
else if (pmt->formattype == FORMAT_MPEG2Video) {
1865 MPEG2VIDEOINFO *pMh =
reinterpret_cast<MPEG2VIDEOINFO*
>(pmt->pbFormat);
1866 VIDEOINFOHEADER2 *pVih = &(pMh->hdr);
1868 m_VideoFormat.m_Width = pVih->bmiHeader.biWidth;
1869 m_VideoFormat.m_Height = pVih->bmiHeader.biHeight;
1870 m_VideoFormat.m_BitCount = pVih->bmiHeader.biBitCount;
1871 m_VideoFormat.m_BitRate = pVih->dwBitRate;
1872 m_VideoFormat.m_TimePerFrame = pVih->AvgTimePerFrame;
1873 m_VideoFormat.m_BufferSize = pVih->bmiHeader.biWidth * pVih->bmiHeader.biHeight * 3;
1874 m_VideoFormat.SetVideoMode();
1882 IPin * moDsGraph::GetInPin( IBaseFilter * pFilter,
int nPin )
1885 GetPin(pFilter, PINDIR_INPUT, nPin, &pComPin);
1890 IPin * moDsGraph::GetOutPin( IBaseFilter * pFilter,
int nPin )
1893 GetPin(pFilter, PINDIR_OUTPUT, nPin, &pComPin);
1898 moDsGraph::GetPin( IBaseFilter * pFilter, PIN_DIRECTION dirrequired,
int iNum, IPin **ppPin)
1903 HRESULT hr = pFilter->EnumPins(&pEnum);
1911 while(S_OK == pEnum->Next(1, &pPin, &ulFound))
1913 PIN_DIRECTION pindir =(PIN_DIRECTION)3;
1915 pPin->QueryDirection(&pindir);
1916 if(pindir == dirrequired)
1935 moDsGraph::CheckMediaType( IPin* p_Pin ) {
1938 IEnumMediaTypes* ppEnum;
1939 AM_MEDIA_TYPE* pMediaTypes;
1942 hr = p_Pin->EnumMediaTypes( &ppEnum);
1946 while( ppEnum->Next( 1, &pMediaTypes, NULL) == S_OK ) {
1947 if ( pMediaTypes->majortype == MEDIATYPE_Video ) {
1948 if ( pMediaTypes->formattype == FORMAT_VideoInfo ) {
1950 VIDEOINFOHEADER *pVih =
reinterpret_cast<VIDEOINFOHEADER*
>(pMediaTypes->pbFormat);
1951 m_VideoFormat.m_Width = pVih->bmiHeader.biWidth;
1952 m_VideoFormat.m_Height = pVih->bmiHeader.biHeight;
1953 m_VideoFormat.m_BitCount = pVih->bmiHeader.biBitCount;
1954 m_VideoFormat.m_BitRate = pVih->dwBitRate;
1955 m_VideoFormat.m_TimePerFrame = pVih->AvgTimePerFrame;
1956 m_VideoFormat.m_BufferSize = pMediaTypes->lSampleSize;
1957 m_VideoFormat.SetVideoMode();
moVideoFormat & GetVideoFormat()
Devuelve el formato de video del dispositivo.
clase de para manejar textos
void Present(bool p=true)
Fija la presencia del dispositivo.
Administrador de moBucket 's.
const moText & GetPath() const
Devuelve el camino al dispositivo.
DefiniciĆ³n de un dispositivo de video, generalmente uno de captura de video, o camara.