<div>i checked the x264 <a href="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/">daily tarball</a>. i found that the function "x264_nal_encode" has changed since 20100705.</div>
<div>before this day ,the function "x264_nal_encode" is defined as </div>
<div><</div>
<div>/****************************************************************************<br> * x264_nal_encode:<br> ****************************************************************************/<br>int x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal, int b_long_startcode )<br>
{<br> uint8_t *src = nal->p_payload;<br> uint8_t *end = nal->p_payload + nal->i_payload;<br> uint8_t *orig_dst = dst;</div>
<div> if( h->param.b_annexb )<br> {<br> if( b_long_startcode )<br> *dst++ = 0x00;<br> *dst++ = 0x00;<br> *dst++ = 0x00;<br> *dst++ = 0x01;<br> }<br> else /* save room for size later */<br>
dst += 4;</div>
<div> /* nal header */<br> *dst++ = ( 0x00 << 7 ) | ( nal->i_ref_idc << 5 ) | nal->i_type;</div>
<div> dst = h->bsf.nal_escape( dst, src, end );<br> int size = (dst - orig_dst) - 4;</div>
<div> /* Write the size header for mp4/etc */<br> if( !h->param.b_annexb )<br> {<br> /* Size doesn't include the size of the header we're writing now. */<br> orig_dst[0] = size>>24;<br>
orig_dst[1] = size>>16;<br> orig_dst[2] = size>> 8;<br> orig_dst[3] = size>> 0;<br> }</div>
<div> return size+4;<br>}</div>
<div>></div>
<div>in the 20100705 daily tarball,the function "x264_nal_encode" was defined as</div>
<div><</div>
<div>/****************************************************************************<br> * x264_nal_encode:<br> ****************************************************************************/<br>void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )<br>
{<br> uint8_t *src = nal->p_payload;<br> uint8_t *end = nal->p_payload + nal->i_payload;<br> uint8_t *orig_dst = dst;</div>
<div> if( h->param.b_annexb )<br> {<br> if( nal->b_long_startcode )<br> *dst++ = 0x00;<br> *dst++ = 0x00;<br> *dst++ = 0x00;<br> *dst++ = 0x01;<br> }<br> else /* save room for size later */<br>
dst += 4;</div>
<div> /* nal header */<br> *dst++ = ( 0x00 << 7 ) | ( nal->i_ref_idc << 5 ) | nal->i_type;</div>
<div> dst = h->bsf.nal_escape( dst, src, end );<br> int size = (dst - orig_dst) - 4;</div>
<div> /* Write the size header for mp4/etc */<br> if( !h->param.b_annexb )<br> {<br> /* Size doesn't include the size of the header we're writing now. */<br> orig_dst[0] = size>>24;<br>
orig_dst[1] = size>>16;<br> orig_dst[2] = size>> 8;<br> orig_dst[3] = size>> 0;<br> }</div>
<div> nal->i_payload = size+4;<br> nal->p_payload = orig_dst;<br>}</div>
<div>><br clear="all">in the plugin-ugly ,the plugin x264enc use the function as </div>
<div><</div>
<div> nal_size = x264_nal_encode (buffer + i_size + 2, &i_data, 0, &nal[sps_ni]);</div>
<div>></div>
<div> </div>
<div>is that mean i can't use the latest version of x264 when i use the lastest version of gstx264enc?<br>-- <br><br>Kang Ho <br></div>