OLD | NEW |
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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated( | 826 void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated( |
827 std::unique_ptr<MediaTracks> tracks) { | 827 std::unique_ptr<MediaTracks> tracks) { |
828 // For MSE/chunk_demuxer case the media track updates are handled by | 828 // For MSE/chunk_demuxer case the media track updates are handled by |
829 // WebSourceBufferImpl. | 829 // WebSourceBufferImpl. |
830 DCHECK(demuxer_.get()); | 830 DCHECK(demuxer_.get()); |
831 DCHECK(!chunk_demuxer_); | 831 DCHECK(!chunk_demuxer_); |
832 | 832 |
833 // Report the media track information to blink. | 833 // Report the media track information to blink. |
834 for (const auto& track : tracks->tracks()) { | 834 for (const auto& track : tracks->tracks()) { |
835 if (track->type() == MediaTrack::Audio) { | 835 if (track->type() == MediaTrack::Audio) { |
836 auto track_id = client_->addAudioTrack( | 836 client_->addAudioTrack(blink::WebString::fromUTF8(track->id()), |
837 blink::WebString::fromUTF8( | 837 blink::WebMediaPlayerClient::AudioTrackKindMain, |
838 base::UintToString(track->bytestream_track_id())), | 838 blink::WebString::fromUTF8(track->label()), |
839 blink::WebMediaPlayerClient::AudioTrackKindMain, | 839 blink::WebString::fromUTF8(track->language()), |
840 blink::WebString::fromUTF8(track->label()), | 840 /*enabled*/ true); |
841 blink::WebString::fromUTF8(track->language()), | |
842 /*enabled*/ true); | |
843 (void)track_id; | |
844 } else if (track->type() == MediaTrack::Video) { | 841 } else if (track->type() == MediaTrack::Video) { |
845 auto track_id = client_->addVideoTrack( | 842 client_->addVideoTrack(blink::WebString::fromUTF8(track->id()), |
846 blink::WebString::fromUTF8( | 843 blink::WebMediaPlayerClient::VideoTrackKindMain, |
847 base::UintToString(track->bytestream_track_id())), | 844 blink::WebString::fromUTF8(track->label()), |
848 blink::WebMediaPlayerClient::VideoTrackKindMain, | 845 blink::WebString::fromUTF8(track->language()), |
849 blink::WebString::fromUTF8(track->label()), | 846 /*selected*/ true); |
850 blink::WebString::fromUTF8(track->language()), | |
851 /*selected*/ true); | |
852 (void)track_id; | |
853 } else { | 847 } else { |
854 // Text tracks are not supported through this code path yet. | 848 // Text tracks are not supported through this code path yet. |
855 NOTREACHED(); | 849 NOTREACHED(); |
856 } | 850 } |
857 } | 851 } |
858 } | 852 } |
859 | 853 |
860 void WebMediaPlayerImpl::SetCdm(const CdmAttachedCB& cdm_attached_cb, | 854 void WebMediaPlayerImpl::SetCdm(const CdmAttachedCB& cdm_attached_cb, |
861 CdmContext* cdm_context) { | 855 CdmContext* cdm_context) { |
862 if (!cdm_context) { | 856 if (!cdm_context) { |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 if (isRemote()) | 1632 if (isRemote()) |
1639 return; | 1633 return; |
1640 #endif | 1634 #endif |
1641 | 1635 |
1642 // Idle timeout chosen arbitrarily. | 1636 // Idle timeout chosen arbitrarily. |
1643 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), | 1637 background_pause_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(5), |
1644 this, &WebMediaPlayerImpl::OnPause); | 1638 this, &WebMediaPlayerImpl::OnPause); |
1645 } | 1639 } |
1646 | 1640 |
1647 } // namespace media | 1641 } // namespace media |
OLD | NEW |