diff options
author | Andy Hung <hunga@google.com> | 2013-11-07 04:06:31 +0000 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2013-11-07 04:06:31 +0000 |
commit | 8ca55fc980a567270d397c7392fd5fa8490f6d42 (patch) | |
tree | 5c5404e80d6bb6c3ed75ba738835819d9be0eeb6 /tests/AccessoryDisplay | |
parent | 52d8aa79a31c5042d2b43d06f08fa28489b27d1b (diff) |
Revert "Add "throws IOException" to MediaCodec constructors (3)"
This reverts commit 52d8aa79a31c5042d2b43d06f08fa28489b27d1b.
Change-Id: Ic706e0fb469931664499d00fa3a221726b258673
Diffstat (limited to 'tests/AccessoryDisplay')
2 files changed, 3 insertions, 15 deletions
diff --git a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/DisplaySinkService.java b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/DisplaySinkService.java index 9e6ced1882d9..daec845d21e0 100644 --- a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/DisplaySinkService.java +++ b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/DisplaySinkService.java @@ -30,7 +30,6 @@ import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; -import java.io.IOException; import java.nio.ByteBuffer; public class DisplaySinkService extends Service implements SurfaceHolder.Callback { @@ -151,12 +150,7 @@ public class DisplaySinkService extends Service implements SurfaceHolder.Callbac if (mSurface != null) { MediaFormat format = MediaFormat.createVideoFormat( "video/avc", mSurfaceWidth, mSurfaceHeight); - try { - mCodec = MediaCodec.createDecoderByType("video/avc"); - } catch (IOException e) { - throw new RuntimeException( - "IOException in MediaCodec.createDecoderByType for video/avc", e); - } + mCodec = MediaCodec.createDecoderByType("video/avc"); mCodec.configure(format, mSurface, null, 0); mCodec.start(); mCodecBufferInfo = new BufferInfo(); diff --git a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/DisplaySourceService.java b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/DisplaySourceService.java index 9207fb213063..256f900ed5a7 100644 --- a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/DisplaySourceService.java +++ b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/DisplaySourceService.java @@ -32,7 +32,6 @@ import android.os.Message; import android.view.Display; import android.view.Surface; -import java.io.IOException; import java.nio.ByteBuffer; public class DisplaySourceService extends Service { @@ -192,13 +191,8 @@ public class DisplaySourceService extends Service { format.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE); format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE); format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, I_FRAME_INTERVAL); - MediaCodec codec; - try { - codec = MediaCodec.createEncoderByType("video/avc"); - } catch (IOException e) { - throw new RuntimeException( - "IOException in MediaCodec.createEncoderByType for video/avc", e); - } + + MediaCodec codec = MediaCodec.createEncoderByType("video/avc"); codec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); Surface surface = codec.createInputSurface(); codec.start(); |