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

Side by Side Diff: webrtc/video/video_capture_input.h

Issue 1763693002: Move encoder thread to VideoSendStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 9 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
« no previous file with comments | « no previous file | webrtc/video/video_capture_input.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 #include "webrtc/typedefs.h" 27 #include "webrtc/typedefs.h"
28 #include "webrtc/video_send_stream.h" 28 #include "webrtc/video_send_stream.h"
29 29
30 namespace webrtc { 30 namespace webrtc {
31 31
32 class Config; 32 class Config;
33 class OveruseFrameDetector; 33 class OveruseFrameDetector;
34 class SendStatisticsProxy; 34 class SendStatisticsProxy;
35 class VideoRenderer; 35 class VideoRenderer;
36 36
37 class VideoCaptureCallback {
38 public:
39 virtual ~VideoCaptureCallback() {}
40
41 virtual void DeliverFrame(VideoFrame video_frame) = 0;
42 };
43
44 namespace internal { 37 namespace internal {
45 class VideoCaptureInput : public webrtc::VideoCaptureInput { 38 class VideoCaptureInput : public webrtc::VideoCaptureInput {
46 public: 39 public:
47 VideoCaptureInput(VideoCaptureCallback* frame_callback, 40 VideoCaptureInput(rtc::Event* capture_event,
48 VideoRenderer* local_renderer, 41 VideoRenderer* local_renderer,
49 SendStatisticsProxy* send_stats_proxy, 42 SendStatisticsProxy* send_stats_proxy,
50 OveruseFrameDetector* overuse_detector); 43 OveruseFrameDetector* overuse_detector);
51 ~VideoCaptureInput(); 44 ~VideoCaptureInput();
52 45
53 void IncomingCapturedFrame(const VideoFrame& video_frame) override; 46 void IncomingCapturedFrame(const VideoFrame& video_frame) override;
54 47
48 bool GetVideoFrame(VideoFrame* frame);
49
55 private: 50 private:
56 // Thread functions for deliver captured frames to receivers.
57 static bool EncoderThreadFunction(void* obj);
58 bool EncoderProcess();
59
60 rtc::CriticalSection crit_; 51 rtc::CriticalSection crit_;
61 52
62 VideoCaptureCallback* const frame_callback_;
63 VideoRenderer* const local_renderer_; 53 VideoRenderer* const local_renderer_;
64 SendStatisticsProxy* const stats_proxy_; 54 SendStatisticsProxy* const stats_proxy_;
65 55 rtc::Event* const capture_event_;
66 rtc::PlatformThread encoder_thread_;
67 rtc::Event capture_event_;
68
69 volatile int stop_;
70 56
71 VideoFrame captured_frame_ GUARDED_BY(crit_); 57 VideoFrame captured_frame_ GUARDED_BY(crit_);
72 Clock* const clock_; 58 Clock* const clock_;
73 // Used to make sure incoming time stamp is increasing for every frame. 59 // Used to make sure incoming time stamp is increasing for every frame.
74 int64_t last_captured_timestamp_; 60 int64_t last_captured_timestamp_;
75 // Delta used for translating between NTP and internal timestamps. 61 // Delta used for translating between NTP and internal timestamps.
76 const int64_t delta_ntp_internal_ms_; 62 const int64_t delta_ntp_internal_ms_;
77 63
78 OveruseFrameDetector* const overuse_detector_; 64 OveruseFrameDetector* const overuse_detector_;
79 }; 65 };
80 66
81 } // namespace internal 67 } // namespace internal
82 } // namespace webrtc 68 } // namespace webrtc
83 69
84 #endif // WEBRTC_VIDEO_VIDEO_CAPTURE_INPUT_H_ 70 #endif // WEBRTC_VIDEO_VIDEO_CAPTURE_INPUT_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_capture_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698