Samples - adds surface memory option to user (#104)

* adding surface mem type as user arg

* adding mem type user arg for all apps

* readme update

* readme updates on all apps

[ROCm/rocdecode commit: 449572f9bf]
This commit is contained in:
Lakshmi Kumar
2023-11-30 05:31:37 -08:00
committed by GitHub
parent 372ab1219a
commit 55193f5165
10 changed files with 51 additions and 6 deletions
@@ -43,7 +43,9 @@ void ShowHelpAndExit(const char *option = NULL) {
<< "-d GPU device ID (0 for the first device, 1 for the second, etc.); optional; default: 0" << std::endl
<< "-z force_zero_latency (force_zero_latency, Decoded frames will be flushed out for display immediately); optional;" << std::endl
<< "-sei extract SEI messages; optional;" << std::endl
<< "-crop crop rectangle for output (not used when using interopped decoded frame); optional; default: 0" << std::endl;
<< "-crop crop rectangle for output (not used when using interopped decoded frame); optional; default: 0" << std::endl
<< "-m output_surface_memory_type - decoded surface memory; optional; default - 0"
<< " [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED]" << std::endl;
exit(0);
}
@@ -112,6 +114,13 @@ int main(int argc, char **argv) {
p_crop_rect = &crop_rect;
continue;
}
if (!strcmp(argv[i], "-m")) {
if (++i == argc) {
ShowHelpAndExit("-m");
}
mem_type = static_cast<OutputSurfaceMemoryType>(atoi(argv[i]));
continue;
}
ShowHelpAndExit(argv[i]);
}
try {