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

Side by Side Diff: media/base/android/sdk_media_codec_bridge.cc

Issue 2572573007: Use passthrough decoder for (E)AC3 formats (Closed)
Patch Set: Use BitReader to unpack header fileds Created 4 years 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 unified diff | Download patch
OLDNEW
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
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 // Use passthrough decoder for (E)AC3.
63 case kCodecAC3: 64 case kCodecAC3:
64 return "audio/ac3";
65 case kCodecEAC3: 65 case kCodecEAC3:
66 return "audio/eac3"; 66 return "audio/raw";
67 default: 67 default:
68 return std::string(); 68 return std::string();
69 } 69 }
70 } 70 }
71 71
72 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) { 72 static const std::string VideoCodecToAndroidMimeType(const VideoCodec& codec) {
73 switch (codec) { 73 switch (codec) {
74 case kCodecH264: 74 case kCodecH264:
75 return "video/avc"; 75 return "video/avc";
76 case kCodecHEVC: 76 case kCodecHEVC:
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 if (adaptive_playback_supported_for_testing_ == 0) 680 if (adaptive_playback_supported_for_testing_ == 0)
681 return false; 681 return false;
682 else if (adaptive_playback_supported_for_testing_ > 0) 682 else if (adaptive_playback_supported_for_testing_ > 0)
683 return true; 683 return true;
684 JNIEnv* env = AttachCurrentThread(); 684 JNIEnv* env = AttachCurrentThread();
685 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(), 685 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, media_codec(),
686 width, height); 686 width, height);
687 } 687 }
688 688
689 } // namespace media 689 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698