Commit f93b7865 authored by Fiona Glaser's avatar Fiona Glaser

Enhance nalu_process

Add the input frame opaque pointer to the arguments.
This makes it easier to use with multiple simultaneous x264 encodes.
parent 05089a37
......@@ -1533,7 +1533,7 @@ static int x264_nal_end( x264_t *h )
* While undefined padding wouldn't actually affect the output, it makes valgrind unhappy. */
memset( end, 0xff, 32 );
if( h->param.nalu_process )
h->param.nalu_process( h, nal );
h->param.nalu_process( h, nal, h->fenc->opaque );
h->out.i_nal++;
return x264_nal_check_buffer( h );
......
......@@ -41,7 +41,7 @@
#include "x264_config.h"
#define X264_BUILD 126
#define X264_BUILD 127
/* Application developers planning to link against a shared library version of
* libx264 from a Microsoft Visual Studio or similar development environment
......@@ -502,8 +502,13 @@ typedef struct x264_param_t
* the calling application is expected to acquire all output NALs through the callback.
*
* It is generally sensible to combine this callback with a use of slice-max-mbs or
* slice-max-size. */
void (*nalu_process) ( x264_t *h, x264_nal_t *nal );
* slice-max-size.
*
* The opaque pointer is the opaque pointer from the input frame associated with this
* NAL unit. This helps distinguish between nalu_process calls from different sources,
* e.g. if doing multiple encodes in one process.
*/
void (*nalu_process) ( x264_t *h, x264_nal_t *nal, void *opaque );
} x264_param_t;
void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment