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 data
pCapture->put_TargetFile(bstrBufferFile);
SysFreeString(bstrBufferFile);
// Get the graph ready to capture video and audio, but don't start capturing yet
hr = pCapture->ReadyCapture(ltmmCapture_Mode_VideoAndAudio | ltmmCapture_Mode_InhibitRun);
if(SUCCEEDED(hr))
{
IUnknown *punk = NULL;
// Get the sink object unknown interface
hr = pCapture->GetSubObject(ltmmCapture_Object_Sink, &punk);
if(SUCCEEDED(hr) && NULL != punk)
{
ILMDVRSink *pDvrSink = NULL;
// Get the sink interface from the unknown object
HRESULT hr = punk->QueryInterface(IID_ILMDVRSink, (LPVOID*)&pDvrSink);
if (SUCCEEDED(hr))
{
// Tell the sink that settings are going to change
pDvrSink->StartChangingAttributes();
// Set the folder count (one buffer folder) and number of buffer files and their maximum size
pDvrSink->put_FolderCount(1);
pDvrSink->SetBufferSize(0, fileCount, bufferSize);
// Apply the DVR settings
pDvrSink->StopChangingAttributes(FALSE);
// Release the sink interface
pDvrSink->Release();
}
// Release the unknown interface
punk->Release();
}
// Start the graph capturing data
hr = 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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.