Cannot connect a Script output to the ASF Writer Script Input



Hello,

I'm new to this this forum and I hope it's the suitable one.

This is what I'm trying to do, in C++/Directshow:
- I have 3 sources with an output pin on each one (CSourceStream) :
respectively
for Video, Audio and Script
- I also have a WM ASF Writer and almost all the required code to set its
profile
- I simply wish to connect these sources to the ASF Writer.

This is my current state :
- I can dynamically set the profile's attributes for the Audio and the Video
input pins of the ASF Writer and it works well.
- The error 0x80040207 occurs when I use the ConnectDirect() method of the
GraphBuilder.

I set the profile of the ASF Writer from scratch by adding each stream with
the
good mediatype and then update them according the Video/Audio attributes. The
Script stream doesn't need to be set dynamically so that I defined it like
that
in the output pin of the script source :
AM_MEDIA_TYPE mediaType;
mediaType.majortype = WMMEDIATYPE_Script;
mediaType.subtype = GUID_NULL ;
mediaType.bFixedSizeSamples = 0;
mediaType.bTemporalCompression = 0;
mediaType.lSampleSize = 0;
mediaType.formattype = WMFORMAT_Script;
mediaType.pUnk = NULL;
mediaType.cbFormat = sizeof(WMSCRIPTFORMAT);
mediaType.pbFormat = (BYTE*) new WMSCRIPTFORMAT;
((WMSCRIPTFORMAT*)mediaType.pbFormat)->scriptType = WMSCRIPTTYPE_TwoStrings;


This Mediatype is accepted by the profile :
if (SUCCEEDED(hr))
{
hr = pProfile->CreateNewStream(WMMEDIATYPE_Script,&pStreamConfig);
}

if (SUCCEEDED(hr))
{
hr = pStreamConfig->SetStreamName(L"Subtitles Input");
}

if (SUCCEEDED(hr))
{
hr =
pStreamConfig->QueryInterface(IID_IWMMediaProps,(void**)&pMediaProp);
}

if (SUCCEEDED(hr))
{
hr = pMediaProp->SetMediaType((WM_MEDIA_TYPE*)&SubTtMediaType);
pMediaProp->Release();
}

if (SUCCEEDED(hr))
{
hr = pProfile->AddStream(pStreamConfig);
}

if (SUCCEEDED(hr))
{
hr = pProfile->ReconfigStream(pStreamConfig);
pStreamConfig->Release();
}
//All succeeded

Am I doing something wrong ?

I read somewhere in another forum that the error 0x80040207 can occur when the
pins don't use the same model (push/pull). Here my sources only use the Push
model due to technical constraints.

Is it possible to connect a Push source to the Script Input of a WM ASF Writer
?
(or only for Video and audio ?)

Thanks for your help

Cheers

OP
.



Relevant Pages

  • Re: GraphEdit and MPEG2 files - incorrect playback
    ... In each case this seems to be happening at the point where the timestamps got decremented. ... I now have two threads, one for the audio pin, and one for the video. ... On some of the data I've been feeding it I find that if I have a small number of buffers available to the allocator, and if I send a sample which is out of sequence, the thread sending the video sample hangs in the ASF writer. ...
    (microsoft.public.win32.programmer.directx.video)
  • Custom ASF Writer configuration
    ... wrapper for WME SDK, ASF Writer filter. ... I am constructing a filter graph with a video decoder and an audio ... As soon as I reconfugure ASF Writer with one of the custom profiles ...
    (microsoft.public.windowsmedia.encoder)
  • Custom ASF Writer configuration
    ... wrapper for WME SDK, ASF Writer filter. ... I am constructing a filter graph with a video decoder and an audio ... As soon as I reconfugure ASF Writer with one of the custom profiles ...
    (microsoft.public.windowsmedia.encoder)
  • Custom ASF Writer configuration
    ... wrapper for WME SDK, ASF Writer filter. ... I am constructing a filter graph with a video decoder and an audio ... As soon as I reconfugure ASF Writer with one of the custom profiles ...
    (microsoft.public.windowsmedia.encoder)
  • Custom ASF Writer configuration
    ... wrapper for WME SDK, ASF Writer filter. ... I am constructing a filter graph with a video decoder and an audio ... As soon as I reconfugure ASF Writer with one of the custom profiles ...
    (microsoft.public.windowsmedia.encoder)