X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=fake_capture.cpp;h=e06ac3a098b4bf3e11b3b4649beae807c9f2a3b0;hb=HEAD;hp=d8f5144adf727008277dcd537f2dbeb6ace98de8;hpb=9dd6b94f84be634306e1266e2f65479fef76a10f;p=bmusb diff --git a/fake_capture.cpp b/fake_capture.cpp index d8f5144..e06ac3a 100644 --- a/fake_capture.cpp +++ b/fake_capture.cpp @@ -230,7 +230,7 @@ void fill_color_noninterleaved(uint8_t *dst, uint8_t y, uint8_t cb, uint8_t cr, pix[3] = (y << 2) | (cr << 12) | ( y << 22); memset16(dst, pix, video_format.stride * video_format.height / sizeof(pix)); } else { - uint8_t ycbcr[] = { y, cb, y, cr }; + uint8_t ycbcr[] = { cb, y, cr, y }; memset4(dst, ycbcr, video_format.width * video_format.height / 2); } } @@ -302,10 +302,10 @@ void FakeCapture::producer_thread_func() memset2(video_frame.data, cbcr, width * height / 2); memset(video_frame.data2, y, width * height); } else { - fill_color_noninterleaved(video_frame.data, y, cb, cr, video_format, current_pixel_format); + fill_color_noninterleaved(video_frame.data, y, cb, cr, video_format, current_pixel_format == PixelFormat_10BitYCbCr); } if (video_frame.data_copy != nullptr) { - fill_color_noninterleaved(video_frame.data_copy, y, cb, cr, video_format, current_pixel_format); + fill_color_noninterleaved(video_frame.data_copy, y, cb, cr, video_format, current_pixel_format == PixelFormat_10BitYCbCr); } video_frame.len = video_format.stride * height; video_frame.received_timestamp = timestamp;