push source filter

push source filter

Post by Song » Thu, 22 Apr 2004 10:12:48


Dear All!

I'd like to develop a Push Source Filter(DirectShow program)
which load the stream from the board.
I got the stream from the board using software SDK.
The stream code has a thread function.
I have no idea about in which method of CSource(or CBaseFilter) Class
the thread function should be written.

Please give me some information

Best Regards,
Song
 
 
 

push source filter

Post by Thore Karl » Thu, 22 Apr 2004 10:28:29


Did you actually read the documentation for CSource? Did you look at the
descriptions for the functions you are meant to override? The answer is
right there.

--
Be seeing you.

 
 
 

push source filter

Post by Song » Thu, 22 Apr 2004 11:16:42


Dear Thore Karlsen

Thank you for your answer!

I have two books about directshow and directshow SDK .
I read a great part of one book two or three times
(read the part of push source filter part four or five times)
and read the push source filter part of the other book
(published by Microsoft Press) one or two times
and read the source filter part of directshow SDK
two or three times.
But I think the content about the push source filter part is
a sort of simple and the content about push source filter
using stream from video card is little included.

I suppose the GetPin and GetPinCount method may be associated with
push source filter for stream from board.
Is it right?

Please recommend the documentation for push source filter.

Best Regards,
Song
 
 
 

push source filter

Post by Pablo Fern » Fri, 03 Sep 2004 18:21:53

Hallo,
I developing a Push Source Filter with two classes:
1. "CReader" class derived form CSource and IFileSourceFilter.
2. "CReaderOutputPin class derived from CSourceStream.

I have to read and send the information from a a special format file. I have
4 files, 1 text file with the characteristics of the video sequence and 3
files with the bitmap information (with the same name but different
extension) .

First I load the text file from disk with help from IFileSourceFilter
Interface, but how can I read the information from this text file and then
also read and transmit to the output pin the samples from the other files?

Thanks,
Pablo.
 
 
 

push source filter

Post by Pablo Fern » Sat, 04 Sep 2004 16:50:45

nobody can help me?
 
 
 

push source filter

Post by Tim Robert » Mon, 06 Sep 2004 14:59:23


If all you need to do is read a file, why are you using IFileSourceFilter?
Why don't you just use CreateFile and ReadFile?
--
- Tim Roberts, XXXX@XXXXX.COM
Providenza & Boekelheide, Inc
 
 
 

push source filter

Post by Pablo Fern » Tue, 07 Sep 2004 22:31:42

Hi,


I need to read three files and send the information downstream, it a
source filter. I think I have to use also Load and GetCurFile methods from
IFileSourceFilter Interface. Don you think so?

Thanks,
Pablo.
 
 
 

push source filter

Post by Dmitry Nik » Wed, 08 Sep 2004 00:16:40

> > If all you need to do is read a file, why are you using
IFileSourceFilter?

You can use IFileSourceFilter, but it's the bad approach. See DirectX SDK
Remarks section in IFileSourceFilter::Load(): "This is an initialization
method for the interface. It is not designed to load multiple files, and any
calls to this method after the first call will fail." That the
IFileSourceFilter:: GetCurfile() function should return if you will open two
files? The more correct approach - to use custom interface, for sample:

[object, local, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]
interface ISomeFilesSourceFilter : IUnknown
{
HRESULT LoadFiles([in] DWORD nFiles, [in] LPCOLESTR*
ppszArrayFileNames);
HRESULT GetCurFiles([out] DWORD* pnFiles, [out] LPCOLESTR*
ppszArrayFileNames);
};

Wbr,
DKN
 
 
 

push source filter

Post by Dmitry Nik » Wed, 08 Sep 2004 00:27:39

Hi!


Sorry, I was not attentive. You can write names of additional files in the
text file, load text file with IFileSourceFilter::Load() and parse this text
file for names of additional files and their any parameters.

DKN
 
 
 

push source filter

Post by Pablo Fern » Wed, 08 Sep 2004 16:57:56

> Sorry, I was not attentive. You can write names of additional files in the

The name of the 4 files is the same, but with different and known
extensions.
 
 
 

push source filter

Post by Dmitry Nik » Wed, 08 Sep 2004 21:36:39

Hi!

If I correctly have understood your problem, you should make (I give only
main steps):

1. Creating filter chain with your source filter:
- creating your filter;
- inserting your filter into graph;
- to call IFileSource::Load()
- opening all four files;
- loading from files data for create output pin's mediatype;
- preparing allocator properties for output pin;
- connecting output pin to input pin of downstream filter;
- to agree allocator properties and to get allocator.

2. Waiting for IMediaFilter::Run():
- creating work thread;
- waiting Run() command in work thread.

3. Sending samples (inner loop of work thread):
- reading data from files;
- creating new video frame;
- getting new sample from allocator;
- getting buffer pointer from sample;
- to put video frame into buffer;
- to put sample parameters (media times/time stamps/flags/etc.) into
sample;
- sending sample to input pin of downstream filter (call of
IMemInputPin::Receive());
- to release last sample after return from IMemInputPin::Receive();
- expect a moment of sending of the following sample.

4. To stop sending samples after call of IMediaFilter::Pause() or
IMediaFilter::Stop()

5. To close all files at IBaseFilter::JoinFilterGraph(NULL,...)

Wbr,
DKN
 
 
 

push source filter

Post by Anura » Sat, 22 Oct 2005 03:03:41

Hello Everyone

I am new to DirectShow and just have started development of writing a
Push Source Filter which
1) Captures mpeg1 stream from the ipcamera using udp/tcp
2) Send it across to Mpeg Splitter filter.

Though I am trying for negotiation between O/p pin of my filter to I/p
Pin of MpegSplitter filter, i was not able to achieve. Can anyone
guide with negotiation of pins.

Thank You in advance

Best Regards
Anurag.
 
 
 

push source filter

Post by Thore Karl » Sat, 22 Oct 2005 03:17:02


What media type are you exposing on your output pin? Have you tried
placing a breakpoint in CSourceStream::CheckMediaType() to see what
media types are being attempted and rejected?

--
New to newsgroups? Read: http://www.yqcomputer.com/
 
 
 

push source filter

Post by Alessandro » Sat, 22 Oct 2005 03:46:32


Th Mpeg2Splitter (CLSID_MMSPLITTER) only works in pull-mode.
The Mpeg2Demux (CLSID_MPEG2Demultiplexer) on XP/2003
supports push-mode instead.

--
// Alessandro Angeli
// MVP :: DigitalMedia
// a dot angeli at psynet dot net