summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/webmediaplayer_params.h
blob: 9fa96e1af26b7dc1db1b3cfe68bfb526f00048ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_
#define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_

#include "base/callback.h"
#include "base/memory/ref_counted.h"

namespace media {
class AudioRendererSink;
}

namespace content {

// Holds parameters for constructing WebMediaPlayerImpl without having
// to plumb arguments through various abstraction layers.
class WebMediaPlayerParams {
 public:
  // Parameters may be null.
  WebMediaPlayerParams(
      const base::Callback<void(const base::Closure&)>& defer_load_cb,
      const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink);
  ~WebMediaPlayerParams();

  base::Callback<void(const base::Closure&)> defer_load_cb() const {
    return defer_load_cb_;
  }

  const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const {
    return audio_renderer_sink_;
  }

 private:
  base::Callback<void(const base::Closure&)> defer_load_cb_;
  scoped_refptr<media::AudioRendererSink> audio_renderer_sink_;

  DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams);
};

}  // namespace media

#endif  // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_