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

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

Issue 23072043: Change NeedKeyCB to use std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix seek_tester, demuxer_bench, and player_x11 Created 7 years, 4 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 | Annotate | Revision Log
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 "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "content/renderer/media/android/webmediaplayer_proxy_android.h" 9 #include "content/renderer/media/android/webmediaplayer_proxy_android.h"
10 #include "content/renderer/media/webmediaplayer_util.h" 10 #include "content/renderer/media/webmediaplayer_util.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 DCHECK(main_loop_->BelongsToCurrentThread()); 732 DCHECK(main_loop_->BelongsToCurrentThread());
733 if (media_source_opened_cb_.is_null()) 733 if (media_source_opened_cb_.is_null())
734 return; 734 return;
735 735
736 media_source_opened_cb_.Run(new WebMediaSourceImpl( 736 media_source_opened_cb_.Run(new WebMediaSourceImpl(
737 chunk_demuxer_.get(), base::Bind(&LogMediaSourceError, media_log_))); 737 chunk_demuxer_.get(), base::Bind(&LogMediaSourceError, media_log_)));
738 } 738 }
739 739
740 void MediaSourceDelegate::OnNeedKey(const std::string& session_id, 740 void MediaSourceDelegate::OnNeedKey(const std::string& session_id,
741 const std::string& type, 741 const std::string& type,
742 scoped_ptr<uint8[]> init_data, 742 const std::vector<uint8>& init_data) {
743 int init_data_size) {
744 DCHECK(main_loop_->BelongsToCurrentThread()); 743 DCHECK(main_loop_->BelongsToCurrentThread());
745 if (need_key_cb_.is_null()) 744 if (need_key_cb_.is_null())
746 return; 745 return;
747 746
748 need_key_cb_.Run(session_id, type, init_data.Pass(), init_data_size); 747 need_key_cb_.Run(session_id, type, init_data);
749 } 748 }
750 749
751 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack( 750 scoped_ptr<media::TextTrack> MediaSourceDelegate::OnAddTextTrack(
752 media::TextKind kind, 751 media::TextKind kind,
753 const std::string& label, 752 const std::string& label,
754 const std::string& language) { 753 const std::string& language) {
755 return scoped_ptr<media::TextTrack>(); 754 return scoped_ptr<media::TextTrack>();
756 } 755 }
757 756
758 bool MediaSourceDelegate::HasEncryptedStream() { 757 bool MediaSourceDelegate::HasEncryptedStream() {
759 DCHECK_BELONG_TO_MEDIA_LOOP(); 758 DCHECK_BELONG_TO_MEDIA_LOOP();
760 return (audio_stream_ && 759 return (audio_stream_ &&
761 audio_stream_->audio_decoder_config().is_encrypted()) || 760 audio_stream_->audio_decoder_config().is_encrypted()) ||
762 (video_stream_ && 761 (video_stream_ &&
763 video_stream_->video_decoder_config().is_encrypted()); 762 video_stream_->video_decoder_config().is_encrypted());
764 } 763 }
765 764
766 void MediaSourceDelegate::SetSeeking(bool seeking) { 765 void MediaSourceDelegate::SetSeeking(bool seeking) {
767 base::AutoLock auto_lock(seeking_lock_); 766 base::AutoLock auto_lock(seeking_lock_);
768 seeking_ = seeking; 767 seeking_ = seeking;
769 } 768 }
770 769
771 bool MediaSourceDelegate::IsSeeking() const { 770 bool MediaSourceDelegate::IsSeeking() const {
772 base::AutoLock auto_lock(seeking_lock_); 771 base::AutoLock auto_lock(seeking_lock_);
773 return seeking_; 772 return seeking_;
774 } 773 }
775 774
776 } // namespace content 775 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/media_source_delegate.h ('k') | content/renderer/media/android/webmediaplayer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698