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_TRACK_EXTRA_DATA_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_EXTRA_DATA_H_
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/threading/thread_checker.h"
12 #include "content/common/content_export.h"
13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
16 class AudioTrackInterface
;
17 class MediaStreamTrackInterface
;
22 // MediaStreamTrack is a Chrome representation of blink::WebMediaStreamTrack.
23 // It is owned by blink::WebMediaStreamTrack as
24 // blink::WebMediaStreamTrack::ExtraData.
25 class CONTENT_EXPORT MediaStreamTrack
26 : NON_EXPORTED_BASE(public blink::WebMediaStreamTrack::ExtraData
) {
28 MediaStreamTrack(webrtc::MediaStreamTrackInterface
* track
,
30 virtual ~MediaStreamTrack();
32 static MediaStreamTrack
* GetTrack(
33 const blink::WebMediaStreamTrack
& track
);
35 // If a subclass overrides this method it has to call the base class.
36 virtual void SetEnabled(bool enabled
);
38 virtual void SetMutedState(bool muted_state
);
39 virtual bool GetMutedState(void) const;
41 // TODO(xians): Make this pure virtual when Stop[Track] has been
42 // implemented for remote audio tracks.
45 virtual webrtc::AudioTrackInterface
* GetAudioAdapter();
47 bool is_local_track () const { return is_local_track_
; }
50 scoped_refptr
<webrtc::MediaStreamTrackInterface
> track_
;
52 // Set to true if the owner MediaStreamSource is not delivering frames.
56 const bool is_local_track_
;
58 base::ThreadChecker thread_checker_
;
60 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrack
);
63 } // namespace content
65 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_EXTRA_DATA_H_