Discussion:
How to read the content of the PropertyPage?
(too old to reply)
Reve
2008-11-15 16:29:42 UTC
Permalink
A click on a filter's output pin brings up the property page with info like
this:


Video Properties
***********************
Video (Tab)
-----------
Major Type: Video

Sub Type: RGB24
Format: YUV 360x-240, 12 bits
reSrc={8,0,360,240}
rcDst{0,0,0,0}
=====================


How to read the text above from application? ISpecifyPropertyPages doesn't
work for me.
Michel Roujansky - [MS MVP DirectShow/MediaFoundation]
2008-12-06 17:20:18 UTC
Permalink
Post by Reve
A click on a filter's output pin brings up the property page with info like
Video Properties
***********************
Video (Tab)
-----------
Major Type: Video
Sub Type: RGB24
Format: YUV 360x-240, 12 bits
reSrc={8,0,360,240}
rcDst{0,0,0,0}
=====================
How to read the text above from application? ISpecifyPropertyPages doesn't
work for me.
You have to get the ConnectionMediaType from the output pin itself.
If you only have a reference to the filter, use findpin or enumerate
the pins to get the output pin.
babgvant
2008-12-07 17:16:13 UTC
Permalink
Post by Michel Roujansky - [MS MVP DirectShow/MediaFoundation]
You have to get the ConnectionMediaType from the output pin itself.
If you only have a reference to the filter, use findpin or enumerate
the pins to get the output pin.
e.g.

IPin pin = DsFindPin.ByDirection(filter, PinDirection.Input, 0);

hr = pin.ConnectionMediaType(pmt);
DsError.ThrowExceptionForHR(hr);

if (pmt.formatType == FormatType.VideoInfo2)
{
VideoInfoHeader2 vih2 = (VideoInfoHeader2)Marshal.PtrToStructure
(pmt.formatPtr, typeof(VideoInfoHeader2));
}
else if (pmt.formatType == FormatType.VideoInfo)
{
VideoInfoHeader vih = (VideoInfoHeader)Marshal.PtrToStructure
(pmt.formatPtr, typeof(VideoInfoHeader));
}

Loading...