Abstract
Ogg Vorbis is a
completely open, patent-free, professional audio encoding and streaming
technology
Copy-on-write (COW), sometimes referred to as implicit sharing
or shadowing,is a resource-management technique used in computer programming to
efficiently implement a "duplicate" or "copy" operation
on modifiable resources.  If a resource is duplicated but not modified, it
is not necessary to create a new resource; the resource can be shared between
the copy and the original. 
Modifications must still create a copy, hence the technique: the copy operation
is deferred to the first write. By sharing resources in this way, it is
possible to significantly reduce the resource consumption of 
unmodified copies, while adding a small overhead to resource-modifying
operations.

A GstElement object is created from a factory.Element factories are the basic types retrieved from the GStreamer registry, they describe all plugins and elements that GStreamer can create.
Pads are element's input and output, where you can connect other elements. Pads have specific data handling capabilities,Data types are negotiated between pads using a process called caps negotiation

A bin is
a container for a collection of elements
A pipeline  is a top-level
bin. It provides a bus for the application and manages the synchronization for
its children
buffers are objects for
passing streaming data between elements in the pipeline.
events are objects sent
between elements or from the application to elements, such as EOS, Seek
messages are
objects posted by elements on the pipeline's message bus
queries allow
applications to request information such as duration or current playback
position from the pipeline
Probing is best envisioned as a pad listener. Technically, a probe is nothing more than a callback that can be attached to a pad;The probe notifies you of any activity that happens on the pad, like buffers,events and queries. You can add the probe to a pad.Blocking probes are used to temporarily block pads because they are unlinked or because you are going to unlink them. If the dataflow is not blocked, the pipeline would go into an error state if data is pushed on an unlinked pad. 

gst_init has to be called from the main application. This call will perform the necessary initialization of the library
tags: the first type is stream tags, which describe the content of a stream in a non-technical way. Examples include the author of a song, the title of that very same song or the album it is a part of. 
The other type of metadata is stream-info, which is a somewhat technical
description of the properties of a stream. This can include video size, audio
samplerate, codecs used and so on(read though Caps).
Tag reading is done through a bus in GStreamer,listen for GST_MESSAGE_TAG
messages and handle them as you wish 

adding an element to a bin will disconnect any already existing links. Also, you cannot directly link elements that are not in the same bin or pipeline;When you set a bin or pipeline to a certain target state, 
it will usually
propagate the state change to all elements within the bin or pipeline
automatically;add an element to will take ownership of that element. 
If you destroy the bin,
the element will be dereferenced with it.

A bus is a simple system that takes care of forwarding messages from the streaming threads to an application in its own thread context
streaming threads, that is GstTask, which A GstPad will typically create to
push or pull data to/from the peer pads

A typical stream starts with a stream start event that marks the start of the stream, followed by a segment event that marks the buffer timestamp range. After that buffers are sent one after the other. After the last buffer an EOS marks the end of the stream.

+-----+-------+ +-++-+ +-+ +---+
|START|SEGMENT| |B||B| ... |B| |EOS|
+-----+-------+ +-++-+ +-+ +---+

pipeline: gstreamer will create at least one thread FOR Bus to pass message to appication
Caps are called simple caps when they contain only one structure, and fixed caps when they contain only one structure and have no variable field types 

Synchronization is to make sure that a buffer with a certain running-time is played when the clock reaches the same running-time.
GStreamer uses a GstClock object, buffer timestamps and a SEGMENT event to
synchronize streams in a pipeline

Latency compensation
Before the pipeline goes to the PLAYING state, it will, in addition to
selecting a clock and calculating a base-time, calculate the latency in the
pipeline. 
It does this by doing a LATENCY query on all the sinks in the pipeline. The
pipeline then selects the maximum latency in the pipeline and configures this
with a LATENCY event.
All sink elements will delay playback by the value in the LATENCY event. Since
all sinks delay with the same amount of time, they will be relative in sync

buffering is used to accumulate enough data in a pipeline so that playback can occur smoothly and without interruptions
In the buffering state, the application should keep the pipeline in the PAUSED
state

"Appsrc” (an imaginary source) and “appsink” (an imaginary sink) can be used to inject data into or grab the output from a pipeline

Playbin is the recommended solution for everything related to simple playback of media that should just work
decodebin is a more flexible autoplugger ,which is is the actual autoplugger
backend of playbin
uridecodebin element is very similar to decodebin, only that it automatically
plugs a source plugin based on the protocol of the URI given.
The playsink element is a powerful sink element. It has request pads for raw
decoded audio, video and text and it will configure itself to play the media
streams

GST_STATE_PAUSED is the state in which an element is ready to accept and handle data. For most elements this state is the same as PLAYING. The only exception to this rule are sink elements. Sink elements only accept one single buffer of data and then block. At this point the pipeline is 'prerolled' and ready to render data immediately

Pad works in push-mode/pull-mode:

Gstreamer lib organizaiton:

usefule tips for coding with gstreamer:

gst-launch -v src ! decodebin ! sink
// this is very useful when try to find out the elements your need!
gst-inspect plugin/element
Elements will write output to GStreamer debugging system to log what they're doing
GStreamer-based applications accept the commandline option --gst-debug=LIST

 

gstreamer的更多相关文章

  1. GStreamer 记录

    GStreamer 是一个新的多媒体框架,大大简化了多媒体工具的开发流程,比如,这里有一个 IBM 的文档,介绍了一个 MP3 播放器. http://www.ibm.com/developerwor ...

  2. Linux No volume control GStreamer plugins and/or devices found

    案例环境:Oracle Linux Server release 5.7 进入Oracle Linux系统后,在右上角点击声音图标时,则会弹出如下报错窗口: The volume control di ...

  3. [quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming

    [quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming http://blog.pi3g.com/2013/08/ffmp ...

  4. ubuntu系统下安装gstreamer的ffmpeg支持

    当您在安装gstreamer到您的ubuntu系统中时,为了更好地进行流媒体开发,需要安装ffmpeg支持,但一般情况下,直接使用 sudo apt-get install gstreamer0.10 ...

  5. Gstreamer基本概念介绍(开发前必读)

    1. 元件(Elements) 元件(element)是GStreamer中最重要的概念.你可以通过创建一系列的元件(Elements),并把它们连接起来,从而让数据流在这个被连接的各个元件(Elem ...

  6. vlc/ffmepg/mplayer/gstreamer/openmax/mpc/ffdshow/directshow

    一些应该学习的开源框架与库用途和差别 一.播放器层次 这个层次上,是直接可以用的软件,已经做完了一切工作,如果我们需要用他们,是不需要写一行代码的,编译通过就可以拿来使用了,对于国内这些山寨公司来说, ...

  7. Gstreamer 数据流线程(GstTask / GstTaskPool)分析

    作者:fengcc 原创文章 转载请注明出处 GStreamer 是一个基于流水线的多媒体框架,基于 GObject,以 C 语言写成. 凭借 GStreamer,程序员可以很容易地创建各种多媒体功能 ...

  8. gstreamer让playbin能够播放rtp over udp流数据

    最近一段时间在研究传屏低延迟传输相关的一些东西.本来想使用gstreamer来验证下rtp over udp传送h264 nal数据相关 的,结果发现竟然不能用playbin来播放rtp的数据!诚然, ...

  9. Gstreamer 中的playback插件

    1. PLAYBACK插件基本介绍 在早期的版本中同时存在playbin和playbin2,但是在最新的版本中,playbin2已经稳定,取代了playbin, playbin不再进行维护.下面是官网 ...

  10. GStreamer Plugin: Embedded video playback halted; module decodebin20 reported: Your GStreamer installation is missing a plug-in.

    标题是在Linux下使用系统yum install 的opencv库来获取视频帧的时候抛出来的错误消息.opencv调用了Gstream的API来处理了视频.错误抛出的代码如下图: http://ub ...

随机推荐

  1. 【概括】C++11/14特性

    c++11 c++14

  2. java枚举(enum)

    1. 创建枚举类型要使用 enum 关键字,隐含了所创建的类型都是 java.lang.Enum (抽象类) 类的子类. enum AccountType { SAVING, FIXED, CURRE ...

  3. centos6.8离线安装nginx

    rpm可从官网下载镜像解压获得,推荐从http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/下载 安装gcc rpm -ivh mpfr-2.4. ...

  4. 搭建VirtualBox虚拟机集群

    ===============================VirtualBox常用网络===============================NetworkAddress Translati ...

  5. C# UpdatePanel加载完毕回调JS

    如果 我们想UpdatePanel加载完成后做一些事情 需要使用js <script type="text/javascript"> //给ScriptManager的 ...

  6. org.apache.jasper.JasperException: Unable to convert string

    最佳实践 不要使用idea生成的模板,头文件宁愿不要省事,除非知道有什么副作用. <!--<!DOCTYPE web-app PUBLIC--> <!--"-//Su ...

  7. python 爬虫得到网页的图片

    import urllib.request,os import re # 获取html 中的内容 def getHtml(url): page=urllib.request.urlopen(url) ...

  8. Redis Fun使用

    using Newtonsoft.Json; using StackExchange.Redis; using System; using System.Configuration; using Sy ...

  9. 微信小程序 后端用Flask实现

    手上有个微信小程序项目,因为对Python相对熟悉一些,打算后端用python写,具体采用python 轻量级的flask框架. 在做的过程中,有些问题需要考虑,记录在下边. 1. 开发的小程序后端怎 ...

  10. Coursera, Machine Learning, Neural Networks: Representation - week4/5

    Neural Network Motivations 想要拟合一条曲线,在feature 很多的情况下,feature的组合也很多,在现实中不适用,比如在computer vision问题中featu ...