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.
4
5#include "ppapi/cpp/private/video_frame_private.h"
6
7namespace pp {
8
9VideoFrame_Private::VideoFrame_Private()
10    : video_frame_() {
11  video_frame_.image_data = image_data_.pp_resource();
12}
13
14VideoFrame_Private::VideoFrame_Private(const ImageData& image_data,
15                                       PP_TimeTicks timestamp)
16    : image_data_(image_data), video_frame_() {
17  video_frame_.timestamp = timestamp;
18  video_frame_.image_data = image_data_.pp_resource();
19}
20
21VideoFrame_Private::VideoFrame_Private(
22    PassRef,
23    const PP_VideoFrame_Private& pp_video_frame)
24    : video_frame_(pp_video_frame) {
25  // Take over the image_data resource in the frame.
26  image_data_ = ImageData(PASS_REF, video_frame_.image_data);
27}
28
29VideoFrame_Private::VideoFrame_Private(const VideoFrame_Private& other)
30    : video_frame_() {
31  set_image_data(other.image_data());
32  set_timestamp(other.timestamp());
33}
34
35VideoFrame_Private::~VideoFrame_Private() {
36}
37
38VideoFrame_Private& VideoFrame_Private::operator=(
39    const VideoFrame_Private& other) {
40  if (this == &other)
41    return *this;
42
43  set_image_data(other.image_data());
44  set_timestamp(other.timestamp());
45
46  return *this;
47}
48
49}  // namespace pp
50