OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_VIDEO_FRAME_H_ | 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ |
6 #define MEDIA_BASE_VIDEO_FRAME_H_ | 6 #define MEDIA_BASE_VIDEO_FRAME_H_ |
7 | 7 |
8 #include "media/base/buffers.h" | 8 #include "media/base/buffers.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 int32 stride(size_t plane) const { return strides_[plane]; } | 74 int32 stride(size_t plane) const { return strides_[plane]; } |
75 | 75 |
76 // Returns pointer to the buffer for a given plane. The memory is owned by | 76 // Returns pointer to the buffer for a given plane. The memory is owned by |
77 // VideoFrame object and must not be freed by the caller. | 77 // VideoFrame object and must not be freed by the caller. |
78 uint8* data(size_t plane) const { return data_[plane]; } | 78 uint8* data(size_t plane) const { return data_[plane]; } |
79 | 79 |
80 // StreamSample interface. | 80 // StreamSample interface. |
81 virtual bool IsEndOfStream() const; | 81 virtual bool IsEndOfStream() const; |
82 | 82 |
83 int GetRepeatCount() const { | |
84 return repeat_count_; | |
85 } | |
86 | |
87 void SetRepeatCount(int repeat_count) { | |
88 repeat_count_ = repeat_count; | |
89 } | |
90 | |
91 protected: | 83 protected: |
92 // Clients must use the static CreateFrame() method to create a new frame. | 84 // Clients must use the static CreateFrame() method to create a new frame. |
93 VideoFrame(Format format, | 85 VideoFrame(Format format, |
94 size_t video_width, | 86 size_t video_width, |
95 size_t video_height); | 87 size_t video_height); |
96 | 88 |
97 virtual ~VideoFrame(); | 89 virtual ~VideoFrame(); |
98 | 90 |
99 // Used internally by CreateFrame(). | 91 // Used internally by CreateFrame(). |
100 bool AllocateRGB(size_t bytes_per_pixel); | 92 bool AllocateRGB(size_t bytes_per_pixel); |
(...skipping 11 matching lines...) Expand all Loading... |
112 size_t planes_; | 104 size_t planes_; |
113 | 105 |
114 // Array of strides for each plane, typically greater or equal to the width | 106 // Array of strides for each plane, typically greater or equal to the width |
115 // of the surface divided by the horizontal sampling period. Note that | 107 // of the surface divided by the horizontal sampling period. Note that |
116 // strides can be negative. | 108 // strides can be negative. |
117 int32 strides_[kMaxPlanes]; | 109 int32 strides_[kMaxPlanes]; |
118 | 110 |
119 // Array of data pointers to each plane. | 111 // Array of data pointers to each plane. |
120 uint8* data_[kMaxPlanes]; | 112 uint8* data_[kMaxPlanes]; |
121 | 113 |
122 // Display meta data | |
123 int repeat_count_; | |
124 | |
125 DISALLOW_COPY_AND_ASSIGN(VideoFrame); | 114 DISALLOW_COPY_AND_ASSIGN(VideoFrame); |
126 }; | 115 }; |
127 | 116 |
128 } // namespace media | 117 } // namespace media |
129 | 118 |
130 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 119 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |