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

Side by Side Diff: webrtc/voice_engine/channel.h

Issue 1263223002: Adding locking to webrtc::voe::Channel to fix race conditions (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved LeastRequiredDelayMs definition to cc file Created 5 years, 4 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/voice_engine/channel.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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 int SetChannelOutputVolumeScaling(float scaling); 267 int SetChannelOutputVolumeScaling(float scaling);
268 int GetChannelOutputVolumeScaling(float& scaling) const; 268 int GetChannelOutputVolumeScaling(float& scaling) const;
269 269
270 // VoENetEqStats 270 // VoENetEqStats
271 int GetNetworkStatistics(NetworkStatistics& stats); 271 int GetNetworkStatistics(NetworkStatistics& stats);
272 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const; 272 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
273 273
274 // VoEVideoSync 274 // VoEVideoSync
275 bool GetDelayEstimate(int* jitter_buffer_delay_ms, 275 bool GetDelayEstimate(int* jitter_buffer_delay_ms,
276 int* playout_buffer_delay_ms) const; 276 int* playout_buffer_delay_ms) const;
277 int least_required_delay_ms() const { return least_required_delay_ms_; } 277 int LeastRequiredDelayMs() const;
278 int SetInitialPlayoutDelay(int delay_ms); 278 int SetInitialPlayoutDelay(int delay_ms);
279 int SetMinimumPlayoutDelay(int delayMs); 279 int SetMinimumPlayoutDelay(int delayMs);
280 int GetPlayoutTimestamp(unsigned int& timestamp); 280 int GetPlayoutTimestamp(unsigned int& timestamp);
281 void UpdatePlayoutTimestamp(bool rtcp);
282 int SetInitTimestamp(unsigned int timestamp); 281 int SetInitTimestamp(unsigned int timestamp);
283 int SetInitSequenceNumber(short sequenceNumber); 282 int SetInitSequenceNumber(short sequenceNumber);
284 283
285 // VoEVideoSyncExtended 284 // VoEVideoSyncExtended
286 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; 285 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const;
287 286
288 // VoEDtmf 287 // VoEDtmf
289 int SendTelephoneEventOutband(unsigned char eventCode, int lengthMs, 288 int SendTelephoneEventOutband(unsigned char eventCode, int lengthMs,
290 int attenuationDb, bool playDtmfEvent); 289 int attenuationDb, bool playDtmfEvent);
291 int SendTelephoneEventInband(unsigned char eventCode, int lengthMs, 290 int SendTelephoneEventInband(unsigned char eventCode, int lengthMs,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 bool HandleRtxPacket(const uint8_t* packet, 456 bool HandleRtxPacket(const uint8_t* packet,
458 size_t packet_length, 457 size_t packet_length,
459 const RTPHeader& header); 458 const RTPHeader& header);
460 bool IsPacketInOrder(const RTPHeader& header) const; 459 bool IsPacketInOrder(const RTPHeader& header) const;
461 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; 460 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const;
462 int ResendPackets(const uint16_t* sequence_numbers, int length); 461 int ResendPackets(const uint16_t* sequence_numbers, int length);
463 int InsertInbandDtmfTone(); 462 int InsertInbandDtmfTone();
464 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); 463 int32_t MixOrReplaceAudioWithFile(int mixingFrequency);
465 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); 464 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency);
466 int32_t SendPacketRaw(const void *data, size_t len, bool RTCP); 465 int32_t SendPacketRaw(const void *data, size_t len, bool RTCP);
466 void UpdatePlayoutTimestamp(bool rtcp);
467 void UpdatePacketDelay(uint32_t timestamp, 467 void UpdatePacketDelay(uint32_t timestamp,
468 uint16_t sequenceNumber); 468 uint16_t sequenceNumber);
469 void RegisterReceiveCodecsToRTPModule(); 469 void RegisterReceiveCodecsToRTPModule();
470 470
471 int SetRedPayloadType(int red_payload_type); 471 int SetRedPayloadType(int red_payload_type);
472 int SetSendRtpHeaderExtension(bool enable, RTPExtensionType type, 472 int SetSendRtpHeaderExtension(bool enable, RTPExtensionType type,
473 unsigned char id); 473 unsigned char id);
474 474
475 int32_t GetPlayoutFrequency(); 475 int32_t GetPlayoutFrequency();
476 int64_t GetRTT(bool allow_associate_channel) const; 476 int64_t GetRTT(bool allow_associate_channel) const;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 bool _outputExternalMedia; 509 bool _outputExternalMedia;
510 VoEMediaProcess* _inputExternalMediaCallbackPtr; 510 VoEMediaProcess* _inputExternalMediaCallbackPtr;
511 VoEMediaProcess* _outputExternalMediaCallbackPtr; 511 VoEMediaProcess* _outputExternalMediaCallbackPtr;
512 uint32_t _timeStamp; 512 uint32_t _timeStamp;
513 uint8_t _sendTelephoneEventPayloadType; 513 uint8_t _sendTelephoneEventPayloadType;
514 514
515 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); 515 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_);
516 516
517 // Timestamp of the audio pulled from NetEq. 517 // Timestamp of the audio pulled from NetEq.
518 uint32_t jitter_buffer_playout_timestamp_; 518 uint32_t jitter_buffer_playout_timestamp_;
519 uint32_t playout_timestamp_rtp_; 519 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_);
520 uint32_t playout_timestamp_rtcp_; 520 uint32_t playout_timestamp_rtcp_;
521 uint32_t playout_delay_ms_; 521 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_);
522 uint32_t _numberOfDiscardedPackets; 522 uint32_t _numberOfDiscardedPackets;
523 uint16_t send_sequence_number_; 523 uint16_t send_sequence_number_;
524 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; 524 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes];
525 525
526 rtc::scoped_ptr<CriticalSectionWrapper> ts_stats_lock_; 526 rtc::scoped_ptr<CriticalSectionWrapper> ts_stats_lock_;
527 527
528 rtc::scoped_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; 528 rtc::scoped_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_;
529 // The rtp timestamp of the first played out audio frame. 529 // The rtp timestamp of the first played out audio frame.
530 int64_t capture_start_rtp_time_stamp_; 530 int64_t capture_start_rtp_time_stamp_;
531 // The capture ntp time (in local timebase) of the first played out audio 531 // The capture ntp time (in local timebase) of the first played out audio
(...skipping 25 matching lines...) Expand all
557 // VoEDtmf 557 // VoEDtmf
558 bool _playOutbandDtmfEvent; 558 bool _playOutbandDtmfEvent;
559 bool _playInbandDtmfEvent; 559 bool _playInbandDtmfEvent;
560 // VoeRTP_RTCP 560 // VoeRTP_RTCP
561 uint32_t _lastLocalTimeStamp; 561 uint32_t _lastLocalTimeStamp;
562 int8_t _lastPayloadType; 562 int8_t _lastPayloadType;
563 bool _includeAudioLevelIndication; 563 bool _includeAudioLevelIndication;
564 // VoENetwork 564 // VoENetwork
565 AudioFrame::SpeechType _outputSpeechType; 565 AudioFrame::SpeechType _outputSpeechType;
566 // VoEVideoSync 566 // VoEVideoSync
567 uint32_t _average_jitter_buffer_delay_us; 567 rtc::scoped_ptr<CriticalSectionWrapper> video_sync_lock_;
568 int least_required_delay_ms_; 568 uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_);
569 uint32_t _previousTimestamp; 569 uint32_t _previousTimestamp;
570 uint16_t _recPacketDelayMs; 570 uint16_t _recPacketDelayMs GUARDED_BY(video_sync_lock_);
571 // VoEAudioProcessing 571 // VoEAudioProcessing
572 bool _RxVadDetection; 572 bool _RxVadDetection;
573 bool _rxAgcIsEnabled; 573 bool _rxAgcIsEnabled;
574 bool _rxNsIsEnabled; 574 bool _rxNsIsEnabled;
575 bool restored_packet_in_use_; 575 bool restored_packet_in_use_;
576 // RtcpBandwidthObserver 576 // RtcpBandwidthObserver
577 rtc::scoped_ptr<VoERtcpObserver> rtcp_observer_; 577 rtc::scoped_ptr<VoERtcpObserver> rtcp_observer_;
578 rtc::scoped_ptr<NetworkPredictor> network_predictor_; 578 rtc::scoped_ptr<NetworkPredictor> network_predictor_;
579 // An associated send channel. 579 // An associated send channel.
580 rtc::scoped_ptr<CriticalSectionWrapper> assoc_send_channel_lock_; 580 rtc::scoped_ptr<CriticalSectionWrapper> assoc_send_channel_lock_;
581 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); 581 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_);
582 }; 582 };
583 583
584 } // namespace voe 584 } // namespace voe
585 } // namespace webrtc 585 } // namespace webrtc
586 586
587 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ 587 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698