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

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

Issue 1211353002: Integration of VP9 packetization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: set ss data if not set Created 5 years, 4 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
11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" 11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h"
12 12
13 #include <stdlib.h> 13 #include <stdlib.h>
14 #include <string.h> 14 #include <string.h>
15 15
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/base/checks.h" 18 #include "webrtc/base/checks.h"
19 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" 19 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
20 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 20 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
21 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" 21 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h"
22 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" 22 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" 23 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h"
24 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h"
24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" 25 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
25 #include "webrtc/system_wrappers/interface/logging.h" 26 #include "webrtc/system_wrappers/interface/logging.h"
26 #include "webrtc/system_wrappers/interface/trace_event.h" 27 #include "webrtc/system_wrappers/interface/trace_event.h"
27 28
28 namespace webrtc { 29 namespace webrtc {
29 enum { REDForFECHeaderLength = 1 }; 30 enum { REDForFECHeaderLength = 1 };
30 31
31 struct RtpPacket { 32 struct RtpPacket {
32 uint16_t rtpHeaderLength; 33 uint16_t rtpHeaderLength;
33 ForwardErrorCorrection::Packet* pkt; 34 ForwardErrorCorrection::Packet* pkt;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 70 }
70 71
71 // Static. 72 // Static.
72 RtpUtility::Payload* RTPSenderVideo::CreateVideoPayload( 73 RtpUtility::Payload* RTPSenderVideo::CreateVideoPayload(
73 const char payloadName[RTP_PAYLOAD_NAME_SIZE], 74 const char payloadName[RTP_PAYLOAD_NAME_SIZE],
74 const int8_t payloadType, 75 const int8_t payloadType,
75 const uint32_t maxBitRate) { 76 const uint32_t maxBitRate) {
76 RtpVideoCodecTypes videoType = kRtpVideoGeneric; 77 RtpVideoCodecTypes videoType = kRtpVideoGeneric;
77 if (RtpUtility::StringCompare(payloadName, "VP8", 3)) { 78 if (RtpUtility::StringCompare(payloadName, "VP8", 3)) {
78 videoType = kRtpVideoVp8; 79 videoType = kRtpVideoVp8;
80 } else if (RtpUtility::StringCompare(payloadName, "VP9", 3)) {
81 videoType = kRtpVideoVp9;
79 } else if (RtpUtility::StringCompare(payloadName, "H264", 4)) { 82 } else if (RtpUtility::StringCompare(payloadName, "H264", 4)) {
80 videoType = kRtpVideoH264; 83 videoType = kRtpVideoH264;
81 } else if (RtpUtility::StringCompare(payloadName, "I420", 4)) { 84 } else if (RtpUtility::StringCompare(payloadName, "I420", 4)) {
82 videoType = kRtpVideoGeneric; 85 videoType = kRtpVideoGeneric;
83 } else { 86 } else {
84 videoType = kRtpVideoGeneric; 87 videoType = kRtpVideoGeneric;
85 } 88 }
86 RtpUtility::Payload* payload = new RtpUtility::Payload(); 89 RtpUtility::Payload* payload = new RtpUtility::Payload();
87 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; 90 payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
88 strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1); 91 strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 CriticalSectionScoped cs(crit_.get()); 370 CriticalSectionScoped cs(crit_.get());
368 return _retransmissionSettings; 371 return _retransmissionSettings;
369 } 372 }
370 373
371 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 374 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
372 CriticalSectionScoped cs(crit_.get()); 375 CriticalSectionScoped cs(crit_.get());
373 _retransmissionSettings = settings; 376 _retransmissionSettings = settings;
374 } 377 }
375 378
376 } // namespace webrtc 379 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698