From 4bfd23aa1330c50da686deabcf3c0c9365eb6424 Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Fri, 17 Nov 2023 12:46:27 -0500 Subject: [PATCH] Code clean up - remove unused headers from demuxer, unused ffmpeg dependencies, and redundent info from videodecode sample (#71) [ROCm/rocdecode commit: 071b37b3bd505c60ac2223caf1036b8b93cb99b6] --- projects/rocdecode/README.md | 2 +- projects/rocdecode/rocDecode-setup.py | 4 ++-- projects/rocdecode/samples/videoDecode/CMakeLists.txt | 2 +- projects/rocdecode/samples/videoDecode/README.md | 2 +- projects/rocdecode/samples/videoDecode/videodecode.cpp | 4 ---- projects/rocdecode/samples/videoDecodeFork/README.md | 2 +- projects/rocdecode/samples/videoDecodePerf/README.md | 2 +- projects/rocdecode/utils/video_demuxer.h | 7 +------ 8 files changed, 8 insertions(+), 17 deletions(-) diff --git a/projects/rocdecode/README.md b/projects/rocdecode/README.md index 5bef94993d..31ab0640a9 100644 --- a/projects/rocdecode/README.md +++ b/projects/rocdecode/README.md @@ -74,7 +74,7 @@ The tool provides a few samples to decode videos [here](samples/). Please refer * [FFMPEG](https://ffmpeg.org/about.html) - required to run sample applications & make test ``` - sudo apt install ffmpeg libavcodec-dev libavformat-dev libswscale-dev + sudo apt install ffmpeg ``` ## Docker: diff --git a/projects/rocdecode/rocDecode-setup.py b/projects/rocdecode/rocDecode-setup.py index d173c40c1e..a99b6cb02e 100644 --- a/projects/rocdecode/rocDecode-setup.py +++ b/projects/rocdecode/rocDecode-setup.py @@ -115,7 +115,7 @@ os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' ' + if "Ubuntu" in platfromInfo: os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install vainfo libva-dev libdrm-dev ffmpeg libavcodec-dev libavformat-dev libswscale-dev') + ' install vainfo libva-dev libdrm-dev ffmpeg') else: os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + ' install autoconf automake bzip2 bzip2-devel freetype-devel') @@ -145,7 +145,7 @@ else: ' install libass-devel') os.system('sudo -v') os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + - ' install ffmpeg libavcodec-devel libavformat-devel libswscale-devel') + ' install ffmpeg') elif "centos-8" in platfromInfo or "redhat-8" in platfromInfo: # el8 x86_64 packages os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' '+linuxSystemInstall_check + diff --git a/projects/rocdecode/samples/videoDecode/CMakeLists.txt b/projects/rocdecode/samples/videoDecode/CMakeLists.txt index e447bac4d2..0397888676 100644 --- a/projects/rocdecode/samples/videoDecode/CMakeLists.txt +++ b/projects/rocdecode/samples/videoDecode/CMakeLists.txt @@ -57,7 +57,7 @@ if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND) set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::device) # FFMPEG include_directories(${AVUTIL_INCLUDE_DIR} ${AVCODEC_INCLUDE_DIR} - ${SWSCALE_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR}) + ${AVFORMAT_INCLUDE_DIR}) set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${FFMPEG_LIBRARIES}) # rocDecode include_directories (${ROCDECODE_INCLUDE_DIR}) diff --git a/projects/rocdecode/samples/videoDecode/README.md b/projects/rocdecode/samples/videoDecode/README.md index d0901132d3..08532477b9 100644 --- a/projects/rocdecode/samples/videoDecode/README.md +++ b/projects/rocdecode/samples/videoDecode/README.md @@ -18,7 +18,7 @@ This sample supports both YUV420 8-bit and 10-bit streams. * [FFMPEG](https://ffmpeg.org/about.html) ``` - sudo apt install ffmpeg libavcodec-dev libavformat-dev libswscale-dev + sudo apt install ffmpeg ``` ## Build diff --git a/projects/rocdecode/samples/videoDecode/videodecode.cpp b/projects/rocdecode/samples/videoDecode/videodecode.cpp index bf2eabeafe..e2fad9169c 100644 --- a/projects/rocdecode/samples/videoDecode/videodecode.cpp +++ b/projects/rocdecode/samples/videoDecode/videodecode.cpp @@ -149,10 +149,6 @@ int main(int argc, char **argv) { n_frame += n_frame_returned; } while (n_video_bytes); - std::cout << "info: Video codec format: " << viddec.GetCodecFmtName(viddec.GetCodecId()) << std::endl; - std::cout << "info: Video size: [ " << surf_info->output_width << ", " << surf_info->output_height << " ]" << std::endl; - std::cout << "info: Video surface format: " << viddec.GetSurfaceFmtName(surf_info->surface_format) << std::endl; - std::cout << "info: Video Bit depth: " << surf_info->bit_depth << std::endl; std::cout << "info: Total frame decoded: " << n_frame << std::endl; if (!dump_output_frames) { std::cout << "info: avg decoding time per frame (ms): " << total_dec_time / n_frame << std::endl; diff --git a/projects/rocdecode/samples/videoDecodeFork/README.md b/projects/rocdecode/samples/videoDecodeFork/README.md index 600998686f..7374b5d9e9 100644 --- a/projects/rocdecode/samples/videoDecodeFork/README.md +++ b/projects/rocdecode/samples/videoDecodeFork/README.md @@ -20,7 +20,7 @@ This sample uses fork() to create multiple processes to decode the same input vi * [FFMPEG](https://ffmpeg.org/about.html) ``` - sudo apt install ffmpeg libavcodec-dev libavformat-dev libswscale-dev + sudo apt install ffmpeg ``` ## Build diff --git a/projects/rocdecode/samples/videoDecodePerf/README.md b/projects/rocdecode/samples/videoDecodePerf/README.md index 7b65a956ce..4963cddc92 100644 --- a/projects/rocdecode/samples/videoDecodePerf/README.md +++ b/projects/rocdecode/samples/videoDecodePerf/README.md @@ -20,7 +20,7 @@ This sample uses multiple threads to decode the same input video parallely. * [FFMPEG](https://ffmpeg.org/about.html) ``` - sudo apt install ffmpeg libavcodec-dev libavformat-dev libswscale-dev + sudo apt install ffmpeg ``` ## Build diff --git a/projects/rocdecode/utils/video_demuxer.h b/projects/rocdecode/utils/video_demuxer.h index 99d8473030..14335bf36e 100644 --- a/projects/rocdecode/utils/video_demuxer.h +++ b/projects/rocdecode/utils/video_demuxer.h @@ -26,17 +26,12 @@ THE SOFTWARE. extern "C" { #include #include - #include - #include - #include - #include - #include } #include "rocdecode.h" /*! * \file - * \brief The AMD Video Demuxer for rocDecode Library. + * \brief The AMD Video Demuxer for rocDecode Library. * * \defgroup group_amd_rocdecode_videodemuxer videoDemuxer: AMD rocDecode Video Demuxer API * \brief AMD The rocDecode Video Demuxer API.