Skip to content
Snippets Groups Projects
Commit 0da903b2 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

Revert "video: don't blacken frame if not needed"

This reverts commit c4b580a2.

Change-Id: If4a00bde338aa657c482ae18cc59902ed1be593c
parent c4b580a2
No related branches found
No related tags found
No related merge requests found
...@@ -273,6 +273,11 @@ int ...@@ -273,6 +273,11 @@ int
MediaEncoder::encode(VideoFrame& input, bool is_keyframe, MediaEncoder::encode(VideoFrame& input, bool is_keyframe,
int64_t frame_number) int64_t frame_number)
{ {
/* Prepare a frame suitable to our encoder frame format,
* keeping also the input aspect ratio.
*/
yuv422_clear_to_black(scaledFrame_); // to fill blank space left by the "keep aspect"
scaler_.scale_with_aspect(input, scaledFrame_); scaler_.scale_with_aspect(input, scaledFrame_);
auto frame = scaledFrame_.pointer(); auto frame = scaledFrame_.pointer();
......
...@@ -189,6 +189,8 @@ VideoMixer::setDimensions(int width, int height) ...@@ -189,6 +189,8 @@ VideoMixer::setDimensions(int width, int height)
// cleanup the previous frame to have a nice copy in rendering method // cleanup the previous frame to have a nice copy in rendering method
std::shared_ptr<VideoFrame> previous_p(obtainLastFrame()); std::shared_ptr<VideoFrame> previous_p(obtainLastFrame());
if (previous_p)
yuv422_clear_to_black(*previous_p);
start_sink(); start_sink();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment