Skip to content

Commit 959b2a3

Browse files
committed
Add more dump location quirks for vtcapture
1 parent 1163777 commit 959b2a3

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ In this case, to not need totally different binaries, we implemented *quirks*, w
4848

4949
Currently the following ones exist:
5050

51-
| Backend | Quirk | Description | Flag |
52-
|-------------------|---------------------------------|-------------------------------------------------------------------------|-------|
53-
| DILE_VT | QUIRK_DILE_VT_CREATE_EX | Use `DILE_VT_CreateEx` instead of `DILE_VT_Create` | 0x1 |
54-
| DILE_VT | QUIRK_DILE_VT_NO_FREEZE_CAPTURE | Do not freeze frame before capturing (higher fps) | 0x2 |
55-
| DILE_VT VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION | (webOS 3.4, VTCAPTURE) Use alternative dump location | 0x4 |
56-
| VTCAPTURE | QUIRK_VTCAPTURE_FORCE_CAPTURE | Use of a custom kernel module for reenable capture in special situation | 0x100 |
51+
| Backend | Quirk | Description | Flag |
52+
|-------------------|-----------------------------------|---------------------------------------------------------------------------------|-------|
53+
| DILE_VT | QUIRK_DILE_VT_CREATE_EX | Use `DILE_VT_CreateEx` instead of `DILE_VT_Create` | 0x1 |
54+
| DILE_VT | QUIRK_DILE_VT_NO_FREEZE_CAPTURE | Do not freeze frame before capturing (higher fps) | 0x2 |
55+
| DILE_VT VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION | (webOS 3.4, VTCAPTURE) Use alternative dump location (vtcapture: SCALER_OUTPUT) | 0x4 |
56+
| VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION_2 | Use alternative dump location SCALER_INPUT | 0x8 |
57+
| VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION_3 | Use alternative dump location BLENDED_OUTPUT | 0x16 |
58+
| VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION_4 | Use alternative dump location OSD_OUTPUT | 0x32 |
59+
| VTCAPTURE | QUIRK_ALTERNATIVE_DUMP_LOCATION_5 | Use alternative dump location HISTOGRAM_OUTPUT | 0x64 |
60+
| VTCAPTURE | QUIRK_VTCAPTURE_FORCE_CAPTURE | Use of a custom kernel module for reenable capture in special situation | 0x100 |
5761

5862

5963
They can be provided in `config.json` via the `{"quirks": 0}` field or on commandline via `--quirks`.

src/quirks.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ enum CAPTURE_QUIRKS {
1212
DILE_VT_SetVideoFrameOutputDeviceOutputRegion
1313
*/
1414
QUIRK_ALTERNATIVE_DUMP_LOCATION = 0x4,
15+
QUIRK_ALTERNATIVE_DUMP_LOCATION_2 = 0x8,
16+
QUIRK_ALTERNATIVE_DUMP_LOCATION_3 = 0x16,
17+
QUIRK_ALTERNATIVE_DUMP_LOCATION_4 = 0x32,
18+
QUIRK_ALTERNATIVE_DUMP_LOCATION_5 = 0x64,
1519

1620
// vtCapture
1721
// Reenables video capture using custom kernel module

unicapture/backends/libvtcapture.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ typedef struct _vtcapture_backend_state {
2828
bool quirk_force_capture;
2929
} vtcapture_backend_state_t;
3030

31+
enum _vtcapture_dump_location {
32+
SCALER_INPUT,
33+
SCALER_OUTPUT,
34+
DISPLAY_OUTPUT,
35+
BLENDED_OUTPUT,
36+
OSD_OUTPUT,
37+
HISTOGRAM_OUTPUT
38+
};
39+
3140
int capture_terminate(void* state);
3241

3342
int capture_init(cap_backend_config_t* config, void** state_p)
@@ -52,7 +61,20 @@ int capture_init(cap_backend_config_t* config, void** state_p)
5261

5362
// Sorry, no unlimited fps for you.
5463
self->props.frm = config->fps == 0 ? 60 : config->fps;
55-
self->props.dump = HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION) ? 1 : 2;
64+
65+
int dump = DISPLAY_OUTPUT;
66+
if (HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION))
67+
dump = SCALER_OUTPUT;
68+
if (HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION_2))
69+
dump = SCALER_INPUT;
70+
if (HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION_3))
71+
dump = BLENDED_OUTPUT;
72+
if (HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION_4))
73+
dump = OSD_OUTPUT;
74+
if (HAS_QUIRK(config->quirks, QUIRK_ALTERNATIVE_DUMP_LOCATION_5))
75+
dump = HISTOGRAM_OUTPUT;
76+
77+
self->props.dump = dump;
5678
self->props.loc.x = 0;
5779
self->props.loc.y = 0;
5880
self->props.reg.w = config->resolution_width;

0 commit comments

Comments
 (0)