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 20 matching lines...) Expand all Loading... |
31 alloc_worked = frame->AllocateRGB(3u); | 31 alloc_worked = frame->AllocateRGB(3u); |
32 break; | 32 break; |
33 case VideoFrame::RGB32: | 33 case VideoFrame::RGB32: |
34 case VideoFrame::RGBA: | 34 case VideoFrame::RGBA: |
35 alloc_worked = frame->AllocateRGB(4u); | 35 alloc_worked = frame->AllocateRGB(4u); |
36 break; | 36 break; |
37 case VideoFrame::YV12: | 37 case VideoFrame::YV12: |
38 case VideoFrame::YV16: | 38 case VideoFrame::YV16: |
39 alloc_worked = frame->AllocateYUV(); | 39 alloc_worked = frame->AllocateYUV(); |
40 break; | 40 break; |
| 41 case VideoFrame::ASCII: |
| 42 alloc_worked = frame->AllocateRGB(1u); |
| 43 break; |
41 default: | 44 default: |
42 NOTREACHED(); | 45 NOTREACHED(); |
43 alloc_worked = false; | 46 alloc_worked = false; |
44 break; | 47 break; |
45 } | 48 } |
46 } | 49 } |
47 *frame_out = alloc_worked ? frame : NULL; | 50 *frame_out = alloc_worked ? frame : NULL; |
48 } | 51 } |
49 | 52 |
50 void VideoFrame::CreateFrameExternal(VideoFrame::Format format, | 53 void VideoFrame::CreateFrameExternal(VideoFrame::Format format, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // so just delete index 0. | 215 // so just delete index 0. |
213 if (!external_memory_) | 216 if (!external_memory_) |
214 delete[] data_[0]; | 217 delete[] data_[0]; |
215 } | 218 } |
216 | 219 |
217 bool VideoFrame::IsEndOfStream() const { | 220 bool VideoFrame::IsEndOfStream() const { |
218 return format_ == VideoFrame::EMPTY; | 221 return format_ == VideoFrame::EMPTY; |
219 } | 222 } |
220 | 223 |
221 } // namespace media | 224 } // namespace media |
OLD | NEW |