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

Side by Side Diff: webrtc/media/base/rtpdataengine.h

Issue 1823503002: Reland Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 virtual bool AddRecvStream(const StreamParams& sp); 86 virtual bool AddRecvStream(const StreamParams& sp);
87 virtual bool RemoveRecvStream(uint32_t ssrc); 87 virtual bool RemoveRecvStream(uint32_t ssrc);
88 virtual bool SetSend(bool send) { 88 virtual bool SetSend(bool send) {
89 sending_ = send; 89 sending_ = send;
90 return true; 90 return true;
91 } 91 }
92 virtual bool SetReceive(bool receive) { 92 virtual bool SetReceive(bool receive) {
93 receiving_ = receive; 93 receiving_ = receive;
94 return true; 94 return true;
95 } 95 }
96 virtual void OnPacketReceived(rtc::Buffer* packet, 96 virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
97 const rtc::PacketTime& packet_time); 97 const rtc::PacketTime& packet_time);
98 virtual void OnRtcpReceived(rtc::Buffer* packet, 98 virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
99 const rtc::PacketTime& packet_time) {} 99 const rtc::PacketTime& packet_time) {}
100 virtual void OnReadyToSend(bool ready) {} 100 virtual void OnReadyToSend(bool ready) {}
101 virtual bool SendData( 101 virtual bool SendData(
102 const SendDataParams& params, 102 const SendDataParams& params,
103 const rtc::Buffer& payload, 103 const rtc::CopyOnWriteBuffer& payload,
104 SendDataResult* result); 104 SendDataResult* result);
105 105
106 private: 106 private:
107 void Construct(rtc::Timing* timing); 107 void Construct(rtc::Timing* timing);
108 bool SetMaxSendBandwidth(int bps); 108 bool SetMaxSendBandwidth(int bps);
109 bool SetSendCodecs(const std::vector<DataCodec>& codecs); 109 bool SetSendCodecs(const std::vector<DataCodec>& codecs);
110 bool SetRecvCodecs(const std::vector<DataCodec>& codecs); 110 bool SetRecvCodecs(const std::vector<DataCodec>& codecs);
111 111
112 bool sending_; 112 bool sending_;
113 bool receiving_; 113 bool receiving_;
114 rtc::Timing* timing_; 114 rtc::Timing* timing_;
115 std::vector<DataCodec> send_codecs_; 115 std::vector<DataCodec> send_codecs_;
116 std::vector<DataCodec> recv_codecs_; 116 std::vector<DataCodec> recv_codecs_;
117 std::vector<StreamParams> send_streams_; 117 std::vector<StreamParams> send_streams_;
118 std::vector<StreamParams> recv_streams_; 118 std::vector<StreamParams> recv_streams_;
119 std::map<uint32_t, RtpClock*> rtp_clock_by_send_ssrc_; 119 std::map<uint32_t, RtpClock*> rtp_clock_by_send_ssrc_;
120 std::unique_ptr<rtc::RateLimiter> send_limiter_; 120 std::unique_ptr<rtc::RateLimiter> send_limiter_;
121 }; 121 };
122 122
123 } // namespace cricket 123 } // namespace cricket
124 124
125 #endif // WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_ 125 #endif // WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698