Commit 7f7bc0e7 authored by Alexandre Lision's avatar Alexandre Lision Committed by Guillaume Roguez

video: change pixfmt used by VideoMixer

YUV420P was allocating one large buffer on Linux and 3 on OSX.
This was causing read overflows. We use YUYV422 which is packed (always one buf)

Issue: #81116
Change-Id: I76456f72c6f155d181aa533aa62cb70b92f6eff1
parent b0a4abc8
......@@ -115,7 +115,7 @@ int libav_pixel_format(int fmt)
switch (fmt) {
case video::VIDEO_PIXFMT_BGRA: return PIXEL_FORMAT(BGRA);
case video::VIDEO_PIXFMT_RGBA: return PIXEL_FORMAT(RGBA);
case video::VIDEO_PIXFMT_YUV420P: return PIXEL_FORMAT(YUV420P);
case video::VIDEO_PIXFMT_YUYV422: return PIXEL_FORMAT(YUYV422);
}
return fmt;
}
......@@ -123,7 +123,7 @@ int libav_pixel_format(int fmt)
int ring_pixel_format(int fmt)
{
switch (fmt) {
case PIXEL_FORMAT(YUV420P): return video::VIDEO_PIXFMT_YUV420P;
case PIXEL_FORMAT(YUYV422): return video::VIDEO_PIXFMT_YUYV422;
}
return fmt;
}
......
......@@ -50,7 +50,7 @@ namespace ring { namespace video {
enum VideoPixelFormat {
VIDEO_PIXFMT_BGRA = -1,
VIDEO_PIXFMT_YUV420P = -2,
VIDEO_PIXFMT_YUYV422 = -2,
VIDEO_PIXFMT_RGBA = -3,
};
......
......@@ -130,7 +130,7 @@ VideoMixer::process()
VideoFrame& output = getNewFrame();
try {
output.reserve(VIDEO_PIXFMT_YUV420P, width_, height_);
output.reserve(VIDEO_PIXFMT_YUYV422, width_, height_);
} catch (const std::bad_alloc& e) {
RING_ERR("VideoFrame::allocBuffer() failed");
return;
......@@ -231,6 +231,6 @@ VideoMixer::getHeight() const
int
VideoMixer::getPixelFormat() const
{ return VIDEO_PIXFMT_YUV420P; }
{ return VIDEO_PIXFMT_YUYV422; }
}} // namespace ring::video
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