1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_
6 #define MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_
8 #include "base/functional/callback.h"
9 #include "base/memory/raw_ptr.h"
10 #include "base/task/sequenced_task_runner.h"
11 #include "media/base/media_export.h"
12 #include "media/base/renderer_factory.h"
18 // Simple RendererFactory wrapper class. It wraps any Renderer created by the
19 // underlying factory, and returns it as a DecryptingRenderer.
21 // See DecryptingRenderer for more information.
23 // The caller must guarantee that the returned DecryptingRenderer will never
24 // be initialized with a |media_resource| of type MediaResource::Type::URL.
25 class MEDIA_EXPORT DecryptingRendererFactory final : public RendererFactory {
27 DecryptingRendererFactory(
29 std::unique_ptr<media::RendererFactory> renderer_factory);
31 DecryptingRendererFactory(const DecryptingRendererFactory&) = delete;
32 DecryptingRendererFactory& operator=(const DecryptingRendererFactory&) =
35 ~DecryptingRendererFactory() final;
37 // RendererFactory implementation.
38 std::unique_ptr<Renderer> CreateRenderer(
39 const scoped_refptr<base::SequencedTaskRunner>& media_task_runner,
40 const scoped_refptr<base::TaskRunner>& worker_task_runner,
41 AudioRendererSink* audio_renderer_sink,
42 VideoRendererSink* video_renderer_sink,
43 RequestOverlayInfoCB request_overlay_info_cb,
44 const gfx::ColorSpace& target_color_space) final;
47 raw_ptr<MediaLog> media_log_;
49 std::unique_ptr<media::RendererFactory> renderer_factory_;
54 #endif // MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_