core,doc: Make AAC_ISO_320 transcoder configurable
authorLuis de Bethencourt <luis.debethencourt@collabora.com>
Tue, 12 Jul 2011 10:36:05 +0000 (12:36 +0200)
committerJens Georg <mail@jensge.org>
Thu, 4 Aug 2011 19:48:42 +0000 (21:48 +0200)
data/rygel.conf
doc/man/rygel.conf.xml
doc/man/rygel.xml
src/rygel/rygel-cmdline-config.vala
src/rygel/rygel-configuration.vala
src/rygel/rygel-environment-config.vala
src/rygel/rygel-meta-config.vala
src/rygel/rygel-transcode-manager.vala
src/rygel/rygel-user-config.vala

index 91fa862..77a7054 100644 (file)
@@ -26,6 +26,9 @@ enable-mp2ts-transcoder=true
 # Set it to 'false' if you want to disable WMV transcoding support.
 enable-wmv-transcoder=true
 
+# Set it to 'false' if you want to disable AAC_ISO_320 transcoding support.
+enable-aac-transcoder=true
+
 # Where video files should be saved if allow-upload is true.
 # Defaults to @VIDEOS@, the standard videos folder (typically ${HOME}/Videos).
 video-upload-folder=@VIDEOS@
index 1d70260..9036aae 100644 (file)
@@ -187,6 +187,16 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
       </varlistentry>
       <varlistentry>
         <term>
+          <option>enable-aac-transcoder</option>
+        </term>
+        <listitem>
+          <para>
+            Set to <userinput>true</userinput> to enable transcoding to AAC.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>
           <option>log-level=<replaceable>DOMAIN</replaceable>:<replaceable>LEVEL</replaceable>[,<replaceable>DOMAIN</replaceable>:<replaceable>LEVEL</replaceable>,…]</option>
         </term>
         <listitem>
index 12afd40..8d42ee9 100644 (file)
@@ -222,6 +222,17 @@ handling.</para>
       </varlistentry>
       <varlistentry>
         <term>
+          <option>-a</option>
+        </term>
+        <term>
+          <option>--disable-aac-transcoder</option>
+        </term>
+        <listitem>
+          <para>Disable transcoding to AAC.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>
           <option>-U</option>
         </term>
         <term>
@@ -430,6 +441,14 @@ handling.</para>
       </varlistentry>
       <varlistentry>
         <term>
+          <envar>RYGEL_DISABLE_AAC_TRANS</envar>
+        </term>
+        <listitem>
+          <para>Disable transcoding to AAC format.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>
           <envar>RYGEL_LOG</envar>
         </term>
         <listitem>
index 372c933..67e0962 100644 (file)
@@ -41,6 +41,7 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
     private static bool no_mp2ts_trans;
     private static bool no_lpcm_trans;
     private static bool no_wmv_trans;
+    private static bool no_aac_trans;
 
     private static bool disallow_upload;
     private static bool disallow_deletion;
@@ -85,6 +86,8 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
           "Disable Linear PCM transcoder", null },
         { "disable-wmv-transcoder", 'w', 0, OptionArg.NONE, ref no_wmv_trans,
           "Disable WMV transcoder", null },
+        { "disable-aac-transcoder", 'a', 0, OptionArg.NONE, ref no_aac_trans,
+          "Disable AAC_ISO_320 transcoder", null },
         { "disallow-upload", 'U', 0, OptionArg.NONE,
           ref disallow_upload, "Disallow upload", null },
         { "disallow-deletion", 'D', 0, OptionArg.NONE,
@@ -209,6 +212,14 @@ internal class Rygel.CmdlineConfig : GLib.Object, Configuration {
         }
     }
 
+    public bool get_aac_transcoder () throws GLib.Error {
+        if (!no_aac_trans) {
+            throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
+        } else {
+            return false;
+        }
+    }
+
     public bool get_allow_upload () throws GLib.Error {
         if (!disallow_upload) {
             throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
index 9f59d7c..45b4555 100644 (file)
@@ -47,6 +47,8 @@ public interface Rygel.Configuration : GLib.Object {
 
     public abstract bool get_wmv_transcoder () throws GLib.Error;
 
+    public abstract bool get_aac_transcoder () throws GLib.Error;
+
     public abstract bool get_allow_upload () throws GLib.Error;
 
     public abstract bool get_allow_deletion () throws GLib.Error;
index e9695aa..3f09ae8 100644 (file)
@@ -41,6 +41,7 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration {
     private static string MP2TS_TRANSCODING_ENV = DISABLE_PREFIX +
                                                   "_MP2TS_TRANS";
     private static string WMV_TRANSCODING_ENV = DISABLE_PREFIX + "_WMV_TRANS";
+    private static string AAC_TRANSCODING_ENV = DISABLE_PREFIX + "_AAC_TRANS";
     private static string DISALLOW_UPLOAD_ENV = DISABLE_PREFIX + "_UPLOAD";
     private static string DISALLOW_DELETION_ENV = DISABLE_PREFIX + "_DELETION";
     private static string LOG_LEVELS_ENV = RYGEL_PREFIX + "_LOG";
@@ -85,6 +86,10 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration {
         return !this.get_bool_variable (WMV_TRANSCODING_ENV);
     }
 
+    public bool get_aac_transcoder () throws GLib.Error {
+        return !this.get_bool_variable (AAC_TRANSCODING_ENV);
+    }
+
     public bool get_lpcm_transcoder () throws GLib.Error {
         return !this.get_bool_variable (LPCM_TRANSCODING_ENV);
     }
index 507f9d3..d509c63 100644 (file)
@@ -219,6 +219,25 @@ public class Rygel.MetaConfig : GLib.Object, Configuration {
         return val;
     }
 
+    public bool get_aac_transcoder () throws GLib.Error {
+        bool val = true;
+        bool unavailable = true;
+
+        foreach (var config in this.configs) {
+            try {
+                val = config.get_aac_transcoder ();
+                unavailable = false;
+                break;
+            } catch (GLib.Error err) {}
+        }
+
+        if (unavailable) {
+            throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
+        }
+
+        return val;
+    }
+
     public bool get_allow_upload () throws GLib.Error {
         bool val = true;
         bool unavailable = true;
index 162ef7a..29300f9 100644 (file)
@@ -62,6 +62,7 @@ internal abstract class Rygel.TranscodeManager : GLib.Object {
                 mp3_transcoder = config.get_mp3_transcoder ();
                 mp2ts_transcoder = config.get_mp2ts_transcoder ();
                 wmv_transcoder = config.get_wmv_transcoder ();
+                aac_transcoder = config.get_aac_transcoder ();
             }
         } catch (Error err) {}
 
index 3829b91..df99044 100644 (file)
@@ -39,6 +39,7 @@ public class Rygel.UserConfig : GLib.Object, Configuration {
     public static const string MP2TS_TRANSCODER_KEY = "enable-mp2ts-transcoder";
     public static const string LPCM_TRANSCODER_KEY = "enable-lpcm-transcoder";
     public static const string WMV_TRANSCODER_KEY = "enable-wmv-transcoder";
+    public static const string AAC_TRANSCODER_KEY = "enable-aac-transcoder";
     public static const string ALLOW_UPLOAD_KEY = "allow-upload";
     public static const string ALLOW_DELETION_KEY = "allow-deletion";
     public static const string LOG_LEVELS_KEY = "log-level";
@@ -89,6 +90,10 @@ public class Rygel.UserConfig : GLib.Object, Configuration {
         return this.get_bool ("general", WMV_TRANSCODER_KEY);
     }
 
+    public bool get_aac_transcoder () throws GLib.Error {
+        return this.get_bool ("general", AAC_TRANSCODER_KEY);
+    }
+
     public bool get_allow_upload () throws GLib.Error {
         return this.get_bool ("general", ALLOW_UPLOAD_KEY);
     }