GNOME Bugzilla – Bug 354451
[mythtvsrc] Plugin for MythTV source
Last modified: 2007-08-12 09:55:51 UTC
This is a plug-in I developed that allow to get streaming source contents from a MythTV backend server. MythTV is an open source personal video recorder (PVR). More details, the official web-site: www.mythtv.org An example on how to use this new plugin (with image/sound): gst-launch-0.10 mythtvsrc location=myth://xxx.xxx.xxx.xxx:6543/1000_20060717184501.nuv ! ffdemux_nuv name=nuvdemux nuvdemux.video_00 ! queue ! ffdec_mpeg4 ! xvimagesink sync=false nuvdemux.audio_00 ! queue ! ffdec_mp3 ! audioconvert ! alsasink sync=false 2>&1 I hope that it would be a fine contribution, I'm just starting to contribute to GStreamer. Comments are welcome! []'s Rosfran Borges
Created attachment 72254 [details] MythTV source plugin (ext/mythtv) The MythTV source plugin.
Hi, Some new addings to this plug-in: now, it can use another NUV sink (nuvdemux), and not the older from FFMPEG (ffdemux_nuv). The pipeline would seems like that: gst-launch-0.10 mythtvsrc location=myth://xxx.xxx.xxx.xxx:6543/saida.nuv ! nuvdemux name=d .audio_src ! queue ! mad ! audioconvert ! volume volume=4 ! alsasink d.video_src ! queue ! divxdec ! queue ! ffmpegcolorspace ! xvimagesink sync=true Comments are welcome! Rosfran Borges <rosfran at gmail dot com>
Created attachment 74510 [details] New MythTV source (mythtvsrc) Use it with the new nuvdemux. This one includes dependency on the gmyth library (http://sourceforge.net/projects/gmyth).
Created attachment 79321 [details] New mythtvsrc plug-in
Comment on attachment 79321 [details] New mythtvsrc plug-in gstmythtvsrc.c
Created attachment 79323 [details] New mythtvsrc plug-in gstmythtvsrc.h
Created attachment 79324 [details] New mythtvsrc plug-in Makefile.am
Created attachment 79325 [details] New mythtvsrc plug-in This is the Makefile.am to the gst-plugins-bad/ext.
Created attachment 79326 [details] New mythtvsrc plug-in The updated configure.ac from gst-plugins-bad root directory (checking for the gmyth library).
Created attachment 79327 [details] New mythtvsrc plug-in This is the gst-plugins-bad.spec.in from the gst-plugins-bad root directory.
Created attachment 79328 [details] New mythtvsrc plug-in The updated Makefile.am to include the newly added mythtvsrc entry.
Created attachment 79329 [details] New mythtvsrc plug-in One large tar.gz. file with all the source files and autotools.
In future, please provide diffs against gst-plugins-bad CVS for files that already exist and that are changed, with something like: ~/gst-plugins-bad $ cvs diff -u -p configure.ac ext/Makefile.am > newplugin.diff The easiest and most straight-foward way to then add new files that don't exist in CVS yet to the diff is like this: ~/gst-plugins-bad $ diff -u /dev/null ext/mythtv/newfile.c >> newplugin.diff ~/gst-plugins-bad $ diff -u /dev/null ext/mythtv/newfile.h >> newplugin.diff ~/gst-plugins-bad $ diff -u /dev/null ext/mythtv/Makefile.am >> newplugin.diff (note the two >> here, they make sure things get appended to file). This makes things easier for us and you only need to attach one single file :)
Or 'cvs add' the files and then 'cvs diff -uN'.
Created attachment 79898 [details] [review] MythTV source plug-in A patch to be applied on gstreamer/gst-plugins-bad, in order to install the MythTV plug-in (includes dependency on gmyth library).
Looks like this was committed, so closing this bug: 2007-01-12 Edgard Lima <edgard.lima@indt.org.br> Patch by: Rosfran Borges <rosfran.borges@indt.org.br> * configure.ac: * gst-plugins-bad.spec.in: * ext/Makefile.am: * ext/mythtv/Makefile.am: * ext/mythtv/gstmythtvsrc.c: * ext/mythtv/gstmythtvsrc.h: MythTV client source plugin created. Just some quick comments from glancing over the code: - your configure.ac patch removes bits from configure.ac that it shouldn't be touching, like the tests/ directories; the committed version is ok though. - in the _set_property() function you do goto done; with the object lock held in case of an error, but the done label is after where the object is unlocked again - that will deadlock. - there is no need to use things like GST_INFO ("[%s] this and that", __FUNCTION__); the function name will always be printed automatically in the GStreamer debug log. Also, one exclamation mark is usually enough at the end of a debug statement :) - there are g_usleep (500); and sleep(9); statements and similar in the code in the _start() function this is almost always wrong and a sign that things should be designed differently. Especially a sleep of 9 seconds is outright evil, since it can't be interrupted, and an application trying to interrupt it would block for at least that long with the interface freezing up etc. Same for the normal start-up case where this is triggered (arguably that's a design problem in GstBaseSrc though, since it also applies when doing open() on CD/DVD devices and the like).
Also, gmyth seems to depend on libcurl, but not include it in its pkg-config --libs (just mentioning it here since you appear to be a developer on that project too): $ pkg-config --libs gmyth-0.1 -L/usr/lib/mysql -L/usr/local/lib -lmysqlclient -lgmyth -lgobject-2.0 -lglib-2.0 $ GST_DEBUG=*:2 gst-inspect-0.10 | grep myth WARN gst_plugin_load_file: module_open failed: /usr/local/lib/libgmyth.so.0: undefined symbol: curl_easy_setopt
Hi, Tim, thanks for the comments! The libcurl dependency is now included in the pkg-config of the gmyth's developer distribution. Most of the proposed changes had already been fixed (by Tim-Philipp Müller). The patch I attached removes the goto statements in the _set_property; is preferred to use break statements, instead of gotos. GST_INFO were solved too. We are trying to remove all the g_usleep/sleep function call from the plug-in, but it should be useful to move all these calls to the gmyth library, it would be the fastest solution: it's sad but, the official MythTV backend server has some particularities, so all these sleep calls are really important. What do you think about it?
Created attachment 80344 [details] [review] Removes goto statements from the _set_property MythTV source function.
I see, thanks for the explanation and the patch.
(In reply to comment #16) > > - there are g_usleep (500); and sleep(9); statements and > similar in the code in the _start() function this is almost > always wrong and a sign that things should be designed > differently. Especially a sleep of 9 seconds is outright > evil, since it can't be interrupted, and an application > trying to interrupt it would block for at least that long > with the interface freezing up etc. Same for the normal > start-up case where this is triggered (arguably that's > a design problem in GstBaseSrc though, since it also > applies when doing open() on CD/DVD devices and the like). > I removed these sleep calls in the new MythTV plug-in, and added these sync calls to the library. Below, there is a patch to fix these issues. This patch must to be applied in order to get the mythtvsrc element to properly run again on LiveTV content. Regards, Rosfran Borges
Created attachment 81079 [details] [review] Patch that removes all sleep calls from mythtvsrc
Created attachment 81532 [details] [review] Some changes in the MythTV API (gmyth-0.1) calls, added better functions for changing TV channels.
Rosfran: I'm happy to commit this, but there's no need to submit changes, you can just give them to Edgard to commit :)
Does the mythtv source work with playbin/decodebin? Ie. does "totem myth://xxx.xxx.xxx.xxx:6543/1000_20060717184501.nuv" work?