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

Side by Side Diff: media/video/picture.h

Issue 1751323002: Allow multiple texture ids per picture buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_VIDEO_PICTURE_H_ 5 #ifndef MEDIA_VIDEO_PICTURE_H_
6 #define MEDIA_VIDEO_PICTURE_H_ 6 #define MEDIA_VIDEO_PICTURE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector>
11
10 #include "gpu/command_buffer/common/mailbox.h" 12 #include "gpu/command_buffer/common/mailbox.h"
11 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
12 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h" 15 #include "ui/gfx/geometry/size.h"
14 16
15 namespace media { 17 namespace media {
16 18
17 // A picture buffer that is composed of a GLES2 texture. 19 // A picture buffer that is composed of a GLES2 texture.
18 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. 20 // This is the media-namespace equivalent of PP_PictureBuffer_Dev.
19 class MEDIA_EXPORT PictureBuffer { 21 class MEDIA_EXPORT PictureBuffer {
20 public: 22 public:
21 PictureBuffer(int32_t id, gfx::Size size, uint32_t texture_id); 23 enum { kMaxPlanes = 4 };
24 using TextureIds = std::vector<uint32_t>;
25
26 PictureBuffer(int32_t id, gfx::Size size, TextureIds texture_ids);
22 PictureBuffer(int32_t id, 27 PictureBuffer(int32_t id,
23 gfx::Size size, 28 gfx::Size size,
24 uint32_t texture_id, 29 TextureIds texture_ids,
25 uint32_t internal_texture_id); 30 TextureIds internal_texture_ids);
26 PictureBuffer(int32_t id, 31 PictureBuffer(int32_t id,
27 gfx::Size size, 32 gfx::Size size,
28 uint32_t texture_id, 33 TextureIds texture_ids,
29 const gpu::Mailbox& texture_mailbox); 34 gpu::Mailbox texture_mailbox[kMaxPlanes]);
35 ~PictureBuffer();
30 36
31 // Returns the client-specified id of the buffer. 37 // Returns the client-specified id of the buffer.
32 int32_t id() const { return id_; } 38 int32_t id() const { return id_; }
33 39
34 // Returns the size of the buffer. 40 // Returns the size of the buffer.
35 gfx::Size size() const { 41 gfx::Size size() const {
36 return size_; 42 return size_;
37 } 43 }
38 void set_size(const gfx::Size& size) { size_ = size; } 44 void set_size(const gfx::Size& size) { size_ = size; }
39 45
40 // Returns the id of the texture. 46 // Returns the id of the texture.
41 // NOTE: The texture id in the renderer process corresponds to a different 47 // NOTE: The texture id in the renderer process corresponds to a different
42 // texture id in the GPU process. 48 // texture id in the GPU process.
43 uint32_t texture_id() const { return texture_id_; } 49 const TextureIds& texture_ids() const { return texture_ids_; }
44 50
45 uint32_t internal_texture_id() const { return internal_texture_id_; } 51 const TextureIds& internal_texture_ids() const {
52 return internal_texture_ids_;
53 }
46 54
47 const gpu::Mailbox& texture_mailbox() const { 55 const gpu::Mailbox& texture_mailbox(size_t plane) const {
48 return texture_mailbox_; 56 return texture_mailbox_[plane];
49 } 57 }
50 58
51 private: 59 private:
52 int32_t id_; 60 int32_t id_;
53 gfx::Size size_; 61 gfx::Size size_;
54 uint32_t texture_id_; 62 TextureIds texture_ids_;
55 uint32_t internal_texture_id_; 63 TextureIds internal_texture_ids_;
56 gpu::Mailbox texture_mailbox_; 64 gpu::Mailbox texture_mailbox_[kMaxPlanes];
57 }; 65 };
58 66
59 // A decoded picture frame. 67 // A decoded picture frame.
60 // This is the media-namespace equivalent of PP_Picture_Dev. 68 // This is the media-namespace equivalent of PP_Picture_Dev.
61 class MEDIA_EXPORT Picture { 69 class MEDIA_EXPORT Picture {
62 public: 70 public:
63 // Defaults |size_changed_| to false. Size changed is currently only used 71 // Defaults |size_changed_| to false. Size changed is currently only used
64 // by AVDA and is set via set_size_changd(). 72 // by AVDA and is set via set_size_changd().
65 Picture(int32_t picture_buffer_id, 73 Picture(int32_t picture_buffer_id,
66 int32_t bitstream_buffer_id, 74 int32_t bitstream_buffer_id,
(...skipping 29 matching lines...) Expand all
96 int32_t picture_buffer_id_; 104 int32_t picture_buffer_id_;
97 int32_t bitstream_buffer_id_; 105 int32_t bitstream_buffer_id_;
98 gfx::Rect visible_rect_; 106 gfx::Rect visible_rect_;
99 bool allow_overlay_; 107 bool allow_overlay_;
100 bool size_changed_; 108 bool size_changed_;
101 }; 109 };
102 110
103 } // namespace media 111 } // namespace media
104 112
105 #endif // MEDIA_VIDEO_PICTURE_H_ 113 #endif // MEDIA_VIDEO_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698