[gst-devel] Souphttpsrc and playbin

Eric Zhang nicolas.m.zhang at gmail.com
Fri Sep 12 03:24:19 CEST 2008


Hi, Raj:

    That's easy. First, connect `notify::source' signal of playbin:

// connect signal
g_signal_connect(G_OBJECT(playbin), "notify::source",
G_CALLBACK(cb_playbin_notify_source), NULL);

Then the callback function(I am working on rtsp recently so the example
source below is a rtspsrc. In your program, this should be souphttpsrc):

static void cb_playbin_notify_source(GObject *obj, GParamSpec *param,
gpointer u_data)
{
    // check whether this is rtsp source
    gchar *objname = GST_OBJECT_NAME(obj);
    g_message("objname is %s", objname);

    // check whether has a `protocols' property
    if (g_object_class_find_property(G_OBJECT_GET_CLASS(obj), "source")) {
        GObject *source_element;
        g_object_get(obj, "source", &source_element, NULL);
        if (g_object_class_find_property(G_OBJECT_GET_CLASS(source_element),
"protocols")) {
            g_object_set(source_element, "protocols", 1, NULL);
        }
        g_object_unref(source_element);
    }
}

Eric Zhang


2008/9/12 Raj Swaminathan <rajshyam at gmail.com>

> Hi,
>
> I am trying to stream an Internet Radio Channel with playbin. I am going
> through a proxy and can use gst-launch in this way to successfully play the
> station:
>
> gst-launch souphttpsrc proxy=http://proxyURL location=http://myIRadio.com.
> ! mad ! alsasink
>
> I do not need to use gst-launch and am actually building my own software
> media player ....
>
> When i do not setup proxy but just run my mediaplayer with playbin, I just
> wait on an endless loop and get the following debug message on cancelling..
> gstsouphttpsrc.c(683): gst_soup_http_src_finished_cb(): /play/source
> libsoup status code 1
> Error: Cancelled
>
> So playbin is trying to use souphttpsrc but Im assuming the error is becoz
> the proxy is not set .....
> Can someone plz suggest how to set the proxy property with souphttpsrc and
> still use playbin v1 ?
>
> Thanks,
> raj
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080912/a31b2add/attachment.htm>


More information about the gstreamer-devel mailing list