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 18 matching lines...) Expand all Loading... |
29 // have enough data to support the primacy of the new video rendering path; see | 29 // have enough data to support the primacy of the new video rendering path; see |
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 && !StartsWithASCII(group_name, "Disabled", true); | 39 return !disabled_via_cli && |
| 40 !base::StartsWithASCII(group_name, "Disabled", true); |
40 } | 41 } |
41 | 42 |
42 VideoRendererImpl::VideoRendererImpl( | 43 VideoRendererImpl::VideoRendererImpl( |
43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 44 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
44 VideoRendererSink* sink, | 45 VideoRendererSink* sink, |
45 ScopedVector<VideoDecoder> decoders, | 46 ScopedVector<VideoDecoder> decoders, |
46 bool drop_frames, | 47 bool drop_frames, |
47 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, | 48 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, |
48 const scoped_refptr<MediaLog>& media_log) | 49 const scoped_refptr<MediaLog>& media_log) |
49 : task_runner_(task_runner), | 50 : task_runner_(task_runner), |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp( | 774 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp( |
774 base::TimeDelta media_time) { | 775 base::TimeDelta media_time) { |
775 std::vector<base::TimeDelta> media_times(1, media_time); | 776 std::vector<base::TimeDelta> media_times(1, media_time); |
776 std::vector<base::TimeTicks> wall_clock_times; | 777 std::vector<base::TimeTicks> wall_clock_times; |
777 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times)) | 778 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times)) |
778 return base::TimeTicks(); | 779 return base::TimeTicks(); |
779 return wall_clock_times[0]; | 780 return wall_clock_times[0]; |
780 } | 781 } |
781 | 782 |
782 } // namespace media | 783 } // namespace media |
OLD | NEW |