From b738ccf6ba5137da340a6a8465790940ec170165 Mon Sep 17 00:00:00 2001 From: Bartosz Meglicki Date: Wed, 29 Mar 2023 14:02:29 +0200 Subject: [PATCH] Revert "expose NVMPI num_capture_buffers (Jetson specific)" This reverts commit e934d2fc18a885bfbf3d8ce88a88f1e261d06ef2. --- README.md | 5 +---- examples/hve_encode_raw_h264.c | 4 +--- examples/hve_encode_raw_hevc10.c | 5 +---- hve.c | 3 --- hve.h | 1 - 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 91d80f5..6474477 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,6 @@ cd hardware-video-encoder mkdir build cd build cmake .. -# alternatively specify FFMPEG_MODULE_PATH pointing to LGPL FFMPEG -# cmake .. -DFFMPEG_MODULE_PATH=[directory_with_FindFFMPEG.cmake] make ``` @@ -126,8 +124,7 @@ There are just 4 functions and 3 user-visible data types: DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES, BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL, VAAPI_LOW_POWER - NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY, - NVMPI_NUM_CAPTURE_BUFFERS}; + NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY}; struct hve *hardware_encoder=hve_init(&hardware_config); struct hve_frame frame = { 0 }; diff --git a/examples/hve_encode_raw_h264.c b/examples/hve_encode_raw_h264.c index 9f8853f..d358ca9 100644 --- a/examples/hve_encode_raw_h264.c +++ b/examples/hve_encode_raw_h264.c @@ -33,7 +33,6 @@ const int VAAPI_LOW_POWER=0; //alternative VAAPI limited low-power encoding path const char *NVENC_PRESET=NULL; //NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp" const int NVENC_DELAY=0; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency const int NVENC_ZEROLATENCY=0; //NVENC specific no reordering delay if non-zero, enable to minimize latency -const int NVMPI_NUM_CAPTURE_BUFFERS=0; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency int encoding_loop(struct hve *hardware_encoder, FILE *output_file); int process_user_input(int argc, char* argv[]); @@ -51,8 +50,7 @@ int main(int argc, char* argv[]) DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES, BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL, VAAPI_LOW_POWER, - NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY, - NVMPI_NUM_CAPTURE_BUFFERS}; + NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY}; struct hve *hardware_encoder; diff --git a/examples/hve_encode_raw_hevc10.c b/examples/hve_encode_raw_hevc10.c index 41a935e..5a30c67 100644 --- a/examples/hve_encode_raw_hevc10.c +++ b/examples/hve_encode_raw_hevc10.c @@ -33,7 +33,6 @@ const int VAAPI_LOW_POWER=0; //alternative VAAPI limited low-power encoding path const char *NVENC_PRESET=NULL; //NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp" const int NVENC_DELAY=0; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency const int NVENC_ZEROLATENCY=0; //NVENC specific no reordering delay if non-zero, enable to minimize latency -const int NVMPI_NUM_CAPTURE_BUFFERS=0; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency int encoding_loop(struct hve *hardware_encoder, FILE *output_file); int process_user_input(int argc, char* argv[]); @@ -51,9 +50,7 @@ int main(int argc, char* argv[]) DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES, BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL, VAAPI_LOW_POWER, - NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY, - NVMPI_NUM_CAPTURE_BUFFERS}; - + NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY}; struct hve *hardware_encoder; //prepare file for raw HEVC output diff --git a/hve.c b/hve.c index 18859be..4a108f9 100644 --- a/hve.c +++ b/hve.c @@ -137,9 +137,6 @@ struct hve *hve_init(const struct hve_config *config) if(config->nvenc_zerolatency && (av_dict_set_int(&opts, "zerolatency", config->nvenc_zerolatency != 0 , 0) < 0)) return hve_close_and_return_null(h, "failed to initialize option dictionary (NVENC zerolatency)"); - if(config->nvmpi_num_capture_buffers && (av_dict_set_int(&opts, "num_capture_buffers", config->nvmpi_num_capture_buffers, 0) < 0)) - return hve_close_and_return_null(h, "failed to initialize option dictionary (NVMPI num_capture_buffers)"); - if((err = avcodec_open2(h->avctx, codec, &opts)) < 0) { av_dict_free(&opts); diff --git a/hve.h b/hve.h index 3e927ac..d0b1065 100644 --- a/hve.h +++ b/hve.h @@ -202,7 +202,6 @@ struct hve_config const char *nvenc_preset; //!< NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp" int nvenc_delay; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency int nvenc_zerolatency; //NVENC specific no reordering delay if non-zero, enable to minimize latency - int nvmpi_num_capture_buffers; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency }; /**