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 672929 - Add source for video optical media
Add source for video optical media
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other Linux
: Normal enhancement
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks: 673591
 
 
Reported: 2012-03-27 15:23 UTC by Bastien Nocera
Modified: 2012-04-12 16:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add optical media source (21.87 KB, patch)
2012-04-04 15:36 UTC, Bastien Nocera
none Details | Review
Add optical media source (23.11 KB, patch)
2012-04-05 16:01 UTC, Bastien Nocera
none Details | Review
Add optical media source (22.83 KB, patch)
2012-04-05 17:07 UTC, Bastien Nocera
none Details | Review
Add optical media source (23.54 KB, patch)
2012-04-10 14:46 UTC, Bastien Nocera
none Details | Review
Refactor of Bastien's patch (27.23 KB, patch)
2012-04-11 17:18 UTC, Juan A. Suarez Romero
none Details | Review

Description Bastien Nocera 2012-03-27 15:23:18 UTC
We have code to handle that in Totem already.

One would get a list of inserted discs with DVDs, Blu-Rays, Audio CDs, etc. and could filter based on media type (eg. not show audio CDs in Totem).
Comment 1 Bastien Nocera 2012-04-04 15:36:30 UTC
Created attachment 211308 [details] [review]
Add optical media source
Comment 2 Bastien Nocera 2012-04-05 16:01:28 UTC
Created attachment 211397 [details] [review]
Add optical media source

Will show:
- Mounted VCDs and DVDs
- mounted ISO images of VCDs and DVDs
Comment 3 Bastien Nocera 2012-04-05 16:02:30 UTC
Works here in grilo-test-ui with a number of physical DVDs and DVD images.
Comment 4 Bastien Nocera 2012-04-05 17:07:19 UTC
Created attachment 211416 [details] [review]
Add optical media source

Will show:
- Mounted VCDs and DVDs
- mounted ISO images of VCDs and DVDs
Comment 5 Bastien Nocera 2012-04-05 17:07:42 UTC
Comment on attachment 211397 [details] [review]
Add optical media source

Removed the debug
Comment 6 Bastien Nocera 2012-04-10 14:46:52 UTC
Created attachment 211743 [details] [review]
Add optical media source

Will show:
- Mounted VCDs and DVDs
- mounted ISO images of VCDs and DVDs
Comment 7 Bastien Nocera 2012-04-10 14:48:40 UTC
Comment on attachment 211416 [details] [review]
Add optical media source

New version has cancellation support, and cleans up after itself (lingering GVolumeMonitor signals, as it's a singleton).
Comment 8 Juan A. Suarez Romero 2012-04-11 17:18:45 UTC
Created attachment 211861 [details] [review]
Refactor of Bastien's patch

This is a refactor over Bastien patch:

* Use GRL_WARNING instead of g_warning

* Removed Gtk dependency and variables, as they are not used in the code

* Fixed indentation

* Show each device as a separated source

The last change deserves an explanation. In Grilo, each plugin can create several sources. The idea is to map each source to a physical device source from where we get the content.

For instance, UPnP plugin creates a source for each server it finds. This is done dynamically, so when a new server comes up a new source is created, and when an UPnP server dissapears, the corresponding source is removed too.

The refactor brings this idea to optical-media: each disk is show as a separated source; inserting a new disk creates a new source, and removing a disk removes the source.

Also, to speed up things, when a new disk is detected, a GrlMedia for that disk is created and cached in the source. So when user browses the source, it gets that media.
Comment 9 Bastien Nocera 2012-04-11 17:41:31 UTC
(In reply to comment #8)
<snip>
> * Show each device as a separated source
> 
> The last change deserves an explanation. In Grilo, each plugin can create
> several sources. The idea is to map each source to a physical device source
> from where we get the content.
> 
> For instance, UPnP plugin creates a source for each server it finds. This is
> done dynamically, so when a new server comes up a new source is created, and
> when an UPnP server dissapears, the corresponding source is removed too.
> 
> The refactor brings this idea to optical-media: each disk is show as a
> separated source; inserting a new disk creates a new source, and removing a
> disk removes the source.
> 
> Also, to speed up things, when a new disk is detected, a GrlMedia for that disk
> is created and cached in the source. So when user browses the source, it gets
> that media.

This has the unfortunate effect of putting the DVDs a level of indirection away from the top-level, each in their own little source with a single media object.

From a UI stand-point, I'd want to have optical media in a single location. There's bound to be only one or 2 optical media listed. We'd want to see them in the same location and hide the whole source if there are no optical media. Right now, I'd need to keep track of every source, and each item inside each source. This doesn't make writing the UI any easier, and I can't quite see the benefits.
Comment 10 Bastien Nocera 2012-04-11 17:42:02 UTC
The rest of the changes are fine by me.
Comment 11 Juan A. Suarez Romero 2012-04-12 08:05:15 UTC
(In reply to comment #9)
> This has the unfortunate effect of putting the DVDs a level of indirection away
> from the top-level, each in their own little source with a single media object.
> 
> From a UI stand-point, I'd want to have optical media in a single location.
> There's bound to be only one or 2 optical media listed. We'd want to see them
> in the same location and hide the whole source if there are no optical media.
> Right now, I'd need to keep track of every source, and each item inside each
> source. This doesn't make writing the UI any easier, and I can't quite see the
> benefits.


Yes, that's true. The main point to propose it, besides following the "one device, one source" approach, is the idea of adding support for CDAudio in future. Even if Totem does not support them, I find it very useful for other applications. 

And in this sense, a CDAudio is not just one media, but a set of CDDA tracks.  So I put two CDAudios or a DVD and a CDAudio, I do not want to mix them in the same place, but have them separated.

But also I understand that maybe having just one source with one media (like in DVD) is too much. A mixed approach could be used instead: group all DVDs in one source (as you are doing in your patch), and for the case of CDAudio putting them in a separated source.

What do you think? Note that CDAudio case is not actually supported in the plugin, but I would like to know the approach to follow in future.

On the other hand, and thinking in your approach, something I don't like personally very much is showing a source with no content. I wonder what's the best approach: showing always the Optical Media source, even if there is no DVD inserted, and thus no content on the source, or rather, showing the source only where there is at least one DVD inserted. Note that by "showing" I mean registering the source when the DVD is inserted, and unregistering it when it is removed.
Comment 12 Bastien Nocera 2012-04-12 08:59:38 UTC
The way I see it being implemented in applications is (depending on the type of source), each item within the single source is a top-level item, or we show each source as a top-level item.

For the first case, it's easy to imagine an "optical media" section in Videos' results row:
https://live.gnome.org/Design/Apps/Videos#Tentative_Design
each item being a video disc, and the section being hidden when no discs are present.

For the second case, applications would show separate sources (like Rhythmbox' sidebar) and do the grouping themselves.

I would go with:
- grouping all video discs in one top-level source
- putting each audio CD in a separate source (or as a container within the same top-level source as the video discs)
Comment 13 Juan A. Suarez Romero 2012-04-12 14:15:16 UTC
(In reply to comment #12)
> I would go with:
> - grouping all video discs in one top-level source
> - putting each audio CD in a separate source (or as a container within the same
> top-level source as the video discs)

Seems that we have an agreement.

I'm applying some of the changes I did over the last version of your patch, and I'll push it master.

Also, I'll backport it 0.1.x branch, so people using that version will be pleased of having this wonderful plugin.
Comment 14 Juan A. Suarez Romero 2012-04-12 16:04:20 UTC
Pushed in master, backported to 0.1.x branch.


commit 9b3f9cd031e270a9a370ddabc46cb02d8329f144
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu Apr 12 14:53:17 2012 +0000

    optical-media: Add optical media source
    
    Will show:
     - Mounted VCDs and DVDs
     - Mounted ISO images of VCDs and DVD
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672929
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>

 configure.ac                                  |   38 ++
 src/media/Makefile.am                         |    6 +-
 src/media/optical-media/Makefile.am           |   41 ++
 src/media/optical-media/grl-optical-media.c   |  571 +++++++++++++++++++++++++
 src/media/optical-media/grl-optical-media.h   |   76 ++++
 src/media/optical-media/grl-optical-media.xml |   10 +
 6 files changed, 741 insertions(+), 1 deletions(-)