Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / renderer / media / media_stream_renderer_factory.h
blob86a644ee4a9e204453e3a59b312a5ea64a0a702d
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "content/renderer/media/media_stream_audio_renderer.h"
12 #include "content/renderer/media/video_frame_provider.h"
13 #include "url/gurl.h"
15 namespace content {
17 // MediaStreamRendererFactory is used by WebMediaPlayerMS to create audio and
18 // video feeds from a MediaStream provided an URL.
19 // The factory methods are virtual in order for blink layouttests to be able to
20 // override them.
21 class CONTENT_EXPORT MediaStreamRendererFactory {
22 public:
23 MediaStreamRendererFactory();
24 virtual ~MediaStreamRendererFactory();
26 virtual scoped_refptr<VideoFrameProvider> GetVideoFrameProvider(
27 const GURL& url,
28 const base::Closure& error_cb,
29 const VideoFrameProvider::RepaintCB& repaint_cb);
31 virtual scoped_refptr<MediaStreamAudioRenderer> GetAudioRenderer(
32 const GURL& url,
33 int render_frame_id);
35 private:
36 DISALLOW_COPY_AND_ASSIGN(MediaStreamRendererFactory);
39 } // namespace content
41 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_RENDERER_FACTORY_H_