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 #include "media/base/video_frame.h" | 5 #include "media/base/video_frame.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
9 // static | 9 // static |
10 void VideoFrame::CreateFrame(VideoFrame::Format format, | 10 void VideoFrame::CreateFrame(VideoFrame::Format format, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return false; | 145 return false; |
146 } | 146 } |
147 | 147 |
148 VideoFrame::VideoFrame(VideoFrame::Format format, | 148 VideoFrame::VideoFrame(VideoFrame::Format format, |
149 size_t width, | 149 size_t width, |
150 size_t height) { | 150 size_t height) { |
151 format_ = format; | 151 format_ = format; |
152 width_ = width; | 152 width_ = width; |
153 height_ = height; | 153 height_ = height; |
154 planes_ = 0; | 154 planes_ = 0; |
| 155 repeat_count_ = 0; |
155 memset(&strides_, 0, sizeof(strides_)); | 156 memset(&strides_, 0, sizeof(strides_)); |
156 memset(&data_, 0, sizeof(data_)); | 157 memset(&data_, 0, sizeof(data_)); |
157 } | 158 } |
158 | 159 |
159 VideoFrame::~VideoFrame() { | 160 VideoFrame::~VideoFrame() { |
160 // In multi-plane allocations, only a single block of memory is allocated | 161 // In multi-plane allocations, only a single block of memory is allocated |
161 // on the heap, and other |data| pointers point inside the same, single block | 162 // on the heap, and other |data| pointers point inside the same, single block |
162 // so just delete index 0. | 163 // so just delete index 0. |
163 delete[] data_[0]; | 164 delete[] data_[0]; |
164 } | 165 } |
165 | 166 |
166 bool VideoFrame::IsEndOfStream() const { | 167 bool VideoFrame::IsEndOfStream() const { |
167 return format_ == VideoFrame::EMPTY; | 168 return format_ == VideoFrame::EMPTY; |
168 } | 169 } |
169 | 170 |
170 } // namespace media | 171 } // namespace media |
OLD | NEW |