Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: media/renderers/default_renderer_factory.cc

Issue 1899363002: Finish plumbing MojoVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows needs some more headers, apaprently. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/mojo/services/test_mojo_media_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/default_renderer_factory.h" 5 #include "media/renderers/default_renderer_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return audio_decoders; 65 return audio_decoders;
66 } 66 }
67 67
68 ScopedVector<VideoDecoder> DefaultRendererFactory::CreateVideoDecoders( 68 ScopedVector<VideoDecoder> DefaultRendererFactory::CreateVideoDecoders(
69 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 69 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
70 const RequestSurfaceCB& request_surface_cb, 70 const RequestSurfaceCB& request_surface_cb,
71 GpuVideoAcceleratorFactories* gpu_factories) { 71 GpuVideoAcceleratorFactories* gpu_factories) {
72 // Create our video decoders and renderer. 72 // Create our video decoders and renderer.
73 ScopedVector<VideoDecoder> video_decoders; 73 ScopedVector<VideoDecoder> video_decoders;
74 74
75 // Prefer an external decoder since one will only exist if it is hardware
76 // accelerated.
77 if (decoder_factory_)
78 decoder_factory_->CreateVideoDecoders(media_task_runner, &video_decoders);
79
80 // |gpu_factories_| requires that its entry points be called on its 75 // |gpu_factories_| requires that its entry points be called on its
81 // |GetTaskRunner()|. Since |pipeline_| will own decoders created from the 76 // |GetTaskRunner()|. Since |pipeline_| will own decoders created from the
82 // factories, require that their message loops are identical. 77 // factories, require that their message loops are identical.
83 DCHECK(!gpu_factories || 78 DCHECK(!gpu_factories ||
84 (gpu_factories->GetTaskRunner() == media_task_runner.get())); 79 (gpu_factories->GetTaskRunner() == media_task_runner.get()));
85 80
86 if (gpu_factories) 81 // Prefer an external decoder since one will only exist if it is hardware
82 // accelerated.
83 if (gpu_factories) {
84 if (decoder_factory_) {
85 decoder_factory_->CreateVideoDecoders(media_task_runner, gpu_factories,
86 &video_decoders);
87 }
87 video_decoders.push_back( 88 video_decoders.push_back(
88 new GpuVideoDecoder(gpu_factories, request_surface_cb)); 89 new GpuVideoDecoder(gpu_factories, request_surface_cb));
90 }
89 91
90 #if !defined(MEDIA_DISABLE_LIBVPX) 92 #if !defined(MEDIA_DISABLE_LIBVPX)
91 video_decoders.push_back(new VpxVideoDecoder()); 93 video_decoders.push_back(new VpxVideoDecoder());
92 #endif 94 #endif
93 95
94 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(DISABLE_FFMPEG_VIDEO_DECODERS) 96 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
95 video_decoders.push_back(new FFmpegVideoDecoder()); 97 video_decoders.push_back(new FFmpegVideoDecoder());
96 #endif 98 #endif
97 99
98 return video_decoders; 100 return video_decoders;
(...skipping 19 matching lines...) Expand all
118 std::unique_ptr<VideoRenderer> video_renderer(new VideoRendererImpl( 120 std::unique_ptr<VideoRenderer> video_renderer(new VideoRendererImpl(
119 media_task_runner, worker_task_runner, video_renderer_sink, 121 media_task_runner, worker_task_runner, video_renderer_sink,
120 CreateVideoDecoders(media_task_runner, request_surface_cb, gpu_factories), 122 CreateVideoDecoders(media_task_runner, request_surface_cb, gpu_factories),
121 true, gpu_factories, media_log_)); 123 true, gpu_factories, media_log_));
122 124
123 return base::WrapUnique(new RendererImpl( 125 return base::WrapUnique(new RendererImpl(
124 media_task_runner, std::move(audio_renderer), std::move(video_renderer))); 126 media_task_runner, std::move(audio_renderer), std::move(video_renderer)));
125 } 127 }
126 128
127 } // namespace media 129 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/test_mojo_media_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698