Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ppapi / cpp / video_frame.cc
blob5092c5a332275397255df640ca97c70b9bc4a69e
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/cpp/video_frame.h"
7 namespace pp {
9 // VideoFrame ------------------------------------------------------------------
11 VideoFrame::VideoFrame()
12 : video_frame_() {
13 video_frame_.image_data = image_data_.pp_resource();
16 VideoFrame::VideoFrame(const ImageData& image_data, PP_TimeTicks timestamp)
17 : image_data_(image_data), video_frame_() {
18 video_frame_.timestamp = timestamp;
19 video_frame_.image_data = image_data_.pp_resource();
22 VideoFrame::VideoFrame(PassRef, const PP_VideoFrame& pp_video_frame)
23 : video_frame_(pp_video_frame) {
24 // Take over the image_data resource in the frame.
25 image_data_ = ImageData(PASS_REF, video_frame_.image_data);
28 VideoFrame::VideoFrame(const VideoFrame& other)
29 : video_frame_() {
30 set_image_data(other.image_data());
31 set_timestamp(other.timestamp());
34 VideoFrame::~VideoFrame() {
37 VideoFrame& VideoFrame::operator=(const VideoFrame& other) {
38 if (this == &other)
39 return *this;
41 set_image_data(other.image_data());
42 set_timestamp(other.timestamp());
44 return *this;
47 } // namespace pp