| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "media/audio/audio_parameters.h" |
| 11 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 12 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 12 | 13 |
| 13 namespace webrtc { | |
| 14 class AudioTrackInterface; | |
| 15 } // namespace webrtc | |
| 16 | |
| 17 namespace content { | 14 namespace content { |
| 18 | 15 |
| 19 // MediaStreamTrack is a Chrome representation of blink::WebMediaStreamTrack. | 16 // MediaStreamTrack is a Chrome representation of blink::WebMediaStreamTrack. |
| 20 // It is owned by blink::WebMediaStreamTrack as | 17 // It is owned by blink::WebMediaStreamTrack as |
| 21 // blink::WebMediaStreamTrack::ExtraData. | 18 // blink::WebMediaStreamTrack::ExtraData. |
| 22 class CONTENT_EXPORT MediaStreamTrack | 19 class CONTENT_EXPORT MediaStreamTrack |
| 23 : NON_EXPORTED_BASE(public blink::WebMediaStreamTrack::ExtraData) { | 20 : NON_EXPORTED_BASE(public blink::WebMediaStreamTrack::ExtraData) { |
| 24 public: | 21 public: |
| 25 explicit MediaStreamTrack(bool is_local_track); | 22 explicit MediaStreamTrack(bool is_local_track); |
| 26 ~MediaStreamTrack() override; | 23 ~MediaStreamTrack() override; |
| 27 | 24 |
| 28 static MediaStreamTrack* GetTrack(const blink::WebMediaStreamTrack& track); | 25 static MediaStreamTrack* GetTrack(const blink::WebMediaStreamTrack& track); |
| 29 | 26 |
| 30 virtual void SetEnabled(bool enabled) = 0; | 27 virtual void SetEnabled(bool enabled) = 0; |
| 31 | 28 |
| 32 virtual void Stop() = 0; | 29 virtual void Stop() = 0; |
| 33 | 30 |
| 34 // TODO(tommi, xians): Remove this method. | |
| 35 virtual webrtc::AudioTrackInterface* GetAudioAdapter(); | |
| 36 | |
| 37 bool is_local_track() const { return is_local_track_; } | 31 bool is_local_track() const { return is_local_track_; } |
| 38 | 32 |
| 39 protected: | 33 protected: |
| 40 const bool is_local_track_; | 34 const bool is_local_track_; |
| 41 | 35 |
| 42 // Used to DCHECK that we are called on Render main Thread. | 36 // Used to DCHECK that we are called on Render main Thread. |
| 43 base::ThreadChecker main_render_thread_checker_; | 37 base::ThreadChecker main_render_thread_checker_; |
| 44 | 38 |
| 39 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrack); | 40 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrack); |
| 46 }; | 41 }; |
| 47 | 42 |
| 48 } // namespace content | 43 } // namespace content |
| 49 | 44 |
| 50 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ | 45 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_TRACK_H_ |
| OLD | NEW |