| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 enum MediaChannelOptions { | 440 enum MediaChannelOptions { |
| 441 // Tune the stream for conference mode. | 441 // Tune the stream for conference mode. |
| 442 OPT_CONFERENCE = 0x0001 | 442 OPT_CONFERENCE = 0x0001 |
| 443 }; | 443 }; |
| 444 | 444 |
| 445 enum VoiceMediaChannelOptions { | 445 enum VoiceMediaChannelOptions { |
| 446 // Tune the audio stream for vcs with different target levels. | 446 // Tune the audio stream for vcs with different target levels. |
| 447 OPT_AGC_MINUS_10DB = 0x80000000 | 447 OPT_AGC_MINUS_10DB = 0x80000000 |
| 448 }; | 448 }; |
| 449 | 449 |
| 450 // DTMF flags to control if a DTMF tone should be played and/or sent. | |
| 451 enum DtmfFlags { | |
| 452 DF_PLAY = 0x01, | |
| 453 DF_SEND = 0x02, | |
| 454 }; | |
| 455 | |
| 456 class MediaChannel : public sigslot::has_slots<> { | 450 class MediaChannel : public sigslot::has_slots<> { |
| 457 public: | 451 public: |
| 458 class NetworkInterface { | 452 class NetworkInterface { |
| 459 public: | 453 public: |
| 460 enum SocketType { ST_RTP, ST_RTCP }; | 454 enum SocketType { ST_RTP, ST_RTCP }; |
| 461 virtual bool SendPacket(rtc::Buffer* packet, | 455 virtual bool SendPacket(rtc::Buffer* packet, |
| 462 const rtc::PacketOptions& options) = 0; | 456 const rtc::PacketOptions& options) = 0; |
| 463 virtual bool SendRtcp(rtc::Buffer* packet, | 457 virtual bool SendRtcp(rtc::Buffer* packet, |
| 464 const rtc::PacketOptions& options) = 0; | 458 const rtc::PacketOptions& options) = 0; |
| 465 virtual int SetOption(SocketType type, rtc::Socket::Option opt, | 459 virtual int SetOption(SocketType type, rtc::Socket::Option opt, |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 virtual int GetOutputLevel() = 0; | 1009 virtual int GetOutputLevel() = 0; |
| 1016 // Get the time in milliseconds since last recorded keystroke, or negative. | 1010 // Get the time in milliseconds since last recorded keystroke, or negative. |
| 1017 virtual int GetTimeSinceLastTyping() = 0; | 1011 virtual int GetTimeSinceLastTyping() = 0; |
| 1018 // Temporarily exposed field for tuning typing detect options. | 1012 // Temporarily exposed field for tuning typing detect options. |
| 1019 virtual void SetTypingDetectionParameters(int time_window, | 1013 virtual void SetTypingDetectionParameters(int time_window, |
| 1020 int cost_per_typing, int reporting_threshold, int penalty_decay, | 1014 int cost_per_typing, int reporting_threshold, int penalty_decay, |
| 1021 int type_event_delay) = 0; | 1015 int type_event_delay) = 0; |
| 1022 // Set speaker output volume of the specified ssrc. | 1016 // Set speaker output volume of the specified ssrc. |
| 1023 virtual bool SetOutputVolume(uint32_t ssrc, double volume) = 0; | 1017 virtual bool SetOutputVolume(uint32_t ssrc, double volume) = 0; |
| 1024 // Returns if the telephone-event has been negotiated. | 1018 // Returns if the telephone-event has been negotiated. |
| 1025 virtual bool CanInsertDtmf() { return false; } | 1019 virtual bool CanInsertDtmf() = 0; |
| 1026 // Send and/or play a DTMF |event| according to the |flags|. | 1020 // Send a DTMF |event|. The DTMF out-of-band signal will be used. |
| 1027 // The DTMF out-of-band signal will be used on sending. | |
| 1028 // The |ssrc| should be either 0 or a valid send stream ssrc. | 1021 // The |ssrc| should be either 0 or a valid send stream ssrc. |
| 1029 // The valid value for the |event| are 0 to 15 which corresponding to | 1022 // The valid value for the |event| are 0 to 15 which corresponding to |
| 1030 // DTMF event 0-9, *, #, A-D. | 1023 // DTMF event 0-9, *, #, A-D. |
| 1031 virtual bool InsertDtmf(uint32_t ssrc, | 1024 virtual bool InsertDtmf(uint32_t ssrc, int event, int duration) = 0; |
| 1032 int event, | |
| 1033 int duration, | |
| 1034 int flags) = 0; | |
| 1035 // Gets quality stats for the channel. | 1025 // Gets quality stats for the channel. |
| 1036 virtual bool GetStats(VoiceMediaInfo* info) = 0; | 1026 virtual bool GetStats(VoiceMediaInfo* info) = 0; |
| 1037 }; | 1027 }; |
| 1038 | 1028 |
| 1039 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { | 1029 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { |
| 1040 }; | 1030 }; |
| 1041 | 1031 |
| 1042 struct VideoRecvParameters : RtpParameters<VideoCodec> { | 1032 struct VideoRecvParameters : RtpParameters<VideoCodec> { |
| 1043 }; | 1033 }; |
| 1044 | 1034 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 // Signal when the media channel is ready to send the stream. Arguments are: | 1204 // Signal when the media channel is ready to send the stream. Arguments are: |
| 1215 // writable(bool) | 1205 // writable(bool) |
| 1216 sigslot::signal1<bool> SignalReadyToSend; | 1206 sigslot::signal1<bool> SignalReadyToSend; |
| 1217 // Signal for notifying that the remote side has closed the DataChannel. | 1207 // Signal for notifying that the remote side has closed the DataChannel. |
| 1218 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; | 1208 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
| 1219 }; | 1209 }; |
| 1220 | 1210 |
| 1221 } // namespace cricket | 1211 } // namespace cricket |
| 1222 | 1212 |
| 1223 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1213 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
| OLD | NEW |