summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/media_stream_center.h
blob: c10080efd045971c34f45e2f9a8e95f3291f2cd9 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2012 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_MEDIA_STREAM_CENTER_H_
#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamCenter.h"

namespace WebKit {
class WebMediaStreamCenterClient;
}

class MediaStreamDependencyFactory;

namespace content {

class CONTENT_EXPORT MediaStreamCenter
    : NON_EXPORTED_BASE(public WebKit::WebMediaStreamCenter) {
 public:
  MediaStreamCenter(WebKit::WebMediaStreamCenterClient* client,
                    MediaStreamDependencyFactory* factory);

  virtual void queryMediaStreamSources(
      const WebKit::WebMediaStreamSourcesRequest& request) OVERRIDE;

  virtual void didEnableMediaStreamTrack(
      const WebKit::WebMediaStreamDescriptor& stream,
      const WebKit::WebMediaStreamComponent& component) OVERRIDE;

  virtual void didDisableMediaStreamTrack(
      const WebKit::WebMediaStreamDescriptor& stream,
      const WebKit::WebMediaStreamComponent& component) OVERRIDE;

  virtual void didStopLocalMediaStream(
      const WebKit::WebMediaStreamDescriptor& stream) OVERRIDE;

  virtual void didCreateMediaStream(
      WebKit::WebMediaStreamDescriptor& stream) OVERRIDE;

  virtual WebKit::WebString constructSDP(
      const WebKit::WebICECandidateDescriptor& candidate) OVERRIDE;

  virtual WebKit::WebString constructSDP(
      const WebKit::WebSessionDescriptionDescriptor& description) OVERRIDE;

 private:
  // |rtc_factory_| is a weak pointer and is owned by the RenderThreadImpl.
  // It is valid as long as  RenderThreadImpl exist.
  MediaStreamDependencyFactory* rtc_factory_;

  DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter);
};

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_