Upload upstream chromium 120.0.6099.5
[platform/framework/web/chromium-efl.git] / media / renderers / decrypting_renderer_factory.h
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.
4
5 #ifndef MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_
6 #define MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_
7
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"
13
14 namespace media {
15
16 class MediaLog;
17
18 // Simple RendererFactory wrapper class. It wraps any Renderer created by the
19 // underlying factory, and returns it as a DecryptingRenderer.
20 //
21 // See DecryptingRenderer for more information.
22 //
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 {
26  public:
27   DecryptingRendererFactory(
28       MediaLog* media_log,
29       std::unique_ptr<media::RendererFactory> renderer_factory);
30
31   DecryptingRendererFactory(const DecryptingRendererFactory&) = delete;
32   DecryptingRendererFactory& operator=(const DecryptingRendererFactory&) =
33       delete;
34
35   ~DecryptingRendererFactory() final;
36
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;
45
46  private:
47   raw_ptr<MediaLog> media_log_;
48
49   std::unique_ptr<media::RendererFactory> renderer_factory_;
50 };
51
52 }  // namespace media
53
54 #endif  // MEDIA_RENDERERS_DECRYPTING_RENDERER_FACTORY_H_