| 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 kCodecRaw: |
| 64 return "audio/raw"; |
| 65 case kCodecAC3: |
| 66 return "audio/ac3"; |
| 67 case kCodecEAC3: |
| 68 return "audio/eac3"; |
| 63 default: | 69 default: |
| 64 return std::string(); | 70 return std::string(); |
| 65 } | 71 } |
| 66 } | 72 } |
| 67 | 73 |
| 68 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) { | 74 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) { |
| 69 switch (codec) { | 75 switch (codec) { |
| 70 case kCodecH264: | 76 case kCodecH264: |
| 71 return "video/avc"; | 77 return "video/avc"; |
| 72 case kCodecHEVC: | 78 case kCodecHEVC: |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 if (adaptive_playback_supported_for_testing_ == 0) | 672 if (adaptive_playback_supported_for_testing_ == 0) |
| 667 return false; | 673 return false; |
| 668 else if (adaptive_playback_supported_for_testing_ > 0) | 674 else if (adaptive_playback_supported_for_testing_ > 0) |
| 669 return true; | 675 return true; |
| 670 JNIEnv* env = AttachCurrentThread(); | 676 JNIEnv* env = AttachCurrentThread(); |
| 671 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), | 677 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), |
| 672 width, height); | 678 width, height); |
| 673 } | 679 } |
| 674 | 680 |
| 675 } // namespace media | 681 } // namespace media |
| OLD | NEW |