From a98f5e6056568de9125c1fbb4f63f525b95e30b1 Mon Sep 17 00:00:00 2001 From: James Almer Date: Wed, 14 Apr 2021 14:22:26 -0300 Subject: dav1d: add event flags to the decoding process And a function to fetch them. Should be useful to signal changes in the bitstream the user may want to know about. Starting with two flags, DAV1D_EVENT_FLAG_NEW_SEQUENCE and DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO, which signal the presence of an updated sequence header in the last returned (or to be returned) picture. --- include/dav1d/dav1d.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include') diff --git a/include/dav1d/dav1d.h b/include/dav1d/dav1d.h index 165e1c0..97852dc 100644 --- a/include/dav1d/dav1d.h +++ b/include/dav1d/dav1d.h @@ -202,6 +202,35 @@ DAV1D_API void dav1d_close(Dav1dContext **c_out); */ DAV1D_API void dav1d_flush(Dav1dContext *c); +enum Dav1dEventFlags { + /** + * The last returned picture contains a reference to a new Sequence Header, + * either because it's the start of a new coded sequence, or the decoder was + * flushed before it was generated. + */ + DAV1D_EVENT_FLAG_NEW_SEQUENCE = 1 << 0, + /** + * The last returned picture contains a reference to a Sequence Header with + * new operating parameters information for the current coded sequence. + */ + DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO = 1 << 1, +}; + +/** + * Fetch a combination of DAV1D_EVENT_FLAG_* event flags generated by the decoding + * process. + * + * @param c Input decoder instance. + * @param flags Where to write the flags. + * + * @return 0 on success, or < 0 (a negative DAV1D_ERR code) on error. + * + * @note Calling this function will clear all the event flags currently stored in + * the decoder. + * + */ +DAV1D_API int dav1d_get_event_flags(Dav1dContext *c, enum Dav1dEventFlags *flags); + # ifdef __cplusplus } # endif -- cgit v1.2.3