1. playbin2
struct _GstPlayBin
{
GstPipeline parent;
GMutex
*lock;
GstSourceGroup
groups[2];
GstSourceGroup
*curr_group;
GstSourceGroup
*next_group;
guint
connection_speed;
gint
current_video;
gint
current_audio;
gint
current_text;
guint64
buffer_duration;
guint
buffer_size;
GstPlaySink *playsink; //
sink也可能是一个bin
GstElement *source;
GMutex *dyn_lock;
gint shutdown;
GMutex *elements_lock;
guint32 elements_cookie;
GValueArray
*elements;
gboolean
have_selector;
GstElement
*audio_sink;
GstElement
*video_sink;
GstElement
*text_sink;
struct
{
gboolean
valid;
GstFormat
format;
gint64
duration;
}
duration[5];
GstSegment
segments[3];
};
2. Playsink
在playbin2的playsink中构建了一些chain:
struct _GstPlaySink
{
GstBin
bin;
GstPlayAudioChain *audiochain;
GstPlayVideoDeinterlaceChain *videodeinterlacechain;
GstPlayVideoChain *videochain;
GstPlayVisChain *vischain;
GstPlayTextChain *textchain;
}
其中:
audiochain:
videoChain:
textChain:
videodeinterlacechain:
vischain:
chain的数据结构:
从上面的数据结构可以看到,chain就是一个bin包含了一个完整的flow。每一个bin包含property,并且需要绑定signal和callback函数: