Skip to content

Commit 6bdcaed

Browse files
ntocmassiot
authored andcommitted
upipe-x265: fix build with x265 4.0
1 parent 64297e7 commit 6bdcaed

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

lib/upipe-x265/upipe_x265.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
#include <stdint.h>
6363
#include <stdio.h>
6464

65+
#include <x265_config.h>
66+
6567
/* fix undef warnings in x265.h */
6668
#ifndef ENABLE_LIBVMAF
6769
# define ENABLE_LIBVMAF 0
@@ -72,6 +74,15 @@
7274
#ifndef X265_DEPTH
7375
# define X265_DEPTH 0
7476
#endif
77+
#ifndef ENABLE_MULTIVIEW
78+
# define ENABLE_MULTIVIEW 0
79+
#endif
80+
#ifndef ENABLE_ALPHA
81+
# define ENABLE_ALPHA 0
82+
#endif
83+
#ifndef ENABLE_SCC_EXT
84+
# define ENABLE_SCC_EXT 0
85+
#endif
7586

7687
#include <x265.h>
7788
#include <bitstream/itu/h265.h>
@@ -989,6 +1000,12 @@ static bool upipe_x265_handle(struct upipe *upipe,
9891000
bool needopen = false;
9901001
int ret = 0;
9911002

1003+
#if X265_BUILD >= 210 && X265_BUILD < 213
1004+
x265_picture *pic_out[MAX_SCALABLE_LAYERS] = { &pic };
1005+
#else
1006+
x265_picture *pic_out = &pic;
1007+
#endif
1008+
9921009
/* init x265 picture */
9931010
upipe_x265->api->picture_init(&upipe_x265->params, &pic);
9941011

@@ -1078,7 +1095,7 @@ static bool upipe_x265_handle(struct upipe *upipe,
10781095
/* encode frame */
10791096
ret = upipe_x265->api->encoder_encode(upipe_x265->encoder,
10801097
&nals, &nals_num,
1081-
&pic, &pic);
1098+
&pic, pic_out);
10821099

10831100
/* unmap */
10841101
for (i = 0; i < 3; i++)
@@ -1094,7 +1111,7 @@ static bool upipe_x265_handle(struct upipe *upipe,
10941111
/* NULL uref, flushing delayed frame */
10951112
ret = upipe_x265->api->encoder_encode(upipe_x265->encoder,
10961113
&nals, &nals_num,
1097-
NULL, &pic);
1114+
NULL, pic_out);
10981115
if (ret <= 0)
10991116
upipe_x265->delayed_frames = false;
11001117
}

0 commit comments

Comments
 (0)