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

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

Issue 13688004: Location/size change notification when external rendering is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ifdef guards Created 7 years, 8 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 5b00e5dbd3c31626a8eb0ff1563c1f33463dccee..bd58d119e59ee4d6d9532e1c24490d3a03c38473 100644
--- a/webkit/media/android/webmediaplayer_android.cc
+++ b/webkit/media/android/webmediaplayer_android.cc
@@ -54,9 +54,12 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseExternalVideoSurface)) {
+#if defined(GOOGLE_TV)
needs_external_surface_ = true;
SetNeedsEstablishPeer(false);
ReallocateVideoFrame();
+#endif
ycheo 2013/04/12 07:54:32 '#else'?
wonsik 2013/04/12 09:58:54 Done.
+ NOTIMPLEMENTED() << "No external video surface rendering support";
} else if (stream_texture_factory_.get()) {
stream_texture_proxy_.reset(stream_texture_factory_->CreateProxy());
stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_);
@@ -98,10 +101,12 @@ void WebMediaPlayerAndroid::cancelLoad() {
}
void WebMediaPlayerAndroid::play() {
+#if defined(GOOGLE_TV)
if (hasVideo() && needs_external_surface_) {
DCHECK(!needs_establish_peer_);
RequestExternalSurface();
}
+#endif
if (hasVideo() && needs_establish_peer_)
EstablishSurfaceTexturePeer();
@@ -480,4 +485,27 @@ void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) {
is_playing_ = is_playing;
}
+#if defined(GOOGLE_TV)
+bool WebMediaPlayerAndroid::GetGeometryChange(gfx::RectF* rect) {
+ if (!video_weblayer_)
+ return false;
+
+ // Compute the geometry of video frame layer.
+ cc::Layer* layer = video_weblayer_->layer();
+ rect->set_size(layer->bounds());
+ while (layer) {
+ rect->Offset(layer->position().OffsetFromOrigin());
+ layer = layer->parent();
+ }
+
+ // Return false when the geometry hasn't been changed from the last time.
+ if (last_computed_rect_ == *rect)
+ return false;
+
+ // Store the changed geometry information when it is actually changed.
+ last_computed_rect_ = *rect;
+ return true;
+}
+#endif
+
} // namespace webkit_media
« 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