Skip to content
Snippets Groups Projects
Commit ea223bd6 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

#30253: video: cleanup mixer background when resized.

parent 19a3a788
No related branches found
No related tags found
No related merge requests found
......@@ -202,6 +202,14 @@ void VideoFrame::copy(VideoFrame &dst)
frame_->height);
}
void VideoFrame::clear()
{
// FIXME: beurk!!!!
memset(frame_->data[0], 0, frame_->linesize[0]*frame_->height);
memset(frame_->data[1], 0, frame_->linesize[1]*frame_->height/2);
memset(frame_->data[2], 0, frame_->linesize[2]*frame_->height/2);
}
void VideoFrame::test()
{
memset(frame_->data[0], 0xaa, frame_->linesize[0]*frame_->height/2);
......
......@@ -203,6 +203,7 @@ public:
bool allocBuffer(int width, int height, int pix_fmt);
int blit(VideoFrame& src, int xoff, int yoff);
void copy(VideoFrame &src);
void clear();
void test();
private:
......
......@@ -136,6 +136,11 @@ void VideoMixer::setDimensions(int width, int height)
width_ = width;
height_ = height;
// cleanup the previous frame to have a nice copy in rendering method
VideoFrameSP previous_p=obtainLastFrame();
if (previous_p)
previous_p->clear();
stop_sink();
start_sink();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment