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

Side by Side Diff: content/renderer/media/rtc_video_encoder.cc

Issue 1928873002: Revert to recreating RTCVideoEncoder::Impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_video_encoder.h" 5 #include "content/renderer/media/rtc_video_encoder.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 video_encoder_->RequestEncodingParametersChange(bitrate * 1000, framerate); 379 video_encoder_->RequestEncodingParametersChange(bitrate * 1000, framerate);
380 } 380 }
381 381
382 void RTCVideoEncoder::Impl::Destroy(base::WaitableEvent* async_waiter) { 382 void RTCVideoEncoder::Impl::Destroy(base::WaitableEvent* async_waiter) {
383 DVLOG(3) << "Impl::Destroy()"; 383 DVLOG(3) << "Impl::Destroy()";
384 DCHECK(thread_checker_.CalledOnValidThread()); 384 DCHECK(thread_checker_.CalledOnValidThread());
385 if (video_encoder_) { 385 if (video_encoder_) {
386 video_encoder_.reset(); 386 video_encoder_.reset();
387 SetStatus(WEBRTC_VIDEO_CODEC_UNINITIALIZED); 387 SetStatus(WEBRTC_VIDEO_CODEC_UNINITIALIZED);
388 } 388 }
389 input_buffers_.clear();
Pawel Osciak 2016/04/28 02:05:33 What would you think of having a Clear() (or a sim
emircan 2016/04/28 02:44:09 Done.
390 output_buffers_.clear();
391 input_buffers_free_.clear();
392 output_buffers_free_count_ = 0;
393 input_next_frame_keyframe_ = false;
394 picture_id_ = static_cast<uint16_t>(base::RandInt(0, 0x7FFF));
389 async_waiter->Signal(); 395 async_waiter->Signal();
390 } 396 }
391 397
392 int32_t RTCVideoEncoder::Impl::GetStatus() const { 398 int32_t RTCVideoEncoder::Impl::GetStatus() const {
393 base::AutoLock lock(status_lock_); 399 base::AutoLock lock(status_lock_);
394 return status_; 400 return status_;
395 } 401 }
396 402
397 void RTCVideoEncoder::Impl::SetStatus(int32_t status) { 403 void RTCVideoEncoder::Impl::SetStatus(int32_t status) {
398 base::AutoLock lock(status_lock_); 404 base::AutoLock lock(status_lock_);
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", 841 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess",
836 init_retval == WEBRTC_VIDEO_CODEC_OK); 842 init_retval == WEBRTC_VIDEO_CODEC_OK);
837 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { 843 if (init_retval == WEBRTC_VIDEO_CODEC_OK) {
838 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", 844 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile",
839 profile, 845 profile,
840 media::VIDEO_CODEC_PROFILE_MAX + 1); 846 media::VIDEO_CODEC_PROFILE_MAX + 1);
841 } 847 }
842 } 848 }
843 849
844 } // namespace content 850 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698