Re: Some help for newbie from gurus - Multiple Sources on a single track
- From: "Seyfullah Çetin" <schwarzxxl@xxxxxxxxx>
- Date: Thu, 31 Mar 2005 17:42:38 +0300
"Apurva Lawale" <apudeepa@xxxxxxxxxxxxxx> wrote>
> I am trying to add multiple media to the same track.
>
> Like:
>
> --------------------
> Media1 | Media2
> -------------------
>
> The quick and dirty figure above shows 1 Track with 2 Media files back to
> back.
>
>
> Well the code that i am trying out is :
>
>
> pTL->CreateEmptyNode(&pSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);
> pSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pSource);
>
> // Set the times and the file name.
> pSourceObj->SetStartStop(0,25*10000000);
> BSTR bstrFile = SysAllocString(OLESTR("C:\\1.avi"));
> pSource->SetMediaName(bstrFile);
> SysFreeString(bstrFile);
> pSource->SetMediaTimes(0,24*10000000);
> pTrack->SrcAdd(pSourceObj);
> bstrFile = SysAllocString(OLESTR("C:\\1.jpg"));
> pSource->SetMediaName(bstrFile);
> SysFreeString(bstrFile);
> pSource->SetMediaTimes(0,1*10000000);
> pTrack->SrcAdd(pSourceObj);
>
> pSourceObj->Release();
> pSource->Release();
> pTrack->Release();
>
>
> The above code only shows me 1.jpg and it does not show me 1.avi. It means
> it only shows me that last media file. I am sure this is something simple
> (at least for the gurus out here), I can't figure it out though. Please
tell
> me what am I doing wrong.
>
AFAIK you must release the IAMTimelineSrc and IAMTimelineObj
interfaces(pSource and pSourceObj) before you use them in a second clip.
Something like this;
pTL->CreateEmptyNode(&pSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);
pSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pSource);
// Set the times and the file name.
pSourceObj->SetStartStop(0,25*10000000);
BSTR bstrFile = SysAllocString(OLESTR("C:\\1.avi"));
pSource->SetMediaName(bstrFile);
SysFreeString(bstrFile);
pSource->SetMediaTimes(0,24*10000000);
pTrack->SrcAdd(pSourceObj);
pSourceObj->Release();
pSource->Release();
pTL->CreateEmptyNode(&pSourceObj, TIMELINE_MAJOR_TYPE_SOURCE);
pSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pSource);
bstrFile = SysAllocString(OLESTR("C:\\1.jpg"));
pSource->SetMediaName(bstrFile);
SysFreeString(bstrFile);
pSource->SetMediaTimes(0,1*10000000);
pTrack->SrcAdd(pSourceObj);
pSourceObj->Release();
pSource->Release();
pTrack->Release();
Seyfullah.
.
- Follow-Ups:
- Re: Some help for newbie from gurus - Multiple Sources on a single track
- From: Apurva Lawale
- Re: Some help for newbie from gurus - Multiple Sources on a single track
- References:
- Some help for newbie from gurus - Multiple Sources on a single track
- From: Apurva Lawale
- Some help for newbie from gurus - Multiple Sources on a single track
- Prev by Date: Re: Using DirectShow to extract information from AVI WMV?
- Next by Date: Re: WMV Pin Connection.
- Previous by thread: Some help for newbie from gurus - Multiple Sources on a single track
- Next by thread: Re: Some help for newbie from gurus - Multiple Sources on a single track
- Index(es):
Relevant Pages
|