From 6777dd0a61ab78cc9fab92af53558ea44c135056 Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 31 Mar 2022 09:42:56 -0300 Subject: lib: add a function to query the decoder frame delay --- include/dav1d/dav1d.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/dav1d/dav1d.h b/include/dav1d/dav1d.h index fd3b622..bd70303 100644 --- a/include/dav1d/dav1d.h +++ b/include/dav1d/dav1d.h @@ -287,6 +287,21 @@ DAV1D_API int dav1d_get_event_flags(Dav1dContext *c, enum Dav1dEventFlags *flags */ DAV1D_API int dav1d_get_decode_error_data_props(Dav1dContext *c, Dav1dDataProps *out); +/** + * Get the decoder delay, which is the number of internally buffered frames, not + * including reference frames. + * This value is guaranteed to be >= 1 and <= max_frame_delay. + * + * @param c Input settings context. + * + * @return Decoder frame delay on success, or < 0 (a negative DAV1D_ERR code) on + * error. + * + * @note The returned delay is valid only for a Dav1dContext initialized with the + * provided Dav1dSettings. + */ +DAV1D_API int dav1d_get_frame_delay(const Dav1dSettings *s); + # ifdef __cplusplus } # endif -- cgit v1.2.3