Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java

Issue 14932020: Add Create() function to AudioCodecBridge and VideoCodecBridge to allow return of null pointers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove dependency, remove target in another CL Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698