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

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, 8 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 <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 using TextureIds = std::vector<uint32_t>;
24
25 PictureBuffer(int32_t id, gfx::Size size, const TextureIds& texture_ids);
22 PictureBuffer(int32_t id, 26 PictureBuffer(int32_t id,
23 gfx::Size size, 27 gfx::Size size,
24 uint32_t texture_id, 28 const TextureIds& texture_ids,
25 uint32_t internal_texture_id); 29 const TextureIds& internal_texture_ids);
26 PictureBuffer(int32_t id, 30 PictureBuffer(int32_t id,
27 gfx::Size size, 31 gfx::Size size,
28 uint32_t texture_id, 32 const TextureIds& texture_ids,
29 const gpu::Mailbox& texture_mailbox); 33 const std::vector<gpu::Mailbox>& texture_mailboxes);
34 ~PictureBuffer();
30 35
31 // Returns the client-specified id of the buffer. 36 // Returns the client-specified id of the buffer.
32 int32_t id() const { return id_; } 37 int32_t id() const { return id_; }
33 38
34 // Returns the size of the buffer. 39 // Returns the size of the buffer.
35 gfx::Size size() const { 40 gfx::Size size() const {
36 return size_; 41 return size_;
37 } 42 }
38 void set_size(const gfx::Size& size) { size_ = size; } 43 void set_size(const gfx::Size& size) { size_ = size; }
39 44
40 // Returns the id of the texture. 45 // Returns the id of the texture.
41 // NOTE: The texture id in the renderer process corresponds to a different 46 // NOTE: The texture id in the renderer process corresponds to a different
42 // texture id in the GPU process. 47 // texture id in the GPU process.
43 uint32_t texture_id() const { return texture_id_; } 48 const TextureIds& texture_ids() const { return texture_ids_; }
44 49
45 uint32_t internal_texture_id() const { return internal_texture_id_; } 50 const TextureIds& internal_texture_ids() const {
51 return internal_texture_ids_;
52 }
46 53
47 const gpu::Mailbox& texture_mailbox() const { 54 const gpu::Mailbox& texture_mailbox(size_t plane) const {
48 return texture_mailbox_; 55 return texture_mailboxes_[plane];
49 } 56 }
50 57
51 private: 58 private:
52 int32_t id_; 59 int32_t id_;
53 gfx::Size size_; 60 gfx::Size size_;
54 uint32_t texture_id_; 61 TextureIds texture_ids_;
55 uint32_t internal_texture_id_; 62 TextureIds internal_texture_ids_;
56 gpu::Mailbox texture_mailbox_; 63 std::vector<gpu::Mailbox> texture_mailboxes_;
57 }; 64 };
58 65
59 // A decoded picture frame. 66 // A decoded picture frame.
60 // This is the media-namespace equivalent of PP_Picture_Dev. 67 // This is the media-namespace equivalent of PP_Picture_Dev.
61 class MEDIA_EXPORT Picture { 68 class MEDIA_EXPORT Picture {
62 public: 69 public:
63 // Defaults |size_changed_| to false. Size changed is currently only used 70 // Defaults |size_changed_| to false. Size changed is currently only used
64 // by AVDA and is set via set_size_changd(). 71 // by AVDA and is set via set_size_changd().
65 Picture(int32_t picture_buffer_id, 72 Picture(int32_t picture_buffer_id,
66 int32_t bitstream_buffer_id, 73 int32_t bitstream_buffer_id,
(...skipping 29 matching lines...) Expand all
96 int32_t picture_buffer_id_; 103 int32_t picture_buffer_id_;
97 int32_t bitstream_buffer_id_; 104 int32_t bitstream_buffer_id_;
98 gfx::Rect visible_rect_; 105 gfx::Rect visible_rect_;
99 bool allow_overlay_; 106 bool allow_overlay_;
100 bool size_changed_; 107 bool size_changed_;
101 }; 108 };
102 109
103 } // namespace media 110 } // namespace media
104 111
105 #endif // MEDIA_VIDEO_PICTURE_H_ 112 #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