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 enable, | 1073 virtual bool SetAudioSend(uint32_t ssrc, |
| 1074 bool enable, |
1074 const AudioOptions* options, | 1075 const AudioOptions* options, |
1075 AudioRenderer* renderer) = 0; | 1076 AudioRenderer* renderer) = 0; |
1076 // 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. |
1077 virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; | 1078 virtual bool SetRemoteRenderer(uint32_t ssrc, AudioRenderer* renderer) = 0; |
1078 // Gets current energy levels for all incoming streams. | 1079 // Gets current energy levels for all incoming streams. |
1079 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; | 1080 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; |
1080 // 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. |
1081 virtual int GetOutputLevel() = 0; | 1082 virtual int GetOutputLevel() = 0; |
1082 // Get the time in milliseconds since last recorded keystroke, or negative. | 1083 // Get the time in milliseconds since last recorded keystroke, or negative. |
1083 virtual int GetTimeSinceLastTyping() = 0; | 1084 virtual int GetTimeSinceLastTyping() = 0; |
1084 // Temporarily exposed field for tuning typing detect options. | 1085 // Temporarily exposed field for tuning typing detect options. |
1085 virtual void SetTypingDetectionParameters(int time_window, | 1086 virtual void SetTypingDetectionParameters(int time_window, |
1086 int cost_per_typing, int reporting_threshold, int penalty_decay, | 1087 int cost_per_typing, int reporting_threshold, int penalty_decay, |
1087 int type_event_delay) = 0; | 1088 int type_event_delay) = 0; |
1088 // 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. |
1089 virtual bool SetOutputScaling(uint32 ssrc, double left, double right) = 0; | 1090 virtual bool SetOutputScaling(uint32_t ssrc, double left, double right) = 0; |
1090 // Returns if the telephone-event has been negotiated. | 1091 // Returns if the telephone-event has been negotiated. |
1091 virtual bool CanInsertDtmf() { return false; } | 1092 virtual bool CanInsertDtmf() { return false; } |
1092 // Send and/or play a DTMF |event| according to the |flags|. | 1093 // Send and/or play a DTMF |event| according to the |flags|. |
1093 // The DTMF out-of-band signal will be used on sending. | 1094 // The DTMF out-of-band signal will be used on sending. |
1094 // The |ssrc| should be either 0 or a valid send stream ssrc. | 1095 // The |ssrc| should be either 0 or a valid send stream ssrc. |
1095 // The valid value for the |event| are 0 to 15 which corresponding to | 1096 // The valid value for the |event| are 0 to 15 which corresponding to |
1096 // DTMF event 0-9, *, #, A-D. | 1097 // DTMF event 0-9, *, #, A-D. |
1097 virtual bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) = 0; | 1098 virtual bool InsertDtmf(uint32_t ssrc, |
| 1099 int event, |
| 1100 int duration, |
| 1101 int flags) = 0; |
1098 // Gets quality stats for the channel. | 1102 // Gets quality stats for the channel. |
1099 virtual bool GetStats(VoiceMediaInfo* info) = 0; | 1103 virtual bool GetStats(VoiceMediaInfo* info) = 0; |
1100 }; | 1104 }; |
1101 | 1105 |
1102 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { | 1106 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { |
1103 }; | 1107 }; |
1104 | 1108 |
1105 struct VideoRecvParameters : RtpParameters<VideoCodec> { | 1109 struct VideoRecvParameters : RtpParameters<VideoCodec> { |
1106 }; | 1110 }; |
1107 | 1111 |
(...skipping 15 matching lines...) Expand all Loading... |
1123 }; | 1127 }; |
1124 | 1128 |
1125 VideoMediaChannel() : renderer_(NULL) {} | 1129 VideoMediaChannel() : renderer_(NULL) {} |
1126 virtual ~VideoMediaChannel() {} | 1130 virtual ~VideoMediaChannel() {} |
1127 | 1131 |
1128 virtual bool SetSendParameters(const VideoSendParameters& params) = 0; | 1132 virtual bool SetSendParameters(const VideoSendParameters& params) = 0; |
1129 virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0; | 1133 virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0; |
1130 // Gets the currently set codecs/payload types to be used for outgoing media. | 1134 // Gets the currently set codecs/payload types to be used for outgoing media. |
1131 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; | 1135 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; |
1132 // Sets the format of a specified outgoing stream. | 1136 // Sets the format of a specified outgoing stream. |
1133 virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0; | 1137 virtual bool SetSendStreamFormat(uint32_t ssrc, |
| 1138 const VideoFormat& format) = 0; |
1134 // Starts or stops transmission (and potentially capture) of local video. | 1139 // Starts or stops transmission (and potentially capture) of local video. |
1135 virtual bool SetSend(bool send) = 0; | 1140 virtual bool SetSend(bool send) = 0; |
1136 // Configure stream for sending. | 1141 // Configure stream for sending. |
1137 virtual bool SetVideoSend(uint32 ssrc, bool enable, | 1142 virtual bool SetVideoSend(uint32_t ssrc, |
| 1143 bool enable, |
1138 const VideoOptions* options) = 0; | 1144 const VideoOptions* options) = 0; |
1139 // Sets the renderer object to be used for the specified stream. | 1145 // Sets the renderer object to be used for the specified stream. |
1140 // If SSRC is 0, the renderer is used for the 'default' stream. | 1146 // If SSRC is 0, the renderer is used for the 'default' stream. |
1141 virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) = 0; | 1147 virtual bool SetRenderer(uint32_t ssrc, VideoRenderer* renderer) = 0; |
1142 // If |ssrc| is 0, replace the default capturer (engine capturer) with | 1148 // If |ssrc| is 0, replace the default capturer (engine capturer) with |
1143 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. | 1149 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. |
1144 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) = 0; | 1150 virtual bool SetCapturer(uint32_t ssrc, VideoCapturer* capturer) = 0; |
1145 // Gets quality stats for the channel. | 1151 // Gets quality stats for the channel. |
1146 virtual bool GetStats(VideoMediaInfo* info) = 0; | 1152 virtual bool GetStats(VideoMediaInfo* info) = 0; |
1147 // Send an intra frame to the receivers. | 1153 // Send an intra frame to the receivers. |
1148 virtual bool SendIntraFrame() = 0; | 1154 virtual bool SendIntraFrame() = 0; |
1149 // Reuqest each of the remote senders to send an intra frame. | 1155 // Reuqest each of the remote senders to send an intra frame. |
1150 virtual bool RequestIntraFrame() = 0; | 1156 virtual bool RequestIntraFrame() = 0; |
1151 virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; | 1157 virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; |
1152 | 1158 |
1153 protected: | 1159 protected: |
1154 VideoRenderer *renderer_; | 1160 VideoRenderer *renderer_; |
1155 }; | 1161 }; |
1156 | 1162 |
1157 enum DataMessageType { | 1163 enum DataMessageType { |
1158 // Chrome-Internal use only. See SctpDataMediaChannel for the actual PPID | 1164 // Chrome-Internal use only. See SctpDataMediaChannel for the actual PPID |
1159 // values. | 1165 // values. |
1160 DMT_NONE = 0, | 1166 DMT_NONE = 0, |
1161 DMT_CONTROL = 1, | 1167 DMT_CONTROL = 1, |
1162 DMT_BINARY = 2, | 1168 DMT_BINARY = 2, |
1163 DMT_TEXT = 3, | 1169 DMT_TEXT = 3, |
1164 }; | 1170 }; |
1165 | 1171 |
1166 // Info about data received in DataMediaChannel. For use in | 1172 // Info about data received in DataMediaChannel. For use in |
1167 // DataMediaChannel::SignalDataReceived and in all of the signals that | 1173 // DataMediaChannel::SignalDataReceived and in all of the signals that |
1168 // signal fires, on up the chain. | 1174 // signal fires, on up the chain. |
1169 struct ReceiveDataParams { | 1175 struct ReceiveDataParams { |
1170 // The in-packet stream indentifier. | 1176 // The in-packet stream indentifier. |
1171 // For SCTP, this is really SID, not SSRC. | 1177 // For SCTP, this is really SID, not SSRC. |
1172 uint32 ssrc; | 1178 uint32_t ssrc; |
1173 // The type of message (binary, text, or control). | 1179 // The type of message (binary, text, or control). |
1174 DataMessageType type; | 1180 DataMessageType type; |
1175 // A per-stream value incremented per packet in the stream. | 1181 // A per-stream value incremented per packet in the stream. |
1176 int seq_num; | 1182 int seq_num; |
1177 // A per-stream value monotonically increasing with time. | 1183 // A per-stream value monotonically increasing with time. |
1178 int timestamp; | 1184 int timestamp; |
1179 | 1185 |
1180 ReceiveDataParams() : | 1186 ReceiveDataParams() : |
1181 ssrc(0), | 1187 ssrc(0), |
1182 type(DMT_TEXT), | 1188 type(DMT_TEXT), |
1183 seq_num(0), | 1189 seq_num(0), |
1184 timestamp(0) { | 1190 timestamp(0) { |
1185 } | 1191 } |
1186 }; | 1192 }; |
1187 | 1193 |
1188 struct SendDataParams { | 1194 struct SendDataParams { |
1189 // The in-packet stream indentifier. | 1195 // The in-packet stream indentifier. |
1190 // For SCTP, this is really SID, not SSRC. | 1196 // For SCTP, this is really SID, not SSRC. |
1191 uint32 ssrc; | 1197 uint32_t ssrc; |
1192 // The type of message (binary, text, or control). | 1198 // The type of message (binary, text, or control). |
1193 DataMessageType type; | 1199 DataMessageType type; |
1194 | 1200 |
1195 // For SCTP, whether to send messages flagged as ordered or not. | 1201 // For SCTP, whether to send messages flagged as ordered or not. |
1196 // If false, messages can be received out of order. | 1202 // If false, messages can be received out of order. |
1197 bool ordered; | 1203 bool ordered; |
1198 // For SCTP, whether the messages are sent reliably or not. | 1204 // For SCTP, whether the messages are sent reliably or not. |
1199 // If false, messages may be lost. | 1205 // If false, messages may be lost. |
1200 bool reliable; | 1206 bool reliable; |
1201 // For SCTP, if reliable == false, provide partial reliability by | 1207 // For SCTP, if reliable == false, provide partial reliability by |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 const rtc::Buffer& payload, | 1275 const rtc::Buffer& payload, |
1270 SendDataResult* result = NULL) = 0; | 1276 SendDataResult* result = NULL) = 0; |
1271 // Signals when data is received (params, data, len) | 1277 // Signals when data is received (params, data, len) |
1272 sigslot::signal3<const ReceiveDataParams&, | 1278 sigslot::signal3<const ReceiveDataParams&, |
1273 const char*, | 1279 const char*, |
1274 size_t> SignalDataReceived; | 1280 size_t> SignalDataReceived; |
1275 // Signal when the media channel is ready to send the stream. Arguments are: | 1281 // Signal when the media channel is ready to send the stream. Arguments are: |
1276 // writable(bool) | 1282 // writable(bool) |
1277 sigslot::signal1<bool> SignalReadyToSend; | 1283 sigslot::signal1<bool> SignalReadyToSend; |
1278 // Signal for notifying that the remote side has closed the DataChannel. | 1284 // Signal for notifying that the remote side has closed the DataChannel. |
1279 sigslot::signal1<uint32> SignalStreamClosedRemotely; | 1285 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
1280 }; | 1286 }; |
1281 | 1287 |
1282 } // namespace cricket | 1288 } // namespace cricket |
1283 | 1289 |
1284 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1290 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |