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/filters/vpx_video_decoder.h" | 5 #include "media/filters/vpx_video_decoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 vpx_codec_ = InitializeVpxContext(vpx_codec_, config); | 336 vpx_codec_ = InitializeVpxContext(vpx_codec_, config); |
337 if (!vpx_codec_) | 337 if (!vpx_codec_) |
338 return false; | 338 return false; |
339 | 339 |
340 // We use our own buffers for VP9 so that there is no need to copy data after | 340 // We use our own buffers for VP9 so that there is no need to copy data after |
341 // decoding. | 341 // decoding. |
342 if (config.codec() == kCodecVP9) { | 342 if (config.codec() == kCodecVP9) { |
343 memory_pool_ = new MemoryPool(); | 343 memory_pool_ = new MemoryPool(); |
344 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 344 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
345 memory_pool_.get(), task_runner_); | 345 memory_pool_.get(), "VpxVideoDecoder", task_runner_); |
346 if (vpx_codec_set_frame_buffer_functions(vpx_codec_, | 346 if (vpx_codec_set_frame_buffer_functions(vpx_codec_, |
347 &MemoryPool::GetVP9FrameBuffer, | 347 &MemoryPool::GetVP9FrameBuffer, |
348 &MemoryPool::ReleaseVP9FrameBuffer, | 348 &MemoryPool::ReleaseVP9FrameBuffer, |
349 memory_pool_.get())) { | 349 memory_pool_.get())) { |
350 LOG(ERROR) << "Failed to configure external buffers."; | 350 LOG(ERROR) << "Failed to configure external buffers."; |
351 return false; | 351 return false; |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 if (config.format() == PIXEL_FORMAT_YV12A) { | 355 if (config.format() == PIXEL_FORMAT_YV12A) { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); | 612 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); |
613 return; | 613 return; |
614 } | 614 } |
615 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], | 615 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], |
616 vpx_image_alpha->stride[VPX_PLANE_Y], | 616 vpx_image_alpha->stride[VPX_PLANE_Y], |
617 vpx_image_alpha->d_h, | 617 vpx_image_alpha->d_h, |
618 video_frame->get()); | 618 video_frame->get()); |
619 } | 619 } |
620 | 620 |
621 } // namespace media | 621 } // namespace media |
OLD | NEW |