Commit a460cbb6 authored by lionel.g.landwerlin's avatar lionel.g.landwerlin Committed by Commit bot

pepper: VideoEncoder: use same constraints as media::VideoFrame for software encoder

Prevent the software encoder to accept odd sized video frames by
reusing the same constraints applied to frames allocated by
media::VideoFrame.

BUG=455409

Review URL: https://codereview.chromium.org/1085003002

Cr-Commit-Position: refs/heads/master@{#325266}
parent 4c05c942
......@@ -101,9 +101,12 @@ void VideoEncoderShim::EncoderImpl::Initialize(
encoder_->UpdateRates(initial_bitrate);
gfx::Size coded_size =
media::VideoFrame::PlaneSize(input_format, 0, input_visible_size);
media_task_runner_->PostTask(
FROM_HERE, base::Bind(&VideoEncoderShim::OnRequireBitstreamBuffers, shim_,
kInputFrameCount, input_visible_size,
kInputFrameCount, coded_size,
kBitstreamBufferSize));
}
......
......@@ -84,6 +84,16 @@ std::string TestVideoEncoder::TestCreate() {
ASSERT_EQ(PP_OK, video_encoder.GetFrameCodedSize(&coded_size));
ASSERT_GE(coded_size.GetArea(), video_size.GetArea());
ASSERT_GE(video_encoder.GetFramesRequired(), 1);
TestCompletionCallbackWithOutput<pp::VideoFrame> get_video_frame(
instance_->pp_instance(), false);
get_video_frame.WaitForResult(
video_encoder.GetVideoFrame(get_video_frame.GetCallback()));
ASSERT_EQ(PP_OK, get_video_frame.result());
pp::Size video_frame_size;
ASSERT_TRUE(get_video_frame.output().GetSize(&video_frame_size));
ASSERT_EQ(coded_size.GetArea(), video_frame_size.GetArea());
}
PASS();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment