rygel r715 - trunk/src/rygel



Author: zeeshanak
Date: Sat Mar 21 13:56:29 2009
New Revision: 715
URL: http://svn.gnome.org/viewvc/rygel?rev=715&view=rev

Log:
Transcoder classes dictate the mimetype and DLNA profile.

Modified:
   trunk/src/rygel/rygel-mp2ts-transcoder.vala
   trunk/src/rygel/rygel-mp3-transcoder.vala
   trunk/src/rygel/rygel-transcode-manager.vala

Modified: trunk/src/rygel/rygel-mp2ts-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp2ts-transcoder.vala	(original)
+++ trunk/src/rygel/rygel-mp2ts-transcoder.vala	Sat Mar 21 13:56:29 2009
@@ -24,6 +24,9 @@
 using Gst;
 
 internal class Rygel.MP2TSTranscoder : Rygel.Transcoder {
+   public const string mime_type = "video/mpeg";
+   public const string dlna_profile = "MP3";
+
    private const string DECODEBIN = "decodebin2";
    private const string VIDEO_ENCODER = "mpeg2enc";
    private const string COLORSPACE_CONVERT = "ffmpegcolorspace";

Modified: trunk/src/rygel/rygel-mp3-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp3-transcoder.vala	(original)
+++ trunk/src/rygel/rygel-mp3-transcoder.vala	Sat Mar 21 13:56:29 2009
@@ -29,6 +29,9 @@
 }
 
 internal class Rygel.MP3Transcoder : Rygel.Transcoder {
+   public const string mime_type = "audio/mpeg";
+   public const string dlna_profile = "MP3";
+
    private const string DECODEBIN = "decodebin2";
    private const string AUDIO_CONVERT = "audioconvert";
    private const string[] AUDIO_ENCODER = {null, "twolame", "lame"};

Modified: trunk/src/rygel/rygel-transcode-manager.vala
==============================================================================
--- trunk/src/rygel/rygel-transcode-manager.vala	(original)
+++ trunk/src/rygel/rygel-transcode-manager.vala	Sat Mar 21 13:56:29 2009
@@ -36,14 +36,17 @@
                                          MediaItem                    item)
                                          throws Error {
         string mime_type;
+        string dlna_profile;
 
         if (item.upnp_class.has_prefix (MediaItem.IMAGE_CLASS)) {
             // No  transcoding for images yet :(
             return;
         } else if (item.upnp_class.has_prefix (MediaItem.MUSIC_CLASS)) {
-            mime_type = "audio/mpeg";
+            mime_type = MP3Transcoder.mime_type;
+            dlna_profile = MP3Transcoder.dlna_profile;
         } else {
-            mime_type = "video/mpeg";
+            mime_type = MP2TSTranscoder.mime_type;
+            dlna_profile = MP2TSTranscoder.dlna_profile;
         }
 
         if (item.mime_type == mime_type) {
@@ -55,6 +58,7 @@
         DIDLLiteResource res = item.create_res (uri);
         res.mime_type = mime_type;
         res.protocol = protocol;
+        res.dlna_profile = dlna_profile;
         res.dlna_conversion = DLNAConversion.TRANSCODED;
         res.dlna_flags = DLNAFlags.STREAMING_TRANSFER_MODE;
         res.dlna_operation = DLNAOperation.NONE;
@@ -66,9 +70,9 @@
     internal Element get_transcoding_src (Element src,
                                           string  target)
                                           throws Error {
-        if (target == "audio/mpeg") {
+        if (target == MP3Transcoder.mime_type) {
             return new MP3Transcoder (src, MP3Profile.LAYER3);
-        } else if (target == "video/mpeg") {
+        } else if (target == MP2TSTranscoder.mime_type) {
             return new MP2TSTranscoder (src);
         } else {
             throw new HTTPRequestError.NOT_FOUND (



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