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]
Este commit está contenido en:
Lakshmi Kumar
2023-11-30 05:31:37 -08:00
cometido por GitHub
padre 372ab1219a
commit 55193f5165
Se han modificado 10 ficheros con 51 adiciones y 6 borrados
@@ -34,4 +34,5 @@ make -j
-z <force_zero_latency - Decoded frames will be flushed out for display immediately [optional]>
-sei <extract SEI messages [optional]>
-crop <crop rectangle for output (not used when using interopped decoded frame) [optional - default: 0,0,0,0]>
-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]>
```
@@ -66,7 +66,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);
}
@@ -135,6 +137,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 {