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

Unified Diff: webkit/media/android/webmediaplayer_android.cc

Issue 11442056: Add external surface rendering mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separated GLRenderer change out; refined messaging scheme. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | webkit/media/android/webmediaplayer_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_android.cc
diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc
index 33fd2d92011ad940a7449726983144e187b6b6dd..9cb01a7d5ce5b9cb8a505e083897d5d92f4ee07c 100644
--- a/webkit/media/android/webmediaplayer_android.cc
+++ b/webkit/media/android/webmediaplayer_android.cc
@@ -43,6 +43,7 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
is_playing_(false),
needs_establish_peer_(true),
has_size_info_(false),
+ is_in_video_view_(false),
stream_texture_factory_(factory) {
main_loop_->AddDestructionObserver(this);
if (manager_)
@@ -380,13 +381,17 @@ void WebMediaPlayerAndroid::Detach() {
}
void WebMediaPlayerAndroid::ReallocateVideoFrame() {
- if (texture_id_) {
- video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture(
- texture_id_, kGLTextureExternalOES, natural_size_,
- gfx::Rect(natural_size_), natural_size_, base::TimeDelta(),
- VideoFrame::ReadPixelsCB(),
- base::Closure())));
+ unsigned int texture_id = texture_id_;
+ if (is_in_video_view_) {
+ texture_id = 0;
+ } else if (texture_id_ == 0) {
+ return;
}
+ video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture(
+ texture_id, kGLTextureExternalOES, natural_size_,
+ gfx::Rect(natural_size_), natural_size_, base::TimeDelta(),
+ VideoFrame::ReadPixelsCB(),
+ base::Closure())));
}
WebVideoFrame* WebMediaPlayerAndroid::getCurrentFrame() {
@@ -419,6 +424,11 @@ void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) {
needs_establish_peer_ = needs_establish_peer;
}
+void WebMediaPlayerAndroid::SetIsInVideoView(bool is_in_video_view) {
+ is_in_video_view_ = is_in_video_view;;
+ ReallocateVideoFrame();
+}
+
void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) {
is_playing_ = is_playing;
}
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | webkit/media/android/webmediaplayer_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698