Global: support for named format arguments

Fix #796
This commit is contained in:
Carter Li
2024-05-27 16:41:37 +08:00
parent 965777323e
commit c8451cab52
65 changed files with 855 additions and 806 deletions
+12 -12
View File
@@ -28,12 +28,12 @@ static void printDevice(FFCameraOptions* options, const FFCameraResult* device,
else
{
FF_PRINT_FORMAT_CHECKED(FF_CAMERA_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_CAMERA_NUM_FORMAT_ARGS, (((FFformatarg[]) {
{FF_FORMAT_ARG_TYPE_STRBUF, &device->name},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->vendor},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->colorspace},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->id},
{FF_FORMAT_ARG_TYPE_UINT, &device->width},
{FF_FORMAT_ARG_TYPE_UINT, &device->height},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->name, "name"},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->vendor, "vendor"},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->colorspace, "colorspace"},
{FF_FORMAT_ARG_TYPE_STRBUF, &device->id, "id"},
{FF_FORMAT_ARG_TYPE_UINT, &device->width, "width"},
{FF_FORMAT_ARG_TYPE_UINT, &device->height, "height"},
})));
}
}
@@ -139,12 +139,12 @@ void ffGenerateCameraJsonResult(FF_MAYBE_UNUSED FFCameraOptions* options, yyjson
void ffPrintCameraHelpFormat(void)
{
FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_CAMERA_MODULE_NAME, "{1} ({4}px x {5}px)", FF_CAMERA_NUM_FORMAT_ARGS, ((const char* []) {
"Device name",
"Vendor",
"Color space",
"Identifier",
"Width (in px)",
"Height (in px)",
"Device name - name",
"Vendor - vendor",
"Color space - colorspace",
"Identifier - id",
"Width (in px) - width",
"Height (in px) - height",
}));
}