[x264-devel] commit: Add API function to return max number of delayed frames ( Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Fri Nov 26 00:57:15 CET 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Fri Nov 19 16:58:38 2010 -0800| [7226b4e7073340c000e94221924b4e45f27a900c] | committer: Jason Garrett-Glaser 

Add API function to return max number of delayed frames

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=7226b4e7073340c000e94221924b4e45f27a900c
---

 encoder/encoder.c |    8 +++++---
 x264.h            |    6 +++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index e0edc49..e8fb3d9 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 ce79d40..e144e51 100644
--- 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.



More information about the x264-devel mailing list