OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 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 | |
11 #include "webrtc/api/video_codecs/video_encoder.h" | |
12 | |
13 namespace webrtc { | |
14 | |
15 VideoCodecVP8 VideoEncoder::GetDefaultVp8Settings() { | |
mflodman
2017/08/08 15:21:21
Default settings are the same as previously in cod
| |
16 VideoCodecVP8 vp8_settings; | |
17 memset(&vp8_settings, 0, sizeof(vp8_settings)); | |
18 | |
19 vp8_settings.resilience = kResilientStream; | |
20 vp8_settings.numberOfTemporalLayers = 1; | |
21 vp8_settings.denoisingOn = true; | |
22 vp8_settings.errorConcealmentOn = false; | |
23 vp8_settings.automaticResizeOn = false; | |
24 vp8_settings.frameDroppingOn = true; | |
25 vp8_settings.keyFrameInterval = 3000; | |
26 | |
27 return vp8_settings; | |
28 } | |
29 | |
30 VideoCodecVP9 VideoEncoder::GetDefaultVp9Settings() { | |
31 VideoCodecVP9 vp9_settings; | |
32 memset(&vp9_settings, 0, sizeof(vp9_settings)); | |
33 | |
34 vp9_settings.resilienceOn = true; | |
35 vp9_settings.numberOfTemporalLayers = 1; | |
36 vp9_settings.denoisingOn = true; | |
37 vp9_settings.frameDroppingOn = true; | |
38 vp9_settings.keyFrameInterval = 3000; | |
39 vp9_settings.adaptiveQpMode = true; | |
40 vp9_settings.automaticResizeOn = true; | |
41 vp9_settings.numberOfSpatialLayers = 1; | |
42 vp9_settings.flexibleMode = false; | |
brandtr
2017/08/10 08:05:34
Add newline, for consistency with GetDefaultVp8Set
| |
43 return vp9_settings; | |
44 } | |
45 | |
46 VideoCodecH264 VideoEncoder::GetDefaultH264Settings() { | |
47 VideoCodecH264 h264_settings; | |
48 memset(&h264_settings, 0, sizeof(h264_settings)); | |
49 | |
50 h264_settings.frameDroppingOn = true; | |
51 h264_settings.keyFrameInterval = 3000; | |
52 h264_settings.spsData = nullptr; | |
53 h264_settings.spsLen = 0; | |
54 h264_settings.ppsData = nullptr; | |
55 h264_settings.ppsLen = 0; | |
56 h264_settings.profile = H264::kProfileConstrainedBaseline; | |
57 | |
58 return h264_settings; | |
59 } | |
60 | |
61 VideoEncoder::ScalingSettings::ScalingSettings(bool on, int low, int high) | |
62 : enabled(on), | |
63 thresholds(rtc::Optional<QpThresholds>(QpThresholds(low, high))) {} | |
64 | |
65 VideoEncoder::ScalingSettings::ScalingSettings(bool on) : enabled(on) {} | |
66 | |
67 VideoEncoder::ScalingSettings::~ScalingSettings() {} | |
68 | |
69 | |
70 int32_t VideoEncoder::SetRates(uint32_t bitrate, uint32_t framerate) { | |
71 RTC_NOTREACHED() << "SetRate(uint32_t, uint32_t) is deprecated."; | |
72 return -1; | |
73 } | |
74 | |
75 int32_t VideoEncoder::SetRateAllocation( | |
76 const BitrateAllocation& allocation, | |
77 uint32_t framerate) { | |
78 return SetRates(allocation.get_sum_kbps(), framerate); | |
79 } | |
80 | |
81 VideoEncoder::ScalingSettings VideoEncoder::GetScalingSettings() const { | |
82 return ScalingSettings(false); | |
83 } | |
84 | |
85 int32_t VideoEncoder::SetPeriodicKeyFrames(bool enable) { | |
86 return -1; | |
87 } | |
88 | |
89 bool VideoEncoder::SupportsNativeHandle() const { | |
90 return false; | |
91 } | |
92 | |
93 const char* VideoEncoder::ImplementationName() const { | |
94 return "unknown"; | |
95 } | |
96 } // namespace webrtc | |
OLD | NEW |