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_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_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
;
21 // MediaStreamTrack is a Chrome representation of blink::WebMediaStreamTrack.
22 // It is owned by blink::WebMediaStreamTrack as
23 // blink::WebMediaStreamTrack::ExtraData.
24 class CONTENT_EXPORT MediaStreamTrack
25 : NON_EXPORTED_BASE(public blink::WebMediaStreamTrack::ExtraData
) {
27 explicit MediaStreamTrack(bool is_local_track
);
28 virtual ~MediaStreamTrack();
30 static MediaStreamTrack
* GetTrack(const blink::WebMediaStreamTrack
& track
);
32 virtual void SetEnabled(bool enabled
) = 0;
34 virtual void Stop() = 0;
36 // TODO(tommi, xians): Remove this method.
37 virtual webrtc::AudioTrackInterface
* GetAudioAdapter();
39 bool is_local_track() const { return is_local_track_
; }
42 const bool is_local_track_
;
44 // Used to DCHECK that we are called on Render main Thread.
45 base::ThreadChecker main_render_thread_checker_
;
47 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrack
);
50 } // namespace content
52 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_