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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Get range of frames: will encode num_frames following start_frame). | 128 // Get range of frames: will encode num_frames following start_frame). |
129 int start_frame = strtol((parser->GetFlag("start_frame")).c_str(), NULL, 10); | 129 int start_frame = strtol((parser->GetFlag("start_frame")).c_str(), NULL, 10); |
130 int num_frames = strtol((parser->GetFlag("num_frames")).c_str(), NULL, 10); | 130 int num_frames = strtol((parser->GetFlag("num_frames")).c_str(), NULL, 10); |
131 | 131 |
132 // Codec SetUp. | 132 // Codec SetUp. |
133 webrtc::VideoCodec inst; | 133 webrtc::VideoCodec inst; |
134 memset(&inst, 0, sizeof(inst)); | 134 memset(&inst, 0, sizeof(inst)); |
135 webrtc::VP8Encoder* encoder = webrtc::VP8Encoder::Create(); | 135 webrtc::VP8Encoder* encoder = webrtc::VP8Encoder::Create(); |
136 webrtc::VP8Decoder* decoder = webrtc::VP8Decoder::Create(); | 136 webrtc::VP8Decoder* decoder = webrtc::VP8Decoder::Create(); |
137 inst.codecType = webrtc::kVideoCodecVP8; | 137 inst.codecType = webrtc::kVideoCodecVP8; |
138 inst.codecSpecific.VP8.feedbackModeOn = false; | 138 inst.VP8()->feedbackModeOn = false; |
139 inst.codecSpecific.VP8.denoisingOn = true; | 139 inst.VP8()->denoisingOn = true; |
140 inst.maxFramerate = framerate; | 140 inst.maxFramerate = framerate; |
141 inst.startBitrate = target_bitrate; | 141 inst.startBitrate = target_bitrate; |
142 inst.maxBitrate = 8000; | 142 inst.maxBitrate = 8000; |
143 inst.width = width; | 143 inst.width = width; |
144 inst.height = height; | 144 inst.height = height; |
145 | 145 |
146 if (encoder->InitEncode(&inst, 1, 1440) < 0) { | 146 if (encoder->InitEncode(&inst, 1, 1440) < 0) { |
147 fprintf(stderr, "Error: Cannot initialize vp8 encoder\n"); | 147 fprintf(stderr, "Error: Cannot initialize vp8 encoder\n"); |
148 return -1; | 148 return -1; |
149 } | 149 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 parser.ProcessFlags(); | 241 parser.ProcessFlags(); |
242 if (parser.GetFlag("help") == "true") { | 242 if (parser.GetFlag("help") == "true") { |
243 parser.PrintUsageMessage(); | 243 parser.PrintUsageMessage(); |
244 exit(EXIT_SUCCESS); | 244 exit(EXIT_SUCCESS); |
245 } | 245 } |
246 parser.PrintEnteredFlags(); | 246 parser.PrintEnteredFlags(); |
247 | 247 |
248 return SequenceCoder(&parser); | 248 return SequenceCoder(&parser); |
249 } | 249 } |
OLD | NEW |