After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 354451 - [mythtvsrc] Plugin for MythTV source
[mythtvsrc] Plugin for MythTV source
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 0.10.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-05 15:04 UTC by Rosfran Borges
Modified: 2007-08-12 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MythTV source plugin (ext/mythtv) (37.28 KB, application/x-compressed-tar)
2006-09-05 15:05 UTC, Rosfran Borges
  Details
New MythTV source (mythtvsrc) (48.28 KB, application/gzip)
2006-10-11 19:09 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (37.96 KB, text/plain)
2007-01-03 21:17 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (2.70 KB, text/plain)
2007-01-03 21:19 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (362 bytes, text/plain)
2007-01-03 21:19 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (3.31 KB, text/plain)
2007-01-03 21:21 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (23.23 KB, text/plain)
2007-01-03 21:22 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (4.64 KB, text/plain)
2007-01-03 21:24 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (597 bytes, text/plain)
2007-01-03 21:25 UTC, Rosfran Borges
  Details
New mythtvsrc plug-in (26.68 KB, text/plain)
2007-01-03 21:26 UTC, Rosfran Borges
  Details
MythTV source plug-in (46.28 KB, patch)
2007-01-09 23:04 UTC, Rosfran Borges
committed Details | Review
Removes goto statements from the _set_property MythTV source function. (996 bytes, patch)
2007-01-15 22:02 UTC, Rosfran Borges
committed Details | Review
Patch that removes all sleep calls from mythtvsrc (3.64 KB, patch)
2007-01-24 14:27 UTC, Rosfran Borges
committed Details | Review
Some changes in the MythTV API (gmyth-0.1) calls, added better functions for changing TV channels. (9.03 KB, patch)
2007-01-30 18:18 UTC, Rosfran Borges
none Details | Review

Description Rosfran Borges 2006-09-05 15:04:03 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
Comment 1 Rosfran Borges 2006-09-05 15:05:43 UTC
Created attachment 72254 [details]
MythTV source plugin (ext/mythtv)

The MythTV source plugin.
Comment 2 Rosfran Borges 2006-10-11 19:00:57 UTC
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>
Comment 3 Rosfran Borges 2006-10-11 19:09:57 UTC
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).
Comment 4 Rosfran Borges 2007-01-03 21:17:49 UTC
Created attachment 79321 [details]
New mythtvsrc plug-in
Comment 5 Rosfran Borges 2007-01-03 21:18:29 UTC
Comment on attachment 79321 [details]
New mythtvsrc plug-in 

gstmythtvsrc.c
Comment 6 Rosfran Borges 2007-01-03 21:19:20 UTC
Created attachment 79323 [details]
New mythtvsrc plug-in

gstmythtvsrc.h
Comment 7 Rosfran Borges 2007-01-03 21:19:55 UTC
Created attachment 79324 [details]
New mythtvsrc plug-in

Makefile.am
Comment 8 Rosfran Borges 2007-01-03 21:21:10 UTC
Created attachment 79325 [details]
New mythtvsrc plug-in

This is the Makefile.am to the gst-plugins-bad/ext.
Comment 9 Rosfran Borges 2007-01-03 21:22:30 UTC
Created attachment 79326 [details]
New mythtvsrc plug-in

The updated configure.ac from gst-plugins-bad root directory (checking for the gmyth library).
Comment 10 Rosfran Borges 2007-01-03 21:24:11 UTC
Created attachment 79327 [details]
New mythtvsrc plug-in

This is the gst-plugins-bad.spec.in from the gst-plugins-bad root directory.
Comment 11 Rosfran Borges 2007-01-03 21:25:20 UTC
Created attachment 79328 [details]
New mythtvsrc plug-in

The updated Makefile.am to include the newly added mythtvsrc entry.
Comment 12 Rosfran Borges 2007-01-03 21:26:52 UTC
Created attachment 79329 [details]
New mythtvsrc plug-in

One large tar.gz. file with all the source files and autotools.
Comment 13 Tim-Philipp Müller 2007-01-04 13:29:50 UTC
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 :)
Comment 14 David Schleef 2007-01-04 20:09:12 UTC
Or 'cvs add' the files and then 'cvs diff -uN'.
Comment 15 Rosfran Borges 2007-01-09 23:04:16 UTC
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).
Comment 16 Tim-Philipp Müller 2007-01-13 12:37:58 UTC
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).
Comment 17 Tim-Philipp Müller 2007-01-13 12:45:45 UTC
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

Comment 18 Rosfran Borges 2007-01-15 22:00:30 UTC
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?
Comment 19 Rosfran Borges 2007-01-15 22:02:22 UTC
Created attachment 80344 [details] [review]
Removes goto statements from the _set_property MythTV source function.
Comment 20 Tim-Philipp Müller 2007-01-17 17:32:05 UTC
I see, thanks for the explanation and the patch.
Comment 21 Rosfran Borges 2007-01-24 14:17:59 UTC
(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
Comment 22 Rosfran Borges 2007-01-24 14:27:25 UTC
Created attachment 81079 [details] [review]
Patch that removes all sleep calls from mythtvsrc
Comment 23 Rosfran Borges 2007-01-30 18:18:34 UTC
Created attachment 81532 [details] [review]
Some changes in the MythTV API (gmyth-0.1) calls, added better functions for changing TV channels.
Comment 24 Tim-Philipp Müller 2007-01-31 16:43:21 UTC
Rosfran: I'm happy to commit this, but there's no need to submit changes, you can just give them to Edgard to commit :)
Comment 25 Bastien Nocera 2007-08-12 09:55:51 UTC
Does the mythtv source work with playbin/decodebin?

Ie. does "totem myth://xxx.xxx.xxx.xxx:6543/1000_20060717184501.nuv" work?