| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <climits> | 8 #include <climits> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // static | 195 // static |
| 196 scoped_refptr<VideoFrame> VideoFrame::WrapNativeTextures( | 196 scoped_refptr<VideoFrame> VideoFrame::WrapNativeTextures( |
| 197 VideoPixelFormat format, | 197 VideoPixelFormat format, |
| 198 const gpu::MailboxHolder (&mailbox_holders)[kMaxPlanes], | 198 const gpu::MailboxHolder (&mailbox_holders)[kMaxPlanes], |
| 199 const ReleaseMailboxCB& mailbox_holder_release_cb, | 199 const ReleaseMailboxCB& mailbox_holder_release_cb, |
| 200 const gfx::Size& coded_size, | 200 const gfx::Size& coded_size, |
| 201 const gfx::Rect& visible_rect, | 201 const gfx::Rect& visible_rect, |
| 202 const gfx::Size& natural_size, | 202 const gfx::Size& natural_size, |
| 203 base::TimeDelta timestamp) { | 203 base::TimeDelta timestamp) { |
| 204 if (format != PIXEL_FORMAT_ARGB && format != PIXEL_FORMAT_XRGB && | 204 if (format != PIXEL_FORMAT_ARGB && format != PIXEL_FORMAT_XRGB && |
| 205 format != PIXEL_FORMAT_UYVY && format != PIXEL_FORMAT_NV12 && | 205 format != PIXEL_FORMAT_UYVY && format != PIXEL_FORMAT_YUY2 && |
| 206 format != PIXEL_FORMAT_I420) { | 206 format != PIXEL_FORMAT_NV12 && format != PIXEL_FORMAT_I420) { |
| 207 LOG(DFATAL) << "Unsupported pixel format supported, got " | 207 LOG(DFATAL) << "Unsupported pixel format supported, got " |
| 208 << VideoPixelFormatToString(format); | 208 << VideoPixelFormatToString(format); |
| 209 return nullptr; | 209 return nullptr; |
| 210 } | 210 } |
| 211 const StorageType storage = STORAGE_OPAQUE; | 211 const StorageType storage = STORAGE_OPAQUE; |
| 212 if (!IsValidConfig(format, storage, coded_size, visible_rect, natural_size)) { | 212 if (!IsValidConfig(format, storage, coded_size, visible_rect, natural_size)) { |
| 213 LOG(DFATAL) << __func__ << " Invalid config." | 213 LOG(DFATAL) << __func__ << " Invalid config." |
| 214 << ConfigToString(format, storage, coded_size, visible_rect, | 214 << ConfigToString(format, storage, coded_size, visible_rect, |
| 215 natural_size); | 215 natural_size); |
| 216 return nullptr; | 216 return nullptr; |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 if (zero_initialize_memory) | 1206 if (zero_initialize_memory) |
| 1207 memset(data, 0, data_size); | 1207 memset(data, 0, data_size); |
| 1208 | 1208 |
| 1209 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) | 1209 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) |
| 1210 data_[plane] = data + offset[plane]; | 1210 data_[plane] = data + offset[plane]; |
| 1211 | 1211 |
| 1212 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); | 1212 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 } // namespace media | 1215 } // namespace media |
| OLD | NEW |