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

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

Issue 2753513008: Merge 58: 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 DCHECK(encoding_task_runner_->BelongsToCurrentThread()); 645 DCHECK(encoding_task_runner_->BelongsToCurrentThread());
646 input_buffers_.push(std::move(shm)); 646 input_buffers_.push(std::move(shm));
647 } 647 }
648 648
649 void VEAEncoder::EncodeOnEncodingTaskRunner( 649 void VEAEncoder::EncodeOnEncodingTaskRunner(
650 scoped_refptr<VideoFrame> frame, 650 scoped_refptr<VideoFrame> frame,
651 base::TimeTicks capture_timestamp) { 651 base::TimeTicks capture_timestamp) {
652 DVLOG(3) << __func__; 652 DVLOG(3) << __func__;
653 DCHECK(encoding_task_runner_->BelongsToCurrentThread()); 653 DCHECK(encoding_task_runner_->BelongsToCurrentThread());
654 654
655 if (input_size_ != frame->visible_rect().size() && video_encoder_) { 655 if (input_size_ != frame->visible_rect().size() && video_encoder_)
656 video_encoder_->Destroy();
657 video_encoder_.reset(); 656 video_encoder_.reset();
658 }
659 657
660 if (!video_encoder_) 658 if (!video_encoder_)
661 ConfigureEncoderOnEncodingTaskRunner(frame->visible_rect().size()); 659 ConfigureEncoderOnEncodingTaskRunner(frame->visible_rect().size());
662 660
663 if (error_notified_) { 661 if (error_notified_) {
664 DVLOG(3) << "An error occurred in VEA encoder"; 662 DVLOG(3) << "An error occurred in VEA encoder";
665 return; 663 return;
666 } 664 }
667 665
668 // Drop frames if there is no output buffers available. 666 // Drop frames if there is no output buffers available.
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 encoder_->SetPaused(paused_before_init_); 1218 encoder_->SetPaused(paused_before_init_);
1221 1219
1222 // StartFrameEncode() will be called on Render IO thread. 1220 // StartFrameEncode() will be called on Render IO thread.
1223 MediaStreamVideoSink::ConnectToTrack( 1221 MediaStreamVideoSink::ConnectToTrack(
1224 track_, 1222 track_,
1225 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_), 1223 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_),
1226 false); 1224 false);
1227 } 1225 }
1228 1226
1229 } // namespace content 1227 } // 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