diff options
| author | 2015-04-22 23:17:58 -0700 | |
|---|---|---|
| committer | 2015-04-23 07:40:46 +0000 | |
| commit | aba29b77a5742fc920ec62dbc9ddb6f025759d65 (patch) | |
| tree | 6a33ca8897bb70c48b54864f38ebeff9528557de | |
| parent | 1c3f534a8e380367fa6d52dda7f8a894681ebac2 (diff) | |
media: rename MediaSync.configureSurface/AudioTrack to set...
Change-Id: Ia1ebf5747959a89635dd45b8966a201397374c71
| -rw-r--r-- | api/current.txt | 4 | ||||
| -rw-r--r-- | api/system-current.txt | 4 | ||||
| -rw-r--r-- | media/java/android/media/MediaSync.java | 32 |
3 files changed, 22 insertions, 18 deletions
diff --git a/api/current.txt b/api/current.txt index cb76015ad1c3..09ef131e04ff 100644 --- a/api/current.txt +++ b/api/current.txt @@ -16346,8 +16346,6 @@ package android.media { public final class MediaSync { ctor public MediaSync(); - method public void configureAudioTrack(android.media.AudioTrack); - method public void configureSurface(android.view.Surface); method public final android.view.Surface createInputSurface(); method public void flush(); method public android.media.PlaybackSettings getPlaybackSettings(); @@ -16355,9 +16353,11 @@ package android.media { method public android.media.MediaTimestamp getTimestamp(); method public void queueAudio(java.nio.ByteBuffer, int, int, long); method public final void release(); + method public void setAudioTrack(android.media.AudioTrack); method public void setCallback(android.media.MediaSync.Callback, android.os.Handler); method public void setPlaybackRate(float, int); method public void setPlaybackSettings(android.media.PlaybackSettings); + method public void setSurface(android.view.Surface); method public void setSyncSettings(android.media.SyncSettings); field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0 field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2 diff --git a/api/system-current.txt b/api/system-current.txt index f35ad9286024..26a06c352ef9 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -17561,8 +17561,6 @@ package android.media { public final class MediaSync { ctor public MediaSync(); - method public void configureAudioTrack(android.media.AudioTrack); - method public void configureSurface(android.view.Surface); method public final android.view.Surface createInputSurface(); method public void flush(); method public android.media.PlaybackSettings getPlaybackSettings(); @@ -17570,9 +17568,11 @@ package android.media { method public android.media.MediaTimestamp getTimestamp(); method public void queueAudio(java.nio.ByteBuffer, int, int, long); method public final void release(); + method public void setAudioTrack(android.media.AudioTrack); method public void setCallback(android.media.MediaSync.Callback, android.os.Handler); method public void setPlaybackRate(float, int); method public void setPlaybackSettings(android.media.PlaybackSettings); + method public void setSurface(android.view.Surface); method public void setSyncSettings(android.media.SyncSettings); field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0 field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2 diff --git a/media/java/android/media/MediaSync.java b/media/java/android/media/MediaSync.java index 43d7dcfb8bef..c1f1a7308616 100644 --- a/media/java/android/media/MediaSync.java +++ b/media/java/android/media/MediaSync.java @@ -39,13 +39,13 @@ import java.util.List; * <p>MediaSync is generally used like this: * <pre> * MediaSync sync = new MediaSync(); - * sync.configureSurface(surface); + * sync.setSurface(surface); * Surface inputSurface = sync.createInputSurface(); * ... * // MediaCodec videoDecoder = ...; * videoDecoder.configure(format, inputSurface, ...); * ... - * sync.configureAudioTrack(audioTrack); + * sync.setAudioTrack(audioTrack); * sync.setCallback(new MediaSync.Callback() { * {@literal @Override} * public void onReturnAudioBuffer(MediaSync sync, ByteBuffer audioBuffer, int bufferIndex) { @@ -95,8 +95,8 @@ import java.util.List; * * </pre> * - * The client needs to configure corresponding sink (i.e., Surface and AudioTrack) based on - * the stream type it will play. + * The client needs to configure corresponding sink by setting the Surface and/or AudioTrack + * based on the stream type it will play. * <p> * For video, the client needs to call {@link #createInputSurface} to obtain a surface on * which it will render video frames. @@ -234,29 +234,33 @@ final public class MediaSync { } /** - * Configures the output surface for MediaSync. + * Sets the output surface for MediaSync. + * <p> + * Currently, this is only supported in the Initialized state. * * @param surface Specify a surface on which to render the video data. - * @throws IllegalArgumentException if the surface has been released, or is invalid. + * @throws IllegalArgumentException if the surface has been released, is invalid, * or can not be connected. - * @throws IllegalStateException if not in the Initialized state, or another surface - * has already been configured. + * @throws IllegalStateException if setting the surface is not supported, e.g. + * not in the Initialized state, or another surface has already been configured. */ - public void configureSurface(@Nullable Surface surface) { + public void setSurface(@Nullable Surface surface) { native_configureSurface(surface); } private native final void native_configureSurface(@Nullable Surface surface); /** - * Configures the audio track for MediaSync. + * Sets the audio track for MediaSync. + * <p> + * Currently, this is only supported in the Initialized state. * * @param audioTrack Specify an AudioTrack through which to render the audio data. * @throws IllegalArgumentException if the audioTrack has been released, or is invalid. - * @throws IllegalStateException if not in the Initialized state, or another audio track - * has already been configured. + * @throws IllegalStateException if setting the audio track is not supported, e.g. + * not in the Initialized state, or another audio track has already been configured. */ - public void configureAudioTrack(@Nullable AudioTrack audioTrack) { + public void setAudioTrack(@Nullable AudioTrack audioTrack) { // AudioTrack has sanity check for configured sample rate. int nativeSampleRateInHz = (audioTrack == null ? 0 : audioTrack.getSampleRate()); @@ -272,7 +276,7 @@ final public class MediaSync { /** * Requests a Surface to use as the input. This may only be called after - * {@link #configureSurface}. + * {@link #setSurface}. * <p> * The application is responsible for calling release() on the Surface when * done. |