gstreamer基础教程15-Platform-specific

官网:https://gstreamer.freedesktop.org/

Demo基础教程:https://gstreamer.freedesktop.org/documentation/tutorials/basic/concepts.html

Demo下载地址:git://anongit.freedesktop.org/gstreamer/gst-docs

Goal

尽管GStreamer是一个多平台框架,但并非所有平台上都提供所有元素。例如,视频接收器严重依赖于底层窗口系统,并且需要根据平台选择不同的窗口系统。在使用像playbinautovideosink之类的元素时,通常不需要担心这一点,但是,当您需要使用仅在特定平台上可用的其中一个接收器的情况时,本教程暗示了它们的一些特性。

Even though GStreamer is a multiplatform framework, not all the elements are available on all platforms. For example, the video sinks depend heavily on the underlying windowing system, and a different one needs to be selected depending on the platform. You normally do not need to worry about this when using elements like playbin or autovideosink, but, for those cases when you need to use one of the sinks that are only available on specific platforms, this tutorial hints you some of their peculiarities.

Cross Platform

glimagesink

此视频接收器基于 OpenGLOpenGL ES。它支持按比例缩放图像以减轻混叠。它实现了VideoOverlay接口,因此视频窗口可以重新定位(嵌入其他窗口)。这是大多数平台上推荐的视频接收器。特别是在Android和iOS上,它是唯一可用的视频接收器。它可以被分解为 glupload ! glcolorconvert ! glimagesinkelement将更多的OpenGL硬件加速处理插入到管道中。

This video sink is based on OpenGL or OpenGL ES. It supports rescaling and filtering of the scaled image to alleviate减轻 aliasing. It implements执行 the VideoOverlay interface, so the video window can be re-parented (embedded inside other windows). This is the video sink recommended on most platforms. In particular, on Android and iOS, it is the only available video sink. It can be decomposed into glupload ! glcolorconvert ! glimagesinkelement to insert further OpenGL hardware accelerated processing into the pipeline.

Linux

ximagesink

标准RGB仅基于X的视频接收器。它实现了VideoOverlay接口,因此视频窗口可以重新定位(嵌入其他窗口)。它不支持RGB以外的缩放或颜色格式; 它必须通过不同的方式执行(例如,使用videoscale元素)。

A standard RGB only X-based video sink. It implements the VideoOverlay interface, so the video window can be re-parented (embedded inside other windows). It does not support scaling or color formats other than RGB; it has to be performed by different means (using the videoscale element, for example).

xvimagesink

基于X的视频接收器,使用X视频扩展(Xv)。它实现了VideoOverlay接口,因此视频窗口可以重新定位(嵌入其他窗口)。它可以在GPU上有效地执行缩放。仅当硬件和相应的驱动程序支持Xv扩展时才可用。

An X-based video sink, using the X Video Extension (Xv). It implements the VideoOverlay interface, so the video window can be re-parented (embedded inside other windows). It can perform scaling efficiently, on the GPU. It is only available if the hardware and corresponding drivers support the Xv extension.

alsasink

此音频接收器通过ALSA(高级Linux声音架构)输出到声卡 。这个接收器几乎在所有Linux平台上都可用。它通常被视为声卡的“低级”接口,并且配置起来可能很复杂(请参阅播放教程9:数字音频传递中的注释 )。

This audio sink outputs to the sound card via ALSA (Advanced Linux Sound Architecture). This sink is available on almost every Linux platform. It is often seen as a “low level” interface to the sound card, and can be complicated to configure (See the comment on Playback tutorial 9: Digital audio pass-through).

pulsesink

此接收器向PulseAudio 服务器播放音频。它是声卡的高级抽象,因此比ALSA更容易使用,并提供更高级的功能。不过,众所周知,它在一些较旧的Linux发行版中是不稳定的。

This sink plays audio to a PulseAudio server. It is a higher level abstraction of the sound card than ALSA, and is therefore easier to use and offers more advanced features. It has been known to be unstable on some older Linux distributions, though.

Mac OS X

osxvideosink

这是GOSreamer在Mac OS X上可用的视频接收器。也可以使用glimagesink元素通过OpenGL 进行绘制。

This is the video sink available to GStreamer on Mac OS X. It is also possible to draw using glimagesink using OpenGL.

osxaudiosink

这是Mac OS X上GStreamer唯一可用的音频接收器。

This is the only audio sink available to GStreamer on Mac OS X.

Windows

directdrawsink

这是最古老的Windows视频接收器,基于Direct Draw。它需要DirectX 7,因此几乎在每个当前的Windows平台上都可用。它支持图像的缩放和过滤以减轻混叠。

This is the oldest of the Windows video sinks, based on Direct Draw. It requires DirectX 7, so it is available on almost every current Windows platform. It supports rescaling and filtering of the scaled image to alleviate aliasing.

dshowvideosink

此视频接收器基于Direct Show。它可以使用不同的渲染后端,如 EVR, VMR9 或 VMR7,EVR仅在Windows Vista或更新版本上可用。它支持缩放图像的重新缩放和过滤以减轻混叠。它实现了VideoOverlay接口,因此视频窗口可以重新定位(嵌入其他窗口)。

This video sink is based on Direct Show. It can use different rendering back-ends, like EVRVMR9 or VMR7, EVR only being available on Windows Vista or more recent. It supports rescaling and filtering of the scaled image to alleviate aliasing. It implements the VideoOverlay interface, so the video window can be re-parented (embedded inside other windows).

d3dvideosink

这个视频接收器基于 Direct3D,它是最新的Windows视频接收器。它支持缩放图像的重新缩放和过滤以减轻混叠。它实现了VideoOverlay接口,因此视频窗口可以重新定位(嵌入其他窗口)。

This video sink is based on Direct3D and it’s the most recent Windows video sink. It supports rescaling and filtering of the scaled image to alleviate aliasing. It implements the VideoOverlay interface, so the video window can be re-parented (embedded inside other windows).

directsoundsink

这是Windows的默认音频接收器,基于Direct Sound,可在所有Windows版本中使用。

This is the default audio sink for Windows, based on Direct Sound, which is available in all Windows versions.

dshowdecwrapper

Direct Show是一个类似于GStreamer的多媒体框架。但它们不同,因此它们的管道无法互连。但是,通过此元素,GStreamer可以受益于Direct Show中的解码元素。dshowdecwrapper包装多个Direct Show解码器,以便它们可以嵌入到GStreamer管道中。使用该gst-inspect-1.0工具(参见基础教程10:GStreamer工具)查看可用的解码器。

Direct Show is a multimedia framework similar to GStreamer. They are different enough, though, so that their pipelines cannot be interconnected互相连接. However, through this element, GStreamer can benefit from the decoding elements present in Direct Show. dshowdecwrapper wraps multiple Direct Show decoders so they can be embedded in a GStreamer pipeline. Use the gst-inspect-1.0 tool (see Basic tutorial 10: GStreamer tools) to see the available decoders.

Android

openslessink

这是Android上GStreamer唯一可用的音频接收器。它基于OpenSL ES

This is the only audio sink available to GStreamer on Android. It is based on OpenSL ES.

openslessrc

这是Android上GStreamer唯一可用的音频源。它基于OpenSL ES

This is the only audio source available to GStreamer on Android. It is based on OpenSL ES.

androidmedia

android.media.MediaCodec 是一个Android特定的API,用于访问设备上可用的编解码器,包括硬件编解码器。它是非常用用的,API级别16(JellyBean)和GStreamer可以通过androidmedia插件使用它进行音频和视频解码。在Android上,将硬件解码器连接到glimagesink元素可以产生高性能的零拷贝解码器管道。

android.media.MediaCodec is an Android specific API to access the codecs that are available on the device, including hardware codecs. It is available since API level 16 (JellyBean) and GStreamer can use it via the androidmedia plugin for audio and video decoding. On Android, attaching the hardware decoder to the glimagesink element can produce a high performance zero-copy decodebin pipeline.

ahcsrc

此视频源可以从Android设备上的摄像头捕获,它是androidmedia插件的一部分,并使用android.hardware.Camera API

This video source can capture from the cameras on Android devices, it is part of the androidmedia plugin and uses the android.hardware.Camera API.

iOS

osxaudiosink

这是iOS上GStreamer唯一可用的音频接收器

This is the only audio sink available to GStreamer on iOS.

iosassetsrc

读取iOS资源的源元素,即存储在库中的文档(如照片,音乐和视频)。playbin当URI使用该assets-library://方案时,它可以自动实例化。

Source element to read iOS assets, this is, documents stored in the Library (like photos, music and videos). It can be instantiated automatically by playbin when URIs use the assets-library:// scheme.

iosavassetsrc

用于读取和解码iOS视听资产的源元素,即存储在库中的文档(如照片,音乐和视频)。playbin当URI使用该ipod-library://方案时, 它可以自动实例化。解码由系统执行,因此如果可用,将使用专用硬件。

Source element to read and decode iOS audiovisual assets, this is, documents stored in the Library (like photos, music and videos). It can be instantiated automatically by playbin when URIs use the ipod-library:// scheme. Decoding is performed by the system, so dedicated hardware will be used if available.

Conclusion

本教程展示了一些GStreamer元素的一些具体细节,这些元素并非在所有平台上都可用。在使用像playbin或autovideosink这样的多平台元素时,你不必担心它们,但如果手动实例化它们,最好知道它们的个人怪癖。

This tutorial has shown a few specific details about some GStreamer elements which are not available on all platforms. You do not have to worry about them when using multiplatform elements like playbin or autovideosink, but it is good to know their personal quirks if instancing them manually.

It has been a pleasure having you here, and see you soon!

猜你喜欢

转载自blog.csdn.net/knowledgebao/article/details/82865037