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

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: Fix API version ids. 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..5092c5a332275397255df640ca97c70b9bc4a69e
--- /dev/null
+++ b/ppapi/cpp/video_frame.cc
@@ -0,0 +1,47 @@
+// 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_() {
+ video_frame_.image_data = image_data_.pp_resource();
+}
+
+VideoFrame::VideoFrame(const ImageData& image_data, PP_TimeTicks timestamp)
+ : image_data_(image_data), video_frame_() {
+ video_frame_.timestamp = timestamp;
+ video_frame_.image_data = image_data_.pp_resource();
+}
+
+VideoFrame::VideoFrame(PassRef, const PP_VideoFrame& pp_video_frame)
+ : video_frame_(pp_video_frame) {
+ // Take over the image_data resource in the frame.
+ image_data_ = ImageData(PASS_REF, video_frame_.image_data);
+}
+
+VideoFrame::VideoFrame(const VideoFrame& other)
+ : video_frame_() {
+ 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