Commit ea223bd6 authored by Guillaume Roguez's avatar Guillaume Roguez

#30253: video: cleanup mixer background when resized.

parent 19a3a788
......@@ -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();
}
......
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