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

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

Issue 2347843002: Add proper lifetime of encoder-specific settings (Closed)
Patch Set: Created 4 years, 3 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // such as codecs, header extensions, and the global bitrate limit for the 388 // such as codecs, header extensions, and the global bitrate limit for the
394 // entire channel. 389 // entire channel.
395 VideoSendStreamParameters parameters_ GUARDED_BY(lock_); 390 VideoSendStreamParameters parameters_ GUARDED_BY(lock_);
396 // Contains settings that are unique for each stream, such as max_bitrate. 391 // Contains settings that are unique for each stream, such as max_bitrate.
397 // Does *not* contain codecs, however. 392 // Does *not* contain codecs, however.
398 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. 393 // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_.
399 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only 394 // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only
400 // one stream per MediaChannel. 395 // one stream per MediaChannel.
401 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_); 396 webrtc::RtpParameters rtp_parameters_ GUARDED_BY(lock_);
402 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_); 397 bool pending_encoder_reconfiguration_ GUARDED_BY(lock_);
403 VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_);
404 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); 398 AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_);
405 VideoFrameInfo last_frame_info_ GUARDED_BY(lock_); 399 VideoFrameInfo last_frame_info_ GUARDED_BY(lock_);
406 400
407 bool sending_ GUARDED_BY(lock_); 401 bool sending_ GUARDED_BY(lock_);
408 402
409 // The timestamp of the last frame received 403 // The timestamp of the last frame received
410 // Used to generate timestamp for the black frame when source is removed 404 // Used to generate timestamp for the black frame when source is removed
411 int64_t last_frame_timestamp_us_ GUARDED_BY(lock_); 405 int64_t last_frame_timestamp_us_ GUARDED_BY(lock_);
412 }; 406 };
413 407
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 int64_t last_stats_log_ms_; 550 int64_t last_stats_log_ms_;
557 }; 551 };
558 552
559 } // namespace cricket 553 } // namespace cricket
560 554
561 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ 555 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698