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/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/command_line.h" | |
11 #include "base/cpu.h" | 12 #include "base/cpu.h" |
12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
14 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
15 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
16 #include "base/task_runner_util.h" | 17 #include "base/task_runner_util.h" |
17 #include "gpu/command_buffer/common/mailbox_holder.h" | 18 #include "gpu/command_buffer/common/mailbox_holder.h" |
18 #include "media/base/bind_to_current_loop.h" | 19 #include "media/base/bind_to_current_loop.h" |
19 #include "media/base/decoder_buffer.h" | 20 #include "media/base/decoder_buffer.h" |
20 #include "media/base/media_log.h" | 21 #include "media/base/media_log.h" |
22 #include "media/base/media_switches.h" | |
21 #include "media/base/pipeline.h" | 23 #include "media/base/pipeline.h" |
22 #include "media/base/pipeline_status.h" | 24 #include "media/base/pipeline_status.h" |
23 #include "media/base/video_decoder_config.h" | 25 #include "media/base/video_decoder_config.h" |
24 #include "media/filters/gpu_video_accelerator_factories.h" | 26 #include "media/filters/gpu_video_accelerator_factories.h" |
25 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
26 | 28 |
27 namespace media { | 29 namespace media { |
28 | 30 |
29 // Maximum number of concurrent VDA::Decode() operations GVD will maintain. | 31 // Maximum number of concurrent VDA::Decode() operations GVD will maintain. |
30 // Higher values allow better pipelining in the GPU, but also require more | 32 // Higher values allow better pipelining in the GPU, but also require more |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 if (!pending_reset_cb_.is_null()) | 115 if (!pending_reset_cb_.is_null()) |
114 base::ResetAndReturn(&pending_reset_cb_).Run(); | 116 base::ResetAndReturn(&pending_reset_cb_).Run(); |
115 } | 117 } |
116 | 118 |
117 static bool IsCodedSizeSupported(const gfx::Size& coded_size) { | 119 static bool IsCodedSizeSupported(const gfx::Size& coded_size) { |
118 // Only non-Windows, Ivy Bridge+ platforms can support more than 1920x1080. | 120 // Only non-Windows, Ivy Bridge+ platforms can support more than 1920x1080. |
119 // We test against 1088 to account for 16x16 macroblocks. | 121 // We test against 1088 to account for 16x16 macroblocks. |
120 if (coded_size.width() <= 1920 && coded_size.height() <= 1088) | 122 if (coded_size.width() <= 1920 && coded_size.height() <= 1088) |
121 return true; | 123 return true; |
122 | 124 |
125 // NOTE: additional autodetection logic may require updating input buffer size | |
126 // selection in V4L2VideoDecodeAccelerator. | |
Ami GONE FROM CHROMIUM
2014/05/19 18:42:43
s/in/in platform-specific implementations, such as
| |
123 base::CPU cpu; | 127 base::CPU cpu; |
124 bool hw_large_video_support = | 128 bool hw_large_video_support = |
125 (cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55; | 129 CommandLine::ForCurrentProcess()->HasSwitch( |
130 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode) || | |
131 ((cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55); | |
126 bool os_large_video_support = true; | 132 bool os_large_video_support = true; |
127 #if defined(OS_WIN) | 133 #if defined(OS_WIN) |
128 os_large_video_support = false; | 134 os_large_video_support = false; |
129 #endif | 135 #endif |
130 return os_large_video_support && hw_large_video_support; | 136 return os_large_video_support && hw_large_video_support; |
131 } | 137 } |
132 | 138 |
133 // Report |status| to UMA and run |cb| with it. This is super-specific to the | 139 // Report |status| to UMA and run |cb| with it. This is super-specific to the |
134 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a | 140 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a |
135 // callsite to always be called with the same stat name (can't parameterize it). | 141 // callsite to always be called with the same stat name (can't parameterize it). |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 return; | 646 return; |
641 } | 647 } |
642 } | 648 } |
643 | 649 |
644 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
645 const { | 651 const { |
646 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
647 } | 653 } |
648 | 654 |
649 } // namespace media | 655 } // namespace media |
OLD | NEW |