X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fjpeg_frame_view.cpp;fp=futatabi%2Fjpeg_frame_view.cpp;h=059a3410586285ff230d6ebcc469846f428a4dc3;hb=52336c086b8bc355b55e2046e3a055b1b4c70ef7;hp=a9cf11cf77b51cbbc6fe43cd9b8582c5b66d26a4;hpb=5c1bc79d6c26c96cb8d2195ae8ef457c30ed364a;p=nageru diff --git a/futatabi/jpeg_frame_view.cpp b/futatabi/jpeg_frame_view.cpp index a9cf11c..059a341 100644 --- a/futatabi/jpeg_frame_view.cpp +++ b/futatabi/jpeg_frame_view.cpp @@ -1,6 +1,7 @@ #include "jpeg_frame_view.h" #include "defs.h" +#include "flags.h" #include "jpeg_destroyer.h" #include "jpeglib_error_wrapper.h" #include "shared/post_to_main_thread.h" @@ -474,15 +475,15 @@ shared_ptr get_black_frame() static once_flag flag; call_once(flag, [] { black_frame.reset(new Frame); - black_frame->y.reset(new uint8_t[1280 * 720]); - black_frame->cb.reset(new uint8_t[(1280 / 2) * (720 / 2)]); - black_frame->cr.reset(new uint8_t[(1280 / 2) * (720 / 2)]); - black_frame->width = 1280; - black_frame->height = 720; + black_frame->y.reset(new uint8_t[global_flags.width * global_flags.height]); + black_frame->cb.reset(new uint8_t[(global_flags.width / 2) * (global_flags.height / 2)]); + black_frame->cr.reset(new uint8_t[(global_flags.width / 2) * (global_flags.height / 2)]); + black_frame->width = global_flags.width; + black_frame->height = global_flags.height; black_frame->chroma_subsampling_x = 2; black_frame->chroma_subsampling_y = 2; - black_frame->pitch_y = 1280; - black_frame->pitch_chroma = 1280 / 2; + black_frame->pitch_y = global_flags.width; + black_frame->pitch_chroma = global_flags.width / 2; }); return black_frame; }