Skip to content

Commit

Permalink
chore: update AviRecord to comply with updated x265 API
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrui333 committed Nov 23, 2024
1 parent 34eb760 commit a6fcb73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/drivers/Qt/AviRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ static int encode_frame( unsigned char *inBuf, int width, int height )
pic->stride[1] = width/2;
pic->stride[2] = width/2;

#ifdef MAX_SCALABLE_LAYERS
/* Handle API changes for scalable layers output in x265 4.0 */
x265_picture *pics[MAX_SCALABLE_LAYERS] = {NULL};
pics[0] = pic;
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, pics );
#else
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, &pic_out );
#endif

if ( ret <= 0 )
{
Expand Down Expand Up @@ -493,7 +500,14 @@ static int close(void)
/* Flush delayed frames */
while( hdl != NULL )
{
#ifdef MAX_SCALABLE_LAYERS
/* Handle API changes for scalable layers output in x265 4.0 */
x265_picture *pics[MAX_SCALABLE_LAYERS] = {NULL};
pics[0] = pic;
ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, pics );
#else
ret = x265_encoder_encode( hdl, &nal, &i_nal, NULL, &pic_out );
#endif

if ( ret <= 0 )
{
Expand Down

0 comments on commit a6fcb73

Please sign in to comment.