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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2749653003: Prototype HTMLVideoElement properties for WebGL texImage2D (Closed)
Patch Set: move fields to WebGLTexture Created 3 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 813a643f7cf0fc1e93183549f5163e3738b9889f..6629799ab48844fefdee3438e42499020ef987d4 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -702,6 +702,15 @@ void WebMediaPlayerImpl::selectedVideoTrackChanged(
pipeline_controller_.OnSelectedVideoTrackChanged(selected_video_track_id);
}
+bool WebMediaPlayerImpl::getLastUploadedFrameInfo(unsigned* width,
+ unsigned* height,
+ double* timestamp) {
+ *width = last_uploaded_frame_size_.width();
+ *height = last_uploaded_frame_size_.height();
+ *timestamp = last_uploaded_frame_timestamp_.InSecondsF();
+ return true;
+}
+
blink::WebSize WebMediaPlayerImpl::naturalSize() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -1841,6 +1850,9 @@ scoped_refptr<VideoFrame> WebMediaPlayerImpl::GetCurrentFrameFromCompositor() {
base::Bind(&GetCurrentFrameAndSignal, base::Unretained(compositor_),
&video_frame, &event));
event.Wait();
+
+ last_uploaded_frame_size_ = video_frame->natural_size();
+ last_uploaded_frame_timestamp_ = video_frame->timestamp();
return video_frame;
}

Powered by Google App Engine
This is Rietveld 408576698