| 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 18 matching lines...) Expand all Loading... |
| 29 private static final String TAG = "cr_MediaCodecUtil"; | 29 private static final String TAG = "cr_MediaCodecUtil"; |
| 30 | 30 |
| 31 // Codec direction. Keep this in sync with media_codec_direction.h. | 31 // Codec direction. Keep this in sync with media_codec_direction.h. |
| 32 static final int MEDIA_CODEC_DECODER = 0; | 32 static final int MEDIA_CODEC_DECODER = 0; |
| 33 static final int MEDIA_CODEC_ENCODER = 1; | 33 static final int MEDIA_CODEC_ENCODER = 1; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Class to pass parameters from createDecoder() | 36 * Class to pass parameters from createDecoder() |
| 37 */ | 37 */ |
| 38 public static class CodecCreationInfo { | 38 public static class CodecCreationInfo { |
| 39 public MediaCodec mediaCodec = null; | 39 public MediaCodec mediaCodec; |
| 40 public boolean supportsAdaptivePlayback = false; | 40 public boolean supportsAdaptivePlayback; |
| 41 public BitrateAdjustmentTypes bitrateAdjustmentType = BitrateAdjustmentT
ypes.NO_ADJUSTMENT; | 41 public BitrateAdjustmentTypes bitrateAdjustmentType = BitrateAdjustmentT
ypes.NO_ADJUSTMENT; |
| 42 } | 42 } |
| 43 | 43 |
| 44 public static final class MimeTypes { | 44 public static final class MimeTypes { |
| 45 public static final String VIDEO_MP4 = "video/mp4"; | 45 public static final String VIDEO_MP4 = "video/mp4"; |
| 46 public static final String VIDEO_WEBM = "video/webm"; | 46 public static final String VIDEO_WEBM = "video/webm"; |
| 47 public static final String VIDEO_H264 = "video/avc"; | 47 public static final String VIDEO_H264 = "video/avc"; |
| 48 public static final String VIDEO_H265 = "video/hevc"; | 48 public static final String VIDEO_H265 = "video/hevc"; |
| 49 public static final String VIDEO_VP8 = "video/x-vnd.on2.vp8"; | 49 public static final String VIDEO_VP8 = "video/x-vnd.on2.vp8"; |
| 50 public static final String VIDEO_VP9 = "video/x-vnd.on2.vp9"; | 50 public static final String VIDEO_VP9 = "video/x-vnd.on2.vp9"; |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 * supported. | 532 * supported. |
| 533 * This method was introduced in Android N. Note that if platformSupportsCbc
sEncryption | 533 * This method was introduced in Android N. Note that if platformSupportsCbc
sEncryption |
| 534 * returns true, then this function will set the pattern. | 534 * returns true, then this function will set the pattern. |
| 535 */ | 535 */ |
| 536 static void setPatternIfSupported(CryptoInfo cryptoInfo, int encrypt, int sk
ip) { | 536 static void setPatternIfSupported(CryptoInfo cryptoInfo, int encrypt, int sk
ip) { |
| 537 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 537 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| 538 cryptoInfo.setPattern(new CryptoInfo.Pattern(encrypt, skip)); | 538 cryptoInfo.setPattern(new CryptoInfo.Pattern(encrypt, skip)); |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 } | 541 } |
| OLD | NEW |