blob: e78a4aacca75f538e663dcf00732a691ad9570f8 [file] [log] [blame]
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
hta257dc392016-10-25 09:05:06 -070011#include "webrtc/base/checks.h"
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000012#include "webrtc/common_types.h"
13
14#include <string.h>
15
16namespace webrtc {
17
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000018StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
19
sprang@webrtc.org30933902015-03-17 14:33:12 +000020RTPHeaderExtension::RTPHeaderExtension()
21 : hasTransmissionTimeOffset(false),
22 transmissionTimeOffset(0),
23 hasAbsoluteSendTime(false),
24 absoluteSendTime(0),
25 hasTransportSequenceNumber(false),
26 transportSequenceNumber(0),
27 hasAudioLevel(false),
Minyue4cee4192015-08-10 15:08:36 +020028 voiceActivity(false),
sprang@webrtc.org30933902015-03-17 14:33:12 +000029 audioLevel(0),
30 hasVideoRotation(false),
magjed71eb61c2016-09-08 03:24:58 -070031 videoRotation(kVideoRotation_0) {}
sprang@webrtc.org30933902015-03-17 14:33:12 +000032
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000033RTPHeader::RTPHeader()
34 : markerBit(false),
35 payloadType(0),
36 sequenceNumber(0),
37 timestamp(0),
38 ssrc(0),
39 numCSRCs(0),
tommia6219cc2016-06-15 10:30:14 -070040 arrOfCSRCs(),
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000041 paddingLength(0),
42 headerLength(0),
43 payload_type_frequency(0),
tommia6219cc2016-06-15 10:30:14 -070044 extension() {}
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000045
hta257dc392016-10-25 09:05:06 -070046VideoCodec::VideoCodec()
47 : codecType(kVideoCodecUnknown),
48 plName(),
49 plType(0),
50 width(0),
51 height(0),
52 startBitrate(0),
53 maxBitrate(0),
54 minBitrate(0),
55 targetBitrate(0),
56 maxFramerate(0),
57 qpMax(0),
58 numberOfSimulcastStreams(0),
59 simulcastStream(),
60 spatialLayers(),
61 mode(kRealtimeVideo),
62 codecSpecific() {}
63
64VideoCodecVP8* VideoCodec::VP8() {
65 RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
66 return &codecSpecific.VP8;
67}
68
69const VideoCodecVP8& VideoCodec::VP8() const {
70 RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
71 return codecSpecific.VP8;
72}
73
74VideoCodecVP9* VideoCodec::VP9() {
75 RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
76 return &codecSpecific.VP9;
77}
78
79const VideoCodecVP9& VideoCodec::VP9() const {
80 RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
81 return codecSpecific.VP9;
82}
83
84VideoCodecH264* VideoCodec::H264() {
85 RTC_DCHECK_EQ(codecType, kVideoCodecH264);
86 return &codecSpecific.H264;
87}
88
89const VideoCodecH264& VideoCodec::H264() const {
90 RTC_DCHECK_EQ(codecType, kVideoCodecH264);
91 return codecSpecific.H264;
92}
93
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000094} // namespace webrtc