Index: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
index 9e7894cfbef0b6e5a24ceda648ba158091b5f82c..13b9334afbac2915122e4563e55070e163f48404 100644 |
--- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
@@ -111,8 +111,13 @@ class MediaCodecBridge { |
} |
@CalledByNative |
- private MediaFormat getOutputFormat() { |
- return mMediaCodec.getOutputFormat(); |
+ private int getOutputHeight() { |
+ return mMediaCodec.getOutputFormat().getInteger(MediaFormat.KEY_HEIGHT); |
+ } |
+ |
+ @CalledByNative |
+ private int getOutputWidth() { |
+ return mMediaCodec.getOutputFormat().getInteger(MediaFormat.KEY_WIDTH); |
} |
@CalledByNative |
@@ -156,6 +161,29 @@ class MediaCodecBridge { |
} |
@CalledByNative |
+ private static MediaFormat createAudioFormat(String mime, int SampleRate, int ChannelCount) { |
+ return MediaFormat.createAudioFormat(mime, SampleRate, ChannelCount); |
+ } |
+ |
+ @CalledByNative |
+ private static MediaFormat createVideoFormat(String mime, int width, int height) { |
+ return MediaFormat.createVideoFormat(mime, width, height); |
+ } |
+ |
+ @CalledByNative |
+ private static void setCodecSpecificData(MediaFormat format, int index, ByteBuffer bytes) { |
+ String name = null; |
+ if (index == 0) { |
+ name = "csd-0"; |
+ } else if (index == 1) { |
+ name = "csd-1"; |
+ } |
+ if (name != null) { |
+ format.setByteBuffer(name, bytes); |
+ } |
+ } |
+ |
+ @CalledByNative |
private void configureAudio(MediaFormat format, MediaCrypto crypto, int flags, |
boolean playAudio) { |
mMediaCodec.configure(format, null, crypto, flags); |