Playbin unable to play http streaming

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Playbin unable to play http streaming

Debsu
Hi,
I want to play an image or media file from http source through playbin. Soup plugin is installed, through which playbin can read from the http source. But whenever I give the following command :
gst-launch playbin uri=http://www.youtube.com/img/pic_youtubelogo_123x63.gif, it gives me "proxy authentication required" error. Http Proxy is already set in the environment variable and through Curl I can read from that location.

Now in GstSoupHTTPSrc has some properties through which I can set the proxy id and password ("proxy-id", "proxy-pw"). Then I hope this problem will solve.

But how can I add this source element in the Playbin? The GstPlayBaseBin documentation says that its "source" element is only read only property.

Any help is appreciated.

Regards,
Deb
Reply | Threaded
Open this post in threaded view
|

setting http userid/password with playbin (was: Playbin unable to play http streaming)

Tim-Philipp Müller-2
On Wed, 2010-03-03 at 06:02 -0800, Debsu wrote:

Hi,

> I want to play an image or media file from http source through playbin. Soup
> plugin is installed, through which playbin can read from the http source.
> But whenever I give the following command :
> gst-launch playbin
> uri=http://www.youtube.com/img/pic_youtubelogo_123x63.gif, it gives me
> "proxy authentication required" error. Http Proxy is already set in the
> environment variable and through Curl I can read from that location.
>
> Now in GstSoupHTTPSrc has some properties through which I can set the proxy
> id and password ("proxy-id", "proxy-pw"). Then I hope this problem will
> solve.
>
> But how can I add this source element in the Playbin? The GstPlayBaseBin
> documentation says that its "source" element is only read only property.

Basically you need to do what's described in the section called

"Specifying which CD/DVD device to use"

in
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-playbin.html

just that you want to set the proxy-* properties and not the device
property on the source.

You can't do that with gst-launch though, you will need to write code.

However, *maybe* you can pass the proxy user/password via the http_proxy
environment variable by doing something like

 export http_proxy=http://user:password@proxyserver

I don't know if that will work or is supposed to work though.

Cheers
 -Tim

PS: you should use playbin2 instead of playbin.



------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: setting http userid/password with playbin (was: Playbin unable to play http streaming)

Debsu

Hi Tim,

 

Thanks a lot. You are right; I need to write code in order to add the proxy user id & password during the signal callback. But my question is how to set these information to the GstSoupHTTPSrc as the playbin Source property is Read Only.

 

I have already added the proxy user id & password in the environment variable, but the problem is soup src plugin doesn’t read from the environment variable. Thus it couldn’t pass the authentication.

 

Regards,

Deb

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Reply | Threaded
Open this post in threaded view
|

Re: setting http proxy userid/password with playbin

Tim-Philipp Müller-2
On Wed, 2010-03-03 at 07:01 -0800, Debsu wrote:

> But my question is how to set these information to the GstSoupHTTPSrc
> as the playbin Source property is Read Only.

Not sure how those two things are related. You connect to playbin's
"notify::source" signal, then your callback will be called when playback
has created the source element (e.g. GstSoupHttpSrc). In the callback
you can then do something like:

 GObjectClass *klass;
 GstElement *src = NULL;

 g_object_get (playbin, "source", &src, NULL);

 klass = G_OBJECT_GET_CLASS (src);
 if (g_object_class_find_property (klass, "proxy-id") != NULL &&
     g_object_class_find_property (klass, "proxy-pw") != NULL) {
   g_object_set (src, "proxy-id", "foo", "proxy-pw", "s3cr3t", NULL);
 }

 gst_object_unref (src);

So yes, the "source" property is read-only, but that only means that you
can't tell playbin what source to use (it will find one automatically
via the URI protocol), it doesn't mean that you can't set properties on
the source object.

 Cheers
  -Tim




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: setting http proxy userid/password with playbin

Debsu
Hi Tim,

As per your suggession, I wrote the following callback.
static void cb_playbin_notify_source(GObject *obj, GParamSpec *param, gpointer u_data)
{
    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), "proxy-id") && \
            g_object_class_find_property(G_OBJECT_GET_CLASS(source_element), "proxy-pw"))
        {
            g_object_set (source_element, "proxy", "proxy_ip", "proxy-id", "user_id", "proxy-pw", "passwd", NULL);
        }
        g_object_unref(source_element);
    }
}

connect that callback with this:
    g_signal_connect(G_OBJECT(playbin), "notify::source", G_CALLBACK(cb_playbin_notify_source), NULL);

But every time I am still getting the "Proxy Authentication Required" error.

Did I made any mistake?
Reply | Threaded
Open this post in threaded view
|

Re: setting http proxy userid/password with playbin

Tim-Philipp Müller-2
On Thu, 2010-03-04 at 02:03 -0800, Debsu wrote:

> But every time I am still getting the "Proxy Authentication Required" error.
>
> Did I made any mistake?

I have no idea. You should probably verify that the code with the
g_object_set() is actually executed, then check the GST_DEBUG=*soup*:5
debug log, then check what souphttpsrc sends over the wire with
wireshark or some other tool.

 Cheers
  -Tim



------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel