| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 int32 stride(size_t plane) const { return strides_[plane]; } | 66 int32 stride(size_t plane) const { return strides_[plane]; } |
| 67 | 67 |
| 68 // Returns pointer to the buffer for a given plane. The memory is owned by | 68 // Returns pointer to the buffer for a given plane. The memory is owned by |
| 69 // VideoFrame object and must not be freed by the caller. | 69 // VideoFrame object and must not be freed by the caller. |
| 70 uint8* data(size_t plane) const { return data_[plane]; } | 70 uint8* data(size_t plane) const { return data_[plane]; } |
| 71 | 71 |
| 72 // StreamSample interface. | 72 // StreamSample interface. |
| 73 virtual bool IsEndOfStream() const; | 73 virtual bool IsEndOfStream() const; |
| 74 | 74 |
| 75 int GetRepeatCount() const { |
| 76 return repeat_count_; |
| 77 } |
| 78 |
| 79 void SetRepeatCount(int repeat_count) { |
| 80 repeat_count_ = repeat_count; |
| 81 } |
| 82 |
| 75 private: | 83 private: |
| 76 // 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. |
| 77 VideoFrame(Format format, | 85 VideoFrame(Format format, |
| 78 size_t video_width, | 86 size_t video_width, |
| 79 size_t video_height); | 87 size_t video_height); |
| 80 | 88 |
| 81 virtual ~VideoFrame(); | 89 virtual ~VideoFrame(); |
| 82 | 90 |
| 83 // Used internally by CreateFrame(). | 91 // Used internally by CreateFrame(). |
| 84 bool AllocateRGB(size_t bytes_per_pixel); | 92 bool AllocateRGB(size_t bytes_per_pixel); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 96 size_t planes_; | 104 size_t planes_; |
| 97 | 105 |
| 98 // 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 |
| 99 // of the surface divided by the horizontal sampling period. Note that | 107 // of the surface divided by the horizontal sampling period. Note that |
| 100 // strides can be negative. | 108 // strides can be negative. |
| 101 int32 strides_[kMaxPlanes]; | 109 int32 strides_[kMaxPlanes]; |
| 102 | 110 |
| 103 // Array of data pointers to each plane. | 111 // Array of data pointers to each plane. |
| 104 uint8* data_[kMaxPlanes]; | 112 uint8* data_[kMaxPlanes]; |
| 105 | 113 |
| 114 // Display meta data |
| 115 int repeat_count_; |
| 116 |
| 106 DISALLOW_COPY_AND_ASSIGN(VideoFrame); | 117 DISALLOW_COPY_AND_ASSIGN(VideoFrame); |
| 107 }; | 118 }; |
| 108 | 119 |
| 109 } // namespace media | 120 } // namespace media |
| 110 | 121 |
| 111 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 122 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |