GNOME Bugzilla – Bug 558450
New plugin: curlsrc, a libcurl-based http source
Last modified: 2012-06-29 13:41:11 UTC
A new plugin. Other information: Hi. I've asked on gstreamer irc chat where should I submit a new plugin for gstreamer and I was told here it would be a great place. The plugin is already written, and I need a little testing from you guys. You can download the plugin from here: http://d.itmediaconnect.ro/gstcurlsrc.zip. The plugin is a source plugin and should do same as souphttpsrc and is a web src plugin. Thank in advance for any type of answer. Chris
Thanks, would be nice if you could make a patch against gst-plugins-bad. I'm not really sure why the GStreamer world needs yet another http source plugin, esp. a GPL-licensed one which seems to be less featureful than any of the existing plugins (no icecast support etc.). If I may ask: why did you write it rather than use one of the many existing ones? :) Some suggestions: maybe rename it to 'curlhttpsrc'; run gst-indent over the .c file; use gst debug logging instead of commented out printfs. Also, as long as it doesn't support icecast streams we probably won't be able to give it a rank > NONE, ie. have it autoplugged by default.
I was forced to make a new http plugin for only one reason: Heave you ever tried to play IP Video Cameras which have only JPEG encoding (pure jpeg, not motion jpeg)? I can point to you a few of those. I had no ideea how to work with soup, since I'm not familiar with the technology, neon is as far away as soup, I didn't even try to get she sources and modify it. My plugin has a repeat option, which allows repeated source reading (which allows you to play transform jpeg sources into motion jpeg only by rereading the source infinite times). I do not intend to go as far as adding this source plugin to GStreamer, but I really need it tested by other people since this specific plugin will remain under GPL licence. Even more... my company will probably make it public really soon and give people the possibility of choosing which plugin they will use with the rest of your non GPL plugins. We're working with ip cameras most of the time and we're developing plugins for geting the info from them. About the sugestion, the name of the plugin can be changed if easily, and is not a real problem right now. I cannot change it though, because I do not intend to use curlsrc only as a http. As you well know, curl supports plenty of other protocols, and during time I intend of extending curlsrc to use not only http protocol, but almost all the protocols curl supports. Hm... this may become a good reason of inserting curlsrc in Gstreamer. Don't you think? I don't understand why icecast is such a problem, but I will eventually try and fix that also, if you make a big fuzz because of it. This plugin was not intended for that kind of stuff, but... why not? I just need to test and modify. Chris
Dragos, please attach the code here. The link seems to not work {anymore/right now}.
Hello Stefan. You can download the code via svn from http://svn.itmcd.ro/trunk/gst/curlsrc. User and pass: anonymous. If you guys find any bugs please report them to me. If you want to help developing/improving it, also, please contact me on dragosc@itmcd.ro
Reopening as the requested information has been provided.
This plugin performs only some basic operations, it cannot be used for full-fledged handling files on the FTP server, since there's no seeking implemented. Also, CURL handle, created and used in the code, is passed over threads, while that is directly forbidden by the libcurl documentation. I tried implementing seeking, this lead to crashes after closing. I have plans to add all necessary functionality to this plugin, but don't know exact schedule right now.
Hey there... I've moved the actual source to http://svn.itmcd.ro/tags/gst/curlsrc/0.0.1, while http://svn.itmcd.ro/trunk/gst/curlsrc will remain for develop. I'm also gonna try and rewrite the thread part, Vladimir was telling above. Vladimir if u can, please give advices. I'm became pretty low with c/c++ programing (not that I was better), since I kinda quited the domain short after I wrote this plugin.
I'd advise to switch to using GThreads instead of Pthreads. Gthreads however, miss semaphores, which are used in the code.
I understand now what you told me. I'm gonna try to find a solution in the next few days. I'll probably move the curl handle to have it only inside the second thread. Gonna read about Gthreads also, to see if I can find smth to match what semaphores do.
Let's close this bug. No activity for ages, and from the sound of it it doesn't even support minimal features such as seeking. Feel free to re-open if you have a patch against gst-plugins-bad (git master branch), thanks!
Hmm... I wrote the plugin from obvious reasons and only for certain purposes. No one bothered to help or suggest anything :). I quit this domain since I quit the project this plugin was involved in. So I'm fine with the idea :).