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
> 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
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
> 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