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_WEBRTC_TRACK_OBSERVER_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/single_thread_task_runner.h"
11 #include "content/common/content_export.h"
12 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
16 class CONTENT_EXPORT TrackObserver
{
18 typedef base::Callback
<void(webrtc::MediaStreamTrackInterface::TrackState
)>
21 TrackObserver(const scoped_refptr
<base::SingleThreadTaskRunner
>& main_thread
,
22 const scoped_refptr
<webrtc::MediaStreamTrackInterface
>& track
);
25 void SetCallback(const OnChangedCallback
& callback
);
27 const scoped_refptr
<webrtc::MediaStreamTrackInterface
>& track() const;
30 class TrackObserverImpl
;
31 const scoped_refptr
<TrackObserverImpl
> observer_
;
32 DISALLOW_COPY_AND_ASSIGN(TrackObserver
);
35 } // namespace content
37 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_TRACK_OBSERVER_H_