原英文网址:点击打开链接
有些函数做了翻译,因为太多,有些函数就没做翻译了。
1、IAMExtDevice 接口:这个接口继承 IUnKnown 接口,控制设备的基本函数,其中的一些方法如下:
2、IAMStreamConfig 接口,在确定的采集和压缩过滤器上设置一些输出格式,同时设置音频/视频。用户能使用这个接口设置一些属性,比如:视频的输出路数和帧率,音频的采样率和通道数。同样是继承 IUnKnown 接口,其中一些方法如下:
注意,过滤器需要在他们的输出 IPin 上获得 IAMStreamConfig 接口,所以在使用该接口之前要枚举过滤器的 PIn,或者你也可以使用 Capture Graph Builder 对象来建立filter graph,你可以调用ICaptureGraphBuilder2::FindInterface 方法.注意在采集的时候可能要区分采集Pin和预览Pin。
IAMStreamConfig::GetNumberOfCapabilities () 方法的函数原型如下:
HRESULT GetNumberOfCapabilities( int* piCount, int* piSize );第一个参数用来保存所有可支持的音频/视频设备的数量,第二个参数用来保存配置AUDIO_STREAM_CONFIG_CAPS 或者 VIDEO_STREAM_CONFIG_CAPS,结构体的大小。
IAMStreamConfig::GetStreamCaps () 方法的函数原型如下:
HRESULT GetStreamCaps( int iIndex, AM_MEDIA_TYPE** pmt, BYTE* pSCC );
这个方法获取音频、视频或者其他数据流的所依靠的结构体类型,在 pSCC中被指出,第一个参数是与GetNumberOfCapabilities方法对应piCount 中的设备标号,第二个参数是指向媒体类型结构体的指针,第三个参数指向媒体流的配置结构体。
关于媒体流的配置结构体,原网页:点击打开链接
GUID that identifies the format type. For example, FORMAT_VideoInfo or FORMAT_VideoInfo2. For more information, see the formattype member of the AM_MEDIA_TYPE structure.
The analog video standard supported. The value is a bitwise combination of flags from theAnalogVideoStandard enumeration type, or zero.
Native size of the incoming video signal. For a compressor, the size is taken from the input pin. For a capture filter, the size is the largest signal the filter can digitize with every pixel remaining unique.
Smallest source rectangle allowed. The source rectangle is defined in the rcSource member of theVIDEOINFOHEADER or VIDEOINFOHEADER2 structure.
Largest source rectangle allowed.
Horizontal granularity of the source rectangle. This value specifies the increments that are valid betweenMinCroppingSize and MaxCroppingSize.
Vertical granularity of the source rectangle. This value specifies the increments that are valid betweenMinCroppingSize and MaxCroppingSize.
Required horizontal alignment of the source rectangle.
Required vertical alignment of the source rectangle.
Minimum output size.
Maximum output size.
Granularity of the output width. This value specifies the increments that are valid betweenMinOutputSize and MaxOutputSize.
Granularity of output height. This value specifies the increments that are valid between MinOutputSizeand MaxOutputSize.
Indicates how well the filter can stretch the image horizontally.
Indicates how well the filter can stretch the image vertically.
Indicates how well the filter can shrink the image horizontally.
Indicates how well the filter can shrink the image vertically.
The previous four structure members use the following values:
Value | Meaning |
---|---|
|
Does not support stretching/shrinking. |
|
Uses pixel doubling (stretching) or eliminates pixels (shrinking) |
|
Uses interpolation (2 taps) |
|
Uses interpolation (>2 taps) |
The minimum frame duration, in 100-nanosecond units. This value applies only to capture filters.
The maximum frame duration, in 100-nanosecond units. This value applies only to capture filters.
Minimum data rate this pin can produce.
Maximum data rate this pin can produce.
3、IAMVideoControl 接口,这个接口让你可以水平或者垂直的反转一幅图片,可以设置一个外部触法按钮来采集图像,软件的方式模拟外部触法,以及列出可用帧率。同样是继承IUnKnown 接口,其中的方法如下:
未完。
版权声明:本文为博主原创文章,未经博主允许不得转载。
WebRTC 音/视频模块学习中的 DirectSHow接口
原文地址:http://blog.csdn.net/dopamy_busymonkey/article/details/47334443