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

Unified Diff: ppapi/cpp/video_frame.cc

Issue 13461010: Add PP_VideoFrame, PPB_VideoReader, and PPB_VideoWriter APIs to Pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise API after design review, address review comments. Created 7 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: ppapi/cpp/video_frame.cc
diff --git a/ppapi/cpp/video_frame.cc b/ppapi/cpp/video_frame.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d79d94275540c5645019d20e68a2ef9144cf970e
--- /dev/null
+++ b/ppapi/cpp/video_frame.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/video_frame.h"
+
+namespace pp {
+
+// VideoFrame ------------------------------------------------------------------
+
+VideoFrame::VideoFrame() {
+ video_frame_.image_data = image_data_.pp_resource();
+ set_timestamp(0);
+}
+
+VideoFrame::VideoFrame(
+ PassRef,
+ const PP_VideoFrame& pp_video_frame) {
dmichael (off chromium) 2013/04/04 20:18:41 I think you probably need to default-initialize pp
bbudge 2013/04/04 21:15:16 Done.
+ video_frame_ = pp_video_frame;
+ image_data_ = ImageData(PASS_REF, pp_video_frame.image_data);
+}
+
+VideoFrame::VideoFrame(const VideoFrame& other) {
+ set_image_data(other.image_data());
+ set_timestamp(other.timestamp());
+}
+
+VideoFrame::~VideoFrame() {
+}
+
+VideoFrame& VideoFrame::operator=(const VideoFrame& other) {
+ if (this == &other)
+ return *this;
+
+ set_image_data(other.image_data());
+ set_timestamp(other.timestamp());
+
+ return *this;
+}
+
+} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698