fix for hipOutOfMem bug when decoding large videos (#189)

* fix for issue 441908

[ROCm/rocdecode commit: 51ecd8fccf]
Этот коммит содержится в:
Rajy Rawther
2024-01-19 09:46:02 -08:00
коммит произвёл GitHub
родитель 5527ee0b79
Коммит 9afce4a03a
4 изменённых файлов: 108 добавлений и 109 удалений
+2 -11
Просмотреть файл
@@ -65,9 +65,7 @@ void ShowHelpAndExit(const char *option = NULL) {
<< "-i Input File Path - required" << std::endl
<< "-t Number of threads (>= 1) - optional; default: 4" << std::endl
<< "-d Device ID (>= 0) - optional; default: 0" << std::endl
<< "-z force_zero_latency (force_zero_latency, Decoded frames will be flushed out for display immediately); optional;" << 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;
<< "-z force_zero_latency (force_zero_latency, Decoded frames will be flushed out for display immediately); optional;" << std::endl;
exit(0);
}
@@ -77,7 +75,7 @@ int main(int argc, char **argv) {
int device_id = 0;
int n_thread = 4;
Rect *p_crop_rect = nullptr;
OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal
OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_NOT_MAPPED; // set to decode only for performance
bool b_force_zero_latency = false;
// Parse command-line arguments
if(argc <= 1) {
@@ -121,13 +119,6 @@ int main(int argc, char **argv) {
b_force_zero_latency = true;
continue;
}
if (!strcmp(argv[i], "-m")) {
if (++i == argc) {
ShowHelpAndExit("-m");
}
mem_type = static_cast<OutputSurfaceMemoryType>(atoi(argv[i]));
continue;
}
ShowHelpAndExit(argv[i]);
}