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

Unified Diff: content/renderer/media_recorder/video_track_recorder.cc

Issue 2785393002: Revert of Copy based on coded size in VideoTrackRecorder::VEAEncoder (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/media_recorder/video_track_recorder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media_recorder/video_track_recorder.cc
diff --git a/content/renderer/media_recorder/video_track_recorder.cc b/content/renderer/media_recorder/video_track_recorder.cc
index 5d8dddf400477ad17acde72c5516223986b3ee5a..3b1b0a5578ee8617ee68c64058455517a096172e 100644
--- a/content/renderer/media_recorder/video_track_recorder.cc
+++ b/content/renderer/media_recorder/video_track_recorder.cc
@@ -474,10 +474,10 @@
std::unique_ptr<VideoFrameAndTimestamp> last_frame_;
// Size used to initialize encoder.
- gfx::Size input_visible_size_;
+ gfx::Size input_size_;
// Coded size that encoder requests as input.
- gfx::Size vea_requested_input_coded_size_;
+ gfx::Size vea_requested_input_size_;
// Frames and corresponding timestamps in encode as FIFO.
std::queue<VideoParamsAndTimestamp> frames_in_encode_;
@@ -639,7 +639,7 @@
DVLOG(3) << __func__;
DCHECK(encoding_task_runner_->BelongsToCurrentThread());
- vea_requested_input_coded_size_ = input_coded_size;
+ vea_requested_input_size_ = input_coded_size;
output_buffers_.clear();
std::queue<std::unique_ptr<base::SharedMemory>>().swap(input_buffers_);
@@ -705,7 +705,7 @@
DVLOG(3) << __func__;
DCHECK(encoding_task_runner_->BelongsToCurrentThread());
- if (input_visible_size_ != frame->visible_rect().size() && video_encoder_)
+ if (input_size_ != frame->visible_rect().size() && video_encoder_)
video_encoder_.reset();
if (!video_encoder_)
@@ -739,14 +739,14 @@
// a copy is required for other storage types.
scoped_refptr<media::VideoFrame> video_frame = frame;
if (video_frame->storage_type() != VideoFrame::STORAGE_SHMEM ||
- vea_requested_input_coded_size_ != frame->coded_size() ||
- input_visible_size_.width() < kVEAEncoderMinResolutionWidth ||
- input_visible_size_.height() < kVEAEncoderMinResolutionHeight) {
+ vea_requested_input_size_ != input_size_ ||
+ input_size_.width() < kVEAEncoderMinResolutionWidth ||
+ input_size_.height() < kVEAEncoderMinResolutionHeight) {
// Create SharedMemory backed input buffers as necessary. These SharedMemory
// instances will be shared with GPU process.
std::unique_ptr<base::SharedMemory> input_buffer;
const size_t desired_mapped_size = media::VideoFrame::AllocationSize(
- media::PIXEL_FORMAT_I420, vea_requested_input_coded_size_);
+ media::PIXEL_FORMAT_I420, vea_requested_input_size_);
if (input_buffers_.empty()) {
input_buffer = gpu_factories_->CreateSharedMemory(desired_mapped_size);
} else {
@@ -760,8 +760,8 @@
}
video_frame = media::VideoFrame::WrapExternalSharedMemory(
- media::PIXEL_FORMAT_I420, vea_requested_input_coded_size_,
- gfx::Rect(input_visible_size_), input_visible_size_,
+ media::PIXEL_FORMAT_I420, vea_requested_input_size_,
+ gfx::Rect(input_size_), input_size_,
reinterpret_cast<uint8_t*>(input_buffer->memory()),
input_buffer->mapped_size(), input_buffer->handle(), 0,
frame->timestamp());
@@ -780,7 +780,7 @@
video_frame->stride(media::VideoFrame::kUPlane),
video_frame->visible_data(media::VideoFrame::kVPlane),
video_frame->stride(media::VideoFrame::kVPlane),
- input_visible_size_.width(), input_visible_size_.height());
+ input_size_.width(), input_size_.height());
}
frames_in_encode_.push(std::make_pair(
media::WebmMuxer::VideoParameters(frame), capture_timestamp));
@@ -794,11 +794,11 @@
DCHECK(gpu_factories_->GetTaskRunner()->BelongsToCurrentThread());
DCHECK_GT(bits_per_second_, 0);
- input_visible_size_ = size;
+ input_size_ = size;
video_encoder_ = gpu_factories_->CreateVideoEncodeAccelerator();
if (!video_encoder_ ||
- !video_encoder_->Initialize(media::PIXEL_FORMAT_I420, input_visible_size_,
- codec_, bits_per_second_, this)) {
+ !video_encoder_->Initialize(media::PIXEL_FORMAT_I420, input_size_, codec_,
+ bits_per_second_, this)) {
NotifyError(media::VideoEncodeAccelerator::kPlatformFailureError);
}
}
« no previous file with comments | « no previous file | content/renderer/media_recorder/video_track_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698