| 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_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 9 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| 10 #include "content/public/renderer/media_stream_video_sink.h" | 11 #include "content/public/renderer/media_stream_video_sink.h" |
| 11 #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h" | 12 #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h" |
| 12 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 13 #include "third_party/webrtc/api/mediastreaminterface.h" | 14 #include "third_party/webrtc/api/mediastreaminterface.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 class MediaStreamVideoTrack; | 18 class MediaStreamVideoTrack; |
| 18 class PeerConnectionDependencyFactory; | 19 class PeerConnectionDependencyFactory; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 // Implementation of MediaStreamSink. | 41 // Implementation of MediaStreamSink. |
| 41 void OnEnabledChanged(bool enabled) override; | 42 void OnEnabledChanged(bool enabled) override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 // Used to DCHECK that we are called on the correct thread. | 45 // Used to DCHECK that we are called on the correct thread. |
| 45 base::ThreadChecker thread_checker_; | 46 base::ThreadChecker thread_checker_; |
| 46 | 47 |
| 47 scoped_refptr<webrtc::VideoTrackInterface> video_track_; | 48 scoped_refptr<webrtc::VideoTrackInterface> video_track_; |
| 48 blink::WebMediaStreamTrack web_track_; | |
| 49 | 49 |
| 50 class WebRtcVideoSourceAdapter; | 50 class WebRtcVideoSourceAdapter; |
| 51 scoped_refptr<WebRtcVideoSourceAdapter> source_adapter_; | 51 scoped_refptr<WebRtcVideoSourceAdapter> source_adapter_; |
| 52 | 52 |
| 53 // Provides WebRtcVideoSourceAdapter a weak reference to |
| 54 // MediaStreamVideoWebRtcSink in order to allow it to request refresh frames. |
| 55 // See comments in media_stream_video_webrtc_sink.cc. |
| 56 base::WeakPtrFactory<MediaStreamVideoWebRtcSink> weak_factory_; |
| 57 |
| 53 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoWebRtcSink); | 58 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoWebRtcSink); |
| 54 }; | 59 }; |
| 55 | 60 |
| 56 } // namespace content | 61 } // namespace content |
| 57 | 62 |
| 58 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ | 63 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ |
| OLD | NEW |