I need to create Directshow filter that's similar to "Capture" filter that loads either an input audio/video file and send buffer data to upstream to AVStream driver. How can I approach this? Thanks.
On Mon, 7 Apr 2008 16:38:26 -0700 (PDT), gottoit7@gmail.com wrote: > I need to create Directshow filter that's similar to "Capture" filter > that loads either an input audio/video file and send buffer data to > upstream to AVStream driver. How can I approach this? Thanks. What do you mean here by "upstream"? What will it be connected to? -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
On Apr 8, 8:27 am, "Chris P." wrote: > On Mon, 7 Apr 2008 16:38:26 -0700 (PDT), gotto...@gmail.com wrote: > > I need to create Directshow filter that's similar to "Capture" filter > > that loads either an input audio/video file and send buffer data to > > upstream to AVStream driver. How can I approach this? Thanks. > > What do you mean here by "upstream"? > > What will it be connected to? > > --http://www.chrisnet.net/code.htm > [MS MVP for DirectShow / MediaFoundation] Basically I want to make a filter that's able to load an input file (e.g. .mpeg file or .wav file) then feed it to my AVStream class driver. Then when I hit play in GraphEdit, it'll stream the file. Like picture below in a graph. ______________________ ________________ _______________ | Test.mpeg or Audio.wav | ==> | Custom Filter | ==> | Render Filter | |_____________________| |________________| | _______________|
On Apr 8, 8:27 am, "Chris P." wrote: > What do you mean here by "upstream"? > What will it be connected to? Basically I want to make a filter that's able to load an input file (e.g. .mpeg file or .wav file) then feed it to my AVStream class driver. Then when I hit play in GraphEdit, it'll stream the file. Like picture below in a graph. |Test.mpeg | ==> | Custom Filter | ==> |RenderFilter |
On Tue, 8 Apr 2008 10:52:40 -0700 (PDT), gottoit7@gmail.com wrote: > Basically I want to make a filter that's able to load an input file > (e.g. .mpeg file or .wav file) then feed it to my AVStream class > driver. Then when I hit play in GraphEdit, it'll stream the file. > Like picture below in a graph. > >|Test.mpeg | ==> | Custom Filter | ==> |RenderFilter | How about making a sub-graph like above with a custom renderer filter, rather than playing the audio to the sound card it delivers the audio stream to you class driver via a private connection. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
> > How about making a sub-graph like above with a custom renderer filter, > rather than playing the audio to the sound card it delivers the audio > stream to you class driver via a private connection. Thanks for the reply. But I want to create a filter that loads an input file and send data packets to my AVS driver. How I can I achieve such filter.
On Tue, 8 Apr 2008 12:16:53 -0700 (PDT), gottoit7@gmail.com wrote: >> >> How about making a sub-graph like above with a custom renderer filter, >> rather than playing the audio to the sound card it delivers the audio >> stream to you class driver via a private connection. > > Thanks for the reply. But I want to create a filter that loads an > input file and send data packets to my AVS driver. How I can I > achieve such filter. You place the DirectShow graph I described inside the filter. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
On Apr 8, 3:41 pm, "Chris P." wrote: > On Tue, 8 Apr 2008 12:16:53 -0700 (PDT), gotto...@gmail.com wrote: > > >> How about making a sub-graph like above with a custom renderer filter, > >> rather than playing the audio to the sound card it delivers the audio > >> stream to you class driver via a private connection. > > > Thanks for the reply. But I want to create a filter that loads an > > input file and send data packets to my AVS driver. How I can I > > achieve such filter. > > You place the DirectShow graph I described inside the filter. > > --http://www.chrisnet.net/code.htm > [MS MVP for DirectShow / MediaFoundation] So how do I do what you just described "make a sub-graph with a custom renderer filter that delivers the audio stream to the class driver via a private connection" then place this graph inside the filter? I need more guiding, please. Thanks.
On Tue, 8 Apr 2008 15:54:39 -0700 (PDT), gottoit7@gmail.com wrote: > So how do I do what you just described "make a sub-graph with a custom > renderer filter that delivers the audio > stream to the class driver via a private connection" then place this > graph inside the filter? I need more guiding, please. Thanks. As was making the assumption that your custom AVStream class driver is a source, if this is incorrect let me know. Step 1. Start with a test project outside of the filter. Create a DirectShow graph and insert a SampleGrabber (configured for PCM mediatype) and a NULL_Renderer, and then call RenderFile() with the filename of the source file. Implement a SampleGrabber callback function to receive the samples. Once you are happy that you are receiving the PCM sample data correctly move on to step 2. Step 2. Test out if you can successfully integrate the above DirectShow graph directly inside your AVStream driver. Step 3. Create a custom renderer filter and eliminate the SampleGrabber and NULL_Renderer. This will allow you to have better control over the timing and data deliver. Step 4. Test the final package. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
> As was making the assumption that your custom AVStream class driver is a > source, if this is incorrect let me know. Just to verify, the source is an input file (.wav or .mpg) that I need to send up to my AVS driver. Also, how can i verify the PCM sample data I received is matching with the input? Thank you.
On Thu, 10 Apr 2008 19:16:36 -0700 (PDT), gottoit7@gmail.com wrote: > Just to verify, the source is an input file (.wav or .mpg) that I need > to send up to my AVS driver. Also, how can i verify the PCM sample > data I received is matching with the input? Thank you. I still don't understand exactly what your AVS driver is doing so I can't tell if this is the easiest or best approach. You need to describe better what purpose the AVS driver is serving here. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
On Apr 11, 7:00 am, "Chris P." wrote: > On Thu, 10 Apr 2008 19:16:36 -0700 (PDT), gotto...@gmail.com wrote: > > Just to verify, the source is an input file (.wav or .mpg) that I need > > to send up to my AVS driver. Also, how can i verify the PCM sample > > data I received is matching with the input? Thank you. > > I still don't understand exactly what your AVS driver is doing so I can't > tell if this is the easiest or best approach. You need to describe better > what purpose the AVS driver is serving here. > > --http://www.chrisnet.net/code.htm > [MS MVP for DirectShow / MediaFoundation] My AVStream driver is a video capture driver that has Crossbar Filter & Capture Filter already integrated in the driver. It's able to do downstream video. So my question is how can I do "UPSTREAM" to my device ? Thanks.
On Mon, 14 Apr 2008 13:45:32 -0700 (PDT), gottoit7@gmail.com wrote: > My AVStream driver is a video capture driver that has Crossbar Filter > & Capture Filter already integrated in the driver. It's able to do > downstream video. So my question is how can I do "UPSTREAM" to my > device ? Thanks. There is no such thing as upstream, you can only simulate it by pulling the data from file and delivering it with appropriate timing. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]
On Apr 21, 10:45 am, "Chris P." wrote: > On Mon, 14 Apr 2008 13:45:32 -0700 (PDT), gotto...@gmail.com wrote: > > My AVStream driver is a video capture driver that has Crossbar Filter > > & Capture Filter already integrated in the driver. It's able to do > > downstream video. So my question is how can I do "UPSTREAM" to my > > device ? Thanks. > > There is no such thing as upstream, you can only simulate it by pulling the > data from file and delivering it with appropriate timing. > > --http://www.chrisnet.net/code.htm > [MS MVP for DirectShow / MediaFoundation] 1) So to achieve this, how I correctly get data from video file (.asf)? 2) Would I just deliver the data (IMediaSample) to output pin of my capture filter? 3) Do I have to do any conversion before deliver the data? 4) While delivering the data to output pin, how do I manage good timing? Which base class to use? Thanks a lot.
On Thu, 24 Apr 2008 18:37:07 -0700 (PDT), gottoit7@gmail.com wrote: > 1) So to achieve this, how I correctly get data from video file > (.asf)? I would use the IWMReader directly. > 2) Would I just deliver the data (IMediaSample) to output pin of my > capture filter? Basically yes. > 3) Do I have to do any conversion before deliver the data? Shouldn't have to. You will have the option of outputting compressed or uncompressed data. > 4) While delivering the data to output pin, how do I manage good > timing? Which base class to use? Maintaining accurate timing is optional and whether or not it is necessary will depend on the intended use. If you do maintain the timing you can use the timestamp on the samples. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]