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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constructor Created 5 years, 9 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 "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 // TODO(xhwang): Update this UMA name. 671 // TODO(xhwang): Update this UMA name.
672 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); 672 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1);
673 673
674 encrypted_media_support_.SetInitDataType(init_data_type); 674 encrypted_media_support_.SetInitDataType(init_data_type);
675 675
676 const uint8* init_data_ptr = init_data.empty() ? nullptr : &init_data[0]; 676 const uint8* init_data_ptr = init_data.empty() ? nullptr : &init_data[0];
677 client_->encrypted(WebString::fromUTF8(init_data_type), init_data_ptr, 677 client_->encrypted(WebString::fromUTF8(init_data_type), init_data_ptr,
678 base::saturated_cast<unsigned int>(init_data.size())); 678 base::saturated_cast<unsigned int>(init_data.size()));
679 } 679 }
680 680
681 void WebMediaPlayerImpl::OnWaitingForDecryptionKey() {
682 // client_->waitingForKey();
jrummell 2015/02/23 22:06:32 Forgot to update this. There are 2 options. 1) Ca
ddorwin 2015/02/23 23:47:47 Let's start with the simple solution then re-evalu
jrummell 2015/02/24 01:19:39 Done.
683 }
684
681 void WebMediaPlayerImpl::SetCdm(CdmContext* cdm_context, 685 void WebMediaPlayerImpl::SetCdm(CdmContext* cdm_context,
682 const CdmAttachedCB& cdm_attached_cb) { 686 const CdmAttachedCB& cdm_attached_cb) {
683 pipeline_.SetCdm(cdm_context, cdm_attached_cb); 687 pipeline_.SetCdm(cdm_context, cdm_attached_cb);
684 } 688 }
685 689
686 void WebMediaPlayerImpl::OnCdmAttached( 690 void WebMediaPlayerImpl::OnCdmAttached(
687 blink::WebContentDecryptionModuleResult result, 691 blink::WebContentDecryptionModuleResult result,
688 bool success) { 692 bool success) {
689 if (success) { 693 if (success) {
690 result.complete(); 694 result.complete();
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 demuxer_.get(), 886 demuxer_.get(),
883 renderer_factory_->CreateRenderer(media_task_runner_, 887 renderer_factory_->CreateRenderer(media_task_runner_,
884 audio_source_provider_.get()), 888 audio_source_provider_.get()),
885 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded), 889 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineEnded),
886 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError), 890 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineError),
887 BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnPipelineSeeked, false), 891 BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnPipelineSeeked, false),
888 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineMetadata), 892 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineMetadata),
889 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged), 893 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged),
890 base::Bind(&WebMediaPlayerImpl::FrameReady, base::Unretained(this)), 894 base::Bind(&WebMediaPlayerImpl::FrameReady, base::Unretained(this)),
891 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDurationChanged), 895 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDurationChanged),
892 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnAddTextTrack)); 896 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnAddTextTrack),
897 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnWaitingForDecryptionKey));
893 } 898 }
894 899
895 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { 900 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) {
896 DVLOG(1) << __FUNCTION__ << "(" << state << ")"; 901 DVLOG(1) << __FUNCTION__ << "(" << state << ")";
897 DCHECK(main_task_runner_->BelongsToCurrentThread()); 902 DCHECK(main_task_runner_->BelongsToCurrentThread());
898 network_state_ = state; 903 network_state_ = state;
899 // Always notify to ensure client has the latest value. 904 // Always notify to ensure client has the latest value.
900 client_->networkStateChanged(); 905 client_->networkStateChanged();
901 } 906 }
902 907
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 1004
1000 // pause() may be called after playback has ended and the HTMLMediaElement 1005 // pause() may be called after playback has ended and the HTMLMediaElement
1001 // requires that currentTime() == duration() after ending. We want to ensure 1006 // requires that currentTime() == duration() after ending. We want to ensure
1002 // |paused_time_| matches currentTime() in this case or a future seek() may 1007 // |paused_time_| matches currentTime() in this case or a future seek() may
1003 // incorrectly discard what it thinks is a seek to the existing time. 1008 // incorrectly discard what it thinks is a seek to the existing time.
1004 paused_time_ = 1009 paused_time_ =
1005 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 1010 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
1006 } 1011 }
1007 1012
1008 } // namespace media 1013 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698