| Index: media/base/android/media_source_player.cc
|
| diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
|
| index 8380141002016aa8344e62129a1ca2a0c1dca54b..7fdf4097a1044761643694d0e368d4887e025d30 100644
|
| --- a/media/base/android/media_source_player.cc
|
| +++ b/media/base/android/media_source_player.cc
|
| @@ -191,16 +191,15 @@ void MediaSourcePlayer::StartInternal() {
|
| SyncAndStartDecoderJobs();
|
| }
|
|
|
| -void MediaSourcePlayer::DemuxerReady(
|
| - const MediaPlayerHostMsg_DemuxerReady_Params& params) {
|
| - duration_ = base::TimeDelta::FromMilliseconds(params.duration_ms);
|
| +void MediaSourcePlayer::DemuxerReady(const MediaConfigs& configs) {
|
| + duration_ = base::TimeDelta::FromMilliseconds(configs.duration_ms);
|
| clock_.SetDuration(duration_);
|
|
|
| - audio_codec_ = params.audio_codec;
|
| - num_channels_ = params.audio_channels;
|
| - sampling_rate_ = params.audio_sampling_rate;
|
| - is_audio_encrypted_ = params.is_audio_encrypted;
|
| - audio_extra_data_ = params.audio_extra_data;
|
| + audio_codec_ = configs.audio_codec;
|
| + num_channels_ = configs.audio_channels;
|
| + sampling_rate_ = configs.audio_sampling_rate;
|
| + is_audio_encrypted_ = configs.is_audio_encrypted;
|
| + audio_extra_data_ = configs.audio_extra_data;
|
| if (HasAudio()) {
|
| DCHECK_GT(num_channels_, 0);
|
| audio_timestamp_helper_.reset(new AudioTimestampHelper(sampling_rate_));
|
| @@ -209,10 +208,10 @@ void MediaSourcePlayer::DemuxerReady(
|
| audio_timestamp_helper_.reset();
|
| }
|
|
|
| - video_codec_ = params.video_codec;
|
| - width_ = params.video_size.width();
|
| - height_ = params.video_size.height();
|
| - is_video_encrypted_ = params.is_video_encrypted;
|
| + video_codec_ = configs.video_codec;
|
| + width_ = configs.video_size.width();
|
| + height_ = configs.video_size.height();
|
| + is_video_encrypted_ = configs.is_video_encrypted;
|
|
|
| OnMediaMetadataChanged(duration_, width_, height_, true);
|
|
|
| @@ -232,10 +231,9 @@ void MediaSourcePlayer::DemuxerReady(
|
| }
|
| }
|
|
|
| -void MediaSourcePlayer::ReadFromDemuxerAck(
|
| - const MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params) {
|
| - DCHECK_LT(0u, params.access_units.size());
|
| - if (params.type == DemuxerStream::AUDIO)
|
| +void MediaSourcePlayer::ReadFromDemuxerAck(const MediaData& data) {
|
| + DCHECK_LT(0u, data.access_units.size());
|
| + if (data.type == DemuxerStream::AUDIO)
|
| waiting_for_audio_data_ = false;
|
| else
|
| waiting_for_video_data_ = false;
|
| @@ -245,12 +243,12 @@ void MediaSourcePlayer::ReadFromDemuxerAck(
|
| if (pending_event_ & SEEK_EVENT_PENDING)
|
| return;
|
|
|
| - if (params.type == DemuxerStream::AUDIO) {
|
| + if (data.type == DemuxerStream::AUDIO) {
|
| DCHECK_EQ(0u, audio_access_unit_index_);
|
| - received_audio_ = params;
|
| + received_audio_ = data;
|
| } else {
|
| DCHECK_EQ(0u, video_access_unit_index_);
|
| - received_video_ = params;
|
| + received_video_ = data;
|
| }
|
|
|
| if (pending_event_ != NO_EVENT_PENDING || !playing_)
|
| @@ -261,7 +259,7 @@ void MediaSourcePlayer::ReadFromDemuxerAck(
|
| return;
|
| }
|
|
|
| - if (params.type == DemuxerStream::AUDIO)
|
| + if (data.type == DemuxerStream::AUDIO)
|
| DecodeMoreAudio();
|
| else
|
| DecodeMoreVideo();
|
| @@ -432,7 +430,7 @@ void MediaSourcePlayer::DecodeMoreAudio() {
|
| // Wait for demuxer ready message.
|
| reconfig_audio_decoder_ = true;
|
| pending_event_ |= CONFIG_CHANGE_EVENT_PENDING;
|
| - received_audio_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| + received_audio_ = MediaData();
|
| audio_access_unit_index_ = 0;
|
| ProcessPendingEvents();
|
| return;
|
| @@ -455,7 +453,7 @@ void MediaSourcePlayer::DecodeMoreVideo() {
|
| // Wait for demuxer ready message.
|
| reconfig_video_decoder_ = true;
|
| pending_event_ |= CONFIG_CHANGE_EVENT_PENDING;
|
| - received_video_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| + received_video_ = MediaData();
|
| video_access_unit_index_ = 0;
|
| ProcessPendingEvents();
|
| return;
|
| @@ -492,8 +490,8 @@ void MediaSourcePlayer::ClearDecodingData() {
|
| if (video_decoder_job_)
|
| video_decoder_job_->Flush();
|
| start_time_ticks_ = base::TimeTicks();
|
| - received_audio_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| - received_video_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| + received_audio_ = MediaData();
|
| + received_video_ = MediaData();
|
| audio_access_unit_index_ = 0;
|
| video_access_unit_index_ = 0;
|
| waiting_for_audio_data_ = false;
|
| @@ -628,7 +626,7 @@ void MediaSourcePlayer::RequestAudioData() {
|
| return;
|
|
|
| manager()->OnReadFromDemuxer(player_id(), DemuxerStream::AUDIO);
|
| - received_audio_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| + received_audio_ = MediaData();
|
| audio_access_unit_index_ = 0;
|
| waiting_for_audio_data_ = true;
|
| }
|
| @@ -640,7 +638,7 @@ void MediaSourcePlayer::RequestVideoData() {
|
| return;
|
|
|
| manager()->OnReadFromDemuxer(player_id(), DemuxerStream::VIDEO);
|
| - received_video_ = MediaPlayerHostMsg_ReadFromDemuxerAck_Params();
|
| + received_video_ = MediaData();
|
| video_access_unit_index_ = 0;
|
| waiting_for_video_data_ = true;
|
| }
|
|
|