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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 : width(176), | 321 : width(176), |
322 height(144), | 322 height(144), |
323 rotation(webrtc::kVideoRotation_0), | 323 rotation(webrtc::kVideoRotation_0), |
324 is_texture(false) {} | 324 is_texture(false) {} |
325 int width; | 325 int width; |
326 int height; | 326 int height; |
327 webrtc::VideoRotation rotation; | 327 webrtc::VideoRotation rotation; |
328 bool is_texture; | 328 bool is_texture; |
329 }; | 329 }; |
330 | 330 |
331 union VideoEncoderSettings { | |
332 webrtc::VideoCodecH264 h264; | |
333 webrtc::VideoCodecVP8 vp8; | |
334 webrtc::VideoCodecVP9 vp9; | |
335 }; | |
336 | |
337 static std::vector<webrtc::VideoStream> CreateVideoStreams( | 331 static std::vector<webrtc::VideoStream> CreateVideoStreams( |
338 const VideoCodec& codec, | 332 const VideoCodec& codec, |
339 const VideoOptions& options, | 333 const VideoOptions& options, |
340 int max_bitrate_bps, | 334 int max_bitrate_bps, |
341 size_t num_streams); | 335 size_t num_streams); |
342 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( | 336 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( |
343 const VideoCodec& codec, | 337 const VideoCodec& codec, |
344 const VideoOptions& options, | 338 const VideoOptions& options, |
345 int max_bitrate_bps, | 339 int max_bitrate_bps, |
346 size_t num_streams); | 340 size_t num_streams); |
347 | 341 |
348 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) | 342 rtc::scoped_refptr<webrtc::VideoEncoderConfig::EncoderSpecificSettings> |
| 343 ConfigureVideoEncoderSettings(const VideoCodec& codec) |
349 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 344 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
350 | 345 |
351 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) | 346 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) |
352 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 347 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
353 void DestroyVideoEncoder(AllocatedEncoder* encoder) | 348 void DestroyVideoEncoder(AllocatedEncoder* encoder) |
354 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 349 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
355 void SetCodec(const VideoCodecSettings& codec) | 350 void SetCodec(const VideoCodecSettings& codec) |
356 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 351 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
357 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); | 352 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); |
358 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( | 353 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( |
(...skipping 28 matching lines...) Expand all Loading... |
387 // such as codecs, header extensions, and the global bitrate limit for the | 382 // such as codecs, header extensions, and the global bitrate limit for the |
388 // entire channel. | 383 // entire channel. |
389 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); | 384 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); |
390 // Contains settings that are unique for each stream, such as max_bitrate. | 385 // Contains settings that are unique for each stream, such as max_bitrate. |
391 // Does *not* contain codecs, however. | 386 // Does *not* contain codecs, however. |
392 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. | 387 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. |
393 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only | 388 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only |
394 // one stream per MediaChannel. | 389 // one stream per MediaChannel. |
395 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_); | 390 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_); |
396 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_); | 391 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_); |
397 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_); | |
398 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); | 392 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); |
399 VideoFrameInfo last_frame_info_ GUARDED_BY(lock_); | 393 VideoFrameInfo last_frame_info_ GUARDED_BY(lock_); |
400 | 394 |
401 bool sending_ GUARDED_BY(lock_); | 395 bool sending_ GUARDED_BY(lock_); |
402 | 396 |
403 // The timestamp of the first frame received | 397 // The timestamp of the first frame received |
404 // Used to generate the timestamps of subsequent frames | 398 // Used to generate the timestamps of subsequent frames |
405 rtc::Optional<int64_t> first_frame_timestamp_ms_ GUARDED_BY(lock_); | 399 rtc::Optional<int64_t> first_frame_timestamp_ms_ GUARDED_BY(lock_); |
406 | 400 |
407 // The timestamp of the last frame received | 401 // The timestamp of the last frame received |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // send_params/recv_params, rtp_extensions, options, etc. | 545 // send_params/recv_params, rtp_extensions, options, etc. |
552 VideoSendParameters send_params_; | 546 VideoSendParameters send_params_; |
553 VideoOptions default_send_options_; | 547 VideoOptions default_send_options_; |
554 VideoRecvParameters recv_params_; | 548 VideoRecvParameters recv_params_; |
555 bool red_disabled_by_remote_side_; | 549 bool red_disabled_by_remote_side_; |
556 }; | 550 }; |
557 | 551 |
558 } // namespace cricket | 552 } // namespace cricket |
559 | 553 |
560 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 554 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |