if( h->param.rc.psz_stat_in )
h->param.rc.psz_stat_in = strdup( h->param.rc.psz_stat_in );
- x264_set_aspect_ratio( h, param, 1 );
+ x264_set_aspect_ratio( h, &h->param, 1 );
x264_reduce_fraction( &h->param.i_fps_num, &h->param.i_fps_den );
x264_reduce_fraction( &h->param.i_timebase_num, &h->param.i_timebase_den );
for( i=0; x264_cpu_names[i].flags; i++ )
{
if( !strcmp(x264_cpu_names[i].name, "SSE2")
- && param->cpu & (X264_CPU_SSE2_IS_FAST|X264_CPU_SSE2_IS_SLOW) )
+ && h->param.cpu & (X264_CPU_SSE2_IS_FAST|X264_CPU_SSE2_IS_SLOW) )
continue;
if( !strcmp(x264_cpu_names[i].name, "SSE3")
- && (param->cpu & X264_CPU_SSSE3 || !(param->cpu & X264_CPU_CACHELINE_64)) )
+ && (h->param.cpu & X264_CPU_SSSE3 || !(h->param.cpu & X264_CPU_CACHELINE_64)) )
continue;
if( !strcmp(x264_cpu_names[i].name, "SSE4.1")
- && (param->cpu & X264_CPU_SSE42) )
+ && (h->param.cpu & X264_CPU_SSE42) )
continue;
- if( (param->cpu & x264_cpu_names[i].flags) == x264_cpu_names[i].flags
+ if( (h->param.cpu & x264_cpu_names[i].flags) == x264_cpu_names[i].flags
&& (!i || x264_cpu_names[i].flags != x264_cpu_names[i-1].flags) )
p += sprintf( p, " %s", x264_cpu_names[i].name );
}
- if( !param->cpu )
+ if( !h->param.cpu )
p += sprintf( p, " none!" );
x264_log( h, X264_LOG_INFO, "%s\n", buf );
return x264_validate_parameters( h );
}
+/****************************************************************************
+ * x264_encoder_parameters:
+ ****************************************************************************/
+void x264_encoder_parameters( x264_t *h, x264_param_t *param )
+{
+ memcpy( param, &h->thread[h->i_thread_phase]->param, sizeof(x264_param_t) );
+}
+
/* internal usage */
static void x264_nal_start( x264_t *h, int i_type, int i_ref_idc )
{
#include <stdarg.h>
-#define X264_BUILD 82
+#define X264_BUILD 83
/* x264_t:
* opaque handler for encoder */
* if the change should apply to some particular frame, use x264_picture_t->param instead.
* returns 0 on success, negative on parameter validation error. */
int x264_encoder_reconfig( x264_t *, x264_param_t * );
+/* x264_encoder_parameters:
+ * copies the current internal set of parameters to the pointer provided
+ * by the caller. useful when the calling application needs to know
+ * how x264_encoder_open has changed the parameters, or the current state
+ * of the encoder after multiple x264_encoder_reconfig calls.
+ * note that the data accessible through pointers in the returned param struct
+ * (e.g. filenames) should not be modified by the calling application. */
+void x264_encoder_parameters( x264_t *, x264_param_t * );
/* x264_encoder_headers:
* return the SPS and PPS that will be used for the whole stream.
* if i_nal > 0, returns the total size of all NAL payloads.