Gstreamer on Android(Qt C++)
doon
don-prog at mail.ru
Mon Apr 18 09:48:39 UTC 2016
saepia wrote
> First of all, try using makefile scripts that come with GStreamer (see
> e.g.
> https://github.com/sdroege/gst-player) instead of trying to reinvent the
> wheel.
>
> Secondly, using C++ with Android may be a bad choice, it's not well
> supported (http://developer.android.com/ndk/guides/cpp-support.html)
>
> m.
>
> 2016-04-15 6:36 GMT-07:00 doon <
> don-prog@
> >:
>
>> I try to use some Gstreamer(1.8.0) plugins in my Qt C++ Android project,
>> but
>> I get a problems with a libraries.
>> First cpp code:
>> G_BEGIN_DECLS
>> GST_PLUGIN_STATIC_DECLARE(coreelements);
>> GST_PLUGIN_STATIC_DECLARE(soup);
>> G_END_DECLS
>> void MainWindow::play(){
>> GST_PLUGIN_STATIC_REGISTER(coreelements);
>> GST_PLUGIN_STATIC_REGISTER(soup);
>> }
>>
>> First error:
>> soup-session.c:631: error: undefined reference to
>> 'g_simple_proxy_resolver_new'
>>
>>
>> Second cpp code:
>> G_BEGIN_DECLS
>> GST_PLUGIN_STATIC_DECLARE(coreelements);
>> GST_PLUGIN_STATIC_DECLARE(androidmedia);
>> G_END_DECLS
>> void MainWindow::play(){
>> GST_PLUGIN_STATIC_REGISTER(coreelements);
>> GST_PLUGIN_STATIC_REGISTER(androidmedia);
>> }
>>
>> Second error:
>> gstvideoencoder.c:284: error: undefined reference to
>> 'gst_preset_get_type'
>>
>>
>> pro file:
>> #...
>> LIBS += -L$$GST_ROOT/lib/gstreamer-1.0/static \
>> -lgstvideo-1.0 \
>> -lgstaudio-1.0 \
>> -lgstcoreelements \
>> -lgstudp \
>> -lgstrtp \
>> -lgstx264 \
>> -lgstlibav \
>> -lgstvideoparsersbad \
>> -lgstvideotestsrc \
>> -lgstplayback \
>> -lgstaudiotestsrc \
>> -lgstaudioconvert \
>> -lgstvideoconvert \
>> -lgstinterleave \
>> -lgstautodetect \
>> -lgstandroidmedia \
>> -lgstphotography-1.0 \
>> -lgstopengl \
>> -lgstopenh264 -lgstogg -lgstfreeverb -lgstx264 -lgstopus
>> -lgstequalizer -lgstencodebin -lgstlibav -lgstspeex -lgstvpx \
>> -lGLESv2 -lEGL \
>> -lgstfaad -lgstsouphttpsrc -lgsttheora -lgstlibvisual
>> -lgstencodebin
>>
>> # Rest of GStreamer dependencies
>> LIBS += -L$$GST_ROOT/lib \
>> -lgstfft-1.0 -lm \
>> -lgstnet-1.0 -lgio-2.0 -lgstgl-1.0 \
>> -lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 \
>> -lgstreamer-1.0 -lgsttag-1.0 -lgstrtp-1.0 -lgstpbutils-1.0 \
>> -lgstvideo-1.0 -lavformat -lavcodec -lavutil -lx264 \
>> -lbz2 -lgobject-2.0 -lfaad -lsoup-2.4 -logg \
>> -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
>> -lorc-0.4
>> -liconv -lffi -lintl -lgstbase-1.0 -ldl -lgthread-2.0 -lxml2
>> -lgstbadbase-1.0
>>
>> LIBS += -L$$GST_ROOT/lib/gio/modules/static -lgnutls -lgnustl
>> -lgiognutls
>> #...
>> How can I solve these errors?
>>
>>
>>
>> --
>> View this message in context:
>> http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-on-Android-Qt-C-tp4676932.html
>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> gstreamer-devel mailing list
>>
> gstreamer-devel at .freedesktop
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at .freedesktop
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Hello!
Thanks, yes, I already saw these makefiles but they all uses gradle, but I
don't know how can I use it with .pro. Anyway I found some solution:
http://stackoverflow.com/a/36640385/2656632
But now I have another problem, I built my project, but have strange problem
with the pads linking. Here is my code:
//...
pipeline = gst_parse_launch("souphttpsrc
location=http://docs.gstreamer.com/media/sintel_trailer-368p.ogv ! oggdemux
! vorbisdec ! audioconvert ! openslessink", &error);
//...
This pipeline works fine on Ubuntu, problem occurs on Android.
If I use uri with ogv video(Theora) and audio(Vorbis) than I get this
GST_DEBUG without audio playback(of course now I need only this, without
Theora):
//...
creating caps event audio/x-vorbis, rate=(int)48000, channels=(int)2,
streamheader=(buffer)<
01766f72626973000000000280bb0000000000008038010000000000b801,
03766f726269731d000000586970682e4f7267206c6962566f726269732049203230303930373039010000001a000000454e434f4445523d66666d706567327468656f72612d302e323401,
05766f7262697321424356010000010018635429469952d24a8919739431469962924a89a5841642489d731453a939d79c6bacb9b52084101a5350290599528e526919639029059952104b492574123a279d63105b49c1d6986b8b41b61c840d9a524c29c494528a420819538c29c594524a420725740e3ae61c538e4a2841b89c73abb59696638ba974924ae724644c42482985924a07a5534e42483596d652291d7352526a41e820841042b620840d82d0905500000100c040101ab20a00500000108aa1188a028486ac020032000004a0288ee2288e233992634916101ab20a00000200100000c07014499114c9b1244bd22c4bd34451557dd5365555f6755dd7755dd7
adding pad 'src_0a053d9b'
trying delayed linking some pad of GstOggDemux named oggdemux0 to some pad
of GstVorbisDec named vorbisdec0
trying to link element oggdemux0:(any) to element vorbisdec0:(any)
trying to link oggdemux0:src_38a00248 and vorbisdec0:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
Could not find a compatible pad to link to oggdemux0:src_38a00248
trying to link oggdemux0:src_0a053d9b and vorbisdec0:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
found pad vorbisdec0:sink
oggdemux0 and vorbisdec0 in same bin, no need for ghost pads
trying to link oggdemux0:src_0a053d9b and vorbisdec0:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
caps are incompatible
link between oggdemux0:src_0a053d9b and vorbisdec0:sink failed: no common
format
trying to link oggdemux0:src_38a00248 and vorbisdec0:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
trying to link oggdemux0:src_0a053d9b and vorbisdec0:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
no such pad 'src_%08x' in element "oggdemux0"
Could not find a compatible pad to link to vorbisdec0:sink
Could not link pads: oggdemux0:(null) - vorbisdec0:(null)
warning: Delayed linking failed.
warning: failed delayed linking some pad of GstOggDemux named oggdemux0 to
some pad of GstVorbisDec named vorbisdec0
posting message: Delayed linking failed.
posted warning message: Delayed linking failed.
//...
But if I use uri with only audio(Vorbis) all works fine.
I also tried to use gst code for making pipeline and elements(instead of
gst_parse_launch), it also works fine on Ubuntu(with audio and video) and on
Android(with audio only). Android output:
//...
found pad demux:sink
creating caps event video/x-theora, width=(int)854, height=(int)366,
framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1,
streamheader=(buffer)<
807468656f72610302010036001700035600016e0002000000180000000100000100000100000000c0c0,
817468656f72612b000000586970682e4f7267206c69627468656f726120312e312032303039303832322028546875736e656c64612900000000,
827468656f7261becd28f7b9cd6b18b5a9494a10739ce6318c5294a42108318c62108421084000000000000000000011f4e1642e5549b47612f570b4986b95a2a9409648a1d047d399b8d66430174b2552912c94462210078391c0d06431168b05628130944621100783a1c0c8602c1509848220f0683014fb9917d69555541412d2d19190504f0f0dcdcc8c8b4b4b4a0a0a08c8c8c787878786464646450505050503c3c3c3c3c3c3c28282828282828281414141414141402100b0a101828333d0c0c0e131a3a3c370e0d1018283945380e11161d3357503e1216253a446d674d182337405168715c31404e
adding pad 'src_38a00248'
found pad demux:sink
creating caps event audio/x-vorbis, rate=(int)48000, channels=(int)2,
streamheader=(buffer)<
01766f72626973000000000280bb0000000000008038010000000000b801,
03766f726269731d000000586970682e4f7267206c6962566f726269732049203230303930373039010000001a000000454e434f4445523d66666d706567327468656f72612d302e323401,
05766f7262697321424356010000010018635429469952d24a8919739431469962924a89a5841642489d731453a939d79c6bacb9b52084101a5350290599528e526919639029059952104b492574123a279d63105b49c1d6986b8b41b61c840d9a524c29c494528a420819538c29c594524a420725740e3ae61c538e4a2841b89c73abb59696638ba974924ae724644c42482985924a07a5534e42483596d652291d7352526a41e820841042b620840d82d0905500000100c040101ab20a00500000108aa1188a028486ac020032000004a0288ee2288e233992634916101ab20a00000200100000c07014499114c9b1244bd22c4bd34451557dd5365555f6755dd7755dd7
adding pad 'src_0a053d9b'
found pad dec:sink
trying to link demux:src_0a053d9b and dec:sink
Expected field 'channel-mask' in structure: audio/x-raw, rate=(int){ 8000,
11025, 12000, 16000, 22050, 24000, 32000, 44100 }, channels=(int)[ 1, 2 ],
layout=(string)interleaved;
caps are incompatible
link between demux:src_0a053d9b and dec:sink failed: no common format
//...
What is the problem?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-on-Android-Qt-C-tp4676932p4676965.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list