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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
559 // multiple SSRCs. | 559 // multiple SSRCs. |
560 virtual bool RemoveSendStream(uint32 ssrc) = 0; | 560 virtual bool RemoveSendStream(uint32 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 ssrc) = 0; |
568 | 568 |
569 // Mutes the channel. | |
570 virtual bool MuteStream(uint32 ssrc, bool on) = 0; | |
571 | |
572 // Sets the RTP extension headers and IDs to use when sending RTP. | 569 // Sets the RTP extension headers and IDs to use when sending RTP. |
573 virtual bool SetRecvRtpHeaderExtensions( | 570 virtual bool SetRecvRtpHeaderExtensions( |
574 const std::vector<RtpHeaderExtension>& extensions) = 0; | 571 const std::vector<RtpHeaderExtension>& extensions) = 0; |
575 virtual bool SetSendRtpHeaderExtensions( | 572 virtual bool SetSendRtpHeaderExtensions( |
576 const std::vector<RtpHeaderExtension>& extensions) = 0; | 573 const std::vector<RtpHeaderExtension>& extensions) = 0; |
577 // Returns the absoulte sendtime extension id value from media channel. | 574 // Returns the absoulte sendtime extension id value from media channel. |
578 virtual int GetRtpSendTimeExtnId() const { | 575 virtual int GetRtpSendTimeExtnId() const { |
579 return -1; | 576 return -1; |
580 } | 577 } |
581 // Sets the maximum allowed bandwidth to use when sending data. | 578 // Sets the maximum allowed bandwidth to use when sending data. |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1090 SetRecvRtpHeaderExtensions(params.extensions)); | 1087 SetRecvRtpHeaderExtensions(params.extensions)); |
1091 } | 1088 } |
1092 // Sets the codecs/payload types to be used for incoming media. | 1089 // Sets the codecs/payload types to be used for incoming media. |
1093 virtual bool SetRecvCodecs(const std::vector<AudioCodec>& codecs) = 0; | 1090 virtual bool SetRecvCodecs(const std::vector<AudioCodec>& codecs) = 0; |
1094 // Sets the codecs/payload types to be used for outgoing media. | 1091 // Sets the codecs/payload types to be used for outgoing media. |
1095 virtual bool SetSendCodecs(const std::vector<AudioCodec>& codecs) = 0; | 1092 virtual bool SetSendCodecs(const std::vector<AudioCodec>& codecs) = 0; |
1096 // Starts or stops playout of received audio. | 1093 // Starts or stops playout of received audio. |
1097 virtual bool SetPlayout(bool playout) = 0; | 1094 virtual bool SetPlayout(bool playout) = 0; |
1098 // Starts or stops sending (and potentially capture) of local audio. | 1095 // Starts or stops sending (and potentially capture) of local audio. |
1099 virtual bool SetSend(SendFlags flag) = 0; | 1096 virtual bool SetSend(SendFlags flag) = 0; |
1097 // Configure stream for sending. | |
1098 virtual bool SetAudioSend(uint32 ssrc, bool mute, const AudioOptions* options, | |
1099 AudioRenderer* renderer) = 0; | |
1100 // Sets the renderer object to be used for the specified remote audio stream. | 1100 // Sets the renderer object to be used for the specified remote audio stream. |
1101 virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; | 1101 virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; |
1102 // Sets the renderer object to be used for the specified local audio stream. | |
1103 virtual bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; | |
1104 // Gets current energy levels for all incoming streams. | 1102 // Gets current energy levels for all incoming streams. |
1105 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; | 1103 virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; |
1106 // Get the current energy level of the stream sent to the speaker. | 1104 // Get the current energy level of the stream sent to the speaker. |
1107 virtual int GetOutputLevel() = 0; | 1105 virtual int GetOutputLevel() = 0; |
1108 // Get the time in milliseconds since last recorded keystroke, or negative. | 1106 // Get the time in milliseconds since last recorded keystroke, or negative. |
1109 virtual int GetTimeSinceLastTyping() = 0; | 1107 virtual int GetTimeSinceLastTyping() = 0; |
1110 // Temporarily exposed field for tuning typing detect options. | 1108 // Temporarily exposed field for tuning typing detect options. |
1111 virtual void SetTypingDetectionParameters(int time_window, | 1109 virtual void SetTypingDetectionParameters(int time_window, |
1112 int cost_per_typing, int reporting_threshold, int penalty_decay, | 1110 int cost_per_typing, int reporting_threshold, int penalty_decay, |
1113 int type_event_delay) = 0; | 1111 int type_event_delay) = 0; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1190 // Sets the codecs/payload types to be used for outgoing media. | 1188 // Sets the codecs/payload types to be used for outgoing media. |
1191 virtual bool SetSendCodecs(const std::vector<VideoCodec>& codecs) = 0; | 1189 virtual bool SetSendCodecs(const std::vector<VideoCodec>& codecs) = 0; |
1192 // Gets the currently set codecs/payload types to be used for outgoing media. | 1190 // Gets the currently set codecs/payload types to be used for outgoing media. |
1193 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; | 1191 virtual bool GetSendCodec(VideoCodec* send_codec) = 0; |
1194 // Sets the format of a specified outgoing stream. | 1192 // Sets the format of a specified outgoing stream. |
1195 virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0; | 1193 virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0; |
1196 // Starts or stops playout of received video. | 1194 // Starts or stops playout of received video. |
1197 virtual bool SetRender(bool render) = 0; | 1195 virtual bool SetRender(bool render) = 0; |
1198 // Starts or stops transmission (and potentially capture) of local video. | 1196 // Starts or stops transmission (and potentially capture) of local video. |
1199 virtual bool SetSend(bool send) = 0; | 1197 virtual bool SetSend(bool send) = 0; |
1198 // Mutes the channel. | |
pthatcher1
2015/09/09 07:16:12
It's more like enable/disables the channel.
the sun
2015/09/09 09:50:50
Done.
| |
1199 virtual bool SetVideoSend(uint32 ssrc, bool mute, | |
1200 const VideoOptions* options) = 0; | |
1200 // Sets the renderer object to be used for the specified stream. | 1201 // Sets the renderer object to be used for the specified stream. |
1201 // If SSRC is 0, the renderer is used for the 'default' stream. | 1202 // If SSRC is 0, the renderer is used for the 'default' stream. |
1202 virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) = 0; | 1203 virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) = 0; |
1203 // If |ssrc| is 0, replace the default capturer (engine capturer) with | 1204 // If |ssrc| is 0, replace the default capturer (engine capturer) with |
1204 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. | 1205 // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. |
1205 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) = 0; | 1206 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) = 0; |
1206 // Gets quality stats for the channel. | 1207 // Gets quality stats for the channel. |
1207 virtual bool GetStats(VideoMediaInfo* info) = 0; | 1208 virtual bool GetStats(VideoMediaInfo* info) = 0; |
1208 // Send an intra frame to the receivers. | 1209 // Send an intra frame to the receivers. |
1209 virtual bool SendIntraFrame() = 0; | 1210 virtual bool SendIntraFrame() = 0; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1332 } | 1333 } |
1333 // TODO(pthatcher): Remove SetRecvCodecs and | 1334 // TODO(pthatcher): Remove SetRecvCodecs and |
1334 // SetRecvRtpHeaderExtensions once all implementations implement | 1335 // SetRecvRtpHeaderExtensions once all implementations implement |
1335 // SetRecvParameters. | 1336 // SetRecvParameters. |
1336 virtual bool SetRecvParameters(const DataRecvParameters& params) { | 1337 virtual bool SetRecvParameters(const DataRecvParameters& params) { |
1337 return SetRecvCodecs(params.codecs); | 1338 return SetRecvCodecs(params.codecs); |
1338 } | 1339 } |
1339 virtual bool SetSendCodecs(const std::vector<DataCodec>& codecs) = 0; | 1340 virtual bool SetSendCodecs(const std::vector<DataCodec>& codecs) = 0; |
1340 virtual bool SetRecvCodecs(const std::vector<DataCodec>& codecs) = 0; | 1341 virtual bool SetRecvCodecs(const std::vector<DataCodec>& codecs) = 0; |
1341 | 1342 |
1342 virtual bool MuteStream(uint32 ssrc, bool on) { return false; } | |
1343 // TODO(pthatcher): Implement this. | 1343 // TODO(pthatcher): Implement this. |
1344 virtual bool GetStats(DataMediaInfo* info) { return true; } | 1344 virtual bool GetStats(DataMediaInfo* info) { return true; } |
1345 | 1345 |
1346 virtual bool SetSend(bool send) = 0; | 1346 virtual bool SetSend(bool send) = 0; |
1347 virtual bool SetReceive(bool receive) = 0; | 1347 virtual bool SetReceive(bool receive) = 0; |
1348 | 1348 |
1349 virtual bool SendData( | 1349 virtual bool SendData( |
1350 const SendDataParams& params, | 1350 const SendDataParams& params, |
1351 const rtc::Buffer& payload, | 1351 const rtc::Buffer& payload, |
1352 SendDataResult* result = NULL) = 0; | 1352 SendDataResult* result = NULL) = 0; |
1353 // Signals when data is received (params, data, len) | 1353 // Signals when data is received (params, data, len) |
1354 sigslot::signal3<const ReceiveDataParams&, | 1354 sigslot::signal3<const ReceiveDataParams&, |
1355 const char*, | 1355 const char*, |
1356 size_t> SignalDataReceived; | 1356 size_t> SignalDataReceived; |
1357 // Signal errors from MediaChannel. Arguments are: | 1357 // Signal errors from MediaChannel. Arguments are: |
1358 // ssrc(uint32), and error(DataMediaChannel::Error). | 1358 // ssrc(uint32), and error(DataMediaChannel::Error). |
1359 sigslot::signal2<uint32, DataMediaChannel::Error> SignalMediaError; | 1359 sigslot::signal2<uint32, DataMediaChannel::Error> SignalMediaError; |
1360 // Signal when the media channel is ready to send the stream. Arguments are: | 1360 // Signal when the media channel is ready to send the stream. Arguments are: |
1361 // writable(bool) | 1361 // writable(bool) |
1362 sigslot::signal1<bool> SignalReadyToSend; | 1362 sigslot::signal1<bool> SignalReadyToSend; |
1363 // Signal for notifying that the remote side has closed the DataChannel. | 1363 // Signal for notifying that the remote side has closed the DataChannel. |
1364 sigslot::signal1<uint32> SignalStreamClosedRemotely; | 1364 sigslot::signal1<uint32> SignalStreamClosedRemotely; |
1365 }; | 1365 }; |
1366 | 1366 |
1367 } // namespace cricket | 1367 } // namespace cricket |
1368 | 1368 |
1369 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1369 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |