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

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
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/video/picture.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "gpu/command_buffer/common/mailbox.h" 10 #include "gpu/command_buffer/common/mailbox.h"
11 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 // A picture buffer that is composed of a GLES2 texture. 17 // A picture buffer that is composed of a GLES2 texture.
18 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. 18 // This is the media-namespace equivalent of PP_PictureBuffer_Dev.
19 class MEDIA_EXPORT PictureBuffer { 19 class MEDIA_EXPORT PictureBuffer {
20 public: 20 public:
21 PictureBuffer(int32_t id, gfx::Size size, uint32_t texture_id); 21 enum { kMaxPlanes = 4 };
22
23 struct TextureIds {
sandersd (OOO until July 31) 2016/03/23 00:41:00 Is there a particular reason to be using a struct,
24 TextureIds() { memset(ids, 0, sizeof(ids)); }
25 uint32_t ids[kMaxPlanes];
26 };
27 PictureBuffer(int32_t id, gfx::Size size, TextureIds texture_ids);
22 PictureBuffer(int32_t id, 28 PictureBuffer(int32_t id,
23 gfx::Size size, 29 gfx::Size size,
24 uint32_t texture_id, 30 TextureIds texture_ids,
25 uint32_t internal_texture_id); 31 TextureIds internal_texture_ids);
26 PictureBuffer(int32_t id, 32 PictureBuffer(int32_t id,
27 gfx::Size size, 33 gfx::Size size,
28 uint32_t texture_id, 34 TextureIds texture_ids,
29 const gpu::Mailbox& texture_mailbox); 35 gpu::Mailbox texture_mailbox[kMaxPlanes]);
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 TextureIds texture_ids() const { return texture_ids_; }
44 50
45 uint32_t internal_texture_id() const { return internal_texture_id_; } 51 TextureIds internal_texture_ids() const { return internal_texture_ids_; }
46 52
47 const gpu::Mailbox& texture_mailbox() const { 53 const gpu::Mailbox& texture_mailbox(size_t plane) const {
48 return texture_mailbox_; 54 return texture_mailbox_[plane];
49 } 55 }
50 56
51 private: 57 private:
52 int32_t id_; 58 int32_t id_;
53 gfx::Size size_; 59 gfx::Size size_;
54 uint32_t texture_id_; 60 TextureIds texture_ids_;
55 uint32_t internal_texture_id_; 61 TextureIds internal_texture_ids_;
56 gpu::Mailbox texture_mailbox_; 62 gpu::Mailbox texture_mailbox_[kMaxPlanes];
57 }; 63 };
58 64
59 // A decoded picture frame. 65 // A decoded picture frame.
60 // This is the media-namespace equivalent of PP_Picture_Dev. 66 // This is the media-namespace equivalent of PP_Picture_Dev.
61 class MEDIA_EXPORT Picture { 67 class MEDIA_EXPORT Picture {
62 public: 68 public:
63 // Defaults |size_changed_| to false. Size changed is currently only used 69 // Defaults |size_changed_| to false. Size changed is currently only used
64 // by AVDA and is set via set_size_changd(). 70 // by AVDA and is set via set_size_changd().
65 Picture(int32_t picture_buffer_id, 71 Picture(int32_t picture_buffer_id,
66 int32_t bitstream_buffer_id, 72 int32_t bitstream_buffer_id,
(...skipping 29 matching lines...) Expand all
96 int32_t picture_buffer_id_; 102 int32_t picture_buffer_id_;
97 int32_t bitstream_buffer_id_; 103 int32_t bitstream_buffer_id_;
98 gfx::Rect visible_rect_; 104 gfx::Rect visible_rect_;
99 bool allow_overlay_; 105 bool allow_overlay_;
100 bool size_changed_; 106 bool size_changed_;
101 }; 107 };
102 108
103 } // namespace media 109 } // namespace media
104 110
105 #endif // MEDIA_VIDEO_PICTURE_H_ 111 #endif // MEDIA_VIDEO_PICTURE_H_
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/video/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698