OLD | NEW |
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 |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
| 15 #include <memory> |
15 | 16 |
16 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
17 #include "webrtc/base/onetimeevent.h" | 18 #include "webrtc/base/onetimeevent.h" |
18 #include "webrtc/base/rate_statistics.h" | 19 #include "webrtc/base/rate_statistics.h" |
19 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/common_types.h" | 21 #include "webrtc/common_types.h" |
21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
22 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | 23 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
23 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" | 24 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" |
24 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
27 #include "webrtc/modules/rtp_rtcp/source/video_codec_information.h" | 28 #include "webrtc/modules/rtp_rtcp/source/video_codec_information.h" |
28 #include "webrtc/typedefs.h" | 29 #include "webrtc/typedefs.h" |
29 | 30 |
30 namespace webrtc { | 31 namespace webrtc { |
| 32 class RtpPacketToSend; |
31 | 33 |
32 class RTPSenderVideo { | 34 class RTPSenderVideo { |
33 public: | 35 public: |
34 RTPSenderVideo(Clock* clock, RTPSender* rtpSender); | 36 RTPSenderVideo(Clock* clock, RTPSender* rtpSender); |
35 virtual ~RTPSenderVideo(); | 37 virtual ~RTPSenderVideo(); |
36 | 38 |
37 virtual RtpVideoCodecTypes VideoCodecType() const; | 39 virtual RtpVideoCodecTypes VideoCodecType() const; |
38 | 40 |
39 size_t FecPacketOverhead() const; | 41 size_t FecPacketOverhead() const; |
40 | 42 |
(...skipping 27 matching lines...) Expand all Loading... |
68 void SetFecParameters(const FecProtectionParams* delta_params, | 70 void SetFecParameters(const FecProtectionParams* delta_params, |
69 const FecProtectionParams* key_params); | 71 const FecProtectionParams* key_params); |
70 | 72 |
71 uint32_t VideoBitrateSent() const; | 73 uint32_t VideoBitrateSent() const; |
72 uint32_t FecOverheadRate() const; | 74 uint32_t FecOverheadRate() const; |
73 | 75 |
74 int SelectiveRetransmissions() const; | 76 int SelectiveRetransmissions() const; |
75 void SetSelectiveRetransmissions(uint8_t settings); | 77 void SetSelectiveRetransmissions(uint8_t settings); |
76 | 78 |
77 private: | 79 private: |
78 void SendVideoPacket(uint8_t* data_buffer, | 80 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, |
79 size_t payload_length, | |
80 size_t rtp_header_length, | |
81 uint16_t seq_num, | |
82 uint32_t capture_timestamp, | |
83 int64_t capture_time_ms, | |
84 StorageType storage); | 81 StorageType storage); |
85 | 82 |
86 void SendVideoPacketAsRed(uint8_t* data_buffer, | 83 void SendVideoPacketAsRed(std::unique_ptr<RtpPacketToSend> media_packet, |
87 size_t payload_length, | |
88 size_t rtp_header_length, | |
89 uint16_t video_seq_num, | |
90 uint32_t capture_timestamp, | |
91 int64_t capture_time_ms, | |
92 StorageType media_packet_storage, | 84 StorageType media_packet_storage, |
93 bool protect); | 85 bool protect); |
94 | 86 |
95 RTPSender* const rtp_sender_; | 87 RTPSender* const rtp_sender_; |
96 Clock* const clock_; | 88 Clock* const clock_; |
97 | 89 |
98 // Should never be held when calling out of this class. | 90 // Should never be held when calling out of this class. |
99 rtc::CriticalSection crit_; | 91 rtc::CriticalSection crit_; |
100 | 92 |
101 RtpVideoCodecTypes video_type_ = kRtpVideoGeneric; | 93 RtpVideoCodecTypes video_type_ = kRtpVideoGeneric; |
(...skipping 14 matching lines...) Expand all Loading... |
116 // and any padding overhead. | 108 // and any padding overhead. |
117 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); | 109 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); |
118 // Bitrate used for video payload and RTP headers. | 110 // Bitrate used for video payload and RTP headers. |
119 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); | 111 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); |
120 OneTimeEvent first_frame_sent_; | 112 OneTimeEvent first_frame_sent_; |
121 }; | 113 }; |
122 | 114 |
123 } // namespace webrtc | 115 } // namespace webrtc |
124 | 116 |
125 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 117 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
OLD | NEW |