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

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

Issue 1999853002: Forward the SignalFirstPacketReceived to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add media type to BaseChannel. Created 4 years, 7 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
« webrtc/api/webrtcsession.cc ('K') | « webrtc/api/webrtcsession.cc ('k') | no next file » | 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Made public for easier testing. 161 // Made public for easier testing.
162 void SetReadyToSend(bool rtcp, bool ready); 162 void SetReadyToSend(bool rtcp, bool ready);
163 163
164 // Only public for unit tests. Otherwise, consider protected. 164 // Only public for unit tests. Otherwise, consider protected.
165 int SetOption(SocketType type, rtc::Socket::Option o, int val) 165 int SetOption(SocketType type, rtc::Socket::Option o, int val)
166 override; 166 override;
167 int SetOption_n(SocketType type, rtc::Socket::Option o, int val); 167 int SetOption_n(SocketType type, rtc::Socket::Option o, int val);
168 168
169 SrtpFilter* srtp_filter() { return &srtp_filter_; } 169 SrtpFilter* srtp_filter() { return &srtp_filter_; }
170 170
171 virtual cricket::MediaType MediaType() = 0;
172
171 protected: 173 protected:
172 virtual MediaChannel* media_channel() const { return media_channel_; } 174 virtual MediaChannel* media_channel() const { return media_channel_; }
173 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is 175 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is
174 // true). Gets the transport channels from |transport_controller_|. 176 // true). Gets the transport channels from |transport_controller_|.
175 bool SetTransport_n(const std::string& transport_name); 177 bool SetTransport_n(const std::string& transport_name);
176 178
177 void SetTransportChannel_n(TransportChannel* transport); 179 void SetTransportChannel_n(TransportChannel* transport);
178 void SetRtcpTransportChannel_n(TransportChannel* transport, 180 void SetRtcpTransportChannel_n(TransportChannel* transport,
179 bool update_writablity); 181 bool update_writablity);
180 182
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor; 430 sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor;
429 431
430 int GetInputLevel_w(); 432 int GetInputLevel_w();
431 int GetOutputLevel_w(); 433 int GetOutputLevel_w();
432 void GetActiveStreams_w(AudioInfo::StreamList* actives); 434 void GetActiveStreams_w(AudioInfo::StreamList* actives);
433 webrtc::RtpParameters GetRtpSendParameters_w(uint32_t ssrc) const; 435 webrtc::RtpParameters GetRtpSendParameters_w(uint32_t ssrc) const;
434 bool SetRtpSendParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters); 436 bool SetRtpSendParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters);
435 webrtc::RtpParameters GetRtpReceiveParameters_w(uint32_t ssrc) const; 437 webrtc::RtpParameters GetRtpReceiveParameters_w(uint32_t ssrc) const;
436 bool SetRtpReceiveParameters_w(uint32_t ssrc, 438 bool SetRtpReceiveParameters_w(uint32_t ssrc,
437 webrtc::RtpParameters parameters); 439 webrtc::RtpParameters parameters);
440 cricket::MediaType MediaType() override { return cricket::MEDIA_TYPE_AUDIO; }
438 441
439 private: 442 private:
440 // overrides from BaseChannel 443 // overrides from BaseChannel
441 void OnChannelRead(TransportChannel* channel, 444 void OnChannelRead(TransportChannel* channel,
442 const char* data, 445 const char* data,
443 size_t len, 446 size_t len,
444 const rtc::PacketTime& packet_time, 447 const rtc::PacketTime& packet_time,
445 int flags) override; 448 int flags) override;
446 void ChangeState_w() override; 449 void ChangeState_w() override;
447 const ContentInfo* GetFirstContent(const SessionDescription* sdesc) override; 450 const ContentInfo* GetFirstContent(const SessionDescription* sdesc) override;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 void StopMediaMonitor(); 514 void StopMediaMonitor();
512 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor; 515 sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor;
513 516
514 bool SetVideoSend(uint32_t ssrc, bool enable, const VideoOptions* options); 517 bool SetVideoSend(uint32_t ssrc, bool enable, const VideoOptions* options);
515 webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const; 518 webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const;
516 bool SetRtpSendParameters(uint32_t ssrc, 519 bool SetRtpSendParameters(uint32_t ssrc,
517 const webrtc::RtpParameters& parameters); 520 const webrtc::RtpParameters& parameters);
518 webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const; 521 webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const;
519 bool SetRtpReceiveParameters(uint32_t ssrc, 522 bool SetRtpReceiveParameters(uint32_t ssrc,
520 const webrtc::RtpParameters& parameters); 523 const webrtc::RtpParameters& parameters);
524 cricket::MediaType MediaType() override { return cricket::MEDIA_TYPE_VIDEO; }
521 525
522 private: 526 private:
523 // overrides from BaseChannel 527 // overrides from BaseChannel
524 void ChangeState_w() override; 528 void ChangeState_w() override;
525 const ContentInfo* GetFirstContent(const SessionDescription* sdesc) override; 529 const ContentInfo* GetFirstContent(const SessionDescription* sdesc) override;
526 bool SetLocalContent_w(const MediaContentDescription* content, 530 bool SetLocalContent_w(const MediaContentDescription* content,
527 ContentAction action, 531 ContentAction action,
528 std::string* error_desc) override; 532 std::string* error_desc) override;
529 bool SetRemoteContent_w(const MediaContentDescription* content, 533 bool SetRemoteContent_w(const MediaContentDescription* content,
530 ContentAction action, 534 ContentAction action,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 sigslot::signal2<DataChannel*, const std::vector<ConnectionInfo>&> 586 sigslot::signal2<DataChannel*, const std::vector<ConnectionInfo>&>
583 SignalConnectionMonitor; 587 SignalConnectionMonitor;
584 sigslot::signal3<DataChannel*, const ReceiveDataParams&, 588 sigslot::signal3<DataChannel*, const ReceiveDataParams&,
585 const rtc::CopyOnWriteBuffer&> SignalDataReceived; 589 const rtc::CopyOnWriteBuffer&> SignalDataReceived;
586 // Signal for notifying when the channel becomes ready to send data. 590 // Signal for notifying when the channel becomes ready to send data.
587 // That occurs when the channel is enabled, the transport is writable, 591 // That occurs when the channel is enabled, the transport is writable,
588 // both local and remote descriptions are set, and the channel is unblocked. 592 // both local and remote descriptions are set, and the channel is unblocked.
589 sigslot::signal1<bool> SignalReadyToSendData; 593 sigslot::signal1<bool> SignalReadyToSendData;
590 // Signal for notifying that the remote side has closed the DataChannel. 594 // Signal for notifying that the remote side has closed the DataChannel.
591 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 595 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
596 cricket::MediaType MediaType() override { return cricket::MEDIA_TYPE_DATA; }
pthatcher1 2016/06/08 17:35:56 media_type()
Zhi Huang 2016/06/09 00:37:36 Done.
592 597
593 protected: 598 protected:
594 // downcasts a MediaChannel. 599 // downcasts a MediaChannel.
595 DataMediaChannel* media_channel() const override { 600 DataMediaChannel* media_channel() const override {
596 return static_cast<DataMediaChannel*>(BaseChannel::media_channel()); 601 return static_cast<DataMediaChannel*>(BaseChannel::media_channel());
597 } 602 }
598 603
599 private: 604 private:
600 struct SendDataMessageData : public rtc::MessageData { 605 struct SendDataMessageData : public rtc::MessageData {
601 SendDataMessageData(const SendDataParams& params, 606 SendDataMessageData(const SendDataParams& params,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 // SetSendParameters. 677 // SetSendParameters.
673 DataSendParameters last_send_params_; 678 DataSendParameters last_send_params_;
674 // Last DataRecvParameters sent down to the media_channel() via 679 // Last DataRecvParameters sent down to the media_channel() via
675 // SetRecvParameters. 680 // SetRecvParameters.
676 DataRecvParameters last_recv_params_; 681 DataRecvParameters last_recv_params_;
677 }; 682 };
678 683
679 } // namespace cricket 684 } // namespace cricket
680 685
681 #endif // WEBRTC_PC_CHANNEL_H_ 686 #endif // WEBRTC_PC_CHANNEL_H_
OLDNEW
« webrtc/api/webrtcsession.cc ('K') | « webrtc/api/webrtcsession.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698