This topic is now archived and is closed to further replies.


DirectShow - IVideoFilter's behavior

Recommended Posts

Here comes my code which smoothy switches video clip files without returning from fullscreen to windowed mode and screen flicking. This code work perfectly, but it loses fullscreen mode when new clip have different resolution. Can anybody help me? HRESULT ReConstructGraph(const TCHAR * Movie) { USES_CONVERSION; HRESULT hr; WCHAR wFile[MAX_PATH]; wcscpy(wFile, T2W(Movie)); do{ CComQIPtr pGC(_pGB); // pGB - IGraphBuilder void* p; // Stop the graph in order to disconnect pins hr = _pMC->Stop();// IMediaControl if(FAILED(hr)) break; //Disconnect Pins CComPtr pFatherPin(GetPin(_pVideoFilter,PINDIR_INPUT)); hr = pFatherPin->ConnectedTo((IPin**)&p); if(FAILED(hr)) break; CComPtr pMotherPin((IPin*)p); hr = _pGB->Disconnect(pMotherPin); if(FAILED(hr)) break; hr = _pGB->Disconnect(pFatherPin); if(FAILED(hr)) break; //Add Video Filter to Cache hr = pGC->AddFilterToCache(_pVideoFilter); if(FAILED(hr)) break; //Build new graph (cached filters are connected in the first order) hr = _pGB->RenderFile(wFile, NULL); if(FAILED(hr)) break; // Run the new graph hr = _pMC->Run(); if(FAILED(hr)) break; }while(0); return hr; }

Share this post

Link to post
Share on other sites