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

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

Issue 1750213002: Fix Android black frames from MSE config changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cros build 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 "gpu/command_buffer/common/mailbox.h" 10 #include "gpu/command_buffer/common/mailbox.h"
(...skipping 17 matching lines...) Expand all
28 uint32_t texture_id, 28 uint32_t texture_id,
29 const gpu::Mailbox& texture_mailbox); 29 const gpu::Mailbox& texture_mailbox);
30 30
31 // Returns the client-specified id of the buffer. 31 // Returns the client-specified id of the buffer.
32 int32_t id() const { return id_; } 32 int32_t id() const { return id_; }
33 33
34 // Returns the size of the buffer. 34 // Returns the size of the buffer.
35 gfx::Size size() const { 35 gfx::Size size() const {
36 return size_; 36 return size_;
37 } 37 }
38 void set_size(gfx::Size size) { size_ = size; }
38 39
39 // Returns the id of the texture. 40 // Returns the id of the texture.
40 // NOTE: The texture id in the renderer process corresponds to a different 41 // NOTE: The texture id in the renderer process corresponds to a different
41 // texture id in the GPU process. 42 // texture id in the GPU process.
42 uint32_t texture_id() const { return texture_id_; } 43 uint32_t texture_id() const { return texture_id_; }
43 44
44 uint32_t internal_texture_id() const { return internal_texture_id_; } 45 uint32_t internal_texture_id() const { return internal_texture_id_; }
45 46
46 const gpu::Mailbox& texture_mailbox() const { 47 const gpu::Mailbox& texture_mailbox() const {
47 return texture_mailbox_; 48 return texture_mailbox_;
48 } 49 }
49 50
50 private: 51 private:
51 int32_t id_; 52 int32_t id_;
52 gfx::Size size_; 53 gfx::Size size_;
53 uint32_t texture_id_; 54 uint32_t texture_id_;
54 uint32_t internal_texture_id_; 55 uint32_t internal_texture_id_;
55 gpu::Mailbox texture_mailbox_; 56 gpu::Mailbox texture_mailbox_;
56 }; 57 };
57 58
58 // A decoded picture frame. 59 // A decoded picture frame.
59 // This is the media-namespace equivalent of PP_Picture_Dev. 60 // This is the media-namespace equivalent of PP_Picture_Dev.
60 class MEDIA_EXPORT Picture { 61 class MEDIA_EXPORT Picture {
61 public: 62 public:
62 Picture(int32_t picture_buffer_id, 63 Picture(int32_t picture_buffer_id,
63 int32_t bitstream_buffer_id, 64 int32_t bitstream_buffer_id,
64 const gfx::Rect& visible_rect, 65 const gfx::Rect& visible_rect,
65 bool allow_overlay); 66 bool allow_overlay,
67 bool size_changed);
liberato (no reviews please) 2016/03/05 08:51:00 since this flag has a very specific, uncommon use,
chcunningham 2016/03/08 03:19:36 I think I prefer your int flags suggestion.
66 68
67 // Returns the id of the picture buffer where this picture is contained. 69 // Returns the id of the picture buffer where this picture is contained.
68 int32_t picture_buffer_id() const { return picture_buffer_id_; } 70 int32_t picture_buffer_id() const { return picture_buffer_id_; }
69 71
70 // Returns the id of the bitstream buffer from which this frame was decoded. 72 // Returns the id of the bitstream buffer from which this frame was decoded.
71 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } 73 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; }
72 74
73 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { 75 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) {
74 bitstream_buffer_id_ = bitstream_buffer_id; 76 bitstream_buffer_id_ = bitstream_buffer_id;
75 } 77 }
76 78
77 // Returns the visible rectangle of the picture. Its size may be smaller 79 // Returns the visible rectangle of the picture. Its size may be smaller
78 // than the size of the PictureBuffer, as it is the only visible part of the 80 // than the size of the PictureBuffer, as it is the only visible part of the
79 // Picture contained in the PictureBuffer. 81 // Picture contained in the PictureBuffer.
80 gfx::Rect visible_rect() const { return visible_rect_; } 82 gfx::Rect visible_rect() const { return visible_rect_; }
81 83
82 bool allow_overlay() const { return allow_overlay_; } 84 bool allow_overlay() const { return allow_overlay_; }
83 85
86 // Returns true when the VDA has adjusted the resolution of this Picture
87 // without requesting new PictureBuffers. GpuVideoDecoder should read this
88 // as a signal to update the size of the corresponding PicutreBuffer using
89 // visible_rect() upon receiving this Picture from a VDA.
90 bool size_changed() const { return size_changed_; };
91
84 private: 92 private:
85 int32_t picture_buffer_id_; 93 int32_t picture_buffer_id_;
86 int32_t bitstream_buffer_id_; 94 int32_t bitstream_buffer_id_;
87 gfx::Rect visible_rect_; 95 gfx::Rect visible_rect_;
88 bool allow_overlay_; 96 bool allow_overlay_;
97 bool size_changed_;
89 }; 98 };
90 99
91 } // namespace media 100 } // namespace media
92 101
93 #endif // MEDIA_VIDEO_PICTURE_H_ 102 #endif // MEDIA_VIDEO_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698