Appsrc and Playbin
Brendan Long
self at brendanlong.com
Fri May 17 13:48:04 PDT 2013
What doesn't work about this code? What problem are you having?
On 05/16/2013 06:09 AM, Sasha1987 wrote:
> Good day, is it posible to use playbin and appsrc for playing video and audio
> stream at once? Now i found example how to get appsrc out of Playbin.
> struct _App
> {
> GstElement *playbin;
> GstElement *appsrc;
>
> GMainLoop *loop;
>
> GMappedFile *file;
> guint8 *data;
> gsize length;
> guint64 offset;
> };
> app->playbin = gst_element_factory_make ("playbin2", NULL);
> g_assert (app->playbin);
>
> bus = gst_pipeline_get_bus (GST_PIPELINE (app->playbin));
>
> /* add watch for messages */
> gst_bus_add_watch (bus, (GstBusFunc) bus_message, app);
>
> /* set to read from appsrc */
> g_object_set (app->playbin, "uri", "appsrc://", NULL);
>
> /* get notification when the source is created so that we get a handle to
> it
> * and can configure it */
> g_signal_connect (app->playbin, "deep-notify::source",
> (GCallback) found_source, app);
>
> found_source (GObject * object, GObject * orig, GParamSpec * pspec, App *
> app)
> {
> g_object_get (orig, pspec->name, &app->appsrc, NULL);
> g_object_set (app->appsrc, "size", (gint64) app->length, NULL);
> g_signal_connect (app->appsrc, "need-data", G_CALLBACK (feed_data), app);
> }
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Appsrc-and-Playbin-tp4659959.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130517/16d63293/attachment.pgp>
More information about the gstreamer-devel
mailing list