|
50 | 50 | * 3. p010 works just on macOS/Metal, crashes on Vulkan (see previous point) |
51 | 51 | * 4. p010 corrupted on d3d[12] - pixfmts skipped in query*() as a workaround |
52 | 52 | * 5. see todo in @ref ../audio/capture/sdl_mixer.c |
| 53 | + * 6. size= option doesn't seem to work with YCbCr formats |
53 | 54 | */ |
54 | 55 |
|
55 | 56 | #include <SDL3/SDL.h> |
|
78 | 79 | #include "utils/color_out.h" // for color_printf, TBOLD, TRED |
79 | 80 | #include "utils/list.h" // for simple_linked_list_append, simple_lin... |
80 | 81 | #include "utils/macros.h" // for STR_LEN |
| 82 | +#include "video.h" // for get_video_desc_from_string |
81 | 83 | #include "video_codec.h" // for get_codec_name, codec_is_planar, vc_d... |
82 | 84 | #include "video_display.h" // for display_property, get_splashscreen |
83 | 85 | #include "video_frame.h" // for vf_free, vf_alloc_desc, video_desc_fr... |
@@ -517,7 +519,8 @@ show_help(const char *driver, bool full) |
517 | 519 | "position\n" |
518 | 520 | " " |
519 | 521 | "(syntax: " TBOLD( |
520 | | - "[<W>x<H>][{+-}<X>[{+-}<Y>]]") ")\n"); |
| 522 | + "[<W>x<H>][{+-}<X>[{+-}<Y>]]") |
| 523 | + " or mode name)\n"); |
521 | 524 | color_printf(TBOLD(" <renderer>") " - renderer, one or more of:"); |
522 | 525 | for (int i = 0; i < SDL_GetNumRenderDrivers(); ++i) { |
523 | 526 | const char *renderer_name = SDL_GetRenderDriver(i); |
@@ -886,6 +889,13 @@ set_size(struct state_sdl3 *s, const char *tok) |
886 | 889 | } |
887 | 890 | tok = strchr(tok, '=') + 1; |
888 | 891 | if (strpbrk(tok, "x+-") == NULL) { |
| 892 | + struct video_desc desc = get_video_desc_from_string(tok); |
| 893 | + if (desc.width != 0) { |
| 894 | + s->fixed_size = true; |
| 895 | + s->fixed_w = desc.width; |
| 896 | + s->fixed_h = desc.height; |
| 897 | + return true; |
| 898 | + } |
889 | 899 | log_msg(LOG_LEVEL_ERROR, MOD_NAME "Wrong size spec: %s\n", tok); |
890 | 900 | return false; |
891 | 901 | } |
|
0 commit comments