GNOME Bugzilla – Bug 515759
Add built-in support for gnome-dvb-daemon
Last modified: 2009-12-22 15:17:54 UTC
attachment 104803 [details] contains Zaheer's first try. We'd need to: - remove the card selection, it should be passed from Totem - use the nice name detected from Totem, and pass it to the scanner as well - use brute-force by default, and don't show it in the UI, allow people to pass the initial scanning data file via the command-line - thread the application, so the UI doesn't hang - show a real progress (we know the range of frequencies to check, so it should be possible) - add the ability to not list radios/pay-channels Note that for development purposes you need: - CVS version of gst-plugins-bad (especially plugins in sys/dvb and gst/mpegtsparse/) - SVN version of gst-fluendo-mpegdemux (available at https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegdemux/) - a DVB-T or DVB-S adapter with working Linux support The code can be written in Python or C. If written in Python, it should check (without a traceback) for the presence of the required modules, and error out (with a dialogue explaining the missing requirements).
your third need, I don't necessarily agree with. Brute force scanning takes much much longer than passing the initial scanning data file and in DVB-S would take . What I think would be better for DVB-T is to have a Location with the default being the location (country) from your gnome setup, second option being the Brute force then theird optiion to be a more countries... with an alphabetic list of countries coming out of that. Countries' DVB-T initial tuning data can basicallybe an appended list of the ones read fromt he filesystem. For DVB-S, brute-force is not really going to be good but we can provide a list and maybe an autodetect option where all the satellites' initial tuning data is combined.
"and in DVB-S would take an eternity"
OT: Another nice feature would be to have a UI for automatically installing the firmware needed for the dvb card. Is there a feature request for this somewhere?
(In reply to comment #3) > OT: Another nice feature would be to have a UI for automatically installing the > firmware needed for the dvb card. Is there a feature request for this > somewhere? The problem is that devices won't be created if a firmware's missing. So there's no easy way to report this back in Totem directly. You should bring this idea up on the HAL mailing-list, so something desktop-wide could be put in place. (In reply to comment #1) > your third need, I don't necessarily agree with. Brute force scanning takes > much much longer than passing the initial scanning data file and in DVB-S would > take . What I think would be better for DVB-T is to have a Location with the > default being the location (country) from your gnome setup, second option being > the Brute force then theird optiion to be a more countries... with an > alphabetic list of countries coming out of that. Countries' DVB-T initial > tuning data can basicallybe an appended list of the ones read fromt he > filesystem. For DVB-S, brute-force is not really going to be good but we can > provide a list and maybe an autodetect option where all the satellites' initial > tuning data is combined. We can easily cheat for DVB-S and use _all_ of the initial scanning data available. For DVB-T maybe it would be better to have a single "Country" drop-down, but that would require the initial scanning data to be properly sorted...
So currently I am working on this in my bzr repo http://zaheer.merali.org/zaheer-dvb/ if anyone wants to follow progress. I have added DVB-C support in though there is one bug with DVB-C scanning that I need to iron out.
Created attachment 138453 [details] [review] Remove support of DVB protocol This patch removes the existing DVB support in Totem and support for the dvb:// protocol
Created attachment 138455 [details] [review] Support gnome-dvb-setup as scanner This patch adds support for gnome-dvb-setup to setup DVB. There's only one menu entry "Watch TV" if you have at least one DVB adapter. Clicking on it checks if gnome-dvb-daemon DBus service is currently running or if it can be activated. If not it's checked if packagekit is available and dvb-daemon is installed. Otherwise a simple error message is displayed. Once all requirements are met gnome-dvb-setup is started. As discussed on IRC, gnome-dvb-daemon will become a hard optional dependency, PK support is dropped and the daemon should be able to start without the gstreamer plugins it usually requires. The plugin will then ask totem to install the necessary plugins.
Created attachment 139903 [details] [review] Add gnome-dvb-setup support I removed PackageKit support. Launching "totem dvb:" will search for the recently watched channel, if it's not available an error message is displayed. dvb:// URLs work the same way as before and are handled by GStreamer.
Any update on this issue?
Review of attachment 139903 [details] [review]: Good first pass, but the code in totem-menu, and the helper probably need to be moved into gnome-dvb-daemon (or the plugin) itself. There's no point having this code in Totem if there's no "native" support for DVB. ::: src/backend/bacon-video-widget-gst-0.10.c @@ -4921,3 @@ - * bacon_video_widget_get_channels_file() for the GStreamer backend) - * does not exist, a %BVW_ERROR_FILE_NOT_FOUND error will be returned. - * Why do you remove this useful documentation? @@ +4859,3 @@ return NULL; } + if (!g_file_test ("/dev/dvb/adapter0/frontend0", G_FILE_TEST_EXISTS)) { What happens if you have 2 devices in your system and remove the first one? Fail. @@ +4867,1 @@ + recent_manager = gtk_recent_manager_get_default (); Why do you use this? 1) Remove Totem's provided dvb menu items in totem-menu.c 2) Have the gnome-dvb-daemon plugin add the menu items itself 3) Have gnome-dvb-daemon switch to the last used channel If this is just to handle the dvb: URLs, then we'll need to come up with some other way to do this. ::: src/totem-dvb-setup.c @@ +56,3 @@ + + path_env = g_getenv ("PATH"); + if (path_env != NULL) { You're reimplementing g_find_program_in_path()... @@ +90,3 @@ +static gboolean +dbus_service_is_available (const gchar *name) +{ This function is leaking connection. @@ +246,3 @@ +totem_dvb_daemon_available (void) +{ + return dbus_service_is_available (DBUS_DVB_SERVICE); Why don't you put dbus_service_is_available directly in here, and make totem_dvb_setup() use it? ::: src/totem-menu.c @@ +912,3 @@ update_dvb_menu_items (GtkMenuItem *movie_menuitem, Totem *totem) { + char devicenode[] = "/dev/dvb/adapter0/frontend0"; All that code needs to go and be in the plugin instead.
Review of attachment 139903 [details] [review]: Most of the code needs to be moved to the plugin. I let you know once I ported everything. ::: src/backend/bacon-video-widget-gst-0.10.c @@ -4921,3 @@ - * bacon_video_widget_get_channels_file() for the GStreamer backend) - * does not exist, a %BVW_ERROR_FILE_NOT_FOUND error will be returned. - * Because I removed bacon_video_widget_get_channels_file and the error doesn't appear anymore. @@ +4859,3 @@ return NULL; } + if (!g_file_test ("/dev/dvb/adapter0/frontend0", G_FILE_TEST_EXISTS)) { Good point. Would it be sufficient to check if the directory /dev/dvb exists? @@ +4867,1 @@ + recent_manager = gtk_recent_manager_get_default (); Yes, that code is used to tune to the last watched channel when starting totem with dvb:. Maybe I have to handle that for each client in gnome-dvb-daemon directly. ::: src/totem-menu.c @@ +912,3 @@ update_dvb_menu_items (GtkMenuItem *movie_menuitem, Totem *totem) { + char devicenode[] = "/dev/dvb/adapter0/frontend0"; This would mean that everything in totem-dvb-setup.c would be moved to the plugin, too. Is that what you want?
(In reply to comment #11) > Review of attachment 139903 [details] [review]: > > Most of the code needs to be moved to the plugin. I let you know once I ported > everything. > > ::: src/backend/bacon-video-widget-gst-0.10.c > @@ -4921,3 @@ > - * bacon_video_widget_get_channels_file() for the GStreamer backend) > - * does not exist, a %BVW_ERROR_FILE_NOT_FOUND error will be returned. > - * > > Because I removed bacon_video_widget_get_channels_file and the error doesn't > appear anymore. OK, then the handling for MEDIA_DVB needs to be removed as well. > @@ +4859,3 @@ > return NULL; > } > + if (!g_file_test ("/dev/dvb/adapter0/frontend0", G_FILE_TEST_EXISTS)) { > > Good point. Would it be sufficient to check if the directory /dev/dvb exists? Is it really needed? The backend (gnome-dvb-daemon) should know whether there are one or more devices, possibly using (g)udev for hardware discovery. > @@ +4867,1 @@ > + recent_manager = gtk_recent_manager_get_default (); > > Yes, that code is used to tune to the last watched channel when starting totem > with dvb:. Maybe I have to handle that for each client in gnome-dvb-daemon > directly. This won't work at all if the user removes his recent documents. Best to store it somewhere else. > ::: src/totem-menu.c > @@ +912,3 @@ > update_dvb_menu_items (GtkMenuItem *movie_menuitem, Totem *totem) > { > + char devicenode[] = "/dev/dvb/adapter0/frontend0"; > > This would mean that everything in totem-dvb-setup.c would be moved to the > plugin, too. Is that what you want? Yes.
(In reply to comment #12) > (In reply to comment #11) > > Review of attachment 139903 [details] [review] [details]: > > > > Most of the code needs to be moved to the plugin. I let you know once I ported > > everything. > > > > ::: src/backend/bacon-video-widget-gst-0.10.c > > @@ -4921,3 @@ > > - * bacon_video_widget_get_channels_file() for the GStreamer backend) > > - * does not exist, a %BVW_ERROR_FILE_NOT_FOUND error will be returned. > > - * > > > > Because I removed bacon_video_widget_get_channels_file and the error doesn't > > appear anymore. > > OK, then the handling for MEDIA_DVB needs to be removed as well. > Wouldn't that mean that support for dvb: is dropped, too? > > @@ +4859,3 @@ > > return NULL; > > } > > + if (!g_file_test ("/dev/dvb/adapter0/frontend0", G_FILE_TEST_EXISTS)) { > > > > Good point. Would it be sufficient to check if the directory /dev/dvb exists? > > Is it really needed? The backend (gnome-dvb-daemon) should know whether there > are one or more devices, possibly using (g)udev for hardware discovery. > If MEDIA_TYPE_DVB is removed this would be gone, too. > > @@ +4867,1 @@ > > + recent_manager = gtk_recent_manager_get_default (); > > > > Yes, that code is used to tune to the last watched channel when starting totem > > with dvb:. Maybe I have to handle that for each client in gnome-dvb-daemon > > directly. > > This won't work at all if the user removes his recent documents. Best to store > it somewhere else. > Again, related to dropping MEDIA_TYPE_DVB.
Let's remove the MEDIA_TYPE_DVB altogether. The support for "dvb:" on the command-line will be fixed a different way (it's needed for YouTube integration work as well).
Created attachment 150235 [details] [review] Revised patch I dropped MEDIA_TYPE_DVB and moved handling of setup to the dvb-daemon plugin. DVB related menu items and the sidebar page will only be displayed if at least one device is detected during startup. This would still need some (g)udev magic. Clicking on "Watch TV" in the movie menu will start the setup if no devices are configured, yet, or does nothing if there's a configured device (I'd like to select the correct page in the sidebar instead). The updated version of the plugin is available in the gnome-dvb-daemon repository under client/totem-plugin
Review of attachment 150235 [details] [review]: Looks fine to commit, minus that little fix. ::: src/totem-menu.c @@ +1080,3 @@ on_movie_menu_select (GtkMenuItem *movie_menuitem, Totem *totem) { //FIXME we should check whether there's new DVB items This needs to be re-enabled now: //FIXME we should check whether there's new DVB items /* if (totem->drives_changed == FALSE) return; */