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

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

Issue 866573004: media: Enable Opus support in Clank <video> and MSE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 return false; 729 return false;
730 if (is_audio && audio_stream_) { 730 if (is_audio && audio_stream_) {
731 media::AudioDecoderConfig config = audio_stream_->audio_decoder_config(); 731 media::AudioDecoderConfig config = audio_stream_->audio_decoder_config();
732 configs->audio_codec = config.codec(); 732 configs->audio_codec = config.codec();
733 configs->audio_channels = 733 configs->audio_channels =
734 media::ChannelLayoutToChannelCount(config.channel_layout()); 734 media::ChannelLayoutToChannelCount(config.channel_layout());
735 configs->audio_sampling_rate = config.samples_per_second(); 735 configs->audio_sampling_rate = config.samples_per_second();
736 configs->is_audio_encrypted = config.is_encrypted(); 736 configs->is_audio_encrypted = config.is_encrypted();
737 configs->audio_extra_data = std::vector<uint8>( 737 configs->audio_extra_data = std::vector<uint8>(
738 config.extra_data(), config.extra_data() + config.extra_data_size()); 738 config.extra_data(), config.extra_data() + config.extra_data_size());
739 configs->audio_codec_delay_ns = static_cast<int64_t>(
740 config.codec_delay() * (1000000000.0 / config.samples_per_second()));
Tom Finegan 2015/01/22 02:35:14 Time::kNanosecondsPerSecond ?
vignesh 2015/01/22 21:29:50 Done.
741 configs->audio_seek_preroll_ns =
742 config.seek_preroll().InMicroseconds() * 1000;
Tom Finegan 2015/01/22 02:35:14 Time::kNanosecondsPerMicrosecond ?
vignesh 2015/01/22 21:29:50 Done.
739 return true; 743 return true;
740 } 744 }
741 if (!is_audio && video_stream_) { 745 if (!is_audio && video_stream_) {
742 media::VideoDecoderConfig config = video_stream_->video_decoder_config(); 746 media::VideoDecoderConfig config = video_stream_->video_decoder_config();
743 configs->video_codec = config.codec(); 747 configs->video_codec = config.codec();
744 configs->video_size = config.natural_size(); 748 configs->video_size = config.natural_size();
745 configs->is_video_encrypted = config.is_encrypted(); 749 configs->is_video_encrypted = config.is_encrypted();
746 configs->video_extra_data = std::vector<uint8>( 750 configs->video_extra_data = std::vector<uint8>(
747 config.extra_data(), config.extra_data() + config.extra_data_size()); 751 config.extra_data(), config.extra_data() + config.extra_data_size());
748 return true; 752 return true;
749 } 753 }
750 return false; 754 return false;
751 } 755 }
752 756
753 } // namespace content 757 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698