|
47 | 47 | #include "video_decompress.h" |
48 | 48 | #include "from_planar.h" |
49 | 49 | #include "openapv/from_openapv_conversions.h" |
| 50 | +#include "openapv/openapv_common.hpp" |
50 | 51 |
|
51 | 52 | namespace { |
52 | 53 |
|
@@ -80,7 +81,7 @@ state_video_decompress_openapv::state_video_decompress_openapv() { |
80 | 81 | cdesc.threads = OAPV_CDESC_THREADS_AUTO; |
81 | 82 | decoder_handle = oapvd_create(&cdesc, &ret); |
82 | 83 | if (OAPV_FAILED(ret)) { |
83 | | - throw std::runtime_error("oapvd_create failed (ret=" + std::to_string(ret) + ")"); |
| 84 | + throw std::runtime_error("oapvd_create failed (" + std::string(oapv_err_str(ret)) + ")"); |
84 | 85 | } |
85 | 86 |
|
86 | 87 | decoded_frames.num_frms = MAX_NUM_FRMS; |
@@ -159,7 +160,7 @@ bool configure_with(state_video_decompress_openapv *s, unsigned char *bitstream_ |
159 | 160 |
|
160 | 161 | ret = oapvd_info(bitstream_buffer, codestream_size, &aui); |
161 | 162 | if (OAPV_FAILED(ret) || aui.num_frms != 1) { |
162 | | - log_msg(LOG_LEVEL_ERROR, MOD_NAME "Failed to get APV info (ret=%d, num_frms=%d).\n", ret, aui.num_frms); |
| 163 | + log_msg(LOG_LEVEL_ERROR, MOD_NAME "Failed to get APV info (%s, num_frms=%d).\n", oapv_err_str(ret), aui.num_frms); |
163 | 164 | return false; |
164 | 165 | } |
165 | 166 |
|
@@ -291,7 +292,7 @@ decompress_status openapv_decompress(void *state, unsigned char *dst, unsigned c |
291 | 292 | oapvd_stat_t stat{}; |
292 | 293 | int ret = oapvd_decode(s->decoder_handle, &s->input_buffer, &s->decoded_frames, nullptr, &stat); |
293 | 294 | if (OAPV_FAILED(ret)) { |
294 | | - log_msg(LOG_LEVEL_WARNING, MOD_NAME "oapvd_decode failed ret=%d src_len=%u.\n", ret, src_len); |
| 295 | + log_msg(LOG_LEVEL_WARNING, MOD_NAME "oapvd_decode failed (%s) src_len=%u.\n", oapv_err_str(ret), src_len); |
295 | 296 | return DECODER_NO_FRAME; |
296 | 297 | } |
297 | 298 |
|
|
0 commit comments