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

Unified Diff: chromecast/media/cma/decoder/cast_audio_decoder_linux.cc

Issue 2543633006: To M56: Use ffmpeg for opus decoding, no need to maintain our decoder. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/decoder/cast_audio_decoder_linux.cc
diff --git a/chromecast/media/cma/decoder/cast_audio_decoder_linux.cc b/chromecast/media/cma/decoder/cast_audio_decoder_linux.cc
index 4138e4af43c31c5a65c4b19c93c1b6a61b30cacc..8fc50ad6bd3f4fa60a888b1673cbcbe5705aeb4b 100644
--- a/chromecast/media/cma/decoder/cast_audio_decoder_linux.cc
+++ b/chromecast/media/cma/decoder/cast_audio_decoder_linux.cc
@@ -26,27 +26,12 @@
#include "media/base/decoder_buffer.h"
#include "media/base/sample_format.h"
#include "media/filters/ffmpeg_audio_decoder.h"
-#include "media/filters/opus_audio_decoder.h"
namespace chromecast {
namespace media {
namespace {
-const int kOpusSamplingRate = 48000;
-const uint8_t kFakeOpusExtraData[19] = {
- 'O', 'p', 'u', 's', 'H', 'e', 'a', 'd', // offset 0, OpusHead
- 0, // offset 8, version
- 2, // offset 9, channels
- 0, 0, // offset 10, skip
- static_cast<uint8_t>(kOpusSamplingRate & 0xFF), // offset 12, LE
- static_cast<uint8_t>((kOpusSamplingRate >> 8) & 0xFF),
- static_cast<uint8_t>((kOpusSamplingRate >> 16) & 0xFF),
- static_cast<uint8_t>((kOpusSamplingRate >> 24) & 0xFF),
- 0, 0, // offset 16, gain
- 0, // offset 18, stereo mapping
-};
-
const int kOutputChannelCount = 2; // Always output stereo audio.
const int kMaxChannelInput = 2;
@@ -82,19 +67,8 @@ class CastAudioDecoderImpl : public CastAudioDecoder {
::media::CHANNEL_LAYOUT_STEREO));
}
base::WeakPtr<CastAudioDecoderImpl> self = weak_factory_.GetWeakPtr();
- if (config.codec == media::kCodecOpus) {
- // Insert fake extradata to make OpusAudioDecoder work with v2mirroring.
- if (config_.extra_data.empty() &&
- config_.samples_per_second == kOpusSamplingRate &&
- config_.channel_number == 2)
- config_.extra_data.assign(
- kFakeOpusExtraData,
- kFakeOpusExtraData + sizeof(kFakeOpusExtraData));
- decoder_.reset(new ::media::OpusAudioDecoder(task_runner_));
- } else {
- decoder_.reset(new ::media::FFmpegAudioDecoder(
- task_runner_, make_scoped_refptr(new ::media::MediaLog())));
- }
+ decoder_.reset(new ::media::FFmpegAudioDecoder(
+ task_runner_, make_scoped_refptr(new ::media::MediaLog())));
decoder_->Initialize(
media::DecoderConfigAdapter::ToMediaAudioDecoderConfig(config_),
nullptr, base::Bind(&CastAudioDecoderImpl::OnInitialized, self),
« no previous file with comments | « no previous file | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698