Skip to content

Commit

Permalink
vcompress: prefix compress frame info with MOD_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Oct 25, 2023
1 parent ae53b2b commit b6bf6b6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/video_compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#include "lib_common.h"
#include "debug.h"

static constexpr const char *MOD_NAME = "[vcompress] ";
#define MOD_NAME "[vcompress] "

using namespace std;

Expand Down Expand Up @@ -249,7 +249,9 @@ compress_state_real::compress_state_real(struct module *parent, const char *conf

auto vci = static_cast<const struct video_compress_info *>(load_library(compress_name.c_str(), LIBRARY_CLASS_VIDEO_COMPRESS, VIDEO_COMPRESS_ABI_VERSION));
if(!vci) {
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Unknown or unavailable compression: " << config_string << "\n";
LOG(LOG_LEVEL_ERROR)
<< MOD_NAME "Unknown or unavailable compression: "
<< config_string << "\n";
throw -1;
}

Expand All @@ -259,7 +261,9 @@ compress_state_real::compress_state_real(struct module *parent, const char *conf
state.resize(1);
state[0] = funcs->init_func(parent, compress_options.c_str());
if(!state[0]) {
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Compression initialization failed: " << config_string << "\n";
LOG(LOG_LEVEL_ERROR)
<< MOD_NAME "Compression initialization failed: "
<< config_string << "\n";
throw -1;
}
if(state[0] == INIT_NOERR) {
Expand Down Expand Up @@ -297,7 +301,8 @@ static bool check_state_count(unsigned tile_count, struct compress_state *proxy)
for (unsigned int i = old_size; i < s->state.size(); ++i) {
s->state[i] = s->funcs->init_func(&proxy->mod, s->compress_options.c_str());
if(!s->state[i]) {
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Compression initialization failed\n";
LOG(LOG_LEVEL_ERROR) << MOD_NAME
"Compression initialization failed\n";
return false;
}
}
Expand Down Expand Up @@ -590,10 +595,9 @@ shared_ptr<video_frame> compress_pop(struct compress_state *proxy)

auto f = proxy->queue.pop();
if (f) {
log_msg(LOG_LEVEL_DEBUG,
"Compressed frame size: %8u; duration: %7.3f ms\n",
vf_get_data_len(f.get()),
(f->compress_end - f->compress_start) / MS_IN_NS_DBL);
MSG(DEBUG, "Compressed frame size: %8u; duration: %7.3f ms\n",
vf_get_data_len(f.get()),
(f->compress_end - f->compress_start) / MS_IN_NS_DBL);
}
return f;
}
Expand Down

0 comments on commit b6bf6b6

Please sign in to comment.