Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.h

Issue 2047513002: Add proper lifetime of encoder-specific settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: typo Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // but also makes it so configuration errors are discovered at the time we 315 // but also makes it so configuration errors are discovered at the time we
316 // apply the settings rather than when we get the first frame (waiting for 316 // apply the settings rather than when we get the first frame (waiting for
317 // the first frame to know that you gave a bad codec parameter could make 317 // the first frame to know that you gave a bad codec parameter could make
318 // debugging hard). 318 // debugging hard).
319 // TODO(pbos): Consider setting up encoders lazily. 319 // TODO(pbos): Consider setting up encoders lazily.
320 Dimensions() : width(176), height(144) {} 320 Dimensions() : width(176), height(144) {}
321 int width; 321 int width;
322 int height; 322 int height;
323 }; 323 };
324 324
325 union VideoEncoderSettings {
326 webrtc::VideoCodecH264 h264;
327 webrtc::VideoCodecVP8 vp8;
328 webrtc::VideoCodecVP9 vp9;
329 };
330
331 static std::vector<webrtc::VideoStream> CreateVideoStreams( 325 static std::vector<webrtc::VideoStream> CreateVideoStreams(
332 const VideoCodec& codec, 326 const VideoCodec& codec,
333 const VideoOptions& options, 327 const VideoOptions& options,
334 int max_bitrate_bps, 328 int max_bitrate_bps,
335 size_t num_streams); 329 size_t num_streams);
336 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( 330 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams(
337 const VideoCodec& codec, 331 const VideoCodec& codec,
338 const VideoOptions& options, 332 const VideoOptions& options,
339 int max_bitrate_bps, 333 int max_bitrate_bps,
340 size_t num_streams); 334 size_t num_streams);
341 335
342 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) 336 rtc::scoped_refptr<webrtc::VideoEncoderConfig::EncoderSpecificSettings>
337 ConfigureVideoEncoderSettings(const VideoCodec& codec)
343 EXCLUSIVE_LOCKS_REQUIRED(lock_); 338 EXCLUSIVE_LOCKS_REQUIRED(lock_);
344 339
345 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) 340 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec)
346 EXCLUSIVE_LOCKS_REQUIRED(lock_); 341 EXCLUSIVE_LOCKS_REQUIRED(lock_);
347 void DestroyVideoEncoder(AllocatedEncoder* encoder) 342 void DestroyVideoEncoder(AllocatedEncoder* encoder)
348 EXCLUSIVE_LOCKS_REQUIRED(lock_); 343 EXCLUSIVE_LOCKS_REQUIRED(lock_);
349 void SetCodec(const VideoCodecSettings& codec) 344 void SetCodec(const VideoCodecSettings& codec)
350 EXCLUSIVE_LOCKS_REQUIRED(lock_); 345 EXCLUSIVE_LOCKS_REQUIRED(lock_);
351 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); 346 void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_);
352 webrtc::VideoEncoderConfig CreateVideoEncoderConfig( 347 webrtc::VideoEncoderConfig CreateVideoEncoderConfig(
(...skipping 30 matching lines...) Expand all
383 // such as codecs, header extensions, and the global bitrate limit for the 378 // such as codecs, header extensions, and the global bitrate limit for the
384 // entire channel. 379 // entire channel.
385 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); 380 VideoSendStreamParameters parameters_ GUARDED_BY(lock_);
386 // Contains settings that are unique for each stream, such as max_bitrate. 381 // Contains settings that are unique for each stream, such as max_bitrate.
387 // Does *not* contain codecs, however. 382 // Does *not* contain codecs, however.
388 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. 383 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_.
389 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only 384 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only
390 // one stream per MediaChannel. 385 // one stream per MediaChannel.
391 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_); 386 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_);
392 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_); 387 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_);
393 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_);
394 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); 388 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_);
395 Dimensions last_dimensions_ GUARDED_BY(lock_); 389 Dimensions last_dimensions_ GUARDED_BY(lock_);
396 webrtc::VideoRotation last_rotation_ GUARDED_BY(lock_) = 390 webrtc::VideoRotation last_rotation_ GUARDED_BY(lock_) =
397 webrtc::kVideoRotation_0; 391 webrtc::kVideoRotation_0;
398 392
399 bool sending_ GUARDED_BY(lock_); 393 bool sending_ GUARDED_BY(lock_);
400 394
401 // The timestamp of the first frame received 395 // The timestamp of the first frame received
402 // Used to generate the timestamps of subsequent frames 396 // Used to generate the timestamps of subsequent frames
403 rtc::Optional<int64_t> first_frame_timestamp_ms_ GUARDED_BY(lock_); 397 rtc::Optional<int64_t> first_frame_timestamp_ms_ GUARDED_BY(lock_);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 // send_params/recv_params, rtp_extensions, options, etc. 543 // send_params/recv_params, rtp_extensions, options, etc.
550 VideoSendParameters send_params_; 544 VideoSendParameters send_params_;
551 VideoOptions default_send_options_; 545 VideoOptions default_send_options_;
552 VideoRecvParameters recv_params_; 546 VideoRecvParameters recv_params_;
553 bool red_disabled_by_remote_side_; 547 bool red_disabled_by_remote_side_;
554 }; 548 };
555 549
556 } // namespace cricket 550 } // namespace cricket
557 551
558 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 552 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698