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

Side by Side Diff: webrtc/common_video/include/incoming_video_stream.h

Issue 2040763002: Remove dead code in IncomingVideoStream that's just causing contention. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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/common_video/incoming_video_stream.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 20 matching lines...) Expand all
31 // Overrides VideoSinkInterface 31 // Overrides VideoSinkInterface
32 void OnFrame(const VideoFrame& video_frame) override; 32 void OnFrame(const VideoFrame& video_frame) override;
33 33
34 // Callback for file recording, snapshot, ... 34 // Callback for file recording, snapshot, ...
35 void SetExternalCallback(rtc::VideoSinkInterface<VideoFrame>* render_object); 35 void SetExternalCallback(rtc::VideoSinkInterface<VideoFrame>* render_object);
36 36
37 // Start/Stop. 37 // Start/Stop.
38 int32_t Start(); 38 int32_t Start();
39 int32_t Stop(); 39 int32_t Stop();
40 40
41 // Clear all buffers.
42 int32_t Reset();
43
44 // Properties.
45 uint32_t IncomingRate() const;
46
47 int32_t SetExpectedRenderDelay(int32_t delay_ms); 41 int32_t SetExpectedRenderDelay(int32_t delay_ms);
48 42
49 protected: 43 protected:
50 static bool IncomingVideoStreamThreadFun(void* obj); 44 static bool IncomingVideoStreamThreadFun(void* obj);
51 bool IncomingVideoStreamProcess(); 45 bool IncomingVideoStreamProcess();
52 46
53 private: 47 private:
54 enum { kEventStartupTimeMs = 10 }; 48 enum { kEventStartupTimeMs = 10 };
55 enum { kEventMaxWaitTimeMs = 100 }; 49 enum { kEventMaxWaitTimeMs = 100 };
56 enum { kFrameRatePeriodMs = 1000 }; 50 enum { kFrameRatePeriodMs = 1000 };
57 51
58 void DeliverFrame(const VideoFrame& video_frame); 52 void DeliverFrame(const VideoFrame& video_frame);
59 53
60 const bool disable_prerenderer_smoothing_; 54 const bool disable_prerenderer_smoothing_;
61 // Critsects in allowed to enter order. 55 // Critsects in allowed to enter order.
62 rtc::CriticalSection stream_critsect_; 56 rtc::CriticalSection stream_critsect_;
63 rtc::CriticalSection thread_critsect_; 57 rtc::CriticalSection thread_critsect_;
64 rtc::CriticalSection buffer_critsect_; 58 rtc::CriticalSection buffer_critsect_;
65 // TODO(pbos): Make plain member and stop resetting this thread, just 59 // TODO(pbos): Make plain member and stop resetting this thread, just
66 // start/stoping it is enough. 60 // start/stoping it is enough.
67 std::unique_ptr<rtc::PlatformThread> incoming_render_thread_ 61 std::unique_ptr<rtc::PlatformThread> incoming_render_thread_
68 GUARDED_BY(thread_critsect_); 62 GUARDED_BY(thread_critsect_);
69 std::unique_ptr<EventTimerWrapper> deliver_buffer_event_; 63 std::unique_ptr<EventTimerWrapper> deliver_buffer_event_;
70 64
71 bool running_ GUARDED_BY(stream_critsect_); 65 bool running_ GUARDED_BY(stream_critsect_);
72 rtc::VideoSinkInterface<VideoFrame>* external_callback_ 66 rtc::VideoSinkInterface<VideoFrame>* external_callback_
73 GUARDED_BY(thread_critsect_); 67 GUARDED_BY(thread_critsect_);
74 const std::unique_ptr<VideoRenderFrames> render_buffers_ 68 const std::unique_ptr<VideoRenderFrames> render_buffers_
75 GUARDED_BY(buffer_critsect_); 69 GUARDED_BY(buffer_critsect_);
76
77 uint32_t incoming_rate_ GUARDED_BY(stream_critsect_);
78 int64_t last_rate_calculation_time_ms_ GUARDED_BY(stream_critsect_);
79 uint16_t num_frames_since_last_calculation_ GUARDED_BY(stream_critsect_);
80 }; 70 };
81 71
82 } // namespace webrtc 72 } // namespace webrtc
83 73
84 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_ 74 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_video/incoming_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698