diff options
author | James Almer <jamrial@gmail.com> | 2021-04-14 20:22:26 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-04-16 16:54:48 +0300 |
commit | a98f5e6056568de9125c1fbb4f63f525b95e30b1 (patch) | |
tree | 0c0e5ffc262decf10a54233cf8793d74a2b4c682 /include | |
parent | 54ad561dfa8d5b450caa2fecc741ca6c44b80e7a (diff) |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/dav1d/dav1d.h | 29 |
1 files changed, 29 insertions, 0 deletions
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 |