OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.media; | 5 package org.chromium.media; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.media.MediaCodec; | 8 import android.media.MediaCodec; |
9 import android.media.MediaCodec.CryptoInfo; | 9 import android.media.MediaCodec.CryptoInfo; |
10 import android.media.MediaCodecInfo; | 10 import android.media.MediaCodecInfo; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 {200, 10}, {800, 11}, {1800, 20}, {3600, 21}, {7200, 30}, {12000
, 31}, {18000, 40}, | 221 {200, 10}, {800, 11}, {1800, 20}, {3600, 21}, {7200, 30}, {12000
, 31}, {18000, 40}, |
222 {30000, 41}, {60000, 50}, {120000, 51}, {180000, 52}, | 222 {30000, 41}, {60000, 50}, {120000, 51}, {180000, 52}, |
223 }; | 223 }; |
224 VideoCapabilities videoCapabilities = codecCapabilities.getVideoCapabili
ties(); | 224 VideoCapabilities videoCapabilities = codecCapabilities.getVideoCapabili
ties(); |
225 for (int[] entry : bitrateMapping) { | 225 for (int[] entry : bitrateMapping) { |
226 int bitrate = entry[0]; | 226 int bitrate = entry[0]; |
227 int level = entry[1]; | 227 int level = entry[1]; |
228 if (videoCapabilities.getBitrateRange().contains(bitrate)) { | 228 if (videoCapabilities.getBitrateRange().contains(bitrate)) { |
229 // Assume all platforms before N only support VP9 profile 0. | 229 // Assume all platforms before N only support VP9 profile 0. |
230 profileLevels.addCodecProfileLevel( | 230 profileLevels.addCodecProfileLevel( |
231 VideoCodec.kCodecVP9, VideoCodecProfile.VP9PROFILE_PROFI
LE0, level); | 231 VideoCodec.CODEC_VP9, VideoCodecProfile.VP9PROFILE_PROFI
LE0, level); |
232 } | 232 } |
233 } | 233 } |
234 } | 234 } |
235 | 235 |
236 /** | 236 /** |
237 * Return an array of supported codecs and profiles. | 237 * Return an array of supported codecs and profiles. |
238 */ | 238 */ |
239 @CalledByNative | 239 @CalledByNative |
240 private static Object[] getSupportedCodecProfileLevels() { | 240 private static Object[] getSupportedCodecProfileLevels() { |
241 CodecProfileLevelList profileLevels = new CodecProfileLevelList(); | 241 CodecProfileLevelList profileLevels = new CodecProfileLevelList(); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 * supported. | 633 * supported. |
634 * This method was introduced in Android N. Note that if platformSupportsCbc
sEncryption | 634 * This method was introduced in Android N. Note that if platformSupportsCbc
sEncryption |
635 * returns true, then this function will set the pattern. | 635 * returns true, then this function will set the pattern. |
636 */ | 636 */ |
637 static void setPatternIfSupported(CryptoInfo cryptoInfo, int encrypt, int sk
ip) { | 637 static void setPatternIfSupported(CryptoInfo cryptoInfo, int encrypt, int sk
ip) { |
638 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 638 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
639 cryptoInfo.setPattern(new CryptoInfo.Pattern(encrypt, skip)); | 639 cryptoInfo.setPattern(new CryptoInfo.Pattern(encrypt, skip)); |
640 } | 640 } |
641 } | 641 } |
642 } | 642 } |
OLD | NEW |