Output to DV device

1.

Create an instance of the ltmmConvert class. This is accomplished using the Win32 CoCreateInstance function as follows:

C Source

IltmmConvert* pConvert;
CoCreateInstance(&CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmConvert, (void**) &pConvert);

C++ Source

IltmmConvert* pConvert;
CoCreateInstance(CLSID_ltmmConvert, NULL, CLSCTX_INPROC_SERVER, IID_IltmmConvert, (void**) &pConvert);

2.

Set the source file as follows:

C Source

BSTR bstr;

bstr = SysAllocString(L"c:\\Source.avi");
IltmmConvert_put_SourceFile(pConvert, bstr);
SysFreeString(bstr);

C++ Source

BSTR bstr;

bstr = SysAllocString(L"c:\\Source.avi");
pConvert->put_SourceFile(bstr); 
SysFreeString(bstr);

3.

Set the target type to DV as follows:

C Source

IltmmConvert_put_TargetFormat(pConvert, ltmmConvert_TargetFormat_dvsd);

C++ Source

pConvert->put_TargetFormat(ltmmConvert_TargetFormat_dvsd);

 

4.

Select the first available device as follows:

C Source

IltmmTargetDevices* targetdevices;

IltmmConvert_get_TargetDevices(pConvert, &targetdevices);
IltmmTargetDevices_put_Selection(targetdevices, 0);
IUnknown_Release(targetdevices); 

C++ Source

IltmmTargetDevices* targetdevices;

pConvert->get_TargetDevices(&targetdevices);
targetdevices->put_Selection(0);
targetdevices->Release();

5.

You should start converting. What you have on the tape will be overwritten now, so make sure you do not have a tape inside the DV device that you do not want to record over. This is demonstrated with the following code:

C Source

IltmmVCRControl* pVCR;

IltmmConvert_get_TargetVCRControl(pConvert, &pVCR);
IltmmVCRControl_Record(pVCR);
IUnknown_Release(pVCR); 


IltmmConvert_StartConvert(pConvert);

C++ Source

IltmmVCRControl* pVCR;

pConvert->get_TargetVCRControl(&pVCR);
pVCR->Record();
pVCR->Release();

pConvert->StartConvert();