Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Directshow Filter Properties c++

423 views
Skip to first unread message

Alessandro Angeli

unread,
Jan 24, 2008, 1:17:40 PM1/24/08
to
From: "Ademar"

> I惴 trying to create a filter graph, and at this point I
> can show the dialog box with the compression filters
> properties. But I can愒 access that properties so I can
> save them, for later load the graph and the filters
> properties.

There is no standard way to save/restore the state of a
filter. Most filters support one or more of the following:

- IPersistStream: the state is saved to an
application-provided IStream as an opaque binary blob

- IPersistPropertyBag: the state is saved to an
application-provided IPropertyBag as a set of name/value
pairs

- IAMVfwCompressDialogs: the state is saved to an
application-provided buffer as an opaque binary blob (notice
that IAMVfwCompressDialogs::SetState() may not work as
expected, while
IAMVfwCompressDialogs::SendDriverMessage(ICM_SETSTATE) is
more reliable)

http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/b4c33ece9202a060

- ISpecifyPropertyPages: the state is modified through the
provided IPropertyPage GUI and, depending on the filter's
behavior, it may also be saved to some filter-specific
storage (usually a global file or registry key); you can
programmatically use the GUI to save/restore the state, but
it is GUI-specific and requires quite a bit of work:

http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/2390b9b3538561ce
http://groups.google.com/group/microsoft.public.multimedia.directx.dshow.programming/browse_thread/thread/1fe03eb5d363275c

- IFileSourceFilter, IFileSinkFilter: to save/restore the
file name/URL in source/sink filters

- IDMOWrapperFilter: to save/restore the configuration of
the DMOWrapper

- IAMStreamConfig, IAMVideoCompression: to save/restore the
state of output pins (used by some capture and compression
filters)

- a custom interface: filter-specific; besides third-party
filters, also several stock ones have specific documented
interfaces to change their configuration (e.g. the
MPEG2Demultiplexer, the Line21Decoder, the stock audio and
video renderers, the WindowsMedia filters...)

Even if a filter supports saving its state, it may not
support restoring it.

A more complete list of IPersist* interfaces a filter might
support:

IPersistStream
IPersistStreamInit
IPersistStorage
IPersistMemory
IPersistPropertyBag
IPersistPropertyBag2
IPersistFile
IPersistMoniker

> I also used graphedit and saved to a xml file, where
> filter properties are saved at a "value" param, but I
> can愒 load it in my code.

GraphEdit uses the graph manager to save to GRF and the
graph manager uses IPersistStream, if supported by the
filter. To save to XGR, it uses the same technique.

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm

The March Hare [MVP]

unread,
Jan 24, 2008, 1:19:16 PM1/24/08
to
On Thu, 24 Jan 2008 09:18:01 -0800, Ademar wrote:

> I´m trying to create a filter graph, and at this point I can show the dialog
> box with the compression filters properties. But I can´t access that

> properties so I can save them, for later load the graph and the filters
> properties.
>

> I also used graphedit and saved to a xml file, where filter properties are

> saved at a "value" param, but I can´t load it in my code.

Look at the history of this group in Google Groups the question has been
asked many times.

Example search:

http://groups.google.com/groups/search?ie=UTF-8&q=filter+codec++properties+++group%3Amicrosoft.public.win32.programmer.directx.video&qt_s=Search

--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

Ademar

unread,
Jan 24, 2008, 1:46:01 PM1/24/08
to
Thanks for the help!

Regards!

rogerp...@gmail.com

unread,
Apr 13, 2015, 7:32:44 PM4/13/15
to
On Thursday, January 24, 2008 at 11:19:16 AM UTC-7, The March Hare [MVP] wrote:
> On Thu, 24 Jan 2008 09:18:01 -0800, Ademar wrote:
>
> > I´m trying to create a filter graph, and at this point I can show the dialog
> > box with the compression filters properties. But I can´t access that
> > properties so I can save them, for later load the graph and the filters
> > properties.
> >
> > I also used graphedit and saved to a xml file, where filter properties are
> > saved at a "value" param, but I can´t load it in my code.
>
> Look at the history of this group in Google Groups the question has been
> asked many times.
>
> Example search:
>
> http://groups.google.com/groups/search?ie=UTF-8&q=filter+codec++properties+++group%3Amicrosoft.public.win32.programmer.directx.video&qt_s=Search

Hmm that search doesn't seem to work as well as it used to, perhaps, anymore, and I'm a "follower" trying to figure out the same thing [well, similar, how do you use IPersistStream::Load to load a single filter onto a graph]. Any specific links come to mind in this regard?
Cheers!
-roger-
0 new messages