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

Questions about IAMStreamConfig

17 views
Skip to first unread message

Loren Rogers

unread,
Nov 24, 2009, 10:59:25 AM11/24/09
to
Hey gang,
Here's a snippet of what I'm doing to retrieve video capture pin info:

IAMStreamConfig* pStreamConfig = NULL;
hr = pin->QueryInterface(IID_IAMStreamConfig, (void **)
&pStreamConfig);
if(SUCCEEDED(hr))
{
int iCount = 0;
int iSize = 0;
hr = pStreamConfig->GetNumberOfCapabilities(&iCount, &iSize);
if(SUCCEEDED(hr) && iCount > 0)
{
for(int i = 0; i < iCount; i++)
{
AM_MEDIA_TYPE *pType = NULL;
VIDEO_STREAM_CONFIG_CAPS SCC;
hr = pStreamConfig->GetStreamCaps(i, &pType,
reinterpret_cast<BYTE *>(&SCC));
if(SUCCEEDED(hr))
{
...
}
}
}

And I can retrieve compressions/frame sizes for most of my VIDEO
CAPTURE devices. However I just received a "software" video capture
device to where I can put this device into GraphEdit.exe and I can see
in the sizes combo box with the different supported sizes (about 10
sizes). However, the above code will return an 'iCount' of 1 and I
can only see 640x480 as an available size (which by the way is the
default as represented in GraphEdit.exe). Anybody have any ideas?
Thanks
/Loren

Alessandro Angeli

unread,
Nov 24, 2009, 1:00:45 PM11/24/09
to
From: "Loren Rogers"

> And I can retrieve compressions/frame sizes for most of
> my VIDEO CAPTURE devices. However I just received a
> "software" video capture device to where I can put this
> device into GraphEdit.exe and I can see in the sizes
> combo box with the different supported sizes (about 10
> sizes). However, the above code will return an 'iCount'
> of 1 and I can only see 640x480 as an available size

GE uses IPin::EnumMediaTypes(), not IStreamConfig.

IStreamConfig is used by the application to configure the
media type the output pin should use to connect.
IPin::EnumMediaTypes() is used by the pins to negotiate the
connection media type (and that is what GE shows).

The application can use IPin::EnumMediaTypes() to list the
available types instead of using IStreamConfig, but the
default set may be different.

You should look at the VIDEO_STREAM_CONFIG_CAPS structure to
discover what values you can modify in the associated base
AM_MEDIA_TYPE. The pin is not required to return a different
AM_MEDIA_TYPE/VIDEO_STREAM_CONFIG_CAPS pair for each
possible format, but it can return only one and the
VIDEO_STREAM_CONFIG_CAPS tells how to derive the others.


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


Loren Rogers

unread,
Nov 24, 2009, 2:50:22 PM11/24/09
to
On Nov 24, 1:00 pm, "Alessandro Angeli" <nob...@nowhere.in.the.net>
wrote:

Thank you so much Alessandro for the previous information! I did
attempt to implement the IEnumMediaTypes on the IPin interface with
the same results as IAMStreamConfig (1 AMT) for this particular
device. I am not sure what you meant by the last paragraph where you
suggested I look at the VIDEO_STREAM_CONFIG_CAPS struct. As I see no
information to glean the frame sizes. Thank you so much for you help
thus far.
/Loren

Alessandro Angeli

unread,
Nov 24, 2009, 4:27:31 PM11/24/09
to
From: "Loren Rogers"

> device. I am not sure what you meant by the last
> paragraph where you suggested I look at the
> VIDEO_STREAM_CONFIG_CAPS struct. As I see no information
> to glean the frame sizes. Thank you so much for you help

Read the Remarks section here:

http://msdn.microsoft.com/en-us/library/ms787931.aspx

0 new messages