OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 Settable<bool> typing_detection; | 281 Settable<bool> typing_detection; |
282 Settable<bool> aecm_generate_comfort_noise; | 282 Settable<bool> aecm_generate_comfort_noise; |
283 Settable<bool> conference_mode; | 283 Settable<bool> conference_mode; |
284 Settable<int> adjust_agc_delta; | 284 Settable<int> adjust_agc_delta; |
285 Settable<bool> experimental_agc; | 285 Settable<bool> experimental_agc; |
286 Settable<bool> extended_filter_aec; | 286 Settable<bool> extended_filter_aec; |
287 Settable<bool> delay_agnostic_aec; | 287 Settable<bool> delay_agnostic_aec; |
288 Settable<bool> experimental_ns; | 288 Settable<bool> experimental_ns; |
289 Settable<bool> aec_dump; | 289 Settable<bool> aec_dump; |
290 // Note that tx_agc_* only applies to non-experimental AGC. | 290 // Note that tx_agc_* only applies to non-experimental AGC. |
291 Settable<uint16> tx_agc_target_dbov; | 291 Settable<uint16_t> tx_agc_target_dbov; |
292 Settable<uint16> tx_agc_digital_compression_gain; | 292 Settable<uint16_t> tx_agc_digital_compression_gain; |
293 Settable<bool> tx_agc_limiter; | 293 Settable<bool> tx_agc_limiter; |
294 Settable<uint16> rx_agc_target_dbov; | 294 Settable<uint16_t> rx_agc_target_dbov; |
295 Settable<uint16> rx_agc_digital_compression_gain; | 295 Settable<uint16_t> rx_agc_digital_compression_gain; |
296 Settable<bool> rx_agc_limiter; | 296 Settable<bool> rx_agc_limiter; |
297 Settable<uint32> recording_sample_rate; | 297 Settable<uint32_t> recording_sample_rate; |
298 Settable<uint32> playout_sample_rate; | 298 Settable<uint32_t> playout_sample_rate; |
299 // Set DSCP value for packet sent from audio channel. | 299 // Set DSCP value for packet sent from audio channel. |
300 Settable<bool> dscp; | 300 Settable<bool> dscp; |
301 // Enable combined audio+bandwidth BWE. | 301 // Enable combined audio+bandwidth BWE. |
302 Settable<bool> combined_audio_video_bwe; | 302 Settable<bool> combined_audio_video_bwe; |
303 }; | 303 }; |
304 | 304 |
305 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. | 305 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. |
306 // Used to be flags, but that makes it hard to selectively apply options. | 306 // Used to be flags, but that makes it hard to selectively apply options. |
307 // We are moving all of the setting of options to structs like this, | 307 // We are moving all of the setting of options to structs like this, |
308 // but some things currently still use flags. | 308 // but some things currently still use flags. |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 virtual void OnRtcpReceived(rtc::Buffer* packet, | 550 virtual void OnRtcpReceived(rtc::Buffer* packet, |
551 const rtc::PacketTime& packet_time) = 0; | 551 const rtc::PacketTime& packet_time) = 0; |
552 // Called when the socket's ability to send has changed. | 552 // Called when the socket's ability to send has changed. |
553 virtual void OnReadyToSend(bool ready) = 0; | 553 virtual void OnReadyToSend(bool ready) = 0; |
554 // Creates a new outgoing media stream with SSRCs and CNAME as described | 554 // Creates a new outgoing media stream with SSRCs and CNAME as described |
555 // by sp. | 555 // by sp. |
556 virtual bool AddSendStream(const StreamParams& sp) = 0; | 556 virtual bool AddSendStream(const StreamParams& sp) = 0; |
557 // Removes an outgoing media stream. | 557 // Removes an outgoing media stream. |
558 // ssrc must be the first SSRC of the media stream if the stream uses | 558 // ssrc must be the first SSRC of the media stream if the stream uses |
559 // multiple SSRCs. | 559 // multiple SSRCs. |
560 virtual bool RemoveSendStream(uint32 ssrc) = 0; | 560 virtual bool RemoveSendStream(uint32_t ssrc) = 0; |
561 // Creates a new incoming media stream with SSRCs and CNAME as described | 561 // Creates a new incoming media stream with SSRCs and CNAME as described |
562 // by sp. | 562 // by sp. |
563 virtual bool AddRecvStream(const StreamParams& sp) = 0; | 563 virtual bool AddRecvStream(const StreamParams& sp) = 0; |
564 // Removes an incoming media stream. | 564 // Removes an incoming media stream. |
565 // ssrc must be the first SSRC of the media stream if the stream uses | 565 // ssrc must be the first SSRC of the media stream if the stream uses |
566 // multiple SSRCs. | 566 // multiple SSRCs. |
567 virtual bool RemoveRecvStream(uint32 ssrc) = 0; | 567 virtual bool RemoveRecvStream(uint32_t ssrc) = 0; |
568 | 568 |
569 // Returns the absoulte sendtime extension id value from media channel. | 569 // Returns the absoulte sendtime extension id value from media channel. |
570 virtual int GetRtpSendTimeExtnId() const { | 570 virtual int GetRtpSendTimeExtnId() const { |
571 return -1; | 571 return -1; |
572 } | 572 } |
573 | 573 |
574 // Base method to send packet using NetworkInterface. | 574 // Base method to send packet using NetworkInterface. |
575 bool SendPacket(rtc::Buffer* packet) { | 575 bool SendPacket(rtc::Buffer* packet) { |
576 return DoSendPacket(packet, false); | 576 return DoSendPacket(packet, false); |
577 } | 577 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 // Media contains a vector of SSRC infos that are exclusively used by this | 633 // Media contains a vector of SSRC infos that are exclusively used by this |
634 // media. (SSRCs shared between media streams can't be represented.) | 634 // media. (SSRCs shared between media streams can't be represented.) |
635 | 635 |
636 // Information about an SSRC. | 636 // Information about an SSRC. |
637 // This data may be locally recorded, or received in an RTCP SR or RR. | 637 // This data may be locally recorded, or received in an RTCP SR or RR. |
638 struct SsrcSenderInfo { | 638 struct SsrcSenderInfo { |
639 SsrcSenderInfo() | 639 SsrcSenderInfo() |
640 : ssrc(0), | 640 : ssrc(0), |
641 timestamp(0) { | 641 timestamp(0) { |
642 } | 642 } |
643 uint32 ssrc; | 643 uint32_t ssrc; |
644 double timestamp; // NTP timestamp, represented as seconds since epoch. | 644 double timestamp; // NTP timestamp, represented as seconds since epoch. |
645 }; | 645 }; |
646 | 646 |
647 struct SsrcReceiverInfo { | 647 struct SsrcReceiverInfo { |
648 SsrcReceiverInfo() | 648 SsrcReceiverInfo() |
649 : ssrc(0), | 649 : ssrc(0), |
650 timestamp(0) { | 650 timestamp(0) { |
651 } | 651 } |
652 uint32 ssrc; | 652 uint32_t ssrc; |
653 double timestamp; | 653 double timestamp; |
654 }; | 654 }; |
655 | 655 |
656 struct MediaSenderInfo { | 656 struct MediaSenderInfo { |
657 MediaSenderInfo() | 657 MediaSenderInfo() |
658 : bytes_sent(0), | 658 : bytes_sent(0), |
659 packets_sent(0), | 659 packets_sent(0), |
660 packets_lost(0), | 660 packets_lost(0), |
661 fraction_lost(0.0), | 661 fraction_lost(0.0), |
662 rtt_ms(0) { | 662 rtt_ms(0) { |
663 } | 663 } |
664 void add_ssrc(const SsrcSenderInfo& stat) { | 664 void add_ssrc(const SsrcSenderInfo& stat) { |
665 local_stats.push_back(stat); | 665 local_stats.push_back(stat); |
666 } | 666 } |
667 // Temporary utility function for call sites that only provide SSRC. | 667 // Temporary utility function for call sites that only provide SSRC. |
668 // As more info is added into SsrcSenderInfo, this function should go away. | 668 // As more info is added into SsrcSenderInfo, this function should go away. |
669 void add_ssrc(uint32 ssrc) { | 669 void add_ssrc(uint32_t ssrc) { |
670 SsrcSenderInfo stat; | 670 SsrcSenderInfo stat; |
671 stat.ssrc = ssrc; | 671 stat.ssrc = ssrc; |
672 add_ssrc(stat); | 672 add_ssrc(stat); |
673 } | 673 } |
674 // Utility accessor for clients that are only interested in ssrc numbers. | 674 // Utility accessor for clients that are only interested in ssrc numbers. |
675 std::vector<uint32> ssrcs() const { | 675 std::vector<uint32_t> ssrcs() const { |
676 std::vector<uint32> retval; | 676 std::vector<uint32_t> retval; |
677 for (std::vector<SsrcSenderInfo>::const_iterator it = local_stats.begin(); | 677 for (std::vector<SsrcSenderInfo>::const_iterator it = local_stats.begin(); |
678 it != local_stats.end(); ++it) { | 678 it != local_stats.end(); ++it) { |
679 retval.push_back(it->ssrc); | 679 retval.push_back(it->ssrc); |
680 } | 680 } |
681 return retval; | 681 return retval; |
682 } | 682 } |
683 // Utility accessor for clients that make the assumption only one ssrc | 683 // Utility accessor for clients that make the assumption only one ssrc |
684 // exists per media. | 684 // exists per media. |
685 // This will eventually go away. | 685 // This will eventually go away. |
686 uint32 ssrc() const { | 686 uint32_t ssrc() const { |
687 if (local_stats.size() > 0) { | 687 if (local_stats.size() > 0) { |
688 return local_stats[0].ssrc; | 688 return local_stats[0].ssrc; |
689 } else { | 689 } else { |
690 return 0; | 690 return 0; |
691 } | 691 } |
692 } | 692 } |
693 int64 bytes_sent; | 693 int64_t bytes_sent; |
694 int packets_sent; | 694 int packets_sent; |
695 int packets_lost; | 695 int packets_lost; |
696 float fraction_lost; | 696 float fraction_lost; |
697 int64_t rtt_ms; | 697 int64_t rtt_ms; |
698 std::string codec_name; | 698 std::string codec_name; |
699 std::vector<SsrcSenderInfo> local_stats; | 699 std::vector<SsrcSenderInfo> local_stats; |
700 std::vector<SsrcReceiverInfo> remote_stats; | 700 std::vector<SsrcReceiverInfo> remote_stats; |
701 }; | 701 }; |
702 | 702 |
703 template<class T> | 703 template<class T> |
(...skipping 15 matching lines...) Expand all Loading... |
719 : bytes_rcvd(0), | 719 : bytes_rcvd(0), |
720 packets_rcvd(0), | 720 packets_rcvd(0), |
721 packets_lost(0), | 721 packets_lost(0), |
722 fraction_lost(0.0) { | 722 fraction_lost(0.0) { |
723 } | 723 } |
724 void add_ssrc(const SsrcReceiverInfo& stat) { | 724 void add_ssrc(const SsrcReceiverInfo& stat) { |
725 local_stats.push_back(stat); | 725 local_stats.push_back(stat); |
726 } | 726 } |
727 // Temporary utility function for call sites that only provide SSRC. | 727 // Temporary utility function for call sites that only provide SSRC. |
728 // As more info is added into SsrcSenderInfo, this function should go away. | 728 // As more info is added into SsrcSenderInfo, this function should go away. |
729 void add_ssrc(uint32 ssrc) { | 729 void add_ssrc(uint32_t ssrc) { |
730 SsrcReceiverInfo stat; | 730 SsrcReceiverInfo stat; |
731 stat.ssrc = ssrc; | 731 stat.ssrc = ssrc; |
732 add_ssrc(stat); | 732 add_ssrc(stat); |
733 } | 733 } |
734 std::vector<uint32> ssrcs() const { | 734 std::vector<uint32_t> ssrcs() const { |
735 std::vector<uint32> retval; | 735 std::vector<uint32_t> retval; |
736 for (std::vector<SsrcReceiverInfo>::const_iterator it = local_stats.begin(); | 736 for (std::vector<SsrcReceiverInfo>::const_iterator it = local_stats.begin(); |
737 it != local_stats.end(); ++it) { | 737 it != local_stats.end(); ++it) { |
738 retval.push_back(it->ssrc); | 738 retval.push_back(it->ssrc); |
739 } | 739 } |
740 return retval; | 740 return retval; |
741 } | 741 } |
742 // Utility accessor for clients that make the assumption only one ssrc | 742 // Utility accessor for clients that make the assumption only one ssrc |
743 // exists per media. | 743 // exists per media. |
744 // This will eventually go away. | 744 // This will eventually go away. |
745 uint32 ssrc() const { | 745 uint32_t ssrc() const { |
746 if (local_stats.size() > 0) { | 746 if (local_stats.size() > 0) { |
747 return local_stats[0].ssrc; | 747 return local_stats[0].ssrc; |
748 } else { | 748 } else { |
749 return 0; | 749 return 0; |
750 } | 750 } |
751 } | 751 } |
752 | 752 |
753 int64 bytes_rcvd; | 753 int64_t bytes_rcvd; |
754 int packets_rcvd; | 754 int packets_rcvd; |
755 int packets_lost; | 755 int packets_lost; |
756 float fraction_lost; | 756 float fraction_lost; |
757 std::string codec_name; | 757 std::string codec_name; |
758 std::vector<SsrcReceiverInfo> local_stats; | 758 std::vector<SsrcReceiverInfo> local_stats; |
759 std::vector<SsrcSenderInfo> remote_stats; | 759 std::vector<SsrcSenderInfo> remote_stats; |
760 }; | 760 }; |
761 | 761 |
762 struct VoiceSenderInfo : public MediaSenderInfo { | 762 struct VoiceSenderInfo : public MediaSenderInfo { |
763 VoiceSenderInfo() | 763 VoiceSenderInfo() |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 float accelerate_rate; | 820 float accelerate_rate; |
821 // Fraction of data inserted through time stretching. | 821 // Fraction of data inserted through time stretching. |
822 float preemptive_expand_rate; | 822 float preemptive_expand_rate; |
823 int decoding_calls_to_silence_generator; | 823 int decoding_calls_to_silence_generator; |
824 int decoding_calls_to_neteq; | 824 int decoding_calls_to_neteq; |
825 int decoding_normal; | 825 int decoding_normal; |
826 int decoding_plc; | 826 int decoding_plc; |
827 int decoding_cng; | 827 int decoding_cng; |
828 int decoding_plc_cng; | 828 int decoding_plc_cng; |
829 // Estimated capture start time in NTP time in ms. | 829 // Estimated capture start time in NTP time in ms. |
830 int64 capture_start_ntp_time_ms; | 830 int64_t capture_start_ntp_time_ms; |
831 }; | 831 }; |
832 | 832 |
833 struct VideoSenderInfo : public MediaSenderInfo { | 833 struct VideoSenderInfo : public MediaSenderInfo { |
834 VideoSenderInfo() | 834 VideoSenderInfo() |
835 : packets_cached(0), | 835 : packets_cached(0), |
836 firs_rcvd(0), | 836 firs_rcvd(0), |
837 plis_rcvd(0), | 837 plis_rcvd(0), |
838 nacks_rcvd(0), | 838 nacks_rcvd(0), |
839 input_frame_width(0), | 839 input_frame_width(0), |
840 input_frame_height(0), | 840 input_frame_height(0), |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 int min_playout_delay_ms; | 924 int min_playout_delay_ms; |
925 // Requested latency to account for rendering delay. | 925 // Requested latency to account for rendering delay. |
926 int render_delay_ms; | 926 int render_delay_ms; |
927 // Target overall delay: network+decode+render, accounting for | 927 // Target overall delay: network+decode+render, accounting for |
928 // min_playout_delay_ms. | 928 // min_playout_delay_ms. |
929 int target_delay_ms; | 929 int target_delay_ms; |
930 // Current overall delay, possibly ramping towards target_delay_ms. | 930 // Current overall delay, possibly ramping towards target_delay_ms. |
931 int current_delay_ms; | 931 int current_delay_ms; |
932 | 932 |
933 // Estimated capture start time in NTP time in ms. | 933 // Estimated capture start time in NTP time in ms. |
934 int64 capture_start_ntp_time_ms; | 934 int64_t capture_start_ntp_time_ms; |
935 }; | 935 }; |
936 | 936 |
937 struct DataSenderInfo : public MediaSenderInfo { | 937 struct DataSenderInfo : public MediaSenderInfo { |
938 DataSenderInfo() | 938 DataSenderInfo() |
939 : ssrc(0) { | 939 : ssrc(0) { |
940 } | 940 } |
941 | 941 |
942 uint32 ssrc; | 942 uint32_t ssrc; |
943 }; | 943 }; |
944 | 944 |
945 struct DataReceiverInfo : public MediaReceiverInfo { | 945 struct DataReceiverInfo : public MediaReceiverInfo { |
946 DataReceiverInfo() | 946 DataReceiverInfo() |
947 : ssrc(0) { | 947 : ssrc(0) { |
948 } | 948 } |
949 | 949 |
950 uint32 ssrc; | 950 uint32_t ssrc; |
951 }; | 951 }; |
952 | 952 |
953 struct BandwidthEstimationInfo { | 953 struct BandwidthEstimationInfo { |
954 BandwidthEstimationInfo() | 954 BandwidthEstimationInfo() |
955 : available_send_bandwidth(0), | 955 : available_send_bandwidth(0), |
956 available_recv_bandwidth(0), | 956 available_recv_bandwidth(0), |
957 target_enc_bitrate(0), | 957 target_enc_bitrate(0), |
958 actual_enc_bitrate(0), | 958 actual_enc_bitrate(0), |
959 retransmit_bitrate(0), | 959 retransmit_bitrate(0), |
960 transmit_bitrate(0), | 960 transmit_bitrate(0), |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 | 1063 |
1064 VoiceMediaChannel() {} | 1064 VoiceMediaChannel() {} |
1065 virtual ~VoiceMediaChannel() {} | 1065 virtual ~VoiceMediaChannel() {} |
1066 virtual bool SetSendParameters(const AudioSendParameters& params) = 0; | 1066 virtual bool SetSendParameters(const AudioSendParameters& params) = 0; |
1067 virtual bool SetRecvParameters(const AudioRecvParameters& params) = 0; | 1067 virtual bool SetRecvParameters(const AudioRecvParameters& params) = 0; |
1068 // Starts or stops playout of received audio. | 1068 // Starts or stops playout of received audio. |
1069 virtual bool SetPlayout(bool playout) = 0; | 1069 virtual bool SetPlayout(bool playout) = 0; |
1070 // Starts or stops sending (and potentially capture) of local audio. | 1070 // Starts or stops sending (and potentially capture) of local audio. |
1071 virtual bool SetSend(SendFlags flag) = 0; | 1071 virtual bool SetSend(SendFlags flag) = 0; |
1072 // Configure stream for sending. | 1072 // Configure stream for sending. |
1073 virtual bool SetAudioSend(uint32 ssrc, bool mute, const AudioOptions* options, | 1073 virtual bool SetAudioSend(uint32_t ssrc, |
| 1074 bool mute, |
| 1075 const AudioOptions* options, |
1074 AudioRenderer* renderer) = 0; | 1076 AudioRenderer* renderer) = 0; |
1075 // Sets the renderer object to be used for the specified remote audio stream. | 1077 // Sets the renderer object to be used for the specified remote audio stream. |
1076 virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; | 1078 virtual bool SetRemoteRenderer(uint32_t ssrc, AudioRenderer* renderer) = 0; |
1077 // Gets current energy levels for all incoming streams. | 1079 // Gets current energy levels for all incoming streams. |
1078 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; | 1080 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; |
1079 // Get the current energy level of the stream sent to the speaker. | 1081 // Get the current energy level of the stream sent to the speaker. |
1080 virtual int GetOutputLevel() = 0; | 1082 virtual int GetOutputLevel() = 0; |
1081 // Get the time in milliseconds since last recorded keystroke, or negative. | 1083 // Get the time in milliseconds since last recorded keystroke, or negative. |
1082 virtual int GetTimeSinceLastTyping() = 0; | 1084 virtual int GetTimeSinceLastTyping() = 0; |
1083 // Temporarily exposed field for tuning typing detect options. | 1085 // Temporarily exposed field for tuning typing detect options. |
1084 virtual void SetTypingDetectionParameters(int time_window, | 1086 virtual void SetTypingDetectionParameters(int time_window, |
1085 int cost_per_typing, int reporting_threshold, int penalty_decay, | 1087 int cost_per_typing, int reporting_threshold, int penalty_decay, |
1086 int type_event_delay) = 0; | 1088 int type_event_delay) = 0; |
1087 // Set left and right scale for speaker output volume of the specified ssrc. | 1089 // Set left and right scale for speaker output volume of the specified ssrc. |
1088 virtual bool SetOutputScaling(uint32 ssrc, double left, double right) = 0; | 1090 virtual bool SetOutputScaling(uint32_t ssrc, double left, double right) = 0; |
1089 // Specifies a ringback tone to be played during call setup. | 1091 // Specifies a ringback tone to be played during call setup. |
1090 virtual bool SetRingbackTone(const char *buf, int len) = 0; | 1092 virtual bool SetRingbackTone(const char *buf, int len) = 0; |
1091 // Plays or stops the aforementioned ringback tone | 1093 // Plays or stops the aforementioned ringback tone |
1092 virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) = 0; | 1094 virtual bool PlayRingbackTone(uint32_t ssrc, bool play, bool loop) = 0; |
1093 // Returns if the telephone-event has been negotiated. | 1095 // Returns if the telephone-event has been negotiated. |
1094 virtual bool CanInsertDtmf() { return false; } | 1096 virtual bool CanInsertDtmf() { return false; } |
1095 // Send and/or play a DTMF |event| according to the |flags|. | 1097 // Send and/or play a DTMF |event| according to the |flags|. |
1096 // The DTMF out-of-band signal will be used on sending. | 1098 // The DTMF out-of-band signal will be used on sending. |
1097 // The |ssrc| should be either 0 or a valid send stream ssrc. | 1099 // The |ssrc| should be either 0 or a valid send stream ssrc. |
1098 // The valid value for the |event| are 0 to 15 which corresponding to | 1100 // The valid value for the |event| are 0 to 15 which corresponding to |
1099 // DTMF event 0-9, *, #, A-D. | 1101 // DTMF event 0-9, *, #, A-D. |
1100 virtual bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) = 0; | 1102 virtual bool InsertDtmf(uint32_t ssrc, |
| 1103 int event, |
| 1104 int duration, |
| 1105 int flags) = 0; |
1101 // Gets quality stats for the channel. | 1106 // Gets quality stats for the channel. |
1102 virtual bool GetStats(VoiceMediaInfo* info) = 0; | 1107 virtual bool GetStats(VoiceMediaInfo* info) = 0; |
1103 // Gets last reported error for this media channel. | 1108 // Gets last reported error for this media channel. |
1104 virtual void GetLastMediaError(uint32* ssrc, | 1109 virtual void GetLastMediaError(uint32_t* ssrc, |
1105 VoiceMediaChannel::Error* error) { | 1110 VoiceMediaChannel::Error* error) { |
1106 ASSERT(error != NULL); | 1111 ASSERT(error != NULL); |
1107 *error = ERROR_NONE; | 1112 *error = ERROR_NONE; |
1108 } | 1113 } |
1109 | 1114 |
1110 // Signal errors from MediaChannel. Arguments are: | 1115 // Signal errors from MediaChannel. Arguments are: |
1111 // ssrc(uint32), and error(VoiceMediaChannel::Error). | 1116 // ssrc(uint32_t), and error(VoiceMediaChannel::Error). |
1112 sigslot::signal2<uint32, VoiceMediaChannel::Error> SignalMediaError; | 1117 sigslot::signal2<uint32_t, VoiceMediaChannel::Error> SignalMediaError; |
1113 }; | 1118 }; |
1114 | 1119 |
1115 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { | 1120 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { |
1116 }; | 1121 }; |
1117 | 1122 |
1118 struct VideoRecvParameters : RtpParameters<VideoCodec> { | 1123 struct VideoRecvParameters : RtpParameters<VideoCodec> { |
1119 }; | 1124 }; |
1120 | 1125 |
1121 class VideoMediaChannel : public MediaChannel { | 1126 class VideoMediaChannel : public MediaChannel { |
1122 public: | 1127 public: |
(...skipping 13 matching lines...) Expand all Loading... |
1136 }; | 1141 }; |
1137 | 1142 |
1138 VideoMediaChannel() : renderer_(NULL) {} | 1143 VideoMediaChannel() : renderer_(NULL) {} |
1139 virtual ~VideoMediaChannel() {} | 1144 virtual ~VideoMediaChannel() {} |
1140 | 1145 |
1141 virtual bool SetSendParameters(const VideoSendParameters& params) = 0; | 1146 virtual bool SetSendParameters(const VideoSendParameters& params) = 0; |
1142 virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0; | 1147 virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0; |
1143 // Gets the currently set codecs/payload types to be used for outgoing media. | 1148 // Gets the currently set codecs/payload types to be used for outgoing media. |
1144 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; | 1149 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; |
1145 // Sets the format of a specified outgoing stream. | 1150 // Sets the format of a specified outgoing stream. |
1146 virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0; | 1151 virtual bool SetSendStreamFormat(uint32_t ssrc, |
| 1152 const VideoFormat& format) = 0; |
1147 // Starts or stops playout of received video. | 1153 // Starts or stops playout of received video. |
1148 virtual bool SetRender(bool render) = 0; | 1154 virtual bool SetRender(bool render) = 0; |
1149 // Starts or stops transmission (and potentially capture) of local video. | 1155 // Starts or stops transmission (and potentially capture) of local video. |
1150 virtual bool SetSend(bool send) = 0; | 1156 virtual bool SetSend(bool send) = 0; |
1151 // Configure stream for sending. | 1157 // Configure stream for sending. |
1152 virtual bool SetVideoSend(uint32 ssrc, bool mute, | 1158 virtual bool SetVideoSend(uint32_t ssrc, |
| 1159 bool mute, |
1153 const VideoOptions* options) = 0; | 1160 const VideoOptions* options) = 0; |
1154 // Sets the renderer object to be used for the specified stream. | 1161 // Sets the renderer object to be used for the specified stream. |
1155 // If SSRC is 0, the renderer is used for the 'default' stream. | 1162 // If SSRC is 0, the renderer is used for the 'default' stream. |
1156 virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) = 0; | 1163 virtual bool SetRenderer(uint32_t ssrc, VideoRenderer* renderer) = 0; |
1157 // If |ssrc| is 0, replace the default capturer (engine capturer) with | 1164 // If |ssrc| is 0, replace the default capturer (engine capturer) with |
1158 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. | 1165 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. |
1159 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) = 0; | 1166 virtual bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) = 0; |
1160 // Gets quality stats for the channel. | 1167 // Gets quality stats for the channel. |
1161 virtual bool GetStats(VideoMediaInfo* info) = 0; | 1168 virtual bool GetStats(VideoMediaInfo* info) = 0; |
1162 // Send an intra frame to the receivers. | 1169 // Send an intra frame to the receivers. |
1163 virtual bool SendIntraFrame() = 0; | 1170 virtual bool SendIntraFrame() = 0; |
1164 // Reuqest each of the remote senders to send an intra frame. | 1171 // Reuqest each of the remote senders to send an intra frame. |
1165 virtual bool RequestIntraFrame() = 0; | 1172 virtual bool RequestIntraFrame() = 0; |
1166 virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; | 1173 virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; |
1167 | 1174 |
1168 // Signal errors from MediaChannel. Arguments are: | 1175 // Signal errors from MediaChannel. Arguments are: |
1169 // ssrc(uint32), and error(VideoMediaChannel::Error). | 1176 // ssrc(uint32_t), and error(VideoMediaChannel::Error). |
1170 sigslot::signal2<uint32, Error> SignalMediaError; | 1177 sigslot::signal2<uint32_t, Error> SignalMediaError; |
1171 | 1178 |
1172 protected: | 1179 protected: |
1173 VideoRenderer *renderer_; | 1180 VideoRenderer *renderer_; |
1174 }; | 1181 }; |
1175 | 1182 |
1176 enum DataMessageType { | 1183 enum DataMessageType { |
1177 // Chrome-Internal use only. See SctpDataMediaChannel for the actual PPID | 1184 // Chrome-Internal use only. See SctpDataMediaChannel for the actual PPID |
1178 // values. | 1185 // values. |
1179 DMT_NONE = 0, | 1186 DMT_NONE = 0, |
1180 DMT_CONTROL = 1, | 1187 DMT_CONTROL = 1, |
1181 DMT_BINARY = 2, | 1188 DMT_BINARY = 2, |
1182 DMT_TEXT = 3, | 1189 DMT_TEXT = 3, |
1183 }; | 1190 }; |
1184 | 1191 |
1185 // Info about data received in DataMediaChannel. For use in | 1192 // Info about data received in DataMediaChannel. For use in |
1186 // DataMediaChannel::SignalDataReceived and in all of the signals that | 1193 // DataMediaChannel::SignalDataReceived and in all of the signals that |
1187 // signal fires, on up the chain. | 1194 // signal fires, on up the chain. |
1188 struct ReceiveDataParams { | 1195 struct ReceiveDataParams { |
1189 // The in-packet stream indentifier. | 1196 // The in-packet stream indentifier. |
1190 // For SCTP, this is really SID, not SSRC. | 1197 // For SCTP, this is really SID, not SSRC. |
1191 uint32 ssrc; | 1198 uint32_t ssrc; |
1192 // The type of message (binary, text, or control). | 1199 // The type of message (binary, text, or control). |
1193 DataMessageType type; | 1200 DataMessageType type; |
1194 // A per-stream value incremented per packet in the stream. | 1201 // A per-stream value incremented per packet in the stream. |
1195 int seq_num; | 1202 int seq_num; |
1196 // A per-stream value monotonically increasing with time. | 1203 // A per-stream value monotonically increasing with time. |
1197 int timestamp; | 1204 int timestamp; |
1198 | 1205 |
1199 ReceiveDataParams() : | 1206 ReceiveDataParams() : |
1200 ssrc(0), | 1207 ssrc(0), |
1201 type(DMT_TEXT), | 1208 type(DMT_TEXT), |
1202 seq_num(0), | 1209 seq_num(0), |
1203 timestamp(0) { | 1210 timestamp(0) { |
1204 } | 1211 } |
1205 }; | 1212 }; |
1206 | 1213 |
1207 struct SendDataParams { | 1214 struct SendDataParams { |
1208 // The in-packet stream indentifier. | 1215 // The in-packet stream indentifier. |
1209 // For SCTP, this is really SID, not SSRC. | 1216 // For SCTP, this is really SID, not SSRC. |
1210 uint32 ssrc; | 1217 uint32_t ssrc; |
1211 // The type of message (binary, text, or control). | 1218 // The type of message (binary, text, or control). |
1212 DataMessageType type; | 1219 DataMessageType type; |
1213 | 1220 |
1214 // For SCTP, whether to send messages flagged as ordered or not. | 1221 // For SCTP, whether to send messages flagged as ordered or not. |
1215 // If false, messages can be received out of order. | 1222 // If false, messages can be received out of order. |
1216 bool ordered; | 1223 bool ordered; |
1217 // For SCTP, whether the messages are sent reliably or not. | 1224 // For SCTP, whether the messages are sent reliably or not. |
1218 // If false, messages may be lost. | 1225 // If false, messages may be lost. |
1219 bool reliable; | 1226 bool reliable; |
1220 // For SCTP, if reliable == false, provide partial reliability by | 1227 // For SCTP, if reliable == false, provide partial reliability by |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 | 1292 |
1286 virtual bool SendData( | 1293 virtual bool SendData( |
1287 const SendDataParams& params, | 1294 const SendDataParams& params, |
1288 const rtc::Buffer& payload, | 1295 const rtc::Buffer& payload, |
1289 SendDataResult* result = NULL) = 0; | 1296 SendDataResult* result = NULL) = 0; |
1290 // Signals when data is received (params, data, len) | 1297 // Signals when data is received (params, data, len) |
1291 sigslot::signal3<const ReceiveDataParams&, | 1298 sigslot::signal3<const ReceiveDataParams&, |
1292 const char*, | 1299 const char*, |
1293 size_t> SignalDataReceived; | 1300 size_t> SignalDataReceived; |
1294 // Signal errors from MediaChannel. Arguments are: | 1301 // Signal errors from MediaChannel. Arguments are: |
1295 // ssrc(uint32), and error(DataMediaChannel::Error). | 1302 // ssrc(uint32_t), and error(DataMediaChannel::Error). |
1296 sigslot::signal2<uint32, DataMediaChannel::Error> SignalMediaError; | 1303 sigslot::signal2<uint32_t, DataMediaChannel::Error> SignalMediaError; |
1297 // Signal when the media channel is ready to send the stream. Arguments are: | 1304 // Signal when the media channel is ready to send the stream. Arguments are: |
1298 // writable(bool) | 1305 // writable(bool) |
1299 sigslot::signal1<bool> SignalReadyToSend; | 1306 sigslot::signal1<bool> SignalReadyToSend; |
1300 // Signal for notifying that the remote side has closed the DataChannel. | 1307 // Signal for notifying that the remote side has closed the DataChannel. |
1301 sigslot::signal1<uint32> SignalStreamClosedRemotely; | 1308 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
1302 }; | 1309 }; |
1303 | 1310 |
1304 } // namespace cricket | 1311 } // namespace cricket |
1305 | 1312 |
1306 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1313 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |