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

Unified Diff: webrtc/modules/video_coding/main/source/video_coding_impl.h

Issue 1336023004: Keep lock after updating encoder parameters. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: void -> Set.. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/main/source/video_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/main/source/video_coding_impl.h
diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.h b/webrtc/modules/video_coding/main/source/video_coding_impl.h
index fd3599f52b04bfce68928440ba01b5da60b49759..86a8ca01cb89f8f3cb0b1fa301fc26a030d7f80d 100644
--- a/webrtc/modules/video_coding/main/source/video_coding_impl.h
+++ b/webrtc/modules/video_coding/main/source/video_coding_impl.h
@@ -93,7 +93,6 @@ class VideoSender {
int32_t SetChannelParameters(uint32_t target_bitrate, // bits/s.
uint8_t lossRate,
int64_t rtt);
- int32_t UpdateEncoderParameters();
int32_t RegisterTransportCallback(VCMPacketizationCallback* transport);
int32_t RegisterSendStatisticsCallback(VCMSendStatisticsCallback* sendStats);
@@ -114,17 +113,28 @@ class VideoSender {
int32_t Process();
private:
- Clock* clock_;
+ struct EncoderParameters {
+ uint32_t target_bitrate;
+ uint8_t loss_rate;
+ int64_t rtt;
+ uint32_t input_frame_rate;
+ bool updated;
+ };
+
+ void SetEncoderParameters(EncoderParameters params)
+ EXCLUSIVE_LOCKS_REQUIRED(send_crit_);
+
+ Clock* const clock_;
rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_;
- CriticalSectionWrapper* _sendCritSect;
+ mutable rtc::CriticalSection send_crit_;
VCMGenericEncoder* _encoder;
VCMEncodedFrameCallback _encodedFrameCallback;
std::vector<FrameType> _nextFrameTypes;
media_optimization::MediaOptimization _mediaOpt;
- VCMSendStatisticsCallback* _sendStatsCallback;
- VCMCodecDataBase _codecDataBase;
- bool frame_dropper_enabled_;
+ VCMSendStatisticsCallback* _sendStatsCallback GUARDED_BY(process_crit_sect_);
+ VCMCodecDataBase _codecDataBase GUARDED_BY(send_crit_);
+ bool frame_dropper_enabled_ GUARDED_BY(send_crit_);
VCMProcessTimer _sendStatsTimer;
// Must be accessed on the construction thread of VideoSender.
@@ -135,13 +145,7 @@ class VideoSender {
VCMProtectionCallback* protection_callback_;
rtc::CriticalSection params_lock_;
- struct EncoderParameters {
- uint32_t target_bitrate;
- uint8_t loss_rate;
- int64_t rtt;
- uint32_t input_frame_rate;
- bool updated;
- } encoder_params_ GUARDED_BY(params_lock_);
+ EncoderParameters encoder_params_ GUARDED_BY(params_lock_);
};
class VideoReceiver {
« no previous file with comments | « no previous file | webrtc/modules/video_coding/main/source/video_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698