[rygel] server: Support PV subtitles



commit a49e943ff361978f18488770546978591699046c
Author: Jens Georg <jensg openismus com>
Date:   Sat Oct 19 11:12:05 2013 +0200

    server: Support PV subtitles
    
    Support serving of external subtitles for devices that support the PV subtitle
    "standard", namely Panasonic TVs and the WD TV Live
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661228

 configure.ac                              |    2 +-
 src/librygel-server/rygel-video-item.vala |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8e8110b..bbaa10b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ VALA_REQUIRED=0.22.0
 VALADOC_REQUIRED=0.2
 GSSDP_REQUIRED=0.13.0
 GUPNP_REQUIRED=0.19.0
-GUPNP_AV_REQUIRED=0.11.4
+GUPNP_AV_REQUIRED=0.12.4
 GUPNP_DLNA_REQUIRED=0.9.4
 GSTREAMER_REQUIRED=1.0
 GSTPBU_REQUIRED=1.0
diff --git a/src/librygel-server/rygel-video-item.vala b/src/librygel-server/rygel-video-item.vala
index b63b308..488f6eb 100644
--- a/src/librygel-server/rygel-video-item.vala
+++ b/src/librygel-server/rygel-video-item.vala
@@ -174,10 +174,15 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
     internal override void add_proxy_resources (HTTPServer   server,
                                                 DIDLLiteItem didl_item)
                                                 throws Error {
+        var main_subtitle = null as Subtitle;
         if (!this.place_holder) {
             // Subtitles first
             foreach (var subtitle in this.subtitles) {
                 if (!server.need_proxy (subtitle.uri)) {
+                    if (main_subtitle == null) {
+                        main_subtitle = subtitle;
+                    }
+
                     continue;
                 }
 
@@ -191,6 +196,12 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
                                                            null);
                 subtitle.add_didl_node (didl_item);
 
+                if (main_subtitle == null) {
+                    main_subtitle = new Subtitle (subtitle.mime_type,
+                                                  subtitle.caption_type);
+                    main_subtitle.uri = subtitle.uri;
+                }
+
                 // Now restore the original URI
                 subtitle.uri = uri;
             }
@@ -198,6 +209,15 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
 
         base.add_proxy_resources (server, didl_item);
 
+        if (main_subtitle != null) {
+            var resources = didl_item.get_resources ();
+            foreach (var resource in resources) {
+                resource.subtitle_file_type =
+                    main_subtitle.caption_type.up ();
+                resource.subtitle_file_uri = main_subtitle.uri;
+            }
+        }
+
         if (!this.place_holder) {
             // Thumbnails comes in the end
             this.add_thumbnail_proxy_resources (server, didl_item);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]