OSDN Git Service

Define AudioSource.REMOTE_SUBMIX.
authorJeff Brown <jeffbrown@google.com>
Fri, 16 Aug 2013 03:01:50 +0000 (20:01 -0700)
committerJeff Brown <jeffbrown@google.com>
Mon, 19 Aug 2013 23:42:07 +0000 (16:42 -0700)
Add an API to allow applications to record from the remote
submix when they have the required permissions.

Bug: 10265163
Change-Id: Id3815fe82a6713e058ce4b8ab6128a898481df7e

api/current.txt
media/java/android/media/MediaRecorder.java

index f912a0b..14bc06e 100644 (file)
@@ -12854,6 +12854,7 @@ package android.media {
     field public static final int CAMCORDER = 5; // 0x5
     field public static final int DEFAULT = 0; // 0x0
     field public static final int MIC = 1; // 0x1
+    field public static final int REMOTE_SUBMIX = 8; // 0x8
     field public static final int VOICE_CALL = 4; // 0x4
     field public static final int VOICE_COMMUNICATION = 7; // 0x7
     field public static final int VOICE_DOWNLINK = 3; // 0x3
index 3e688db..1d2b889 100644 (file)
@@ -179,6 +179,27 @@ public class MediaRecorder
          *  is applied.
          */
         public static final int VOICE_COMMUNICATION = 7;
+
+        /**
+         * Audio source for a submix of audio streams to be presented remotely.
+         * <p>
+         * An application can use this audio source to capture a mix of audio streams
+         * that should be transmitted to a remote receiver such as a Wifi display.
+         * While recording is active, these audio streams are redirected to the remote
+         * submix instead of being played on the device speaker or headset.
+         * </p><p>
+         * Certain streams are excluded from the remote submix, including
+         * {@link AudioManager#STREAM_RING}, {@link AudioManager#STREAM_ALARM},
+         * and {@link AudioManager#STREAM_NOTIFICATION}.  These streams will continue
+         * to be presented locally as usual.
+         * </p><p>
+         * Capturing the remote submix audio requires the
+         * {@link android.Manifest.permission#CAPTURE_AUDIO_OUTPUT} permission.
+         * This permission is reserved for use by system components and is not available to
+         * third-party applications.
+         * </p>
+         */
+        public static final int REMOTE_SUBMIX = 8;
     }
 
     /**
@@ -294,7 +315,7 @@ public class MediaRecorder
      * @see android.media.MediaRecorder.AudioSource
      */
     public static final int getAudioSourceMax() {
-        return AudioSource.VOICE_COMMUNICATION;
+        return AudioSource.REMOTE_SUBMIX;
     }
 
     /**