Skip to content

Commit

Permalink
vtc: add dump loc 1 quirk
Browse files Browse the repository at this point in the history
  • Loading branch information
asturel committed Mar 13, 2023
1 parent 10b638f commit 8013026
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Currently the following ones exist:
| DILE_VT | QUIRK_DILE_VT_NO_FREEZE_CAPTURE | Do not freeze frame before capturing (higher fps) | 0x2 |
| DILE_VT | QUIRK_DILE_VT_DUMP_LOCATION_2 | (webOS 3.4) Use undocumented dump location 2 | 0x4 |
| VTCAPTURE | QUIRK_VTCAPTURE_FORCE_CAPTURE | Use of a custom kernel module for reenable capture in special situation | 0x100 |
| VTCAPTURE | QUIRK_VTCAPTURE_DUMP_LOCATION_1 | Use undocumented dump location 1, may provide better colors on some models | 0x200 |


They can be provided in `config.json` via the `{"quirks": 0}` field or on commandline via `--quirks`.
Expand Down
23 changes: 22 additions & 1 deletion src/backends/libvtcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,28 @@ int capture_init(cap_backend_config_t* config, void** state_p)

// Sorry, no unlimited fps for you.
self->props.frm = config->fps == 0 ? 60 : config->fps;
self->props.dump = 2;
/*
* 1. V4L2_EXT_CAPTURE_SCALER_INPUT
* - LG uses this location only when VTV mode.
* - If not supported, the ioctl should be returned -1 and the errno variable should be set to ENOTSUP.
* 2. V4L2_EXT_CAPTURE_SCALER_OUTPUT
* - Recommend location
* - Before PQ processing, after de-interlace block
* - The frame is a progressive type.
* - Alternative location due to chip limitation
* - Before PQ processing, before de-interlace block
* - The frame is an interlace type.
* 3. V4L2_EXT_CAPTURE_DISPLAY_OUTPUT
* - Capture a video after PQ processing and before OSD blending.
* - The frame size calculated with ARC applied.
* 4. V4L2_EXT_CAPTURE_BLENDED_OUTPUT
* - Capture a video after OSD blending.
* - If not supported, the ioctl should be returned -1 and the errno variable should be set to ENOTSUP.
* 5. V4L2_EXT_CAPTURE_OSD_OUTPUT
* - Capture a OSD output.
* - If not supported, the ioctl should be returned -1 and the errno variable should be set to ENOTSUP.
*/
self->props.dump = HAS_QUIRK(config->quirks, QUIRK_VTCAPTURE_DUMP_LOCATION_1) ? 1 : 2;
self->props.loc.x = 0;
self->props.loc.y = 0;
self->props.reg.w = config->resolution_width;
Expand Down
5 changes: 4 additions & 1 deletion src/quirks.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ enum CAPTURE_QUIRKS {

// vtCapture
// Reenables video capture using custom kernel module
QUIRK_VTCAPTURE_FORCE_CAPTURE = 0x100
QUIRK_VTCAPTURE_FORCE_CAPTURE = 0x100,

// Capture frames at V4L2_EXT_CAPTURE_SCALER_INPUT = 1 (before V4L2_EXT_CAPTURE_SCALER_OUTPUT = 2)
QUIRK_VTCAPTURE_DUMP_LOCATION_1 = 0x200,
};

0 comments on commit 8013026

Please sign in to comment.