From 4fb2f8ebaa0bd199636d5f293dd727e72f9381f9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 21 Nov 2025 11:42:16 +0100 Subject: [PATCH] Revert "cmpto_j2k: silence logging in video_frame_pool" This reverts commit ac450db44219ec67ee96e41528fdef061148ee5f. --- src/utils/video_frame_pool.cpp | 7 ++----- src/utils/video_frame_pool.h | 3 --- src/video_compress/cmpto_j2k.cpp | 24 +++++++++--------------- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/utils/video_frame_pool.cpp b/src/utils/video_frame_pool.cpp index 347f9e0d1..38ffbefb4 100644 --- a/src/utils/video_frame_pool.cpp +++ b/src/utils/video_frame_pool.cpp @@ -73,7 +73,6 @@ struct video_frame_pool::impl { void deallocate_frame(struct video_frame *frame); std::unique_ptr m_allocator = std::unique_ptr(new default_data_allocator); - bool m_quiet; std::queue m_free_frames; std::mutex m_lock; std::condition_variable m_frame_returned; @@ -145,8 +144,7 @@ struct video_frame_pool_allocator *default_data_allocator::clone() const { // \/ | (_| (- (_) __ | | (_| ||| (- __ |_) (_) (_) | . . | ||| |_) | // | | video_frame_pool::impl::impl(const video_frame_pool_params ¶ms) - : m_allocator(params.alloc.clone()), m_quiet(params.quiet), - m_max_used_frames(params.max_used_frames) + : m_allocator(params.alloc.clone()), m_max_used_frames(params.max_used_frames) { } @@ -190,8 +188,7 @@ std::shared_ptr video_frame_pool::impl::get_frame() { ret->tiles[i].data_len = m_max_data_len; } } catch (std::exception &e) { - log_msg(m_quiet ? LOG_LEVEL_DEBUG : LOG_LEVEL_ERROR, - MOD_NAME "%s\n", e.what()); + MSG(ERROR, "%s\n", e.what()); deallocate_frame(ret); throw; } diff --git a/src/utils/video_frame_pool.h b/src/utils/video_frame_pool.h index 630840bef..0dccc0b62 100644 --- a/src/utils/video_frame_pool.h +++ b/src/utils/video_frame_pool.h @@ -62,9 +62,6 @@ struct default_data_allocator : public video_frame_pool_allocator { struct video_frame_pool_params { unsigned int max_used_frames = 0; video_frame_pool_allocator const &alloc = default_data_allocator(); - bool quiet = - false; ///< if exception thrown, do not print e.what() - the caller - ///< is catching the error and will handle the message }; struct video_frame_pool { diff --git a/src/video_compress/cmpto_j2k.cpp b/src/video_compress/cmpto_j2k.cpp index bdbc49446..3b32afd0d 100644 --- a/src/video_compress/cmpto_j2k.cpp +++ b/src/video_compress/cmpto_j2k.cpp @@ -368,9 +368,7 @@ static struct { static void set_cpu_pool(struct state_video_compress_j2k *s, bool /*have_cuda_preprocess*/) { - s->pool = video_frame_pool({ .max_used_frames = s->max_in_frames, - .alloc = default_data_allocator(), - .quiet = true }); + s->pool = video_frame_pool(s->max_in_frames, default_data_allocator()); } #define CPU_CONV_PARAM "j2k-enc-cpu-conv" ADD_TO_PARAM( @@ -387,23 +385,19 @@ set_cuda_pool(struct state_video_compress_j2k *s, bool have_cuda_preprocess) "conversion...\n"); } else if (s->precompress_codec == VC_NONE || have_cuda_preprocess) { s->pool_in_cuda_memory = true; - s->pool = video_frame_pool( - { .max_used_frames = s->max_in_frames, - .alloc = cmpto_j2k_enc_cuda_buffer_data_allocator< - cuda_wrapper_malloc, cuda_wrapper_free>(), - .quiet = true }); + s->pool = video_frame_pool( + s->max_in_frames, + cmpto_j2k_enc_cuda_buffer_data_allocator< + cuda_wrapper_malloc, cuda_wrapper_free>()); return; } s->pool = video_frame_pool( - { .max_used_frames = s->max_in_frames, - .alloc = cmpto_j2k_enc_cuda_buffer_data_allocator< - cuda_wrapper_malloc_host, cuda_wrapper_free_host>(), - .quiet = true }); + s->max_in_frames, + cmpto_j2k_enc_cuda_buffer_data_allocator()); #else assert(!have_cuda_preprocess); // if CUDA not found, we shouldn't have - s->pool = video_frame_pool({ .max_used_frames = s->max_in_frames, - .alloc = default_data_allocator(), - .quiet = true }); + s->pool = video_frame_pool(s->max_in_frames, default_data_allocator()); #endif }