|
50 | 50 |
|
51 | 51 | #include "debug.h" |
52 | 52 | #include "lib_common.h" |
| 53 | +#include "types.h" // for video_desc, tile |
53 | 54 | #include "utils/misc.h" // for get_cpu_core_count |
54 | 55 | #include "video.h" |
55 | 56 | #include "video_compress.h" |
56 | 57 | #include "utils/video_frame_pool.h" |
57 | 58 | #include "utils/synchronized_queue.h" |
58 | 59 | #include "jpegxs/jpegxs_conv.h" |
| 60 | +#include "video_frame.h" // for video_desc_from_frame |
59 | 61 |
|
60 | 62 | #define DEFAULT_POOL_SIZE 5 |
61 | 63 | #define MOD_NAME "[JPEG XS enc.] " |
@@ -206,6 +208,9 @@ while (true) { |
206 | 208 | continue; |
207 | 209 | } |
208 | 210 |
|
| 211 | + enc_input.user_prv_ctx_ptr = malloc(VF_METADATA_SIZE); |
| 212 | + vf_store_metadata(frame.get(), enc_input.user_prv_ctx_ptr); |
| 213 | + |
209 | 214 | struct tile *in_tile = vf_get_tile(frame.get(), 0); |
210 | 215 | s->convert_to_planar((const uint8_t *) in_tile->data, in_tile->width, in_tile->height, &enc_input.image); |
211 | 216 |
|
@@ -255,7 +260,10 @@ while (true) { |
255 | 260 | s->frames_received++; |
256 | 261 |
|
257 | 262 | shared_ptr<video_frame> out_frame = s->pool.get_frame(); |
258 | | - |
| 263 | + |
| 264 | + vf_restore_metadata(out_frame.get(), enc_output.user_prv_ctx_ptr); |
| 265 | + free(enc_output.user_prv_ctx_ptr); |
| 266 | + |
259 | 267 | struct tile *out_tile = vf_get_tile(out_frame.get(), 0); |
260 | 268 | size_t enc_size = enc_output.bitstream.used_size; |
261 | 269 | if (enc_size > out_tile->data_len) { |
|
0 commit comments