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; | |
156 memset(&strides_, 0, sizeof(strides_)); | 155 memset(&strides_, 0, sizeof(strides_)); |
157 memset(&data_, 0, sizeof(data_)); | 156 memset(&data_, 0, sizeof(data_)); |
158 } | 157 } |
159 | 158 |
160 VideoFrame::~VideoFrame() { | 159 VideoFrame::~VideoFrame() { |
161 // In multi-plane allocations, only a single block of memory is allocated | 160 // In multi-plane allocations, only a single block of memory is allocated |
162 // on the heap, and other |data| pointers point inside the same, single block | 161 // on the heap, and other |data| pointers point inside the same, single block |
163 // so just delete index 0. | 162 // so just delete index 0. |
164 delete[] data_[0]; | 163 delete[] data_[0]; |
165 } | 164 } |
166 | 165 |
167 bool VideoFrame::IsEndOfStream() const { | 166 bool VideoFrame::IsEndOfStream() const { |
168 return format_ == VideoFrame::EMPTY; | 167 return format_ == VideoFrame::EMPTY; |
169 } | 168 } |
170 | 169 |
171 } // namespace media | 170 } // namespace media |
OLD | NEW |