summaryrefslogtreecommitdiffstats
path: root/media/video/picture.cc
blob: dd57e4af4d3f3ce89d9fd6d85104fd9c48e73df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (c) 2011 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 "media/video/picture.h"

namespace media {

// PictureBuffer implementation.
PictureBuffer::PictureBuffer(int32 id,
                             gfx::Size pixel_size,
                             std::vector<uint32> color_format,
                             MemoryType memory_type,
                             std::vector<DataPlaneHandle> data_plane_handles)
    : id_(id),
      pixel_size_(pixel_size),
      color_format_(color_format),
      memory_type_(memory_type),
      data_plane_handles_(data_plane_handles) {
}

PictureBuffer::~PictureBuffer() {}

int32 PictureBuffer::GetId() {
  return id_;
}

gfx::Size PictureBuffer::GetSize() {
  return pixel_size_;
}

const std::vector<uint32>& PictureBuffer::GetColorFormat() {
  return color_format_;
}

PictureBuffer::MemoryType PictureBuffer::GetMemoryType() {
  return memory_type_;
}

std::vector<PictureBuffer::DataPlaneHandle>& PictureBuffer::GetPlaneHandles() {
  return data_plane_handles_;
}

// Picture implementation.
Picture::Picture(PictureBuffer* picture_buffer, gfx::Size decoded_pixel_size,
                 gfx::Size visible_pixel_size, void* user_handle)
    : picture_buffer_(picture_buffer),
      decoded_pixel_size_(decoded_pixel_size),
      visible_pixel_size_(visible_pixel_size),
      user_handle_(user_handle) {
}

Picture::~Picture() {}

PictureBuffer* Picture::picture_buffer() {
  return picture_buffer_;
}

gfx::Size Picture::GetDecodedSize() const {
  return decoded_pixel_size_;
}

gfx::Size Picture::GetVisibleSize() const {
  return visible_pixel_size_;
}

void* Picture::GetUserHandle() {
  return user_handle_;
}

}  // namespace media