Chromium Code Reviews| 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 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 public: | 33 public: |
| 34 RTPSenderVideo(Clock* clock, RTPSenderInterface* rtpSender); | 34 RTPSenderVideo(Clock* clock, RTPSenderInterface* rtpSender); |
| 35 virtual ~RTPSenderVideo(); | 35 virtual ~RTPSenderVideo(); |
| 36 | 36 |
| 37 virtual RtpVideoCodecTypes VideoCodecType() const; | 37 virtual RtpVideoCodecTypes VideoCodecType() const; |
| 38 | 38 |
| 39 size_t FECPacketOverhead() const; | 39 size_t FECPacketOverhead() const; |
| 40 | 40 |
| 41 static RtpUtility::Payload* CreateVideoPayload( | 41 static RtpUtility::Payload* CreateVideoPayload( |
| 42 const char payloadName[RTP_PAYLOAD_NAME_SIZE], | 42 const char payloadName[RTP_PAYLOAD_NAME_SIZE], |
| 43 const int8_t payloadType); | 43 const int8_t payload_type); |
|
danilchap
2016/06/15 13:40:01
while chanching this lines, may be also change typ
Sergey Ulanov
2016/06/15 18:27:53
Done.
| |
| 44 | 44 |
| 45 int32_t SendVideo(const RtpVideoCodecTypes videoType, | 45 int32_t SendVideo(const RtpVideoCodecTypes video_type, |
| 46 const FrameType frameType, | 46 const FrameType frame_type, |
| 47 const int8_t payloadType, | 47 const int8_t payload_type, |
| 48 const uint32_t captureTimeStamp, | 48 const uint32_t capture_timestamp, |
| 49 int64_t capture_time_ms, | 49 int64_t capture_time_ms, |
| 50 const uint8_t* payloadData, | 50 const uint8_t* payload_data, |
| 51 const size_t payloadSize, | 51 const size_t payload_size, |
| 52 const RTPFragmentationHeader* fragmentation, | 52 const RTPFragmentationHeader* fragmentation, |
| 53 const RTPVideoHeader* video_header); | 53 const RTPVideoHeader* video_header); |
| 54 | 54 |
| 55 int32_t SendRTPIntraRequest(); | 55 int32_t SendRTPIntraRequest(); |
| 56 | 56 |
| 57 void SetVideoCodecType(RtpVideoCodecTypes type); | 57 void SetVideoCodecType(RtpVideoCodecTypes type); |
| 58 | 58 |
| 59 // FEC | 59 // FEC |
| 60 void SetGenericFECStatus(const bool enable, | 60 void SetGenericFECStatus(const bool enable, |
| 61 const uint8_t payloadTypeRED, | 61 const uint8_t payload_type_red, |
| 62 const uint8_t payloadTypeFEC); | 62 const uint8_t payload_type_fec); |
| 63 | 63 |
| 64 void GenericFECStatus(bool* enable, | 64 void GenericFECStatus(bool* enable, |
| 65 uint8_t* payloadTypeRED, | 65 uint8_t* payload_type_red, |
| 66 uint8_t* payloadTypeFEC) const; | 66 uint8_t* payload_type_fec) const; |
| 67 | 67 |
| 68 void SetFecParameters(const FecProtectionParams* delta_params, | 68 void SetFecParameters(const FecProtectionParams* delta_params, |
| 69 const FecProtectionParams* key_params); | 69 const FecProtectionParams* key_params); |
| 70 | 70 |
| 71 void ProcessBitrate(); | 71 void ProcessBitrate(); |
| 72 | 72 |
| 73 uint32_t VideoBitrateSent() const; | 73 uint32_t VideoBitrateSent() const; |
| 74 uint32_t FecOverheadRate() const; | 74 uint32_t FecOverheadRate() const; |
| 75 | 75 |
| 76 int SelectiveRetransmissions() const; | 76 int SelectiveRetransmissions() const; |
| 77 void SetSelectiveRetransmissions(uint8_t settings); | 77 void SetSelectiveRetransmissions(uint8_t settings); |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 void SendVideoPacket(uint8_t* dataBuffer, | 80 void SendVideoPacket(uint8_t* data_buffer, |
| 81 const size_t payloadLength, | 81 const size_t payload_length, |
| 82 const size_t rtpHeaderLength, | 82 const size_t rtp_header_length, |
| 83 uint16_t seq_num, | 83 uint16_t seq_num, |
| 84 const uint32_t capture_timestamp, | 84 const uint32_t capture_timestamp, |
| 85 int64_t capture_time_ms, | 85 int64_t capture_time_ms, |
| 86 StorageType storage); | 86 StorageType storage); |
| 87 | 87 |
| 88 void SendVideoPacketAsRed(uint8_t* dataBuffer, | 88 void SendVideoPacketAsRed(uint8_t* data_buffer, |
| 89 const size_t payloadLength, | 89 const size_t payload_length, |
| 90 const size_t rtpHeaderLength, | 90 const size_t rtp_header_length, |
| 91 uint16_t video_seq_num, | 91 uint16_t video_seq_num, |
| 92 const uint32_t capture_timestamp, | 92 const uint32_t capture_timestamp, |
| 93 int64_t capture_time_ms, | 93 int64_t capture_time_ms, |
| 94 StorageType media_packet_storage, | 94 StorageType media_packet_storage, |
| 95 bool protect); | 95 bool protect); |
| 96 | 96 |
| 97 RTPSenderInterface& _rtpSender; | 97 RTPSenderInterface* rtp_sender_; |
|
danilchap
2016/06/15 13:40:01
RTPSenderInterface* const
Sergey Ulanov
2016/06/15 18:27:53
Done.
| |
| 98 | 98 |
| 99 // Should never be held when calling out of this class. | 99 // Should never be held when calling out of this class. |
| 100 const rtc::CriticalSection crit_; | 100 const rtc::CriticalSection crit_; |
| 101 | 101 |
| 102 RtpVideoCodecTypes _videoType; | 102 RtpVideoCodecTypes video_type_ = kRtpVideoGeneric; |
| 103 int32_t _retransmissionSettings GUARDED_BY(crit_); | 103 int32_t retransmission_settings_ GUARDED_BY(crit_) = kRetransmitBaseLayer; |
| 104 | 104 |
| 105 // FEC | 105 // FEC |
| 106 ForwardErrorCorrection fec_; | 106 ForwardErrorCorrection fec_; |
| 107 bool fec_enabled_ GUARDED_BY(crit_); | 107 bool fec_enabled_ GUARDED_BY(crit_) = false; |
| 108 int8_t red_payload_type_ GUARDED_BY(crit_); | 108 int8_t red_payload_type_ GUARDED_BY(crit_) = 0; |
| 109 int8_t fec_payload_type_ GUARDED_BY(crit_); | 109 int8_t fec_payload_type_ GUARDED_BY(crit_) = 0; |
| 110 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); | 110 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); |
| 111 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); | 111 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); |
| 112 ProducerFec producer_fec_ GUARDED_BY(crit_); | 112 ProducerFec producer_fec_ GUARDED_BY(crit_); |
| 113 | 113 |
| 114 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets | 114 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets |
| 115 // and any padding overhead. | 115 // and any padding overhead. |
| 116 Bitrate _fecOverheadRate; | 116 Bitrate fec_overhead_rate_; |
| 117 // Bitrate used for video payload and RTP headers | 117 // Bitrate used for video payload and RTP headers |
| 118 Bitrate _videoBitrate; | 118 Bitrate video_bitrate_; |
| 119 OneTimeEvent first_frame_sent_; | 119 OneTimeEvent first_frame_sent_; |
| 120 }; | 120 }; |
| 121 | |
| 121 } // namespace webrtc | 122 } // namespace webrtc |
| 122 | 123 |
| 123 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 124 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
| OLD | NEW |