From: Jason Garrett-Glaser Date: Sat, 20 Nov 2010 00:58:38 +0000 (-0800) Subject: Add API function to return max number of delayed frames X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=7226b4e7073340c000e94221924b4e45f27a900c;p=x264.git Add API function to return max number of delayed frames --- diff --git a/encoder/encoder.c b/encoder/encoder.c index e0edc495..e8fb3d9f 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -3321,9 +3321,6 @@ void x264_encoder_close ( x264_t *h ) } } -/**************************************************************************** - * x264_encoder_delayed_frames: - ****************************************************************************/ int x264_encoder_delayed_frames( x264_t *h ) { int delayed_frames = 0; @@ -3344,3 +3341,8 @@ int x264_encoder_delayed_frames( x264_t *h ) x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex ); return delayed_frames; } + +int x264_encoder_maximum_delayed_frames( x264_t *h ) +{ + return h->frames.i_delay; +} diff --git a/x264.h b/x264.h index ce79d403..e144e514 100644 --- a/x264.h +++ b/x264.h @@ -39,7 +39,7 @@ #include -#define X264_BUILD 108 +#define X264_BUILD 109 /* x264_t: * opaque handler for encoder */ @@ -766,6 +766,10 @@ void x264_encoder_close ( x264_t * ); * return the number of currently delayed (buffered) frames * this should be used at the end of the stream, to know when you have all the encoded frames. */ int x264_encoder_delayed_frames( x264_t * ); +/* x264_encoder_maximum_delayed_frames( x264_t *h ): + * return the maximum number of delayed (buffered) frames that can occur with the current + * parameters. */ +int x264_encoder_maximum_delayed_frames( x264_t *h ); /* x264_encoder_intra_refresh: * If an intra refresh is not in progress, begin one with the next P-frame. * If an intra refresh is in progress, begin one as soon as the current one finishes.