This function does the following:
1) Sets a closed captioning target file and saves it in SRT format.
2) Retrieves the file and its flag and makes sure it is properly set.
3) Sets a closed captioning target file and saves it in TEXT format.
4) Retrieves the file and its flag and makes sure it is properly set.
void TestSetClosedCaptioningTargetFile(IltmmConvert *pConvert)
{
HRESULT hr = S_OK;
BSTR bstrTargetFileSRT = NULL;
BSTR bstrTargetFileTEXT = NULL;
BSTR bstrTargetFile = NULL;
long Flags = 0;
bstrTargetFileSRT = SysAllocString(MAKE_MEDIA_PATH("ClosedCaptioning.srt"));
bstrTargetFileTEXT = SysAllocString(MAKE_MEDIA_PATH("ClosedCaptioning.txt"));
// Set the closed captioning target file to ClosedCaptioning.srt and save it in SRT format.
hr = pConvert->SetClosedCaptioningTargetFile(bstrTargetFileSRT, 0);
ASSERT( hr == S_OK);
bstrTargetFile = NULL;
hr = pConvert->GetClosedCaptioningTargetFile(&bstrTargetFile, &Flags);
if((hr == S_OK) && (VarBstrCmp(bstrTargetFile, bstrTargetFileSRT, NORM_IGNORECASE | LOCALE_USER_DEFAULT, 0) == static_cast<HRESULT>(VARCMP_EQ)) && (0==Flags) )
MessageBox(NULL, TEXT("The Closed Captioning Target File was set properly!"), TEXT("SUCCESS"), MB_OK);
else
MessageBox(NULL, TEXT("The Closed Captioning Target File was NOT set properly!"), TEXT("FAILURE"), MB_OK);
// free the bstr
SysFreeString(bstrTargetFile);
// Set the closed captioning target file to ClosedCaptioning.txt and save it in TEXT format.
hr = pConvert->SetClosedCaptioningTargetFile(bstrTargetFileTEXT, ltmmClosedCaptioning_Text);
ASSERT( hr == S_OK);
bstrTargetFile = NULL;
hr = pConvert->GetClosedCaptioningTargetFile(&bstrTargetFile, &Flags);
if((hr == S_OK) && (VarBstrCmp(bstrTargetFile, bstrTargetFileTEXT, NORM_IGNORECASE | LOCALE_USER_DEFAULT, 0) == static_cast<HRESULT>(VARCMP_EQ)) && (ltmmClosedCaptioning_Text==Flags) )
MessageBox(NULL, TEXT("The Closed Captioning Target File was set properly!"), TEXT("SUCCESS"), MB_OK);
else
MessageBox(NULL, TEXT("The Closed Captioning Target File was NOT set properly!"), TEXT("FAILURE"), MB_OK);
// free the bstrs
SysFreeString(bstrTargetFile);
SysFreeString(bstrTargetFileSRT);
SysFreeString(bstrTargetFileTEXT);
}
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.