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

Unified Diff: media/base/video_frame.cc

Issue 604743005: VideoCapture: Remove deep frame copy in the border to libJingle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« media/base/video_frame.h ('K') | « media/base/video_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 5f0d7282c6e01aedfe0861ee90e55e2cb319b7c1..261d950146f833744d9a725ac6a8f61d1549f467 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -886,6 +886,23 @@ uint8* VideoFrame::data(size_t plane) const {
return data_[plane];
}
+uint8* VideoFrame::visible_data(size_t plane) const {
+ uint8* coded_data = data(plane);
+ const int coded_stride = stride(plane);
+ switch (plane) {
+ case kYPlane:
+ case kAPlane:
+ return coded_data + visible_rect_.y() * coded_stride + visible_rect_.x();
+ case kUPlane:
+ case kVPlane:
+ return coded_data + visible_rect_.y() / 2 * coded_stride +
+ visible_rect_.x() / 2;
+ default:
+ NOTIMPLEMENTED();
+ return NULL;
+ }
+}
+
const gpu::MailboxHolder* VideoFrame::mailbox_holder() const {
DCHECK_EQ(format_, NATIVE_TEXTURE);
return mailbox_holder_.get();
« media/base/video_frame.h ('K') | « media/base/video_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698