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

Side by Side Diff: content/renderer/media_recorder/video_track_recorder.cc

Issue 2753593002: Avoid calling VEA::Destroy() in VideoTrackRecorder (Closed)
Patch Set: Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_recorder/video_track_recorder.h" 5 #include "content/renderer/media_recorder/video_track_recorder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 DCHECK(encoding_task_runner_->BelongsToCurrentThread()); 685 DCHECK(encoding_task_runner_->BelongsToCurrentThread());
686 input_buffers_.push(std::move(shm)); 686 input_buffers_.push(std::move(shm));
687 } 687 }
688 688
689 void VEAEncoder::EncodeOnEncodingTaskRunner( 689 void VEAEncoder::EncodeOnEncodingTaskRunner(
690 scoped_refptr<VideoFrame> frame, 690 scoped_refptr<VideoFrame> frame,
691 base::TimeTicks capture_timestamp) { 691 base::TimeTicks capture_timestamp) {
692 DVLOG(3) << __func__; 692 DVLOG(3) << __func__;
693 DCHECK(encoding_task_runner_->BelongsToCurrentThread()); 693 DCHECK(encoding_task_runner_->BelongsToCurrentThread());
694 694
695 if (input_size_ != frame->visible_rect().size() && video_encoder_) { 695 if (input_size_ != frame->visible_rect().size() && video_encoder_)
696 video_encoder_->Destroy();
697 video_encoder_.reset(); 696 video_encoder_.reset();
698 }
699 697
700 if (!video_encoder_) 698 if (!video_encoder_)
701 ConfigureEncoderOnEncodingTaskRunner(frame->visible_rect().size()); 699 ConfigureEncoderOnEncodingTaskRunner(frame->visible_rect().size());
702 700
703 if (error_notified_) { 701 if (error_notified_) {
704 DVLOG(3) << "An error occurred in VEA encoder"; 702 DVLOG(3) << "An error occurred in VEA encoder";
705 return; 703 return;
706 } 704 }
707 705
708 // Drop frames if there is no output buffers available. 706 // Drop frames if there is no output buffers available.
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_), 1322 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_),
1325 false); 1323 false);
1326 } 1324 }
1327 1325
1328 bool VideoTrackRecorder::CanEncodeAlphaChannelForTesting() { 1326 bool VideoTrackRecorder::CanEncodeAlphaChannelForTesting() {
1329 DCHECK(encoder_); 1327 DCHECK(encoder_);
1330 return encoder_->CanEncodeAlphaChannel(); 1328 return encoder_->CanEncodeAlphaChannel();
1331 } 1329 }
1332 1330
1333 } // namespace content 1331 } // 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