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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_video.h

Issue 2492843002: Reduce taking locks in RTPSenderVideo::SendVideo (Closed)
Patch Set: . Created 4 years, 1 month 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 24 matching lines...) Expand all
35 35
36 class RTPSenderVideo { 36 class RTPSenderVideo {
37 public: 37 public:
38 RTPSenderVideo(Clock* clock, 38 RTPSenderVideo(Clock* clock,
39 RTPSender* rtpSender, 39 RTPSender* rtpSender,
40 FlexfecSender* flexfec_sender); 40 FlexfecSender* flexfec_sender);
41 virtual ~RTPSenderVideo(); 41 virtual ~RTPSenderVideo();
42 42
43 virtual RtpVideoCodecTypes VideoCodecType() const; 43 virtual RtpVideoCodecTypes VideoCodecType() const;
44 44
45 size_t FecPacketOverhead() const; 45 size_t FecPacketOverhead() const {
46 rtc::CritScope cs(&crit_);
47 return CalculateFecPacketOverhead();
48 }
46 49
47 static RtpUtility::Payload* CreateVideoPayload( 50 static RtpUtility::Payload* CreateVideoPayload(
48 const char payload_name[RTP_PAYLOAD_NAME_SIZE], 51 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
49 int8_t payload_type); 52 int8_t payload_type);
50 53
51 bool SendVideo(RtpVideoCodecTypes video_type, 54 bool SendVideo(RtpVideoCodecTypes video_type,
52 FrameType frame_type, 55 FrameType frame_type,
53 int8_t payload_type, 56 int8_t payload_type,
54 uint32_t capture_timestamp, 57 uint32_t capture_timestamp,
55 int64_t capture_time_ms, 58 int64_t capture_time_ms,
(...skipping 11 matching lines...) Expand all
67 void SetFecParameters(const FecProtectionParams& delta_params, 70 void SetFecParameters(const FecProtectionParams& delta_params,
68 const FecProtectionParams& key_params); 71 const FecProtectionParams& key_params);
69 72
70 uint32_t VideoBitrateSent() const; 73 uint32_t VideoBitrateSent() const;
71 uint32_t FecOverheadRate() const; 74 uint32_t FecOverheadRate() const;
72 75
73 int SelectiveRetransmissions() const; 76 int SelectiveRetransmissions() const;
74 void SetSelectiveRetransmissions(uint8_t settings); 77 void SetSelectiveRetransmissions(uint8_t settings);
75 78
76 private: 79 private:
80 size_t CalculateFecPacketOverhead() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
81
77 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, 82 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet,
78 StorageType storage); 83 StorageType storage);
79 84
80 void SendVideoPacketAsRedMaybeWithUlpfec( 85 void SendVideoPacketAsRedMaybeWithUlpfec(
81 std::unique_ptr<RtpPacketToSend> media_packet, 86 std::unique_ptr<RtpPacketToSend> media_packet,
82 StorageType media_packet_storage, 87 StorageType media_packet_storage,
83 bool protect_media_packet); 88 bool protect_media_packet);
84 89
85 // TODO(brandtr): Remove the FlexFEC functions when FlexfecSender has been 90 // TODO(brandtr): Remove the FlexFEC functions when FlexfecSender has been
86 // moved to PacedSender. 91 // moved to PacedSender.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // and any padding overhead. 130 // and any padding overhead.
126 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); 131 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_);
127 // Bitrate used for video payload and RTP headers. 132 // Bitrate used for video payload and RTP headers.
128 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); 133 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_);
129 OneTimeEvent first_frame_sent_; 134 OneTimeEvent first_frame_sent_;
130 }; 135 };
131 136
132 } // namespace webrtc 137 } // namespace webrtc
133 138
134 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ 139 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc » ('j') | webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698