OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 }; | 292 }; |
293 | 293 |
294 struct Dimensions { | 294 struct Dimensions { |
295 // Initial encoder configuration (QCIF, 176x144) frame (to ensure that | 295 // Initial encoder configuration (QCIF, 176x144) frame (to ensure that |
296 // hardware encoders can be initialized). This gives us low memory usage | 296 // hardware encoders can be initialized). This gives us low memory usage |
297 // but also makes it so configuration errors are discovered at the time we | 297 // but also makes it so configuration errors are discovered at the time we |
298 // apply the settings rather than when we get the first frame (waiting for | 298 // apply the settings rather than when we get the first frame (waiting for |
299 // the first frame to know that you gave a bad codec parameter could make | 299 // the first frame to know that you gave a bad codec parameter could make |
300 // debugging hard). | 300 // debugging hard). |
301 // TODO(pbos): Consider setting up encoders lazily. | 301 // TODO(pbos): Consider setting up encoders lazily. |
302 Dimensions() : width(176), height(144), is_screencast(false) {} | 302 Dimensions() : width(176), height(144) {} |
303 int width; | 303 int width; |
304 int height; | 304 int height; |
305 bool is_screencast; | |
306 }; | 305 }; |
307 | 306 |
308 union VideoEncoderSettings { | 307 union VideoEncoderSettings { |
309 webrtc::VideoCodecH264 h264; | 308 webrtc::VideoCodecH264 h264; |
310 webrtc::VideoCodecVP8 vp8; | 309 webrtc::VideoCodecVP8 vp8; |
311 webrtc::VideoCodecVP9 vp9; | 310 webrtc::VideoCodecVP9 vp9; |
312 }; | 311 }; |
313 | 312 |
314 static std::vector<webrtc::VideoStream> CreateVideoStreams( | 313 static std::vector<webrtc::VideoStream> CreateVideoStreams( |
315 const VideoCodec& codec, | 314 const VideoCodec& codec, |
316 const VideoOptions& options, | 315 const VideoOptions& options, |
317 int max_bitrate_bps, | 316 int max_bitrate_bps, |
318 size_t num_streams); | 317 size_t num_streams); |
319 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( | 318 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( |
320 const VideoCodec& codec, | 319 const VideoCodec& codec, |
321 const VideoOptions& options, | 320 const VideoOptions& options, |
322 int max_bitrate_bps, | 321 int max_bitrate_bps, |
323 size_t num_streams); | 322 size_t num_streams); |
324 | 323 |
325 void* ConfigureVideoEncoderSettings(const VideoCodec& codec, | 324 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) |
326 const VideoOptions& options, | |
327 bool is_screencast) | |
328 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 325 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
329 | 326 |
330 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) | 327 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) |
331 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 328 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
332 void DestroyVideoEncoder(AllocatedEncoder* encoder) | 329 void DestroyVideoEncoder(AllocatedEncoder* encoder) |
333 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 330 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
334 void SetCodecAndOptions(const VideoCodecSettings& codec, | 331 void SetCodecAndOptions(const VideoCodecSettings& codec) |
335 const VideoOptions& options) | |
336 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 332 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
337 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); | 333 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); |
338 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( | 334 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( |
339 const Dimensions& dimensions, | 335 const Dimensions& dimensions, |
340 const VideoCodec& codec) const EXCLUSIVE_LOCKS_REQUIRED(lock_); | 336 const VideoCodec& codec) const EXCLUSIVE_LOCKS_REQUIRED(lock_); |
341 void SetDimensions(int width, int height, bool is_screencast) | 337 void SetDimensions(int width, int height) |
342 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 338 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
343 | 339 |
344 const std::vector<uint32_t> ssrcs_; | 340 const std::vector<uint32_t> ssrcs_; |
345 const std::vector<SsrcGroup> ssrc_groups_; | 341 const std::vector<SsrcGroup> ssrc_groups_; |
346 webrtc::Call* const call_; | 342 webrtc::Call* const call_; |
347 rtc::VideoSinkWants sink_wants_; | 343 rtc::VideoSinkWants sink_wants_; |
348 WebRtcVideoEncoderFactory* const external_encoder_factory_ | 344 WebRtcVideoEncoderFactory* const external_encoder_factory_ |
349 GUARDED_BY(lock_); | 345 GUARDED_BY(lock_); |
350 | 346 |
351 rtc::CriticalSection lock_; | 347 rtc::CriticalSection lock_; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 webrtc::Call::Config::BitrateConfig bitrate_config_; | 512 webrtc::Call::Config::BitrateConfig bitrate_config_; |
517 // TODO(deadbeef): Don't duplicate information between | 513 // TODO(deadbeef): Don't duplicate information between |
518 // send_params/recv_params, rtp_extensions, options, etc. | 514 // send_params/recv_params, rtp_extensions, options, etc. |
519 VideoSendParameters send_params_; | 515 VideoSendParameters send_params_; |
520 VideoRecvParameters recv_params_; | 516 VideoRecvParameters recv_params_; |
521 }; | 517 }; |
522 | 518 |
523 } // namespace cricket | 519 } // namespace cricket |
524 | 520 |
525 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 521 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |