Re: Streaming problems with sample grabber
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.audio only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... directx.audio Profile…
 Up
Re: Streaming problems with sample grabber         


Author: mark
Date: Dec 5, 2006 02:52

"Chris P." chrisnet.net> wrote in message
news:1wewkbegfjlcb$.10zuyiu0ciky2$.dlg@40tude.net...
> On Mon, 4 Dec 2006 14:10:54 -0000, mark wrote:
>
>>
>> To stream the data I am the callback mechanism with the sample grabber.
>> I
>> store the data in the callback and keep a running total of the number of
>> bytes I have stored. I get this number from
>> IMediaSample::GetActualDataLength();. I use this running total in the
>> fwrite() when appending to the wav file. My hunch is that the last
>> packet
>> of data does not contain just data but also has extra bytes?
>>
>> Any ideas? I have been tearing my hair out with this!
>
> You are using GetActualDataLength() which is correct, so either you are
> parsing the input data incorrectly, using the conversion routines
> incorrectly or the upstream filter is not correctly setting the length.
> ...
Show full article (2.97Kb)
1 Comment
Re: Streaming problems with sample grabber         


Author: Chris P.
Date: Dec 5, 2006 06:33

On Tue, 5 Dec 2006 10:52:51 -0000, mark wrote:
...
> I understood the sample grabber would do the conversion for me if I set the
> media type correctly, are there other conversion routines? I set the media
> type like this:

Not entirely correct. The SampleGrabber doesn't do any conversion at all.
What actually happens is that the graph manager will discover when it
attempts to connect the pins that your pin for the SampleGrabber is
incompatible, and Intelligent Connect will search for intermediate filters
to do the conversion. This will result in a decoder filter of some
description being inserted.
> One thing I have noticed after stepping through the code is that I use
> IMediaSeeking::SetPositoins() to set the position of the chunk to be
> decoded. First time through current = 0 and stop = amount of time to decode
> this is fine, next time round when current = last stop time and stop = stop
> + amount to decode the call fails, it returns S_FALSE which suggests the
> positions were already set. I use AM_SEEKING_AbsolutePositioning and I have
> checked the media supports positioning.
Show full article (1.84Kb)
no comments