| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |