Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: content/renderer/media/webrtc/media_stream_video_webrtc_sink.h

Issue 2356663002: Implement and use VideoTrackSource directly. (Closed)
Patch Set: add test TODO Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void OnEnabledChanged(bool enabled) override; 42 void OnEnabledChanged(bool enabled) override;
43 43
44 private: 44 private:
45 // Helper to request a refresh frame from the source. Called via the callback 45 // Helper to request a refresh frame from the source. Called via the callback
46 // passed to WebRtcVideoSourceAdapter. 46 // passed to WebRtcVideoSourceAdapter.
47 void RequestRefreshFrame(); 47 void RequestRefreshFrame();
48 48
49 // Used to DCHECK that we are called on the correct thread. 49 // Used to DCHECK that we are called on the correct thread.
50 base::ThreadChecker thread_checker_; 50 base::ThreadChecker thread_checker_;
51 51
52 // |video_source_| and |video_track_source_proxy_| are held as references to
53 // outlive |video_track_| since the interfaces between them don't use
54 // reference counting.
55 class WebRtcVideoSource;
56 scoped_refptr<WebRtcVideoSource> video_source_;
57 scoped_refptr<webrtc::VideoTrackSourceInterface> video_source_proxy_;
52 scoped_refptr<webrtc::VideoTrackInterface> video_track_; 58 scoped_refptr<webrtc::VideoTrackInterface> video_track_;
53 59
54 class WebRtcVideoSourceAdapter; 60 class WebRtcVideoSourceAdapter;
55 scoped_refptr<WebRtcVideoSourceAdapter> source_adapter_; 61 scoped_refptr<WebRtcVideoSourceAdapter> source_adapter_;
56 62
57 // Provides WebRtcVideoSourceAdapter a weak reference to 63 // Provides WebRtcVideoSourceAdapter a weak reference to
58 // MediaStreamVideoWebRtcSink in order to allow it to request refresh frames. 64 // MediaStreamVideoWebRtcSink in order to allow it to request refresh frames.
59 // See comments in media_stream_video_webrtc_sink.cc. 65 // See comments in media_stream_video_webrtc_sink.cc.
60 base::WeakPtrFactory<MediaStreamVideoWebRtcSink> weak_factory_; 66 base::WeakPtrFactory<MediaStreamVideoWebRtcSink> weak_factory_;
61 67
62 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoWebRtcSink); 68 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoWebRtcSink);
63 }; 69 };
64 70
65 } // namespace content 71 } // namespace content
66 72
67 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_ 73 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_TRACK_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698