| Index: media/blink/webmediaplayer_impl.cc
|
| diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
|
| index 071e70ea84795f1ee587582696245009946f7175..dc42a3d23d396df755ac8ea0160132c1ac240ee0 100644
|
| --- a/media/blink/webmediaplayer_impl.cc
|
| +++ b/media/blink/webmediaplayer_impl.cc
|
| @@ -191,6 +191,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
|
| suppress_destruction_errors_(false) {
|
| DCHECK(!adjust_allocated_memory_cb_.is_null());
|
| DCHECK(renderer_factory_);
|
| + DCHECK(client_);
|
|
|
| if (delegate_)
|
| delegate_id_ = delegate_->AddObserver(this);
|
| @@ -803,6 +804,30 @@ void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated(
|
| // WebSourceBufferImpl.
|
| DCHECK(demuxer_.get());
|
| DCHECK(!chunk_demuxer_);
|
| +
|
| + // Report the media track information to blink.
|
| + for (const auto& track : tracks->tracks()) {
|
| + if (track->type() == MediaTrack::Audio) {
|
| + auto track_id = client_->addAudioTrack(
|
| + blink::WebString::fromUTF8(track->id()),
|
| + blink::WebMediaPlayerClient::AudioTrackKindMain,
|
| + blink::WebString::fromUTF8(track->label()),
|
| + blink::WebString::fromUTF8(track->language()),
|
| + /*enabled*/ true);
|
| + (void)track_id;
|
| + } else if (track->type() == MediaTrack::Video) {
|
| + auto track_id = client_->addVideoTrack(
|
| + blink::WebString::fromUTF8(track->id()),
|
| + blink::WebMediaPlayerClient::VideoTrackKindMain,
|
| + blink::WebString::fromUTF8(track->label()),
|
| + blink::WebString::fromUTF8(track->language()),
|
| + /*selected*/ true);
|
| + (void)track_id;
|
| + } else {
|
| + // Text tracks are not supported through this code path yet.
|
| + NOTREACHED();
|
| + }
|
| + }
|
| }
|
|
|
| void WebMediaPlayerImpl::OnWaitingForDecryptionKey() {
|
| @@ -1209,8 +1234,7 @@ void WebMediaPlayerImpl::StartPipeline() {
|
|
|
| #if !defined(MEDIA_DISABLE_FFMPEG)
|
| Demuxer::MediaTracksUpdatedCB media_tracks_updated_cb =
|
| - base::Bind(&WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated,
|
| - base::Unretained(this));
|
| + BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated);
|
|
|
| demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(),
|
| encrypted_media_init_data_cb,
|
|
|