D not fuse - zwhen runnnin gthesmake test. Don't force b_force_latency ofr Perf/Fork sample (#85)

This commit is contained in:
Aryan Salmanpour
2023-11-27 12:33:28 -05:00
committed by GitHub
parent 57c040eff8
commit 8898af78a6
4 changed files with 27 additions and 10 deletions
+1 -1
View File
@@ -33,5 +33,5 @@ add_test(
"${CMAKE_CURRENT_BINARY_DIR}/videoDecode"
--build-generator "${CMAKE_GENERATOR}"
--test-command "videodecode"
-i ${CMAKE_SOURCE_DIR}/data/videos/AMD_driving_virtual_20-H265.mp4 -z
-i ${CMAKE_SOURCE_DIR}/data/videos/AMD_driving_virtual_20-H265.mp4
)
+14 -6
View File
@@ -56,8 +56,9 @@ void DecProc(RocVideoDecoder *p_dec, VideoDemuxer *demuxer, int *pn_frame) {
void ShowHelpAndExit(const char *option = NULL) {
std::cout << "Options:" << std::endl
<< "-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;
<< "-f Number of forks (>= 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;
exit(0);
}
@@ -68,7 +69,7 @@ int main(int argc, char **argv) {
int device_id = 0;
Rect *p_crop_rect = nullptr;
OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal
bool b_force_zero_latency = false;
// Parse command-line arguments
if(argc < 1) {
ShowHelpAndExit();
@@ -84,9 +85,9 @@ int main(int argc, char **argv) {
input_file_path = argv[i];
continue;
}
if (!strcmp(argv[i], "-t")) {
if (!strcmp(argv[i], "-f")) {
if (++i == argc) {
ShowHelpAndExit("-t");
ShowHelpAndExit("-f");
}
n_fork = atoi(argv[i]);
if (n_fork <= 0) {
@@ -104,6 +105,13 @@ int main(int argc, char **argv) {
}
continue;
}
if (!strcmp(argv[i], "-z")) {
if (i == argc) {
ShowHelpAndExit("-z");
}
b_force_zero_latency = true;
continue;
}
ShowHelpAndExit(argv[i]);
}
@@ -151,7 +159,7 @@ int main(int argc, char **argv) {
std::unique_ptr<VideoDemuxer> demuxer(new VideoDemuxer(input_file_path.c_str()));
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer->GetCodecID());
v_device_id[i] = (i % 2 == 0) ? 0 : sd;
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, true, p_crop_rect));
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect));
v_demuxer.push_back(std::move(demuxer));
v_viddec.push_back(std::move(dec));
}
+11 -2
View File
@@ -64,7 +64,8 @@ void ShowHelpAndExit(const char *option = NULL) {
std::cout << "Options:" << std::endl
<< "-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;
<< "-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;
exit(0);
}
@@ -75,6 +76,7 @@ int main(int argc, char **argv) {
int n_thread = 4;
Rect *p_crop_rect = nullptr;
OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal
bool b_force_zero_latency = false;
// Parse command-line arguments
if(argc < 1) {
ShowHelpAndExit();
@@ -110,6 +112,13 @@ int main(int argc, char **argv) {
}
continue;
}
if (!strcmp(argv[i], "-z")) {
if (i == argc) {
ShowHelpAndExit("-z");
}
b_force_zero_latency = true;
continue;
}
ShowHelpAndExit(argv[i]);
}
@@ -157,7 +166,7 @@ int main(int argc, char **argv) {
std::unique_ptr<VideoDemuxer> demuxer(new VideoDemuxer(input_file_path.c_str()));
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer->GetCodecID());
v_device_id[i] = (i % 2 == 0) ? 0 : sd;
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, true, p_crop_rect));
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect));
v_demuxer.push_back(std::move(demuxer));
v_viddec.push_back(std::move(dec));
}
+1 -1
View File
@@ -342,7 +342,7 @@ class RocVideoDecoder {
OutputSurfaceMemoryType out_mem_type_ = OUT_SURFACE_MEM_DEV_INTERNAL;
bool b_extract_sei_message_ = false;
bool b_low_latency_ = true;
bool b_force_zero_latency_ = true;
bool b_force_zero_latency_ = false;
//bool b_device_frame_pitched_ = true;
hipDeviceProp_t hip_dev_prop_;
hipStream_t hip_stream_;