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

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

Issue 1785643006: Relanding https://codereview.webrtc.org/1715883002/ in pieces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase 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 | « webrtc/voice_engine/BUILD.gn ('k') | 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
11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_
12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/audio_sink.h" 16 #include "webrtc/audio_sink.h"
17 #include "webrtc/base/criticalsection.h" 17 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/common_audio/resampler/include/push_resampler.h" 18 #include "webrtc/common_audio/resampler/include/push_resampler.h"
19 #include "webrtc/common_types.h" 19 #include "webrtc/common_types.h"
20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" 20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d efines.h" 21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d efines.h"
22 #include "webrtc/modules/audio_processing/rms_level.h" 22 #include "webrtc/modules/audio_processing/rms_level.h"
23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" 23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
26 #include "webrtc/modules/utility/include/file_player.h" 26 #include "webrtc/modules/utility/include/file_player.h"
27 #include "webrtc/modules/utility/include/file_recorder.h" 27 #include "webrtc/modules/utility/include/file_recorder.h"
28 #include "webrtc/voice_engine/dtmf_inband.h"
29 #include "webrtc/voice_engine/dtmf_inband_queue.h"
30 #include "webrtc/voice_engine/include/voe_audio_processing.h" 28 #include "webrtc/voice_engine/include/voe_audio_processing.h"
31 #include "webrtc/voice_engine/include/voe_network.h" 29 #include "webrtc/voice_engine/include/voe_network.h"
32 #include "webrtc/voice_engine/level_indicator.h" 30 #include "webrtc/voice_engine/level_indicator.h"
33 #include "webrtc/voice_engine/network_predictor.h" 31 #include "webrtc/voice_engine/network_predictor.h"
34 #include "webrtc/voice_engine/shared_data.h" 32 #include "webrtc/voice_engine/shared_data.h"
35 #include "webrtc/voice_engine/voice_engine_defines.h" 33 #include "webrtc/voice_engine/voice_engine_defines.h"
36 34
37 namespace rtc { 35 namespace rtc {
38 36
39 class TimestampWrapAroundHandler; 37 class TimestampWrapAroundHandler;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 int SetMinimumPlayoutDelay(int delayMs); 289 int SetMinimumPlayoutDelay(int delayMs);
292 int GetPlayoutTimestamp(unsigned int& timestamp); 290 int GetPlayoutTimestamp(unsigned int& timestamp);
293 int SetInitTimestamp(unsigned int timestamp); 291 int SetInitTimestamp(unsigned int timestamp);
294 int SetInitSequenceNumber(short sequenceNumber); 292 int SetInitSequenceNumber(short sequenceNumber);
295 293
296 // VoEVideoSyncExtended 294 // VoEVideoSyncExtended
297 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; 295 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const;
298 296
299 // VoEDtmf 297 // VoEDtmf
300 int SendTelephoneEventOutband(int event, int duration_ms); 298 int SendTelephoneEventOutband(int event, int duration_ms);
301 int SendTelephoneEventInband(unsigned char eventCode,
302 int lengthMs,
303 int attenuationDb,
304 bool playDtmfEvent);
305 int SetSendTelephoneEventPayloadType(unsigned char type); 299 int SetSendTelephoneEventPayloadType(unsigned char type);
306 int GetSendTelephoneEventPayloadType(unsigned char& type);
307 300
308 // VoEAudioProcessingImpl 301 // VoEAudioProcessingImpl
309 int UpdateRxVadDetection(AudioFrame& audioFrame); 302 int UpdateRxVadDetection(AudioFrame& audioFrame);
310 int RegisterRxVadObserver(VoERxVadCallback& observer); 303 int RegisterRxVadObserver(VoERxVadCallback& observer);
311 int DeRegisterRxVadObserver(); 304 int DeRegisterRxVadObserver();
312 int VoiceActivityIndicator(int& activity); 305 int VoiceActivityIndicator(int& activity);
313 #ifdef WEBRTC_VOICE_ENGINE_AGC 306 #ifdef WEBRTC_VOICE_ENGINE_AGC
314 int SetRxAgcStatus(bool enable, AgcModes mode); 307 int SetRxAgcStatus(bool enable, AgcModes mode);
315 int GetRxAgcStatus(bool& enabled, AgcModes& mode); 308 int GetRxAgcStatus(bool& enabled, AgcModes& mode);
316 int SetRxAgcConfig(AgcConfig config); 309 int SetRxAgcConfig(AgcConfig config);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 bool ReceivePacket(const uint8_t* packet, 447 bool ReceivePacket(const uint8_t* packet,
455 size_t packet_length, 448 size_t packet_length,
456 const RTPHeader& header, 449 const RTPHeader& header,
457 bool in_order); 450 bool in_order);
458 bool HandleRtxPacket(const uint8_t* packet, 451 bool HandleRtxPacket(const uint8_t* packet,
459 size_t packet_length, 452 size_t packet_length,
460 const RTPHeader& header); 453 const RTPHeader& header);
461 bool IsPacketInOrder(const RTPHeader& header) const; 454 bool IsPacketInOrder(const RTPHeader& header) const;
462 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; 455 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const;
463 int ResendPackets(const uint16_t* sequence_numbers, int length); 456 int ResendPackets(const uint16_t* sequence_numbers, int length);
464 int InsertInbandDtmfTone();
465 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); 457 int32_t MixOrReplaceAudioWithFile(int mixingFrequency);
466 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); 458 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency);
467 void UpdatePlayoutTimestamp(bool rtcp); 459 void UpdatePlayoutTimestamp(bool rtcp);
468 void UpdatePacketDelay(uint32_t timestamp, uint16_t sequenceNumber); 460 void UpdatePacketDelay(uint32_t timestamp, uint16_t sequenceNumber);
469 void RegisterReceiveCodecsToRTPModule(); 461 void RegisterReceiveCodecsToRTPModule();
470 462
471 int SetRedPayloadType(int red_payload_type); 463 int SetRedPayloadType(int red_payload_type);
472 int SetSendRtpHeaderExtension(bool enable, 464 int SetSendRtpHeaderExtension(bool enable,
473 RTPExtensionType type, 465 RTPExtensionType type,
474 unsigned char id); 466 unsigned char id);
(...skipping 25 matching lines...) Expand all
500 AudioFrame _audioFrame; 492 AudioFrame _audioFrame;
501 // Downsamples to the codec rate if necessary. 493 // Downsamples to the codec rate if necessary.
502 PushResampler<int16_t> input_resampler_; 494 PushResampler<int16_t> input_resampler_;
503 FilePlayer* _inputFilePlayerPtr; 495 FilePlayer* _inputFilePlayerPtr;
504 FilePlayer* _outputFilePlayerPtr; 496 FilePlayer* _outputFilePlayerPtr;
505 FileRecorder* _outputFileRecorderPtr; 497 FileRecorder* _outputFileRecorderPtr;
506 int _inputFilePlayerId; 498 int _inputFilePlayerId;
507 int _outputFilePlayerId; 499 int _outputFilePlayerId;
508 int _outputFileRecorderId; 500 int _outputFileRecorderId;
509 bool _outputFileRecording; 501 bool _outputFileRecording;
510 DtmfInbandQueue _inbandDtmfQueue;
511 DtmfInband _inbandDtmfGenerator;
512 bool _outputExternalMedia; 502 bool _outputExternalMedia;
513 VoEMediaProcess* _inputExternalMediaCallbackPtr; 503 VoEMediaProcess* _inputExternalMediaCallbackPtr;
514 VoEMediaProcess* _outputExternalMediaCallbackPtr; 504 VoEMediaProcess* _outputExternalMediaCallbackPtr;
515 uint32_t _timeStamp; 505 uint32_t _timeStamp;
516 uint8_t _sendTelephoneEventPayloadType;
tlegrand-webrtc 2016/03/11 13:49:17 I wonder if this should remain? It's used for the
the sun 2016/03/11 13:56:24 Correct, but it is only used here to support retri
tlegrand-webrtc 2016/03/14 08:24:50 Acknowledged.
517 506
518 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); 507 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_);
519 508
520 // Timestamp of the audio pulled from NetEq. 509 // Timestamp of the audio pulled from NetEq.
521 uint32_t jitter_buffer_playout_timestamp_; 510 uint32_t jitter_buffer_playout_timestamp_;
522 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); 511 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_);
523 uint32_t playout_timestamp_rtcp_; 512 uint32_t playout_timestamp_rtcp_;
524 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); 513 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_);
525 uint32_t _numberOfDiscardedPackets; 514 uint32_t _numberOfDiscardedPackets;
526 uint16_t send_sequence_number_; 515 uint16_t send_sequence_number_;
(...skipping 25 matching lines...) Expand all
552 // VoEBase 541 // VoEBase
553 bool _externalMixing; 542 bool _externalMixing;
554 bool _mixFileWithMicrophone; 543 bool _mixFileWithMicrophone;
555 // VoEVolumeControl 544 // VoEVolumeControl
556 bool _mute; 545 bool _mute;
557 float _panLeft; 546 float _panLeft;
558 float _panRight; 547 float _panRight;
559 float _outputGain; 548 float _outputGain;
560 // VoEDtmf 549 // VoEDtmf
561 bool _playOutbandDtmfEvent; 550 bool _playOutbandDtmfEvent;
562 bool _playInbandDtmfEvent;
563 // VoeRTP_RTCP 551 // VoeRTP_RTCP
564 uint32_t _lastLocalTimeStamp; 552 uint32_t _lastLocalTimeStamp;
565 int8_t _lastPayloadType; 553 int8_t _lastPayloadType;
566 bool _includeAudioLevelIndication; 554 bool _includeAudioLevelIndication;
567 // VoENetwork 555 // VoENetwork
568 AudioFrame::SpeechType _outputSpeechType; 556 AudioFrame::SpeechType _outputSpeechType;
569 // VoEVideoSync 557 // VoEVideoSync
570 rtc::CriticalSection video_sync_lock_; 558 rtc::CriticalSection video_sync_lock_;
571 uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_); 559 uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_);
572 uint32_t _previousTimestamp; 560 uint32_t _previousTimestamp;
(...skipping 14 matching lines...) Expand all
587 PacketRouter* packet_router_ = nullptr; 575 PacketRouter* packet_router_ = nullptr;
588 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; 576 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_;
589 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; 577 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_;
590 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; 578 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_;
591 }; 579 };
592 580
593 } // namespace voe 581 } // namespace voe
594 } // namespace webrtc 582 } // namespace webrtc
595 583
596 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ 584 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698