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

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

Issue 1185453004: Implemented setting memory limits through WebMediaPlayer interface Base URL: https://chromium.googlesource.com/chromium/src.git@set-mem-limits-on-demux-stream
Patch Set: int -> size_t Created 5 years, 6 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 "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 return 0; 752 return 0;
753 } 753 }
754 754
755 unsigned WebMediaPlayerAndroid::videoDecodedByteCount() const { 755 unsigned WebMediaPlayerAndroid::videoDecodedByteCount() const {
756 if (media_source_delegate_) 756 if (media_source_delegate_)
757 return media_source_delegate_->VideoDecodedByteCount(); 757 return media_source_delegate_->VideoDecodedByteCount();
758 NOTIMPLEMENTED(); 758 NOTIMPLEMENTED();
759 return 0; 759 return 0;
760 } 760 }
761 761
762 size_t WebMediaPlayerAndroid::getAudioBufferSize() const {
763 if (media_source_delegate_)
764 return media_source_delegate_->getAudioBufferSize();
765 NOTIMPLEMENTED();
ddorwin 2015/06/17 21:02:27 As mentioned in https://codereview.chromium.org/11
servolk 2015/06/17 22:20:58 See my comments on other CLs: this could make sens
766 return 0;
767 }
768
769 void WebMediaPlayerAndroid::setAudioBufferSize(size_t size) {
770 if (media_source_delegate_)
771 media_source_delegate_->setAudioBufferSize(size);
772 else
773 NOTIMPLEMENTED();
774 }
775
776 size_t WebMediaPlayerAndroid::getVideoBufferSize() const {
777 if (media_source_delegate_)
778 return media_source_delegate_->getVideoBufferSize();
779 NOTIMPLEMENTED();
780 return 0;
781 }
782
783 void WebMediaPlayerAndroid::setVideoBufferSize(size_t size) {
784 if (media_source_delegate_)
785 media_source_delegate_->setVideoBufferSize(size);
786 else
787 NOTIMPLEMENTED();
788 }
789
762 void WebMediaPlayerAndroid::OnMediaMetadataChanged( 790 void WebMediaPlayerAndroid::OnMediaMetadataChanged(
763 const base::TimeDelta& duration, int width, int height, bool success) { 791 const base::TimeDelta& duration, int width, int height, bool success) {
764 DCHECK(main_thread_checker_.CalledOnValidThread()); 792 DCHECK(main_thread_checker_.CalledOnValidThread());
765 bool need_to_signal_duration_changed = false; 793 bool need_to_signal_duration_changed = false;
766 794
767 if (is_local_resource_) 795 if (is_local_resource_)
768 UpdateNetworkState(WebMediaPlayer::NetworkStateLoaded); 796 UpdateNetworkState(WebMediaPlayer::NetworkStateLoaded);
769 797
770 // Update duration, if necessary, prior to ready state updates that may 798 // Update duration, if necessary, prior to ready state updates that may
771 // cause duration() query. 799 // cause duration() query.
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 1890
1863 bool WebMediaPlayerAndroid::IsHLSStream() const { 1891 bool WebMediaPlayerAndroid::IsHLSStream() const {
1864 std::string mime; 1892 std::string mime;
1865 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; 1893 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_;
1866 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) 1894 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime))
1867 return false; 1895 return false;
1868 return !mime.compare("application/x-mpegurl"); 1896 return !mime.compare("application/x-mpegurl");
1869 } 1897 }
1870 1898
1871 } // namespace content 1899 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698