Skip to content

Commit e00b8ea

Browse files
Gijs Peskensagherzan
authored andcommitted
rpidistro-vlc: Fix compilation on Whinlatter
Various backports (i.e.: taglib), casts, etc. to fix compilation on Whinlatter against rpidistro-ffmpeg (upstream ffmpeg changes not backported) Signed-off-by: Gijs Peskens <[email protected]>
1 parent b9d649e commit e00b8ea

File tree

2 files changed

+283
-3
lines changed

2 files changed

+283
-3
lines changed
Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
Upstream-Status: Pending
2+
3+
diff --git a/include/vlc_common.h b/include/vlc_common.h
4+
index 84fb6164e..69d94383e 100644
5+
--- a/include/vlc_common.h
6+
+++ b/include/vlc_common.h
7+
@@ -112,7 +112,6 @@
8+
#ifdef __GNUC__
9+
# define likely(p) __builtin_expect(!!(p), 1)
10+
# define unlikely(p) __builtin_expect(!!(p), 0)
11+
-# define unreachable() __builtin_unreachable()
12+
#else
13+
# define likely(p) (!!(p))
14+
# define unlikely(p) (!!(p))
15+
diff --git a/modules/codec/spudec/spudec.c b/modules/codec/spudec/spudec.c
16+
index 3abdbf49d..160c46eb0 100644
17+
--- a/modules/codec/spudec/spudec.c
18+
+++ b/modules/codec/spudec/spudec.c
19+
@@ -160,7 +160,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
20+
block_ChainRelease( p_spu_block );
21+
22+
/* Parse and decode */
23+
- ParsePacket( p_dec, decoder_QueueSub );
24+
+ ParsePacket( p_dec, (void (*)(decoder_t *, subpicture_t *))decoder_QueueSub );
25+
26+
/* reinit context */
27+
p_sys->i_spu_size = 0;
28+
diff --git a/modules/demux/mpeg/ts_pid.c b/modules/demux/mpeg/ts_pid.c
29+
index 7a7084fd5..a08e79281 100644
30+
--- a/modules/demux/mpeg/ts_pid.c
31+
+++ b/modules/demux/mpeg/ts_pid.c
32+
@@ -101,7 +101,7 @@ ts_pid_t * ts_pid_Get( ts_pid_list_t *p_list, uint16_t i_pid )
33+
pidkey.pp_last = NULL;
34+
35+
ts_pid_t **pp_pidk = bsearch( &pidkey, p_list->pp_all, p_list->i_all,
36+
- sizeof(ts_pid_t *), ts_bsearch_searchkey_Compare );
37+
+ sizeof(ts_pid_t *), (int (*)(const void *, const void *))ts_bsearch_searchkey_Compare );
38+
if ( pp_pidk )
39+
p_pid = *pp_pidk;
40+
else
41+
diff --git a/modules/hw/mmal/mmal_cma.c b/modules/hw/mmal/mmal_cma.c
42+
index 1a35b1896..fcde00035 100644
43+
--- a/modules/hw/mmal/mmal_cma.c
44+
+++ b/modules/hw/mmal/mmal_cma.c
45+
@@ -419,7 +419,7 @@ static void * cma_pool_alloc_cb(void * v, size_t size)
46+
return NULL;
47+
48+
*cb = (cma_buf_t){
49+
- .ref_count = ATOMIC_VAR_INIT(0),
50+
+ .ref_count = (0),
51+
.cbp = cbp,
52+
.in_flight = 0,
53+
.size = size,
54+
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
55+
index ffe712e29..9059db253 100644
56+
--- a/modules/meta_engine/taglib.cpp
57+
+++ b/modules/meta_engine/taglib.cpp
58+
@@ -122,7 +122,11 @@ VLCTagLib::ExtResolver<T>::ExtResolver(const std::string & ext) : FileTypeResolv
59+
template <class T>
60+
File *VLCTagLib::ExtResolver<T>::createFile(FileName fileName, bool, AudioProperties::ReadStyle) const
61+
{
62+
+#if defined(_WIN32) && TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
63+
+ std::string filename = fileName.toString().to8Bit(true);
64+
+#else
65+
std::string filename = std::string(fileName);
66+
+#endif
67+
std::size_t namesize = filename.size();
68+
69+
if (namesize > ext.length())
70+
@@ -177,12 +181,16 @@ public:
71+
return m_stream->psz_location;
72+
}
73+
74+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
75+
+ ByteVector readBlock(size_t length)
76+
+#else
77+
ByteVector readBlock(ulong length)
78+
+#endif
79+
{
80+
ByteVector res(length, 0);
81+
ssize_t i_read = vlc_stream_Read( m_stream, res.data(), length);
82+
if (i_read < 0)
83+
- return ByteVector::null;
84+
+ return {};
85+
else if ((size_t)i_read != length)
86+
res.resize(i_read);
87+
return res;
88+
@@ -193,11 +201,19 @@ public:
89+
// Let's stay Read-Only for now
90+
}
91+
92+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
93+
+ void insert(const ByteVector&, offset_t, size_t)
94+
+#else
95+
void insert(const ByteVector&, ulong, ulong)
96+
+#endif
97+
{
98+
}
99+
100+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
101+
+ void removeBlock(offset_t, size_t)
102+
+#else
103+
void removeBlock(ulong, ulong)
104+
+#endif
105+
{
106+
}
107+
108+
@@ -211,7 +227,11 @@ public:
109+
return true;
110+
}
111+
112+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
113+
+ void seek(offset_t offset, Position p)
114+
+#else
115+
void seek(long offset, Position p)
116+
+#endif
117+
{
118+
uint64_t pos = 0;
119+
switch (p)
120+
@@ -234,12 +254,20 @@ public:
121+
return;
122+
}
123+
124+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
125+
+ offset_t tell() const
126+
+#else
127+
long tell() const
128+
+#endif
129+
{
130+
return m_previousPos;
131+
}
132+
133+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
134+
+ offset_t length()
135+
+#else
136+
long length()
137+
+#endif
138+
{
139+
uint64_t i_size;
140+
if (vlc_stream_GetSize( m_stream, &i_size ) != VLC_SUCCESS)
141+
@@ -247,7 +275,11 @@ public:
142+
return i_size;
143+
}
144+
145+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
146+
+ void truncate(offset_t)
147+
+#else
148+
void truncate(long)
149+
+#endif
150+
{
151+
}
152+
153+
@@ -778,15 +810,15 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_meta_t *p_demux_meta, vlc_meta
154+
{
155+
MP4::Item list;
156+
#define SET( keyName, metaName ) \
157+
- if( tag->itemListMap().contains(keyName) ) \
158+
+ if( tag->contains(keyName) ) \
159+
{ \
160+
- list = tag->itemListMap()[keyName]; \
161+
+ list = tag->item(keyName); \
162+
vlc_meta_Set##metaName( p_meta, list.toStringList().front().toCString( true ) ); \
163+
}
164+
#define SET_EXTRA( keyName, metaName ) \
165+
- if( tag->itemListMap().contains(keyName) ) \
166+
- { \
167+
- list = tag->itemListMap()[keyName]; \
168+
+ if( tag->contains(keyName) ) \
169+
+ { \
170+
+ list = tag->item(keyName); \
171+
vlc_meta_AddExtra( p_meta, metaName, list.toStringList().front().toCString( true ) ); \
172+
}
173+
174+
@@ -796,17 +828,17 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_meta_t *p_demux_meta, vlc_meta
175+
#undef SET
176+
#undef SET_EXTRA
177+
178+
- if( tag->itemListMap().contains("covr") )
179+
+ if( tag->contains("covr") )
180+
{
181+
- MP4::CoverArtList list = tag->itemListMap()["covr"].toCoverArtList();
182+
- const char *psz_format = list[0].format() == MP4::CoverArt::PNG ? "image/png" : "image/jpeg";
183+
+ MP4::CoverArtList cover_list = tag->item("covr").toCoverArtList();
184+
+ const char *psz_format = cover_list[0].format() == MP4::CoverArt::PNG ? "image/png" : "image/jpeg";
185+
186+
msg_Dbg( p_demux_meta, "Found embedded art (%s) is %i bytes",
187+
- psz_format, list[0].data().size() );
188+
+ psz_format, cover_list[0].data().size() );
189+
190+
input_attachment_t *p_attachment =
191+
vlc_input_attachment_New( "cover", psz_format, "cover",
192+
- list[0].data().data(), list[0].data().size() );
193+
+ cover_list[0].data().data(), cover_list[0].data().size() );
194+
if( p_attachment )
195+
{
196+
TAB_APPEND_CAST( (input_attachment_t**),
197+
@@ -894,7 +926,7 @@ static int ReadMeta( vlc_object_t* p_this)
198+
Tag* p_tag = f.tag();
199+
200+
#define SET( tag, meta ) \
201+
- if( !p_tag->tag().isNull() && !p_tag->tag().isEmpty() ) \
202+
+ if( !p_tag->tag().isEmpty() ) \
203+
vlc_meta_Set##meta( p_meta, p_tag->tag().toCString(true) )
204+
#define SETINT( tag, meta ) \
205+
if( p_tag->tag() ) \
206+
@@ -971,7 +1003,7 @@ static int ReadMeta( vlc_object_t* p_this)
207+
if( RIFF::AIFF::File* riff_aiff = dynamic_cast<RIFF::AIFF::File*>(f.file()) )
208+
ReadMetaFromId3v2( riff_aiff->tag(), p_demux_meta, p_meta );
209+
else if( RIFF::WAV::File* riff_wav = dynamic_cast<RIFF::WAV::File*>(f.file()) )
210+
- ReadMetaFromId3v2( riff_wav->tag(), p_demux_meta, p_meta );
211+
+ ReadMetaFromId3v2( riff_wav->ID3v2Tag(), p_demux_meta, p_demux_meta->p_meta );
212+
}
213+
else if( TrueAudio::File* trueaudio = dynamic_cast<TrueAudio::File*>(f.file()) )
214+
{
215+
@@ -1295,7 +1327,11 @@ static int WriteMeta( vlc_object_t *p_this )
216+
if( RIFF::AIFF::File* riff_aiff = dynamic_cast<RIFF::AIFF::File*>(f.file()) )
217+
WriteMetaToId3v2( riff_aiff->tag(), p_item );
218+
else if( RIFF::WAV::File* riff_wav = dynamic_cast<RIFF::WAV::File*>(f.file()) )
219+
+#if TAGLIB_VERSION >= VERSION_INT(2, 0, 0)
220+
+ WriteMetaToId3v2( riff_wav->ID3v2Tag(), p_item );
221+
+#else
222+
WriteMetaToId3v2( riff_wav->tag(), p_item );
223+
+#endif
224+
}
225+
else if( TrueAudio::File* trueaudio = dynamic_cast<TrueAudio::File*>(f.file()) )
226+
{
227+
diff --git a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c
228+
index 0fd255fe5..d37bb4f96 100644
229+
--- a/modules/spu/dynamicoverlay/dynamicoverlay_commands.c
230+
+++ b/modules/spu/dynamicoverlay/dynamicoverlay_commands.c
231+
@@ -231,7 +231,7 @@ static int parser_SetTextAlpha( char *psz_command, char *psz_end,
232+
skip_space( &psz_command );
233+
if( isdigit( (unsigned char)*psz_command ) )
234+
{
235+
- if( parse_digit( &psz_command, &p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC )
236+
+ if( parse_digit( &psz_command, (int32_t *)&p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC )
237+
return VLC_EGENERIC;
238+
}
239+
return VLC_SUCCESS;
240+
diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c
241+
index 1f0c6ba51..64afc3d00 100644
242+
--- a/modules/video_chroma/swscale.c
243+
+++ b/modules/video_chroma/swscale.c
244+
@@ -607,7 +607,7 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
245+
p_dst, i_plane_count, b_swap_uvo );
246+
247+
#if LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)
248+
- sws_scale( ctx, src, src_stride, 0, i_height,
249+
+ sws_scale( ctx, (const uint8_t * const*)src, src_stride, 0, i_height,
250+
dst, dst_stride );
251+
#else
252+
sws_scale_ordered( ctx, src, src_stride, 0, i_height,
253+
diff --git a/modules/video_filter/deinterlace/algo_yadif.c b/modules/video_filter/deinterlace/algo_yadif.c
254+
index 4d130cb27..7d2189fe9 100644
255+
--- a/modules/video_filter/deinterlace/algo_yadif.c
256+
+++ b/modules/video_filter/deinterlace/algo_yadif.c
257+
@@ -134,7 +134,7 @@ int RenderYadif( filter_t *p_filter, picture_t *p_dst, picture_t *p_src,
258+
filter = yadif_filter_line_c;
259+
260+
if( p_sys->chroma->pixel_size == 2 )
261+
- filter = yadif_filter_line_c_16bit;
262+
+ filter = (void (*)(uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int))yadif_filter_line_c_16bit;
263+
264+
for( int n = 0; n < p_dst->i_planes; n++ )
265+
{
266+
diff --git a/src/input/input.c b/src/input/input.c
267+
index d2f006587..e48902f1a 100644
268+
--- a/src/input/input.c
269+
+++ b/src/input/input.c
270+
@@ -906,7 +906,7 @@ static void InitTitle( input_thread_t * p_input )
271+
vlc_mutex_lock( &priv->p_item->lock );
272+
/* Create global title (from master) */
273+
priv->i_title = p_master->i_title;
274+
- priv->title = p_master->title;
275+
+ priv->title = (const input_title_t **)p_master->title;
276+
priv->i_title_offset = p_master->i_title_offset;
277+
priv->i_seekpoint_offset = p_master->i_seekpoint_offset;
278+
if( priv->i_title > 0 )

dynamic-layers/multimedia-layer/recipes-multimedia/rpidistro-vlc/rpidistro-vlc_3.0.17.bb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ SRC_URI = "\
2828
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '', 'file://3008-vo-Makefile.am-exclude-libgl_plugin.patch', d)} \
2929
file://3009-vo-converter_vaapi-Fix-EGL-macro-undeclared.patch \
3030
file://3010-po-Fix-typos-in-oc.po-for-gettext-compatibility.patch \
31+
file://3011-fix_whinlatter_compilation.patch \
3132
"
3233

3334
SRCREV = "b276eb0d7bc3213363e97dbb681ef7c927be6c73"
@@ -36,7 +37,7 @@ PROVIDES = "vlc"
3637
RPROVIDES:${PN} = "${PROVIDES}"
3738
DEPENDS = "coreutils-native fribidi libtool libgcrypt libgcrypt-native \
3839
dbus libxml2 gnutls tremor faad2 ffmpeg flac alsa-lib libidn \
39-
jpeg xz libmodplug mpeg2dec libmtp libopus orc libsamplerate0 \
40+
jpeg xz libmodplug libmtp libopus orc libsamplerate0 \
4041
avahi libusb1 schroedinger taglib tiff"
4142

4243
inherit autotools gettext pkgconfig mime-xdg
@@ -67,10 +68,10 @@ PACKAGECONFIG ?= "\
6768
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)} \
6869
${@bb.utils.contains_any('DISTRO_FEATURES', 'x11', 'notify', '', d)} \
6970
live555 dv1394 fontconfig fluidsynth freetype png udev \
70-
x264 alsa harfbuzz jack neon fribidi dvbpsi a52 v4l2 \
71+
x264 alsa harfbuzz jack neon fribidi dvbpsi v4l2 \
7172
"
7273

73-
PACKAGECONFIG[mmal] = "--enable-omxil --enable-omxil-vout --enable-rpi-omxil --enable-mmal --enable-mmal-avcodec,,userland"
74+
PACKAGECONFIG[mmal] = "--enable-omxil --enable-omxil-vout --enable-rpi-omxil --enable-mmal --disable-mmal-avcodec,,userland"
7475
PACKAGECONFIG[x264] = "--enable-x264,--disable-x264,x264"
7576
PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
7677
PACKAGECONFIG[a52] = "--enable-a52,--disable-a52,liba52"
@@ -161,3 +162,4 @@ COMPATIBLE_HOST = "null"
161162
COMPATIBLE_HOST:rpi = "(.*)"
162163

163164
INSANE_SKIP:${PN} = "dev-so"
165+
INSANE_SKIP:libvlc += "buildpaths"

0 commit comments

Comments
 (0)