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

Side by Side Diff: content/renderer/media/android/media_source_delegate.cc

Issue 898393002: media: Enable Opus support in Clank <video> and MSE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add default case to switch Created 5 years, 10 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/renderer/media/android/media_source_delegate.h" 5 #include "content/renderer/media/android/media_source_delegate.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 return false; 730 return false;
731 if (is_audio && audio_stream_) { 731 if (is_audio && audio_stream_) {
732 media::AudioDecoderConfig config = audio_stream_->audio_decoder_config(); 732 media::AudioDecoderConfig config = audio_stream_->audio_decoder_config();
733 configs->audio_codec = config.codec(); 733 configs->audio_codec = config.codec();
734 configs->audio_channels = 734 configs->audio_channels =
735 media::ChannelLayoutToChannelCount(config.channel_layout()); 735 media::ChannelLayoutToChannelCount(config.channel_layout());
736 configs->audio_sampling_rate = config.samples_per_second(); 736 configs->audio_sampling_rate = config.samples_per_second();
737 configs->is_audio_encrypted = config.is_encrypted(); 737 configs->is_audio_encrypted = config.is_encrypted();
738 configs->audio_extra_data = std::vector<uint8>( 738 configs->audio_extra_data = std::vector<uint8>(
739 config.extra_data(), config.extra_data() + config.extra_data_size()); 739 config.extra_data(), config.extra_data() + config.extra_data_size());
740 configs->audio_codec_delay_ns = static_cast<int64_t>(
741 config.codec_delay() *
742 (static_cast<double>(base::Time::kNanosecondsPerSecond) /
743 config.samples_per_second()));
744 configs->audio_seek_preroll_ns =
745 config.seek_preroll().InMicroseconds() *
746 base::Time::kNanosecondsPerMicrosecond;
740 return true; 747 return true;
741 } 748 }
742 if (!is_audio && video_stream_) { 749 if (!is_audio && video_stream_) {
743 media::VideoDecoderConfig config = video_stream_->video_decoder_config(); 750 media::VideoDecoderConfig config = video_stream_->video_decoder_config();
744 configs->video_codec = config.codec(); 751 configs->video_codec = config.codec();
745 configs->video_size = config.natural_size(); 752 configs->video_size = config.natural_size();
746 configs->is_video_encrypted = config.is_encrypted(); 753 configs->is_video_encrypted = config.is_encrypted();
747 configs->video_extra_data = std::vector<uint8>( 754 configs->video_extra_data = std::vector<uint8>(
748 config.extra_data(), config.extra_data() + config.extra_data_size()); 755 config.extra_data(), config.extra_data() + config.extra_data_size());
749 return true; 756 return true;
750 } 757 }
751 return false; 758 return false;
752 } 759 }
753 760
754 } // namespace content 761 } // namespace content
OLDNEW
« no previous file with comments | « content/common/media/media_player_messages_android.h ('k') | media/base/android/audio_decoder_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698