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

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

Issue 898393002: media: Enable Opus support in Clank <video> and MSE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add default case to switch Created 5 years, 10 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 | « media/base/android/demuxer_stream_player_params.cc ('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 b8e2dc68f18e34a469df90a913901256de70e376..c0609331fb9bf5ed0c4ad69aee57bb7b51dd7659 100644
--- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
@@ -656,11 +656,23 @@ class MediaCodecBridge {
@CalledByNative
private static void setCodecSpecificData(MediaFormat format, int index, byte[] bytes) {
- String name = null;
- if (index == 0) {
- name = "csd-0";
- } else if (index == 1) {
- name = "csd-1";
+ // Codec Specific Data is set in the MediaFormat as ByteBuffer entries with keys csd-0,
+ // csd-1, and so on. See: http://developer.android.com/reference/android/media/MediaCodec.html
+ // for details.
+ String name;
+ switch (index) {
+ case 0:
+ name = "csd-0";
+ break;
+ case 1:
+ name = "csd-1";
+ break;
+ case 2:
+ name = "csd-2";
+ break;
+ default:
+ name = null;
+ break;
}
if (name != null) {
format.setByteBuffer(name, ByteBuffer.wrap(bytes));
« no previous file with comments | « media/base/android/demuxer_stream_player_params.cc ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698