OSDN Git Service

Audio effect XSD: Give effect proxy its own tag
authorKevin Rocard <krocard@google.com>
Wed, 7 Jun 2017 22:25:03 +0000 (15:25 -0700)
committerMikhail Naganov <mnaganov@google.com>
Sat, 8 Jul 2017 00:45:15 +0000 (17:45 -0700)
Effect and effect proxy do not have the same xml structure.
As they had the same xml tag, it was impossible to discriminate them in
the xsd. Leading to xsd validating incorrect xml.

This patch changes the xsd to force proxy effect to have the type
<effectProxy> instead of <element>.

With this patch, effects have to be explicit about being a proxy and
they are forced to have a hw *and* a sw library.

Bug: 37492580
Test: validated xsd against converted effects.conf
Test: vendor/box/user/mnaganov/audio-effects-conf/test.sh
Change-Id: Idf8a1040feccbfd6a346ab9bc892f3b7e87df530
Signed-off-by: Kevin Rocard <krocard@google.com>
audio/effect/2.0/xml/audio_effects_conf_V2_0.xsd

index 64647de..5265303 100644 (file)
@@ -58,7 +58,7 @@
   </xs:simpleType>
 
   <!-- Complex types -->
-  <xs:complexType name="libraryType">
+  <xs:complexType name="librariesType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         List of effect libraries to load. Each library element must have "name" and
     <xs:attribute name="library" type="xs:string" use="required"/>
     <xs:attribute name="uuid" type="aec:uuidType" use="required"/>
   </xs:complexType>
-  <xs:complexType name="effectProxyType">
+  <xs:complexType name="effectType">
     <xs:complexContent>
       <xs:extension base="aec:effectImplType">
+        <xs:attribute name="name" type="xs:string" use="required"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="effectProxyType">
+    <xs:complexContent>
+      <xs:extension base="aec:effectType">
         <xs:sequence>
-          <xs:element name="libsw" type="aec:effectImplType" minOccurs="0" maxOccurs="1"/>
-          <xs:element name="libhw" type="aec:effectImplType" minOccurs="0" maxOccurs="1"/>
+          <xs:element name="libsw" type="aec:effectImplType"/>
+          <xs:element name="libhw" type="aec:effectImplType"/>
         </xs:sequence>
-        <xs:attribute name="name" type="xs:string" use="required"/>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>
-  <xs:complexType name="effectType">
+  <xs:complexType name="effectsType">
     <xs:annotation>
       <xs:documentation xml:lang="en">
         List of effects to load. Each effect element must contain "name",
         Example:
 
         <effect name="name" library="lib" uuid="uuuu"/>
-        <effect name="proxied" library="proxy" uuid="xxxx">
+        <effectProxy name="proxied" library="proxy" uuid="xxxx">
             <libsw library="sw_bundle" uuid="yyyy"/>
             <libhw library="offload_bundle" uuid="zzzz"/>
-        </effect>
+        </effectProxy>
 
       </xs:documentation>
     </xs:annotation>
-    <xs:sequence>
-      <xs:element name="effect" type="aec:effectProxyType" minOccurs="0" maxOccurs="unbounded"/>
-    </xs:sequence>
+    <xs:choice maxOccurs="unbounded">
+      <xs:element name="effect" type="aec:effectType" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element name="effectProxy" type="aec:effectProxyType" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:choice>
   </xs:complexType>
   <xs:complexType name="streamProcessingType">
     <xs:sequence>
   <xs:element name="audio_effects_conf">
     <xs:complexType>
       <xs:sequence>
-        <xs:element name="libraries" type="aec:libraryType"/>
-        <xs:element name="effects" type="aec:effectType"/>
+        <xs:element name="libraries" type="aec:librariesType"/>
+        <xs:element name="effects" type="aec:effectsType"/>
         <xs:element name="postprocess" minOccurs="0" maxOccurs="1">
           <xs:complexType>
             <xs:sequence>