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