From: dos on
Yes, output A/V pins are separately connected with audio and video decoder.
Here is the code for changing state. It's just TestCap sample code without
any modification:
///////////////////////////
Set State
switch (pSrb->CommandData.StreamState)

{
case KSSTATE_STOP:

//
// The stream class will cancel all outstanding IRPs for us
// (but only if it is maintaining the queue ie. using Stream Class
synchronization)
// Since Testcap is not using Stream Class synchronization, we must
clear the queue here

VideoQueueCancelAllSRBs (pStrmEx);

DbgLogInfo(("TestCap: STATE Stopped, Stream=%d\n", StreamNumber));
break;

case KSSTATE_ACQUIRE:

//
// This is a KS only state, that has no correspondence in DirectShow
//
DbgLogInfo(("TestCap: STATE Acquire, Stream=%d\n", StreamNumber));
break;

case KSSTATE_PAUSE:

//
// On a transition to pause from acquire or stop, start our timer
running.
//

if (PreviousState == KSSTATE_ACQUIRE || PreviousState ==
KSSTATE_STOP) {

// Zero the frame counters
pStrmEx->FrameInfo.PictureNumber = 0;
pStrmEx->FrameInfo.DropCount = 0;
pStrmEx->FrameInfo.dwFrameFlags = 0;

// Setup the next timer callback(s)
VideoTimerRoutine(pStrmEx);
}
DbgLogInfo(("TestCap: STATE Pause, Stream=%d\n", StreamNumber));
break;

case KSSTATE_RUN:

//
// Begin Streaming.
//

// Reset the discontinuity flag

pStrmEx->fDiscontinuity = FALSE;

// Setting the NextFrame time to zero will cause the value to be
// reset from the stream time

pStrmEx->QST_NextFrame = 0;

DbgLogInfo(("TestCap: STATE Run, Stream=%d\n", StreamNumber));
break;

} // end switch (pSrb->CommandData.StreamState)

///////////////////////
Get State
pSrb->CommandData.StreamState = pStrmEx->KSState;
pSrb->ActualBytesTransferred = sizeof (KSSTATE);

// A very odd rule:
// When transitioning from stop to pause, DShow tries to preroll
// the graph. Capture sources can't preroll, and indicate this
// by returning VFW_S_CANT_CUE in user mode. To indicate this
// condition from drivers, they must return STATUS_NO_DATA_DETECTED

if (pStrmEx->KSState == KSSTATE_PAUSE) {
pSrb->Status = STATUS_NO_DATA_DETECTED;
}

dos


"Max Paklin" wrote:

> What is your graph topology?
> Output A/V pins of the demux are connected, aren't they?
>
> Now it is time to put some breakpoints in your pin handlers and make sure
> that state transition is handled correctly.
>
> -- Max.
>
>
>
>
> "dos" <dos(a)discussions.microsoft.com> wrote in message
> news:9EC0A3F7-8DA7-4BFB-8CBA-45B752640A65(a)microsoft.com...
> > Hi Max,
> >
> > Thanks for your suggestion!
> > I change my code in the way your suggested:
> > static KSDATARANGE StreamFormatMPEG2_Capture =
> > {
> > // KSDATARANGE
> > sizeof (KSDATARANGE), // FormatSize
> > 0, // Flags
> > 0, // SampleSize
> > 0, // Reserved
> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka. MEDIATYPE_Stream
> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> > TRANSPORT,
> > STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> > };
> > Now, capture pin can be connected with MPEG2 demultiplexer. But when I
> > "run"
> > the graph, an error message is shown: "The graph could not change the
> > state".
> > The return code is 0x800706f8. It means user buffer is invalid.
> > Why?
> >
> > dos
> >
> > "Max Paklin" wrote:
> >
> >> I have no samples that I can share on this subject.
> >> Do you have MPEG2 decoder software on your machine? You can't hook
> >> MPEG2TS
> >> output to VMR. It has to go via MPEG2 Demux and MPEG2 A/V Decoders.
> >>
> >> -- Max.
> >>
> >>
> >>
> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> news:5BA13A1A-6648-4767-9542-99BC05732E0F(a)microsoft.com...
> >> > Hi Max,
> >> >
> >> > Thanks for your suggestion.
> >> > But my capture pin still can't be connect with VMR in GraphEdit, even
> >> > after
> >> > I modified the structure just like your code. Maybe I don't process
> >> > SRB_GET_DATA_INTERSECTION in a correct way? It's complicated to fill
> >> > all
> >> > data
> >> > structures for separate command. Can you supply any sample code that
> >> > can
> >> > capture TS stream by Stream Class minidriver for me?
> >> > Thanks again.
> >> >
> >> > "Max Paklin" wrote:
> >> >
> >> >> Your format description is wrong.
> >> >>
> >> >> You either tell that it is transport stream and that's where you use
> >> >> KS_DATARANGE with
> >> >> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> >> > MEDIATYPE_Stream
> >> >> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE
> >> >> > MPEG2
> >> >>
> >> >> Or you tell the system that you have MPEG2 video and that's when you
> >> >> use
> >> >> KS_DATARANGE_MPEG2_VIDEO and all those MPEG2 goodies.
> >> >>
> >> >>
> >> >> So change the descriptor to simple one (see below) and it should work.
> >> >>
> >> >> static KS_DATARANGE StreamFormatMPEG2_Capture =
> >> >> {
> >> >> // KSDATARANGE
> >> >> {
> >> >> sizeof (KS_DATARANGE ), // FormatSize
> >> >> 0, // Flags
> >> >> 0, // SampleSize
> >> >> 0, // Reserved
> >> >>
> >> >> STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> >> MEDIATYPE_Stream
> >> >> STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> >> >> TRANSPORT,
> >> >> STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> >> >> };
> >> >>
> >> >> -- Max.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> >> news:0221258C-4FDF-4BB9-9071-460BC94C1E64(a)microsoft.com...
> >> >> > Hi all,
> >> >> >
> >> >> > I'm developing a Stream Class minidriver to catch MPEG2-TS from a
> >> >> > USB-TV
> >> >> > box. I modified Testcap, sample code of DDK. Th
From: dos on
Yes, output A/V pins are separately connected with audio and video decoder.
Here is the code for changing state. It's just TestCap sample code without
any modification:
///////////////////////////
Set State
switch (pSrb->CommandData.StreamState)

{
case KSSTATE_STOP:

//
// The stream class will cancel all outstanding IRPs for us
// (but only if it is maintaining the queue ie. using Stream Class
synchronization)
// Since Testcap is not using Stream Class synchronization, we must
clear the queue here

VideoQueueCancelAllSRBs (pStrmEx);

DbgLogInfo(("TestCap: STATE Stopped, Stream=%d\n", StreamNumber));
break;

case KSSTATE_ACQUIRE:

//
// This is a KS only state, that has no correspondence in DirectShow
//
DbgLogInfo(("TestCap: STATE Acquire, Stream=%d\n", StreamNumber));
break;

case KSSTATE_PAUSE:

//
// On a transition to pause from acquire or stop, start our timer
running.
//

if (PreviousState == KSSTATE_ACQUIRE || PreviousState ==
KSSTATE_STOP) {

// Zero the frame counters
pStrmEx->FrameInfo.PictureNumber = 0;
pStrmEx->FrameInfo.DropCount = 0;
pStrmEx->FrameInfo.dwFrameFlags = 0;

// Setup the next timer callback(s)
VideoTimerRoutine(pStrmEx);
}
DbgLogInfo(("TestCap: STATE Pause, Stream=%d\n", StreamNumber));
break;

case KSSTATE_RUN:

//
// Begin Streaming.
//

// Reset the discontinuity flag

pStrmEx->fDiscontinuity = FALSE;

// Setting the NextFrame time to zero will cause the value to be
// reset from the stream time

pStrmEx->QST_NextFrame = 0;

DbgLogInfo(("TestCap: STATE Run, Stream=%d\n", StreamNumber));
break;

} // end switch (pSrb->CommandData.StreamState)

///////////////////////
Get State
pSrb->CommandData.StreamState = pStrmEx->KSState;
pSrb->ActualBytesTransferred = sizeof (KSSTATE);

// A very odd rule:
// When transitioning from stop to pause, DShow tries to preroll
// the graph. Capture sources can't preroll, and indicate this
// by returning VFW_S_CANT_CUE in user mode. To indicate this
// condition from drivers, they must return STATUS_NO_DATA_DETECTED

if (pStrmEx->KSState == KSSTATE_PAUSE) {
pSrb->Status = STATUS_NO_DATA_DETECTED;
}

dos


"Max Paklin" wrote:

> What is your graph topology?
> Output A/V pins of the demux are connected, aren't they?
>
> Now it is time to put some breakpoints in your pin handlers and make sure
> that state transition is handled correctly.
>
> -- Max.
>
>
>
>
> "dos" <dos(a)discussions.microsoft.com> wrote in message
> news:9EC0A3F7-8DA7-4BFB-8CBA-45B752640A65(a)microsoft.com...
> > Hi Max,
> >
> > Thanks for your suggestion!
> > I change my code in the way your suggested:
> > static KSDATARANGE StreamFormatMPEG2_Capture =
> > {
> > // KSDATARANGE
> > sizeof (KSDATARANGE), // FormatSize
> > 0, // Flags
> > 0, // SampleSize
> > 0, // Reserved
> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka. MEDIATYPE_Stream
> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> > TRANSPORT,
> > STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> > };
> > Now, capture pin can be connected with MPEG2 demultiplexer. But when I
> > "run"
> > the graph, an error message is shown: "The graph could not change the
> > state".
> > The return code is 0x800706f8. It means user buffer is invalid.
> > Why?
> >
> > dos
> >
> > "Max Paklin" wrote:
> >
> >> I have no samples that I can share on this subject.
> >> Do you have MPEG2 decoder software on your machine? You can't hook
> >> MPEG2TS
> >> output to VMR. It has to go via MPEG2 Demux and MPEG2 A/V Decoders.
> >>
> >> -- Max.
> >>
> >>
> >>
> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> news:5BA13A1A-6648-4767-9542-99BC05732E0F(a)microsoft.com...
> >> > Hi Max,
> >> >
> >> > Thanks for your suggestion.
> >> > But my capture pin still can't be connect with VMR in GraphEdit, even
> >> > after
> >> > I modified the structure just like your code. Maybe I don't process
> >> > SRB_GET_DATA_INTERSECTION in a correct way? It's complicated to fill
> >> > all
> >> > data
> >> > structures for separate command. Can you supply any sample code that
> >> > can
> >> > capture TS stream by Stream Class minidriver for me?
> >> > Thanks again.
> >> >
> >> > "Max Paklin" wrote:
> >> >
> >> >> Your format description is wrong.
> >> >>
> >> >> You either tell that it is transport stream and that's where you use
> >> >> KS_DATARANGE with
> >> >> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> >> > MEDIATYPE_Stream
> >> >> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE
> >> >> > MPEG2
> >> >>
> >> >> Or you tell the system that you have MPEG2 video and that's when you
> >> >> use
> >> >> KS_DATARANGE_MPEG2_VIDEO and all those MPEG2 goodies.
> >> >>
> >> >>
> >> >> So change the descriptor to simple one (see below) and it should work.
> >> >>
> >> >> static KS_DATARANGE StreamFormatMPEG2_Capture =
> >> >> {
> >> >> // KSDATARANGE
> >> >> {
> >> >> sizeof (KS_DATARANGE ), // FormatSize
> >> >> 0, // Flags
> >> >> 0, // SampleSize
> >> >> 0, // Reserved
> >> >>
> >> >> STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> >> MEDIATYPE_Stream
> >> >> STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> >> >> TRANSPORT,
> >> >> STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> >> >> };
> >> >>
> >> >> -- Max.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> >> news:0221258C-4FDF-4BB9-9071-460BC94C1E64(a)microsoft.com...
> >> >> > Hi all,
> >> >> >
> >> >> > I'm developing a Stream Class minidriver to catch MPEG2-TS from a
> >> >> > USB-TV
> >> >> > box. I modified Testcap, sample code of DDK. Th
From: Max Paklin on
I don't see anything wrong with the code you posted. As I said before, now
is a good time to use the debugger to see if there is anything that you are
failing during state transition. Have you done that?

If all your calbacks return success then it must be somebody else who is
unhappy.
Try building partial graph (remove A/V decoders and renderers) and see what
happens.

I remember that stupid InterVideo decoders would expire (if you are using
trial version of InterVideo package) and then quietly stop working by
failing state transition. At the same time their own DVD player app
continued to work fine. You gotta love those guys.

-- Max.




"dos" <dos(a)discussions.microsoft.com> wrote in message
news:D85045A6-6CD4-4994-8665-4BD62966CC5F(a)microsoft.com...
> Yes, output A/V pins are separately connected with audio and video
> decoder.
> Here is the code for changing state. It's just TestCap sample code without
> any modification:
> ///////////////////////////
> Set State
> switch (pSrb->CommandData.StreamState)
>
> {
> case KSSTATE_STOP:
>
> //
> // The stream class will cancel all outstanding IRPs for us
> // (but only if it is maintaining the queue ie. using Stream Class
> synchronization)
> // Since Testcap is not using Stream Class synchronization, we must
> clear the queue here
>
> VideoQueueCancelAllSRBs (pStrmEx);
>
> DbgLogInfo(("TestCap: STATE Stopped, Stream=%d\n", StreamNumber));
> break;
>
> case KSSTATE_ACQUIRE:
>
> //
> // This is a KS only state, that has no correspondence in
> DirectShow
> //
> DbgLogInfo(("TestCap: STATE Acquire, Stream=%d\n", StreamNumber));
> break;
>
> case KSSTATE_PAUSE:
>
> //
> // On a transition to pause from acquire or stop, start our timer
> running.
> //
>
> if (PreviousState == KSSTATE_ACQUIRE || PreviousState ==
> KSSTATE_STOP) {
>
> // Zero the frame counters
> pStrmEx->FrameInfo.PictureNumber = 0;
> pStrmEx->FrameInfo.DropCount = 0;
> pStrmEx->FrameInfo.dwFrameFlags = 0;
>
> // Setup the next timer callback(s)
> VideoTimerRoutine(pStrmEx);
> }
> DbgLogInfo(("TestCap: STATE Pause, Stream=%d\n", StreamNumber));
> break;
>
> case KSSTATE_RUN:
>
> //
> // Begin Streaming.
> //
>
> // Reset the discontinuity flag
>
> pStrmEx->fDiscontinuity = FALSE;
>
> // Setting the NextFrame time to zero will cause the value to be
> // reset from the stream time
>
> pStrmEx->QST_NextFrame = 0;
>
> DbgLogInfo(("TestCap: STATE Run, Stream=%d\n", StreamNumber));
> break;
>
> } // end switch (pSrb->CommandData.StreamState)
>
> ///////////////////////
> Get State
> pSrb->CommandData.StreamState = pStrmEx->KSState;
> pSrb->ActualBytesTransferred = sizeof (KSSTATE);
>
> // A very odd rule:
> // When transitioning from stop to pause, DShow tries to preroll
> // the graph. Capture sources can't preroll, and indicate this
> // by returning VFW_S_CANT_CUE in user mode. To indicate this
> // condition from drivers, they must return STATUS_NO_DATA_DETECTED
>
> if (pStrmEx->KSState == KSSTATE_PAUSE) {
> pSrb->Status = STATUS_NO_DATA_DETECTED;
> }
>
> dos
>
>
> "Max Paklin" wrote:
>
>> What is your graph topology?
>> Output A/V pins of the demux are connected, aren't they?
>>
>> Now it is time to put some breakpoints in your pin handlers and make sure
>> that state transition is handled correctly.
>>
>> -- Max.
>>
>>
>>
>>
>> "dos" <dos(a)discussions.microsoft.com> wrote in message
>> news:9EC0A3F7-8DA7-4BFB-8CBA-45B752640A65(a)microsoft.com...
>> > Hi Max,
>> >
>> > Thanks for your suggestion!
>> > I change my code in the way your suggested:
>> > static KSDATARANGE StreamFormatMPEG2_Capture =
>> > {
>> > // KSDATARANGE
>> > sizeof (KSDATARANGE), // FormatSize
>> > 0, // Flags
>> > 0, // SampleSize
>> > 0, // Reserved
>> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
>> > MEDIATYPE_Stream
>> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
>> > TRANSPORT,
>> > STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
>> > };
>> > Now, capture pin can be connected with MPEG2 demultiplexer. But when I
>> > "run"
>> > the graph, an error message is shown: "The graph could not change the
>> > state".
>> > The return code is 0x800706f8. It means user buffer is invalid.
>> > Why?
>> >
>> > dos
>> >
>> > "Max Paklin" wrote:
>> >
>> >> I have no samples that I can share on this subject.
>> >> Do you have MPEG2 decoder software on your machine? You can't hook
>> >> MPEG2TS
>> >> output to VMR. It has to go via MPEG2 Demux and MPEG2 A/V Decoders.
>> >>
>> >> -- Max.
>> >>
>> >>
>> >>
>> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
>> >> news:5BA13A1A-6648-4767-9542-99BC05732E0F(a)microsoft.com...
>> >> > Hi Max,
>> >> >
>> >> > Thanks for your suggestion.
>> >> > But my capture pin still can't be connect with VMR in GraphEdit,
>> >> > even
>> >> > after
>> >> > I modified the structure just like your code. Maybe I don't process
>> >> > SRB_GET_DATA_INTERSECTION in a correct way? It's complicated to fill
>> >> > all
>> >> > data
>> >> > structures for separate command. Can you supply any sample code that
>> >> > can
>> >> > capture TS stream by Stream Class minidriver for me?
>> >> > Thanks again.
>> >> >
>> >> > "Max Paklin" wrote:
>> >> >
>> >> >> Your format description is wrong.
>> >> >>
>> >> >> You either tell that it is transport stream and that's where you
>> >> >> use
>> >> >> KS_DATARANGE with
>> >> >> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
>> >> >> > MEDIATYPE_Stream
>> >> >> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE
>> >> >> > MPEG2
>> >> >>
>> >> >> Or you tell the system that you have MPEG2 video and that's when
>> >> >> you
>> >> >> use
>> >> >> KS_DATARANGE_MPEG2_VIDEO and all those MPEG2 goodies.
>> >> >>
>> >> >>
>> >> >> So change the descriptor to simple one (see below) and it should
>> >> >> work.
>> >> >>
>
From: dos on
Hi Max,

I tried DScaler Mpeg2 Video Decoder and Moonlight-Elecard MPEG2 Video
Decoder and got the same result.
Which debugger I can use to trace this bug? KS Studio?
In KS Studio, I tried to connect my capture pin to input pin of Video
Capture Pump. But I got some strange information:

Attempting to get preferred format for pin 0 ...Succeeded.
Preferred Data Format = ...
FormatSize = 64 (0x00000040)
Flags = 64 (0x00000040)
SampleSize = 64 (0x00000040)
Reserved = 64 (0x00000040)
MajorFormat = {00000040-0000-0000-0000-000000000000}
SubFormat = {00000040-0000-0000-0000-000000000000}
Specifier = {00000040-0000-0000-0000-000000000000}

Why this parameters are different with my KSDATARANGE? When and how did KS
Studio get the "preferred format for pin 0"?

Thanks!

dos

"Max Paklin" wrote:

> I don't see anything wrong with the code you posted. As I said before, now
> is a good time to use the debugger to see if there is anything that you are
> failing during state transition. Have you done that?
>
> If all your calbacks return success then it must be somebody else who is
> unhappy.
> Try building partial graph (remove A/V decoders and renderers) and see what
> happens.
>
> I remember that stupid InterVideo decoders would expire (if you are using
> trial version of InterVideo package) and then quietly stop working by
> failing state transition. At the same time their own DVD player app
> continued to work fine. You gotta love those guys.
>
> -- Max.
>
>
>
>
> "dos" <dos(a)discussions.microsoft.com> wrote in message
> news:D85045A6-6CD4-4994-8665-4BD62966CC5F(a)microsoft.com...
> > Yes, output A/V pins are separately connected with audio and video
> > decoder.
> > Here is the code for changing state. It's just TestCap sample code without
> > any modification:
> > ///////////////////////////
> > Set State
> > switch (pSrb->CommandData.StreamState)
> >
> > {
> > case KSSTATE_STOP:
> >
> > //
> > // The stream class will cancel all outstanding IRPs for us
> > // (but only if it is maintaining the queue ie. using Stream Class
> > synchronization)
> > // Since Testcap is not using Stream Class synchronization, we must
> > clear the queue here
> >
> > VideoQueueCancelAllSRBs (pStrmEx);
> >
> > DbgLogInfo(("TestCap: STATE Stopped, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_ACQUIRE:
> >
> > //
> > // This is a KS only state, that has no correspondence in
> > DirectShow
> > //
> > DbgLogInfo(("TestCap: STATE Acquire, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_PAUSE:
> >
> > //
> > // On a transition to pause from acquire or stop, start our timer
> > running.
> > //
> >
> > if (PreviousState == KSSTATE_ACQUIRE || PreviousState ==
> > KSSTATE_STOP) {
> >
> > // Zero the frame counters
> > pStrmEx->FrameInfo.PictureNumber = 0;
> > pStrmEx->FrameInfo.DropCount = 0;
> > pStrmEx->FrameInfo.dwFrameFlags = 0;
> >
> > // Setup the next timer callback(s)
> > VideoTimerRoutine(pStrmEx);
> > }
> > DbgLogInfo(("TestCap: STATE Pause, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_RUN:
> >
> > //
> > // Begin Streaming.
> > //
> >
> > // Reset the discontinuity flag
> >
> > pStrmEx->fDiscontinuity = FALSE;
> >
> > // Setting the NextFrame time to zero will cause the value to be
> > // reset from the stream time
> >
> > pStrmEx->QST_NextFrame = 0;
> >
> > DbgLogInfo(("TestCap: STATE Run, Stream=%d\n", StreamNumber));
> > break;
> >
> > } // end switch (pSrb->CommandData.StreamState)
> >
> > ///////////////////////
> > Get State
> > pSrb->CommandData.StreamState = pStrmEx->KSState;
> > pSrb->ActualBytesTransferred = sizeof (KSSTATE);
> >
> > // A very odd rule:
> > // When transitioning from stop to pause, DShow tries to preroll
> > // the graph. Capture sources can't preroll, and indicate this
> > // by returning VFW_S_CANT_CUE in user mode. To indicate this
> > // condition from drivers, they must return STATUS_NO_DATA_DETECTED
> >
> > if (pStrmEx->KSState == KSSTATE_PAUSE) {
> > pSrb->Status = STATUS_NO_DATA_DETECTED;
> > }
> >
> > dos
> >
> >
> > "Max Paklin" wrote:
> >
> >> What is your graph topology?
> >> Output A/V pins of the demux are connected, aren't they?
> >>
> >> Now it is time to put some breakpoints in your pin handlers and make sure
> >> that state transition is handled correctly.
> >>
> >> -- Max.
> >>
> >>
> >>
> >>
> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> news:9EC0A3F7-8DA7-4BFB-8CBA-45B752640A65(a)microsoft.com...
> >> > Hi Max,
> >> >
> >> > Thanks for your suggestion!
> >> > I change my code in the way your suggested:
> >> > static KSDATARANGE StreamFormatMPEG2_Capture =
> >> > {
> >> > // KSDATARANGE
> >> > sizeof (KSDATARANGE), // FormatSize
> >> > 0, // Flags
> >> > 0, // SampleSize
> >> > 0, // Reserved
> >> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> > MEDIATYPE_Stream
> >> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> >> > TRANSPORT,
> >> > STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> >> > };
> >> > Now, capture pin can be connected with MPEG2 demultiplexer. But when I
> >> > "run"
> >> > the graph, an error message is shown: "The graph could not change the
> >> > state".
> >> > The return code is 0x800706f8. It means user buffer is invalid.
> >> > Why?
> >> >
> >> > dos
> >> >
> >> > "Max Paklin" wrote:
> >> >
> >> >> I have no samples that I can share on this subject.
> >> >> Do you have MPEG2 decoder software on your machine? You can't hook
> >> >> MPEG2TS
> >> >> output to VMR. It has to go via MPEG2 Demux and MPEG2 A/V Decoders.
> >> >>
> >> >> -- Max.
> >> >>
> >> >>
> >> >>
> >> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> >> news:5BA13A1A-6648-4767-9542-99BC05732E0F(a)microsoft.com...
> >> >> > Hi Max,
> >> >> >
> >> >> > Thanks for your suggestion.
> >> >
From: dos on
Hi Max,

I tried DScaler Mpeg2 Video Decoder and Moonlight-Elecard MPEG2 Video
Decoder and got the same result.
Which debugger I can use to trace this bug? KS Studio?
In KS Studio, I tried to connect my capture pin to input pin of Video
Capture Pump. But I got some strange information:

Attempting to get preferred format for pin 0 ...Succeeded.
Preferred Data Format = ...
FormatSize = 64 (0x00000040)
Flags = 64 (0x00000040)
SampleSize = 64 (0x00000040)
Reserved = 64 (0x00000040)
MajorFormat = {00000040-0000-0000-0000-000000000000}
SubFormat = {00000040-0000-0000-0000-000000000000}
Specifier = {00000040-0000-0000-0000-000000000000}

Why this parameters are different with my KSDATARANGE? When and how did KS
Studio get the "preferred format for pin 0"?

Thanks!

dos

"Max Paklin" wrote:

> I don't see anything wrong with the code you posted. As I said before, now
> is a good time to use the debugger to see if there is anything that you are
> failing during state transition. Have you done that?
>
> If all your calbacks return success then it must be somebody else who is
> unhappy.
> Try building partial graph (remove A/V decoders and renderers) and see what
> happens.
>
> I remember that stupid InterVideo decoders would expire (if you are using
> trial version of InterVideo package) and then quietly stop working by
> failing state transition. At the same time their own DVD player app
> continued to work fine. You gotta love those guys.
>
> -- Max.
>
>
>
>
> "dos" <dos(a)discussions.microsoft.com> wrote in message
> news:D85045A6-6CD4-4994-8665-4BD62966CC5F(a)microsoft.com...
> > Yes, output A/V pins are separately connected with audio and video
> > decoder.
> > Here is the code for changing state. It's just TestCap sample code without
> > any modification:
> > ///////////////////////////
> > Set State
> > switch (pSrb->CommandData.StreamState)
> >
> > {
> > case KSSTATE_STOP:
> >
> > //
> > // The stream class will cancel all outstanding IRPs for us
> > // (but only if it is maintaining the queue ie. using Stream Class
> > synchronization)
> > // Since Testcap is not using Stream Class synchronization, we must
> > clear the queue here
> >
> > VideoQueueCancelAllSRBs (pStrmEx);
> >
> > DbgLogInfo(("TestCap: STATE Stopped, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_ACQUIRE:
> >
> > //
> > // This is a KS only state, that has no correspondence in
> > DirectShow
> > //
> > DbgLogInfo(("TestCap: STATE Acquire, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_PAUSE:
> >
> > //
> > // On a transition to pause from acquire or stop, start our timer
> > running.
> > //
> >
> > if (PreviousState == KSSTATE_ACQUIRE || PreviousState ==
> > KSSTATE_STOP) {
> >
> > // Zero the frame counters
> > pStrmEx->FrameInfo.PictureNumber = 0;
> > pStrmEx->FrameInfo.DropCount = 0;
> > pStrmEx->FrameInfo.dwFrameFlags = 0;
> >
> > // Setup the next timer callback(s)
> > VideoTimerRoutine(pStrmEx);
> > }
> > DbgLogInfo(("TestCap: STATE Pause, Stream=%d\n", StreamNumber));
> > break;
> >
> > case KSSTATE_RUN:
> >
> > //
> > // Begin Streaming.
> > //
> >
> > // Reset the discontinuity flag
> >
> > pStrmEx->fDiscontinuity = FALSE;
> >
> > // Setting the NextFrame time to zero will cause the value to be
> > // reset from the stream time
> >
> > pStrmEx->QST_NextFrame = 0;
> >
> > DbgLogInfo(("TestCap: STATE Run, Stream=%d\n", StreamNumber));
> > break;
> >
> > } // end switch (pSrb->CommandData.StreamState)
> >
> > ///////////////////////
> > Get State
> > pSrb->CommandData.StreamState = pStrmEx->KSState;
> > pSrb->ActualBytesTransferred = sizeof (KSSTATE);
> >
> > // A very odd rule:
> > // When transitioning from stop to pause, DShow tries to preroll
> > // the graph. Capture sources can't preroll, and indicate this
> > // by returning VFW_S_CANT_CUE in user mode. To indicate this
> > // condition from drivers, they must return STATUS_NO_DATA_DETECTED
> >
> > if (pStrmEx->KSState == KSSTATE_PAUSE) {
> > pSrb->Status = STATUS_NO_DATA_DETECTED;
> > }
> >
> > dos
> >
> >
> > "Max Paklin" wrote:
> >
> >> What is your graph topology?
> >> Output A/V pins of the demux are connected, aren't they?
> >>
> >> Now it is time to put some breakpoints in your pin handlers and make sure
> >> that state transition is handled correctly.
> >>
> >> -- Max.
> >>
> >>
> >>
> >>
> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> news:9EC0A3F7-8DA7-4BFB-8CBA-45B752640A65(a)microsoft.com...
> >> > Hi Max,
> >> >
> >> > Thanks for your suggestion!
> >> > I change my code in the way your suggested:
> >> > static KSDATARANGE StreamFormatMPEG2_Capture =
> >> > {
> >> > // KSDATARANGE
> >> > sizeof (KSDATARANGE), // FormatSize
> >> > 0, // Flags
> >> > 0, // SampleSize
> >> > 0, // Reserved
> >> > STATIC_KSDATAFORMAT_TYPE_STREAM, // aka.
> >> > MEDIATYPE_Stream
> >> > STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT, //MEDIASUBTYPE MPEG2
> >> > TRANSPORT,
> >> > STATIC_KSDATAFORMAT_SPECIFIER_NONE // aka. None
> >> > };
> >> > Now, capture pin can be connected with MPEG2 demultiplexer. But when I
> >> > "run"
> >> > the graph, an error message is shown: "The graph could not change the
> >> > state".
> >> > The return code is 0x800706f8. It means user buffer is invalid.
> >> > Why?
> >> >
> >> > dos
> >> >
> >> > "Max Paklin" wrote:
> >> >
> >> >> I have no samples that I can share on this subject.
> >> >> Do you have MPEG2 decoder software on your machine? You can't hook
> >> >> MPEG2TS
> >> >> output to VMR. It has to go via MPEG2 Demux and MPEG2 A/V Decoders.
> >> >>
> >> >> -- Max.
> >> >>
> >> >>
> >> >>
> >> >> "dos" <dos(a)discussions.microsoft.com> wrote in message
> >> >> news:5BA13A1A-6648-4767-9542-99BC05732E0F(a)microsoft.com...
> >> >> > Hi Max,
> >> >> >
> >> >> > Thanks for your suggestion.
> >> >
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: dxgkdx.dll
Next: Assigning raw mode to PDO in KMDF problem.