Skip to content

Commit 4fb2f8e

Browse files
committed
Revert "cmpto_j2k: silence logging in video_frame_pool"
This reverts commit ac450db44219ec67ee96e41528fdef061148ee5f.
1 parent 5ae28bd commit 4fb2f8e

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

src/utils/video_frame_pool.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ struct video_frame_pool::impl {
7373
void deallocate_frame(struct video_frame *frame);
7474

7575
std::unique_ptr<video_frame_pool_allocator> m_allocator = std::unique_ptr<video_frame_pool_allocator>(new default_data_allocator);
76-
bool m_quiet;
7776
std::queue<struct video_frame *> m_free_frames;
7877
std::mutex m_lock;
7978
std::condition_variable m_frame_returned;
@@ -145,8 +144,7 @@ struct video_frame_pool_allocator *default_data_allocator::clone() const {
145144
// \/ | (_| (- (_) __ | | (_| ||| (- __ |_) (_) (_) | . . | ||| |_) |
146145
// | |
147146
video_frame_pool::impl::impl(const video_frame_pool_params &params)
148-
: m_allocator(params.alloc.clone()), m_quiet(params.quiet),
149-
m_max_used_frames(params.max_used_frames)
147+
: m_allocator(params.alloc.clone()), m_max_used_frames(params.max_used_frames)
150148
{
151149
}
152150

@@ -190,8 +188,7 @@ std::shared_ptr<video_frame> video_frame_pool::impl::get_frame() {
190188
ret->tiles[i].data_len = m_max_data_len;
191189
}
192190
} catch (std::exception &e) {
193-
log_msg(m_quiet ? LOG_LEVEL_DEBUG : LOG_LEVEL_ERROR,
194-
MOD_NAME "%s\n", e.what());
191+
MSG(ERROR, "%s\n", e.what());
195192
deallocate_frame(ret);
196193
throw;
197194
}

src/utils/video_frame_pool.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ struct default_data_allocator : public video_frame_pool_allocator {
6262
struct video_frame_pool_params {
6363
unsigned int max_used_frames = 0;
6464
video_frame_pool_allocator const &alloc = default_data_allocator();
65-
bool quiet =
66-
false; ///< if exception thrown, do not print e.what() - the caller
67-
///< is catching the error and will handle the message
6865
};
6966

7067
struct video_frame_pool {

src/video_compress/cmpto_j2k.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ static struct {
368368
static void
369369
set_cpu_pool(struct state_video_compress_j2k *s, bool /*have_cuda_preprocess*/)
370370
{
371-
s->pool = video_frame_pool({ .max_used_frames = s->max_in_frames,
372-
.alloc = default_data_allocator(),
373-
.quiet = true });
371+
s->pool = video_frame_pool(s->max_in_frames, default_data_allocator());
374372
}
375373
#define CPU_CONV_PARAM "j2k-enc-cpu-conv"
376374
ADD_TO_PARAM(
@@ -387,23 +385,19 @@ set_cuda_pool(struct state_video_compress_j2k *s, bool have_cuda_preprocess)
387385
"conversion...\n");
388386
} else if (s->precompress_codec == VC_NONE || have_cuda_preprocess) {
389387
s->pool_in_cuda_memory = true;
390-
s->pool = video_frame_pool(
391-
{ .max_used_frames = s->max_in_frames,
392-
.alloc = cmpto_j2k_enc_cuda_buffer_data_allocator<
393-
cuda_wrapper_malloc, cuda_wrapper_free>(),
394-
.quiet = true });
388+
s->pool = video_frame_pool(
389+
s->max_in_frames,
390+
cmpto_j2k_enc_cuda_buffer_data_allocator<
391+
cuda_wrapper_malloc, cuda_wrapper_free>());
395392
return;
396393
}
397394
s->pool = video_frame_pool(
398-
{ .max_used_frames = s->max_in_frames,
399-
.alloc = cmpto_j2k_enc_cuda_buffer_data_allocator<
400-
cuda_wrapper_malloc_host, cuda_wrapper_free_host>(),
401-
.quiet = true });
395+
s->max_in_frames,
396+
cmpto_j2k_enc_cuda_buffer_data_allocator<cuda_wrapper_malloc_host,
397+
cuda_wrapper_free_host>());
402398
#else
403399
assert(!have_cuda_preprocess); // if CUDA not found, we shouldn't have
404-
s->pool = video_frame_pool({ .max_used_frames = s->max_in_frames,
405-
.alloc = default_data_allocator(),
406-
.quiet = true });
400+
s->pool = video_frame_pool(s->max_in_frames, default_data_allocator());
407401
#endif
408402
}
409403

0 commit comments

Comments
 (0)