Add API function to return max number of delayed frames
authorJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 20 Nov 2010 00:58:38 +0000 (16:58 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 25 Nov 2010 21:46:16 +0000 (13:46 -0800)
encoder/encoder.c
x264.h

index e0edc49..e8fb3d9 100644 (file)
@@ -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 ce79d40..e144e51 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -39,7 +39,7 @@
 
 #include <stdarg.h>
 
-#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.