diff options
Diffstat (limited to 'common/encode_lavc.h')
-rw-r--r-- | common/encode_lavc.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/encode_lavc.h b/common/encode_lavc.h index a689b1ea47..97c2cf01f1 100644 --- a/common/encode_lavc.h +++ b/common/encode_lavc.h @@ -101,7 +101,12 @@ struct encoder_context *encoder_context_alloc(struct encode_lavc_context *ctx, // After setting your codec parameters on p->encoder, you call this to "open" // the encoder. This also initializes p->mux_stream. Returns false on failure. -bool encoder_init_codec_and_muxer(struct encoder_context *p); +// on_ready is called as soon as the muxer has been initialized. Then you are +// allowed to write packets with encoder_encode(). +// Warning: the on_ready callback is called asynchronously, so you need to +// make sure to properly synchronize everything. +bool encoder_init_codec_and_muxer(struct encoder_context *p, + void (*on_ready)(void *ctx), void *ctx); // Encode the frame and write the packet. frame is ref'ed as need. bool encoder_encode(struct encoder_context *p, AVFrame *frame); |