@@ -163,7 +163,7 @@ static int parse_fmt(struct state_video_compress_cineform *s, char *fmt) {
163163 if (qual >= 1 && qual <= 6 ){
164164 s->requested_quality = static_cast <CFHD_EncodingQuality>(qual);
165165 } else {
166- log_msg (LOG_LEVEL_ERROR, " [cineform] Error: Quality must be in range 1-6.\n " );
166+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Error: Quality must be in range 1-6.\n " );
167167 return -1 ;
168168 }
169169 } else if (strncasecmp (" threads=" , item, strlen (" threads=" )) == 0 ) {
@@ -173,7 +173,7 @@ static int parse_fmt(struct state_video_compress_cineform *s, char *fmt) {
173173 char *pool_size = item + strlen (" pool_size=" );
174174 s->requested_pool_size = atoi (pool_size);
175175 } else {
176- log_msg (LOG_LEVEL_ERROR, " [cineform] Error: unknown option %s.\n " ,
176+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Error: unknown option %s.\n " ,
177177 item);
178178 return -1 ;
179179 }
@@ -197,19 +197,19 @@ static void * cineform_compress_init(struct module *parent, const char *opts)
197197 return ret > 0 ? INIT_NOERR : nullptr ;
198198 }
199199
200- log_msg (LOG_LEVEL_NOTICE, " [cineform] : Threads: %d.\n " , s->requested_threads );
200+ log_msg (LOG_LEVEL_NOTICE, MOD_NAME " Threads: %d.\n " , s->requested_threads );
201201 CFHD_Error status = CFHD_ERROR_OKAY;
202202 status = CFHD_CreateEncoderPool (&s->encoderPoolRef ,
203203 s->requested_threads ,
204204 s->requested_pool_size ,
205205 nullptr );
206206 if (status != CFHD_ERROR_OKAY){
207- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to create encoder pool\n " );
207+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to create encoder pool\n " );
208208 return nullptr ;
209209 }
210210 status = CFHD_MetadataOpen (&s->metadataRef );
211211 if (status != CFHD_ERROR_OKAY){
212- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to create metadataRef\n " );
212+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to create metadataRef\n " );
213213 CFHD_ReleaseEncoderPool (s->encoderPoolRef );
214214 return nullptr ;
215215 }
@@ -242,7 +242,7 @@ static bool configure_with(struct state_video_compress_cineform *s, struct video
242242 if (s->started ){
243243 status = CFHD_StopEncoderPool (s->encoderPoolRef );
244244 if (status != CFHD_ERROR_OKAY){
245- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to stop encoder pool\n " );
245+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to stop encoder pool\n " );
246246 return false ;
247247 }
248248 }
@@ -267,7 +267,7 @@ static bool configure_with(struct state_video_compress_cineform *s, struct video
267267 }
268268
269269 if (pix_fmt == CFHD_PIXEL_FORMAT_UNKNOWN){
270- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to find suitable pixel format\n " );
270+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to find suitable pixel format\n " );
271271 return false ;
272272 }
273273
@@ -280,7 +280,7 @@ static bool configure_with(struct state_video_compress_cineform *s, struct video
280280 s->requested_quality );
281281
282282 if (status != CFHD_ERROR_OKAY){
283- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to prepare to encode\n " );
283+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to prepare to encode\n " );
284284 return false ;
285285 }
286286
@@ -292,7 +292,7 @@ static bool configure_with(struct state_video_compress_cineform *s, struct video
292292
293293 status = CFHD_AttachEncoderPoolMetadata (s->encoderPoolRef , s->metadataRef );
294294 if (status != CFHD_ERROR_OKAY){
295- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to attach metadata to encoder pool\n " );
295+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to attach metadata to encoder pool\n " );
296296 }
297297
298298 uint32_t fcc_tag = to_fourcc (' U' , ' G' , ' P' , ' F' );
@@ -304,18 +304,18 @@ static bool configure_with(struct state_video_compress_cineform *s, struct video
304304 &val,
305305 false );
306306 if (status != CFHD_ERROR_OKAY){
307- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to add metadata %u\n " , status);
307+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to add metadata %u\n " , status);
308308 }
309309
310310 status = CFHD_AttachEncoderPoolMetadata (s->encoderPoolRef , s->metadataRef );
311311 if (status != CFHD_ERROR_OKAY){
312- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to attach metadata to encoder pool\n " );
312+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to attach metadata to encoder pool\n " );
313313 }
314314
315- log_msg (LOG_LEVEL_INFO, " [cineform] start encoder pool\n " );
315+ log_msg (LOG_LEVEL_INFO, MOD_NAME " Start encoder pool\n " );
316316 status = CFHD_StartEncoderPool (s->encoderPoolRef );
317317 if (status != CFHD_ERROR_OKAY){
318- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to start encoder pool\n " );
318+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to start encoder pool\n " );
319319 return false ;
320320 }
321321
@@ -373,7 +373,7 @@ static void cineform_compress_push(void *state, std::shared_ptr<video_frame> tx)
373373 vc_get_linesize (s->precompress_desc .width , s->precompress_desc .color_spec ),
374374 nullptr );
375375 if (status != CFHD_ERROR_OKAY){
376- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to push null %i pool\n " , status);
376+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to push null %i pool\n " , status);
377377 }
378378 return ;
379379 }
@@ -410,7 +410,7 @@ static void cineform_compress_push(void *state, std::shared_ptr<video_frame> tx)
410410 nullptr );
411411
412412 if (status != CFHD_ERROR_OKAY){
413- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to push sample to encode pool\n " );
413+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to push sample to encode pool\n " );
414414 return ;
415415 }
416416}
@@ -467,7 +467,7 @@ static std::shared_ptr<video_frame> cineform_compress_pop(void *state)
467467 printf (" [cineform] Encoding %u frame took %f milliseconds.\n " , frame_num, t_res.tv_nsec / 1000000.0 );
468468#endif
469469 if (status != CFHD_ERROR_OKAY){
470- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to wait for sample %d\n " , status);
470+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to wait for sample %d\n " , status);
471471 return {};
472472 }
473473
@@ -486,15 +486,15 @@ static std::shared_ptr<video_frame> cineform_compress_pop(void *state)
486486 &encoded_len);
487487 out->tiles [0 ].data_len = encoded_len;
488488 if (status != CFHD_ERROR_OKAY){
489- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to get sample data\n " );
489+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to get sample data\n " );
490490 return {};
491491 }
492492 out->callbacks .dispose_udata = new std::tuple<CFHD_EncoderPoolRef, CFHD_SampleBufferRef>(s->encoderPoolRef , buf);
493493 out->seq = frame_num;
494494
495495 lock.lock ();
496496 if (s->frame_queue .empty ()){
497- log_msg (LOG_LEVEL_ERROR, " [cineform] Failed to pop\n " );
497+ log_msg (LOG_LEVEL_ERROR, MOD_NAME " Failed to pop\n " );
498498 } else {
499499 auto &src = s->frame_queue .front ();
500500 vf_copy_metadata (out.get (), src.get ());
0 commit comments