[x264-devel] Pass through user data

Kieran Kunhya git at videolan.org
Tue Dec 6 01:00:46 CET 2011


x264 | branch: master | Kieran Kunhya <kieran at kunhya.com> | Fri Nov  4 20:09:13 2011 +0000| [00df989cc06208050230756525633438d76b5a6a] | committer: Jason Garrett-Glaser

Pass through user data

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

 common/frame.c    |    1 +
 common/frame.h    |    3 +++
 encoder/encoder.c |    2 ++
 x264.h            |    5 ++---
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/common/frame.c b/common/frame.c
index 04e8afa..3d82627 100644
--- a/common/frame.c
+++ b/common/frame.c
@@ -353,6 +353,7 @@ int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src )
     dst->param      = src->param;
     dst->i_pic_struct = src->i_pic_struct;
     dst->extra_sei  = src->extra_sei;
+    dst->opaque     = src->opaque;
 
     uint8_t *pix[3];
     int stride[3];
diff --git a/common/frame.h b/common/frame.h
index 0ee68cb..37878f5 100644
--- a/common/frame.h
+++ b/common/frame.h
@@ -162,6 +162,9 @@ typedef struct x264_frame
 
     /* user sei */
     x264_sei_t extra_sei;
+
+    /* user data */
+    void *opaque;
 } x264_frame_t;
 
 /* synchronized frame list */
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 72d716f..b1a99e6 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -3108,6 +3108,8 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
     if( pic_out->i_pts < pic_out->i_dts )
         x264_log( h, X264_LOG_WARNING, "invalid DTS: PTS is less than DTS\n" );
 
+    pic_out->opaque = h->fenc->opaque;
+
     pic_out->img.i_csp = h->fdec->i_csp;
 #if HIGH_BIT_DEPTH
     pic_out->img.i_csp |= X264_CSP_HIGH_DEPTH;
diff --git a/x264.h b/x264.h
index 5e88e48..c95c1f2 100644
--- a/x264.h
+++ b/x264.h
@@ -41,7 +41,7 @@
 
 #include "x264_config.h"
 
-#define X264_BUILD 119
+#define X264_BUILD 120
 
 /* x264_t:
  *      opaque handler for encoder */
@@ -724,8 +724,7 @@ typedef struct
     x264_hrd_t hrd_timing;
     /* In: arbitrary user SEI (e.g subtitles, AFDs) */
     x264_sei_t extra_sei;
-    /* private user data. libx264 doesn't touch this,
-       not even copy it from input to output frames. */
+    /* private user data. copied from input to output frames. */
     void *opaque;
 } x264_picture_t;
 



More information about the x264-devel mailing list