diff --git a/projects/rocdecode/samples/videoDecode/README.md b/projects/rocdecode/samples/videoDecode/README.md index 1adb01344b..2808cf0470 100644 --- a/projects/rocdecode/samples/videoDecode/README.md +++ b/projects/rocdecode/samples/videoDecode/README.md @@ -35,5 +35,5 @@ make -j -md5 -md5_check MD5_File_Path -crop - -m + -m ``` \ No newline at end of file diff --git a/projects/rocdecode/samples/videoDecode/videodecode.cpp b/projects/rocdecode/samples/videoDecode/videodecode.cpp index 2482bfa205..6becca1d43 100644 --- a/projects/rocdecode/samples/videoDecode/videodecode.cpp +++ b/projects/rocdecode/samples/videoDecode/videodecode.cpp @@ -51,7 +51,7 @@ void ShowHelpAndExit(const char *option = NULL) { << "-md5_check MD5 File Path - generate MD5 message digest on the decoded YUV image sequence and compare to the reference MD5 string in a file; optional;" << 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; + << " [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED/ 3 : OUT_SURFACE_MEM_NOT_MAPPED]" << std::endl; exit(0); } @@ -221,7 +221,7 @@ int main(int argc, char **argv) { if (b_generate_md5) { viddec.UpdateMd5ForFrame(pframe, surf_info); } - if (dump_output_frames) { + if (dump_output_frames && mem_type != OUT_SURFACE_MEM_NOT_MAPPED) { viddec.SaveFrameToFile(output_file_path, pframe, surf_info); } // release frame @@ -238,6 +238,12 @@ int main(int argc, char **argv) { if (!dump_output_frames) { std::cout << "info: avg decoding time per frame: " << total_dec_time / n_frame << " ms" < -sei -crop - -m + -m ``` \ No newline at end of file diff --git a/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp b/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp index e2caab3682..ec701b8a9c 100644 --- a/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp +++ b/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp @@ -76,7 +76,7 @@ void ShowHelpAndExit(const char *option = NULL) { << "-sei extract SEI messages; optional;" << 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; + << " [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED/ 3 : OUT_SURFACE_MEM_NOT_MAPPED]" << std::endl; exit(0); } @@ -195,7 +195,7 @@ int main(int argc, char **argv) { } for (int i = 0; i < n_frame_returned; i++) { pframe = viddec.GetFrame(&pts); - if (dump_output_frames) { + if (dump_output_frames && mem_type != OUT_SURFACE_MEM_NOT_MAPPED) { viddec.SaveFrameToFile(output_file_path, pframe, surf_info); } // release frame @@ -208,6 +208,13 @@ int main(int argc, char **argv) { if (!dump_output_frames) { std::cout << "info: avg decoding time per frame (ms): " << total_dec_time / n_frame << std::endl; std::cout << "info: avg FPS: " << (n_frame / total_dec_time) * 1000 << std::endl; + } else { + if (mem_type == OUT_SURFACE_MEM_NOT_MAPPED) { + std::cout << "info: saving frames with -m 3 option is not supported!" << std::endl; + } else { + std::cout << "info: saved frames into " << output_file_path << std::endl; + } + } } catch (const std::exception &ex) { std::cout << ex.what() << std::endl; diff --git a/projects/rocdecode/samples/videoDecodeMultiFiles/README.md b/projects/rocdecode/samples/videoDecodeMultiFiles/README.md index 57c4b03b62..430a2b63d1 100644 --- a/projects/rocdecode/samples/videoDecodeMultiFiles/README.md +++ b/projects/rocdecode/samples/videoDecodeMultiFiles/README.md @@ -41,7 +41,7 @@ outfile output1.yuv [optional] z 0 [optional] sei 0 [optional] crop l,t,r,b [optional] -m 0 [optional] [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED] +m 0 [optional] [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED/ 3 : OUT_SURFACE_MEM_NOT_MAPPED] infile input2.[mp4/mov...] [optional] outfile output2.yuv [optional] ... diff --git a/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp b/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp index 03ddb3d2fb..49b23e505e 100644 --- a/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp +++ b/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp @@ -61,7 +61,7 @@ void ShowHelpAndExit(const char *option = NULL) { << "z 0 (force_zero_latency - Decoded frames will be flushed out for display immediately; default: 0)" << std::endl << "sei 0 (extract SEI messages; default: 0)" << std::endl << "crop l,t,r,b (crop rectangle for output (not used when using interopped decoded frame); default: 0)" << std::endl - << "m 0 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 + << "m 0 decoded surface memory; optional; default - 0 [0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED/ 3 : OUT_SURFACE_MEM_NOT_MAPPED]" << std::endl << "flush 1 flush last frames during reconfig; optional; default - 1 [1 : Flush last frames during reconfig 0 : Discard last frames during reconfigure ]" << std::endl << "infile input2.[mp4/mov...]" << std::endl << "outfile output2.yuv" << std::endl @@ -230,7 +230,7 @@ int main(int argc, char **argv) { } for (int i = 0; i < n_frame_returned; i++) { pframe = viddec->GetFrame(&pts); - if (file_data.dump_output_frames) { + if (file_data.dump_output_frames && file_data.mem_type != OUT_SURFACE_MEM_NOT_MAPPED) { viddec->SaveFrameToFile(file_data.out_file, pframe, surf_info); } // release frame @@ -244,6 +244,13 @@ int main(int argc, char **argv) { if (!file_data.dump_output_frames) { std::cout << "info: avg decoding time per frame (ms): " << total_dec_time / n_frame << std::endl; std::cout << "info: avg FPS: " << (n_frame / total_dec_time) * 1000 << std::endl; + } else { + if (file_data.mem_type == OUT_SURFACE_MEM_NOT_MAPPED) { + std::cout << "info: saving frames with -m 3 option is not supported!" << std::endl; + } else { + std::cout << "info: saved frames into " << file_data.out_file << std::endl; + } + } if (!use_reconfigure) { delete viddec; diff --git a/projects/rocdecode/samples/videoDecodePerf/README.md b/projects/rocdecode/samples/videoDecodePerf/README.md index 20cba1a60f..2109288a28 100644 --- a/projects/rocdecode/samples/videoDecodePerf/README.md +++ b/projects/rocdecode/samples/videoDecodePerf/README.md @@ -33,5 +33,4 @@ make -j -t -d = 0) [optional - default:0]> -z - -m ``` \ No newline at end of file diff --git a/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp b/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp index 644a679fec..ff404cfeaa 100644 --- a/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp +++ b/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp @@ -53,8 +53,7 @@ void ShowHelpAndExit(const char *option = NULL) { << "-o Output File Path - dumps output if requested; optional" << std::endl << "-d GPU device ID (0 for the first device, 1 for the second, etc.); optional; default: 0" << std::endl << "-of Output Format name - (native, bgr, bgr48, rgb, rgb48, bgra, bgra64, rgba, rgba64; converts native YUV frame to RGB image format; 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" << std::endl; + << "-crop crop rectangle for output (not used when using interopped decoded frame); optional; default: 0" << std::endl; exit(0); } @@ -259,13 +258,6 @@ int main(int argc, char **argv) { device_id = atoi(argv[i]); continue; } - if (!strcmp(argv[i], "-m")) { - if (++i == argc) { - ShowHelpAndExit("-m"); - } - mem_type = static_cast(atoi(argv[i])); - continue; - } if (!strcmp(argv[i], "-crop")) { if (++i == argc || 4 != sscanf(argv[i], "%d,%d,%d,%d", &crop_rect.l, &crop_rect.t, &crop_rect.r, &crop_rect.b)) { ShowHelpAndExit("-crop");