OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains an implementation of an H.264 Decoded Picture Buffer | 5 // This file contains an implementation of an H.264 Decoded Picture Buffer |
6 // used in H264 decoders. | 6 // used in H264 decoders. |
7 | 7 |
8 #ifndef MEDIA_GPU_H264_DPB_H_ | 8 #ifndef MEDIA_GPU_H264_DPB_H_ |
9 #define MEDIA_GPU_H264_DPB_H_ | 9 #define MEDIA_GPU_H264_DPB_H_ |
10 | 10 |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "media/filters/h264_parser.h" | 17 #include "media/filters/h264_parser.h" |
| 18 #include "ui/gfx/geometry/rect.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 class V4L2H264Picture; | 22 class V4L2H264Picture; |
22 class VaapiH264Picture; | 23 class VaapiH264Picture; |
23 | 24 |
24 // A picture (a frame or a field) in the H.264 spec sense. | 25 // A picture (a frame or a field) in the H.264 spec sense. |
25 // See spec at http://www.itu.int/rec/T-REC-H.264 | 26 // See spec at http://www.itu.int/rec/T-REC-H.264 |
26 class H264Picture : public base::RefCounted<H264Picture> { | 27 class H264Picture : public base::RefCounted<H264Picture> { |
27 public: | 28 public: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 78 |
78 // Values from slice_hdr to be used during reference marking and | 79 // Values from slice_hdr to be used during reference marking and |
79 // memory management after finishing this picture. | 80 // memory management after finishing this picture. |
80 bool long_term_reference_flag; | 81 bool long_term_reference_flag; |
81 bool adaptive_ref_pic_marking_mode_flag; | 82 bool adaptive_ref_pic_marking_mode_flag; |
82 H264DecRefPicMarking ref_pic_marking[H264SliceHeader::kRefListSize]; | 83 H264DecRefPicMarking ref_pic_marking[H264SliceHeader::kRefListSize]; |
83 | 84 |
84 // Position in DPB (i.e. index in DPB). | 85 // Position in DPB (i.e. index in DPB). |
85 int dpb_position; | 86 int dpb_position; |
86 | 87 |
| 88 // The visible size of picture. This could be either parsed from SPS, or set |
| 89 // to gfx::Rect(0, 0) for indicating invalid values or not available. |
| 90 gfx::Rect visible_rect; |
| 91 |
87 protected: | 92 protected: |
88 friend class base::RefCounted<H264Picture>; | 93 friend class base::RefCounted<H264Picture>; |
89 virtual ~H264Picture(); | 94 virtual ~H264Picture(); |
90 | 95 |
91 private: | 96 private: |
92 DISALLOW_COPY_AND_ASSIGN(H264Picture); | 97 DISALLOW_COPY_AND_ASSIGN(H264Picture); |
93 }; | 98 }; |
94 | 99 |
95 // DPB - Decoded Picture Buffer. | 100 // DPB - Decoded Picture Buffer. |
96 // Stores decoded pictures that will be used for future display | 101 // Stores decoded pictures that will be used for future display |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 173 |
169 H264Picture::Vector pics_; | 174 H264Picture::Vector pics_; |
170 size_t max_num_pics_; | 175 size_t max_num_pics_; |
171 | 176 |
172 DISALLOW_COPY_AND_ASSIGN(H264DPB); | 177 DISALLOW_COPY_AND_ASSIGN(H264DPB); |
173 }; | 178 }; |
174 | 179 |
175 } // namespace media | 180 } // namespace media |
176 | 181 |
177 #endif // MEDIA_GPU_H264_DPB_H_ | 182 #endif // MEDIA_GPU_H264_DPB_H_ |
OLD | NEW |