码迷,mamicode.com
首页 > Web开发 > 详细

WebRTC 音/视频模块学习中的 DirectSHow接口

时间:2015-08-07 11:14:48      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:directshow   interface   

原英文网址:点击打开链接

有些函数做了翻译,因为太多,有些函数就没做翻译了。


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 中的设备标号,第二个参数是指向媒体类型结构体的指针,第三个参数指向媒体流的配置结构体

关于媒体流的配置结构体,原网页:点击打开链接

技术分享

Members

guid

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.

VideoStandard

The analog video standard supported. The value is a bitwise combination of flags from theAnalogVideoStandard enumeration type, or zero.

InputSize

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.

Note  Deprecated.
MinCroppingSize

Smallest source rectangle allowed. The source rectangle is defined in the rcSource member of theVIDEOINFOHEADER or VIDEOINFOHEADER2 structure.

Note  Deprecated.
MaxCroppingSize

Largest source rectangle allowed.

Note  Deprecated.
CropGranularityX

Horizontal granularity of the source rectangle. This value specifies the increments that are valid betweenMinCroppingSize and MaxCroppingSize.

Note  Deprecated.
CropGranularityY

Vertical granularity of the source rectangle. This value specifies the increments that are valid betweenMinCroppingSize and MaxCroppingSize.

Note  Deprecated.
CropAlignX

Required horizontal alignment of the source rectangle.

Note  Deprecated.
CropAlignY

Required vertical alignment of the source rectangle.

Note  Deprecated.
MinOutputSize

Minimum output size.

Note  Deprecated.
MaxOutputSize

Maximum output size.

Note  Deprecated.
OutputGranularityX

Granularity of the output width. This value specifies the increments that are valid betweenMinOutputSize and MaxOutputSize.

Note  Deprecated.
OutputGranularityY

Granularity of output height. This value specifies the increments that are valid between MinOutputSizeand MaxOutputSize.

Note  Deprecated.
StretchTapsX

Indicates how well the filter can stretch the image horizontally.

Note  Deprecated.
StretchTapsY

Indicates how well the filter can stretch the image vertically.

Note  Deprecated.
ShrinkTapsX

Indicates how well the filter can shrink the image horizontally.

Note  Deprecated.
ShrinkTapsY

Indicates how well the filter can shrink the image vertically.

Note  Deprecated.

The previous four structure members use the following values:

Value Meaning
0

Does not support stretching/shrinking.

1

Uses pixel doubling (stretching) or eliminates pixels (shrinking)

2

Uses interpolation (2 taps)

3 and higher

Uses interpolation (>2 taps)

 

MinFrameInterval

The minimum frame duration, in 100-nanosecond units. This value applies only to capture filters.

MaxFrameInterval

The maximum frame duration, in 100-nanosecond units. This value applies only to capture filters.

MinBitsPerSecond

Minimum data rate this pin can produce.

Note  Deprecated.
MaxBitsPerSecond

Maximum data rate this pin can produce.



3、IAMVideoControl 接口,这个接口让你可以水平或者垂直的反转一幅图片,可以设置一个外部触法按钮来采集图像,软件的方式模拟外部触法,以及列出可用帧率。同样是继承IUnKnown 接口,其中的方法如下:

技术分享




未完。



版权声明:本文为博主原创文章,未经博主允许不得转载。

WebRTC 音/视频模块学习中的 DirectSHow接口

标签:directshow   interface   

原文地址:http://blog.csdn.net/dopamy_busymonkey/article/details/47334443

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!