mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 22:40:30 +00:00
Revert "cmpto_j2k: silence logging in video_frame_pool"
This reverts commit ac450db44219ec67ee96e41528fdef061148ee5f.
This commit is contained in:
@@ -73,7 +73,6 @@ struct video_frame_pool::impl {
|
||||
void deallocate_frame(struct video_frame *frame);
|
||||
|
||||
std::unique_ptr<video_frame_pool_allocator> m_allocator = std::unique_ptr<video_frame_pool_allocator>(new default_data_allocator);
|
||||
bool m_quiet;
|
||||
std::queue<struct video_frame *> 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> 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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<cuda_wrapper_malloc_host,
|
||||
cuda_wrapper_free_host>());
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user