OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "media/base/android/sdk_media_codec_bridge.h" | 5 #include "media/base/android/sdk_media_codec_bridge.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 static const std::string AudioCodecToAndroidMimeType(const AudioCodec& codec) { | 53 static const std::string AudioCodecToAndroidMimeType(const AudioCodec& codec) { |
54 switch (codec) { | 54 switch (codec) { |
55 case kCodecMP3: | 55 case kCodecMP3: |
56 return "audio/mpeg"; | 56 return "audio/mpeg"; |
57 case kCodecVorbis: | 57 case kCodecVorbis: |
58 return "audio/vorbis"; | 58 return "audio/vorbis"; |
59 case kCodecOpus: | 59 case kCodecOpus: |
60 return "audio/opus"; | 60 return "audio/opus"; |
61 case kCodecAAC: | 61 case kCodecAAC: |
62 return "audio/mp4a-latm"; | 62 return "audio/mp4a-latm"; |
| 63 case kCodecAC3: |
| 64 return "audio/ac3"; |
| 65 case kCodecEAC3: |
| 66 return "audio/eac3"; |
63 default: | 67 default: |
64 return std::string(); | 68 return std::string(); |
65 } | 69 } |
66 } | 70 } |
67 | 71 |
68 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) { | 72 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) { |
69 switch (codec) { | 73 switch (codec) { |
70 case kCodecH264: | 74 case kCodecH264: |
71 return "video/avc"; | 75 return "video/avc"; |
72 case kCodecHEVC: | 76 case kCodecHEVC: |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 if (adaptive_playback_supported_for_testing_ == 0) | 676 if (adaptive_playback_supported_for_testing_ == 0) |
673 return false; | 677 return false; |
674 else if (adaptive_playback_supported_for_testing_ > 0) | 678 else if (adaptive_playback_supported_for_testing_ > 0) |
675 return true; | 679 return true; |
676 JNIEnv* env = AttachCurrentThread(); | 680 JNIEnv* env = AttachCurrentThread(); |
677 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), | 681 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), |
678 width, height); | 682 width, height); |
679 } | 683 } |
680 | 684 |
681 } // namespace media | 685 } // namespace media |
OLD | NEW |