OSDN Git Service

Configure audio effects libraries with relative path
authorKevin Rocard <krocard@google.com>
Mon, 26 Jun 2017 22:50:33 +0000 (15:50 -0700)
committerMikhail Naganov <mnaganov@google.com>
Sat, 8 Jul 2017 00:45:15 +0000 (17:45 -0700)
audio effects.conf legacy format had the libraries specified
in absolute path.
Nevertheless those libraries must be in specific folders.
The .conf loader used to strip the prefix of the paths then
try to load the libraries in those specific folders.

With new xml format the user only has to specify the name of the library
and the loader will load it from the known folders.

Test: run xmllint against a config with absolute paths
Bug: 37492580
Change-Id: I2863e04b3cdf0c6758d9f7be33796621fee527ed
Signed-off-by: Kevin Rocard <krocard@google.com>
audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd

index 5265303..9ae1621 100644 (file)
       <xs:enumeration value="tts"/>
     </xs:restriction>
   </xs:simpleType>
+  <xs:simpleType name="relativePathType">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[^/].*"/>
+    </xs:restriction>
+  </xs:simpleType>
 
   <!-- Complex types -->
   <xs:complexType name="librariesType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         List of effect libraries to load. Each library element must have "name" and
-        "path" attributes. The latter is giving the full path of the library .so file.
-
-        Example:
+        "path" attributes. The latter is giving the path of the library .so file
+        relative to the standard effect folders: /(vendor|odm|system)/lib(64)?/soundfx/
 
-        <library name="name" path="/vendor/lib/soundfx/lib.so"/>
+        Example for a library in "/vendor/lib/soundfx/lib.so":
+        <library name="name" path="lib.so"/>
 
       </xs:documentation>
     </xs:annotation>
@@ -74,7 +79,7 @@
       <xs:element name="library" minOccurs="0" maxOccurs="unbounded">
         <xs:complexType>
           <xs:attribute name="name" type="xs:string" use="required"/>
-          <xs:attribute name="path" type="xs:string" use="required"/>
+          <xs:attribute name="path" type="aec:relativePathType" use="required"/>
         </xs:complexType>
       </xs:element>
     </xs:sequence>