vlc | branch: master | Steve Lhomme <[email protected]> | Thu Jul 11 17:18:05 2019 +0200| [aee808c442476604846a8a33c48e51a0110957f7] | committer: Steve Lhomme
contrib: crystalhd: fix forward declaration of a struct Clang doesn't like it and warns about setting the callback using this signature. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aee808c442476604846a8a33c48e51a0110957f7 --- contrib/src/crystalhd/callback_proto.patch | 29 +++++++++++++++++++++++++++++ contrib/src/crystalhd/rules.mak | 14 ++++++++++---- modules/codec/crystalhd.c | 7 ++++++- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/contrib/src/crystalhd/callback_proto.patch b/contrib/src/crystalhd/callback_proto.patch new file mode 100644 index 0000000000..3199443f74 --- /dev/null +++ b/contrib/src/crystalhd/callback_proto.patch @@ -0,0 +1,29 @@ +--- libcrystalhd/bc_dts_defs.h.orig 2019-07-12 07:02:21.393012000 +0200 ++++ libcrystalhd/bc_dts_defs.h 2019-07-12 07:01:48.787781100 +0200 +@@ -439,6 +439,8 @@ enum DECODER_CAP_FLAGS + BC_DEC_FLAGS_M4P2 = 0x08, //MPEG-4 Part 2: Divx, Xvid etc. + }; + ++typedef struct _BC_DTS_PROC_OUT BC_DTS_PROC_OUT; ++ + #if defined(__KERNEL__) || defined(__LINUX_USER__) + typedef BC_STATUS (*dts_pout_callback)(void *shnd, U32 width,U32 height, U32 stride, void *pOut); + #else +@@ -449,7 +451,7 @@ typedef BC_STATUS (*dts_pout_callback)(v + //User Data + #define MAX_UD_SIZE 1792 //1920 - 128 + +-typedef struct _BC_DTS_PROC_OUT{ ++struct _BC_DTS_PROC_OUT{ + U8 *Ybuff; /* Caller Supplied buffer for Y data */ + U32 YbuffSz; /* Caller Supplied Y buffer size */ + U32 YBuffDoneSz; /* Transferred Y datasize */ +@@ -478,7 +480,7 @@ typedef struct _BC_DTS_PROC_OUT{ + U8 bRevertScramble; + U32 StrideSzUV; /* Caller supplied Stride Size for UV data */ + +-}BC_DTS_PROC_OUT; ++}; + + typedef struct _BC_DTS_STATUS { + U8 ReadyListCount; /* Number of frames in ready list (reported by driver) */ diff --git a/contrib/src/crystalhd/rules.mak b/contrib/src/crystalhd/rules.mak index a697ac85ae..0227dfe34d 100644 --- a/contrib/src/crystalhd/rules.mak +++ b/contrib/src/crystalhd/rules.mak @@ -13,10 +13,16 @@ CRYSTAL_SOURCES := crystalhd_lgpl_includes_v1.zip .sum-crystalhd: $(CRYSTAL_SOURCES) -.crystalhd: $(CRYSTAL_SOURCES) .sum-crystalhd - mkdir -p -- "$(PREFIX)/include/libcrystalhd" - unzip -o $< -d "$(PREFIX)/include/libcrystalhd" +libcrystalhd: $(CRYSTAL_SOURCES) .sum-crystalhd + $(RM) -R $(UNPACK_DIR) && unzip -o $< -d $(UNPACK_DIR) + chmod -R u+w $(UNPACK_DIR) + $(APPLY) $(SRC)/crystalhd/callback_proto.patch ifdef HAVE_WIN32 # we want dlopening on win32 - rm -rf $(PREFIX)/include/libcrystalhd/bc_drv_if.h + rm -rf $(UNPACK_DIR)/bc_drv_if.h endif + $(MOVE) + +.crystalhd: libcrystalhd + rm -Rf "$(PREFIX)/include/libcrystalhd" + cp -R $< "$(PREFIX)/include" touch $@ diff --git a/modules/codec/crystalhd.c b/modules/codec/crystalhd.c index 98526e175c..691d37c5f2 100644 --- a/modules/codec/crystalhd.c +++ b/modules/codec/crystalhd.c @@ -387,14 +387,19 @@ error: free( p_sys ); } +#if defined(__KERNEL__) || defined(__LINUX_USER__) static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut) { + BC_DTS_PROC_OUT *proc_in = (BC_DTS_PROC_OUT*)pOut; +#else +static BC_STATUS ourCallback(void *shnd, uint32_t width, uint32_t height, uint32_t stride, BC_DTS_PROC_OUT *proc_in) +{ +#endif VLC_UNUSED(width); VLC_UNUSED(height); VLC_UNUSED(stride); decoder_t *p_dec = (decoder_t *)shnd; decoder_sys_t *p_sys = p_dec->p_sys; BC_DTS_PROC_OUT *proc_out = p_sys->proc_out; - BC_DTS_PROC_OUT *proc_in = (BC_DTS_PROC_OUT*)pOut; /* Direct Rendering */ /* Do not allocate for the second-field in the pair, in interlaced */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
