OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderers/video_renderer_impl.h" | 5 #include "media/renderers/video_renderer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // http://crbug.com/485699 for details. | 30 // http://crbug.com/485699 for details. |
31 static bool ShouldUseVideoRenderingPath() { | 31 static bool ShouldUseVideoRenderingPath() { |
32 // Note: It's important to query the field trial state first, to ensure that | 32 // Note: It's important to query the field trial state first, to ensure that |
33 // UMA reports the correct group. | 33 // UMA reports the correct group. |
34 const std::string group_name = | 34 const std::string group_name = |
35 base::FieldTrialList::FindFullName("NewVideoRendererTrial"); | 35 base::FieldTrialList::FindFullName("NewVideoRendererTrial"); |
36 const bool disabled_via_cli = | 36 const bool disabled_via_cli = |
37 base::CommandLine::ForCurrentProcess()->HasSwitch( | 37 base::CommandLine::ForCurrentProcess()->HasSwitch( |
38 switches::kDisableNewVideoRenderer); | 38 switches::kDisableNewVideoRenderer); |
39 return !disabled_via_cli && | 39 return !disabled_via_cli && |
40 !base::StartsWithASCII(group_name, "Disabled", true); | 40 !base::StartsWith(group_name, "Disabled", |
| 41 base::CompareCase::SENSITIVE); |
41 } | 42 } |
42 | 43 |
43 VideoRendererImpl::VideoRendererImpl( | 44 VideoRendererImpl::VideoRendererImpl( |
44 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 45 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
45 VideoRendererSink* sink, | 46 VideoRendererSink* sink, |
46 ScopedVector<VideoDecoder> decoders, | 47 ScopedVector<VideoDecoder> decoders, |
47 bool drop_frames, | 48 bool drop_frames, |
48 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, | 49 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, |
49 const scoped_refptr<MediaLog>& media_log) | 50 const scoped_refptr<MediaLog>& media_log) |
50 : task_runner_(task_runner), | 51 : task_runner_(task_runner), |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp( | 777 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp( |
777 base::TimeDelta media_time) { | 778 base::TimeDelta media_time) { |
778 std::vector<base::TimeDelta> media_times(1, media_time); | 779 std::vector<base::TimeDelta> media_times(1, media_time); |
779 std::vector<base::TimeTicks> wall_clock_times; | 780 std::vector<base::TimeTicks> wall_clock_times; |
780 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times)) | 781 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times)) |
781 return base::TimeTicks(); | 782 return base::TimeTicks(); |
782 return wall_clock_times[0]; | 783 return wall_clock_times[0]; |
783 } | 784 } |
784 | 785 |
785 } // namespace media | 786 } // namespace media |
OLD | NEW |