The following method for C++ shows how to get the DVR Sink object from the ltmmPlayControl object, using it to set DVR settings.
void StartDVRCapture(IltmmCapture *pCapture, LPTSTR szBufferFile, long fileCount, double bufferSize){USES_CONVERSION;HRESULT hr = S_OK;pCapture->EnterEdit();BSTR bstrBufferFile = SysAllocString(T2OLE(szBufferFile));// Tell the capture control where to store the captured datapCapture->put_TargetFile(bstrBufferFile);SysFreeString(bstrBufferFile);// Get the graph ready to capture video and audio, but don't start capturing yethr = pCapture->ReadyCapture(ltmmCapture_Mode_VideoAndAudio | ltmmCapture_Mode_InhibitRun);if(SUCCEEDED(hr)){IUnknown *punk = NULL;// Get the sink object unknown interfacehr = pCapture->GetSubObject(ltmmCapture_Object_Sink, &punk);if(SUCCEEDED(hr) && NULL != punk){ILMDVRSink *pDvrSink = NULL;// Get the sink interface from the unknown objectHRESULT hr = punk->QueryInterface(IID_ILMDVRSink, (LPVOID*)&pDvrSink);if (SUCCEEDED(hr)){// Tell the sink that settings are going to changepDvrSink->StartChangingAttributes();// Set the folder count (one buffer folder) and number of buffer files and their maximum sizepDvrSink->put_FolderCount(1);pDvrSink->SetBufferSize(0, fileCount, bufferSize);// Apply the DVR settingspDvrSink->StopChangingAttributes(FALSE);// Release the sink interfacepDvrSink->Release();}// Release the unknown interfacepunk->Release();}// Start the graph capturing datahr = pCapture->RunCapture();}pCapture->LeaveEdit();}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
