Skip to content

Commit

Permalink
add --no-dmabuf option
Browse files Browse the repository at this point in the history
  • Loading branch information
ammen99 committed Aug 23, 2023
1 parent 8792d4f commit a2a27bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions manpage/wf-recorder.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.Op Fl c, -codec Ar output_codec
.Op Fl r, -framerate Ar framerate
.Op Fl d, -device Ar encoding_device
.Op Fl -no-dmabuf
.Op Fl D, -no-damage
.Op Fl f Ar filename.ext
.Op Fl F Ar filter_string
Expand Down Expand Up @@ -88,6 +89,11 @@ Use the
option in addition to the vaapi options to convert the
data in software, before sending it to the GPU.
.Pp
.It Fl -no-dmabuf
By default, wf-recorder will try to use only GPU buffers and copies if using a GPU encoder.
However, this can cause issues on some systems.
In such cases, this option will disable the GPU copy and force a CPU one.
.Pp
.It Fl D , -no-damage
By default, wf-recorder will request a new frame from the compositor
only when the screen updates. This results in a much smaller output
Expand Down
8 changes: 7 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ int main(int argc, char *argv[])

constexpr const char* default_cmdline_output = "interactive";
std::string cmdline_output = default_cmdline_output;
bool force_no_dmabuf = false;

struct option opts[] = {
{ "output", required_argument, NULL, 'o' },
Expand All @@ -902,6 +903,7 @@ int main(int argc, char *argv[])
{ "sample-rate", required_argument, NULL, 'R' },
{ "sample-format", required_argument, NULL, 'X' },
{ "device", required_argument, NULL, 'd' },
{ "no-dmabuf", no_argument, NULL, '&' },
{ "filter", required_argument, NULL, 'F' },
{ "log", no_argument, NULL, 'l' },
{ "audio", optional_argument, NULL, 'a' },
Expand Down Expand Up @@ -1008,6 +1010,10 @@ int main(int argc, char *argv[])
parse_codec_opts(params.audio_codec_options, optarg);
break;

case '&':
force_no_dmabuf = true;
break;

default:
printf("Unsupported command line argument %s\n", optarg);
}
Expand Down Expand Up @@ -1040,7 +1046,7 @@ int main(int argc, char *argv[])
}

// check we use same device as compositor
if (!params.hw_device.empty() && params.hw_device == drm_device_name)
if (!params.hw_device.empty() && params.hw_device == drm_device_name && !force_no_dmabuf)
{
use_dmabuf = true;
} else {
Expand Down

0 comments on commit a2a27bd

Please sign in to comment.