114
* Creates an instance of a playbin with "audio-src" and
115
* "video-src" ghost pads to allow redirected output streams.
117
* ### This function is probably not required now that MediaObject is based
118
* on decodebin directly.
120
GstElement* GstHelper::createPluggablePlaybin()
122
GstElement *playbin = 0;
123
//init playbin and add to our pipeline
124
playbin = gst_element_factory_make("playbin2", NULL);
126
//Create an identity element to redirect sound
127
GstElement *audioSinkBin = gst_bin_new (NULL);
128
GstElement *audioPipe = gst_element_factory_make("identity", NULL);
129
gst_bin_add(GST_BIN(audioSinkBin), audioPipe);
131
//Create a sinkpad on the identity
132
GstPad *audiopad = gst_element_get_pad (audioPipe, "sink");
133
gst_element_add_pad (audioSinkBin, gst_ghost_pad_new ("sink", audiopad));
134
gst_object_unref (audiopad);
136
//Create an "audio_src" source pad on the playbin
137
GstPad *audioPlaypad = gst_element_get_pad (audioPipe, "src");
138
gst_element_add_pad (playbin, gst_ghost_pad_new ("audio_src", audioPlaypad));
139
gst_object_unref (audioPlaypad);
141
//Done with our audio redirection
142
g_object_set (G_OBJECT(playbin), "audio-sink", audioSinkBin, (const char*)NULL);
144
// * * Redirect video to "video_src" pad : * *
146
//Create an identity element to redirect sound
147
GstElement *videoSinkBin = gst_bin_new (NULL);
148
GstElement *videoPipe = gst_element_factory_make("identity", NULL);
149
gst_bin_add(GST_BIN(videoSinkBin), videoPipe);
151
//Create a sinkpad on the identity
152
GstPad *videopad = gst_element_get_pad (videoPipe, "sink");
153
gst_element_add_pad (videoSinkBin, gst_ghost_pad_new ("sink", videopad));
154
gst_object_unref (videopad);
156
//Create an "audio_src" source pad on the playbin
157
GstPad *videoPlaypad = gst_element_get_pad (videoPipe, "src");
158
gst_element_add_pad (playbin, gst_ghost_pad_new ("video_src", videoPlaypad));
159
gst_object_unref (videoPlaypad);
161
//Done with our video redirection
162
g_object_set (G_OBJECT(playbin), "video-sink", videoSinkBin, (const char*)NULL);
166
111
QString GstHelper::stateName(GstState state)