1 // Copyright (c) 2013 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_SOURCE_OBSERVER_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_OBSERVER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/non_thread_safe.h"
11 #include "content/common/content_export.h"
12 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
13 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
17 class MediaStreamSourceExtraData;
19 // MediaStreamSourceObserver listens to events on MediaSourceInterface and
20 // notify WebKit. It will be owned by MediaStreamSourceExtraData.
21 class CONTENT_EXPORT MediaStreamSourceObserver
22 : NON_EXPORTED_BASE(public webrtc::ObserverInterface),
23 NON_EXPORTED_BASE(public base::NonThreadSafe) {
25 MediaStreamSourceObserver(webrtc::MediaSourceInterface* webrtc_source,
26 MediaStreamSourceExtraData* extra_data);
27 virtual ~MediaStreamSourceObserver();
30 // webrtc::ObserverInterface implementation.
31 virtual void OnChanged() OVERRIDE;
33 webrtc::MediaSourceInterface::SourceState state_;
34 scoped_refptr<webrtc::MediaSourceInterface> webrtc_source_;
35 MediaStreamSourceExtraData* extra_data_;
37 DISALLOW_COPY_AND_ASSIGN(MediaStreamSourceObserver);
40 } // namespace content
42 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_OBSERVER_H_