Commit graph

90 commits

Author SHA1 Message Date
Sebastian Dröge
e6651a733b amc: Allow registering codecs, camera or sensors if any of the others failed
https://bugzilla.gnome.org/show_bug.cgi?id=774048
2016-11-08 13:52:17 +02:00
Sebastian Dröge
3db0fa37b7 amc: Fix call to realloc() to allocate the correct size of items 2016-08-08 11:29:04 +02:00
Sebastian Dröge
8748ce94f4 amc: If we find multiple codecs with the same name, just merge them
On the ODroid C1+ the H265 and H264 have the same name but are listed as two
different codecs. We have to handle them as the same one that supports both,
as otherwise we will register the same GType name twice which fails and we
then only have H265 support and not H264 support.
2016-08-01 19:57:03 +03:00
Sebastian Dröge
cce42ea5a6 amc: Use a GQueue for O(1) append instead of a GList 2016-08-01 10:15:04 +03:00
Sebastian Dröge
74158bbf37 amc: Print generated raw/encoded caps in debug logs 2016-07-29 08:54:00 +03:00
Martin Kelly
a04e6b0cb2 new plugin: Android hardware sensor source
ahssrc is a new plugin that enables Gstreamer to read from the
android.hardware.Sensor Android sensors. These sensors are treated as
buffers and can be passed through and manipulated by the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=768110
2016-07-14 17:13:30 -04:00
Sebastian Dröge
00d961a839 amcaudiodec: Set layout=interleaved in raw audio caps
Otherwise the GAP event fallback negotiation will fail to produce complete
srcpad caps, and thus fail.

https://bugzilla.gnome.org/show_bug.cgi?id=766289
2016-05-11 23:49:36 +03:00
Justin Kim
c8e34e93b2 androidmeida: replace with new surfacetexture for ahcsrc
GstAmcSurfaceTexture is more clear and simple than GstAGSurfaceTexture.

https://bugzilla.gnome.org/show_bug.cgi?id=763099
2016-05-06 09:18:00 +03:00
Sebastian Dröge
610705cbb4 amc: Correctly handle NULL input buffers
https://bugzilla.gnome.org/show_bug.cgi?id=763401
2016-03-11 10:46:10 +02:00
Sebastian Dröge
9132b72c32 amcvideodec: getOutputBuffers() returns a NULL array when a surface was configured
So don't error out if it does.

https://bugzilla.gnome.org/show_bug.cgi?id=763401
2016-03-11 10:46:10 +02:00
Martin Kelly
a7d6c07b86 amc: properly deinit when ahcsrc register fails
In the androidmedia plugin_init, we initialize various resources on the
Android device. If anything fails during this series of initializations,
we need to deinitialize any initializations that already occurred.
However, we don't do so if we fail to register the ahcsrc element. Fix
this.

https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-04 09:42:14 +02:00
Sebastian Dröge
5a3744e86c amc: MediaCodec::getOutputBuffer() can return NULL without exception
Happens when doing zerocopy rendering, or when passing a wrong index to it.
Handle this properly for zerocopy rendering, fail properly for the other
cases.

https://bugzilla.gnome.org/show_bug.cgi?id=760961
2016-01-22 16:13:45 +02:00
Justin Kim
f1809c4d93 ahcsrc: porting from 0.10 to 1.0 2016-01-21 13:49:17 -05:00
Matthieu Bouron
7dbb6681a3 androidmedia: Only allow GL output if the decoder has unknown color formats
If GST_AMC_IGNORE_UNKNOWN_COLOR_FORMATS is set to yes, non-GL output
is still allowed.

https://bugzilla.gnome.org/show_bug.cgi?id=731204
2015-10-21 04:27:43 +11:00
Matthieu Bouron
43b63f304d androidmedia: Add support for GL output in amcvideodec
https://bugzilla.gnome.org/show_bug.cgi?id=731204
2015-10-21 04:27:43 +11:00
Edward Hervey
88cd44fbd8 androidmedia: Fix debug statement (%d for a gsize argument) 2015-10-21 04:27:43 +11:00
Matthieu Bouron
8c46a7704a androidmedia: Improve debug messages 2015-10-21 04:27:43 +11:00
Matthieu Bouron
a038478f1b androidmedia: Do not warn we do not support COLOR_FormatSurface 2015-10-21 04:27:43 +11:00
Sebastian Dröge
b48524c357 amcvideodec: Implement support for COLOR_QCOM_FormatYVU420SemiPlanar32mMultiView for decoding
https://bugzilla.gnome.org/show_bug.cgi?id=756578
2015-10-16 09:12:35 +03:00
Sebastian Dröge
42a1a95f3e androidmedia: Add support for H265/HEVC 2015-07-08 11:42:48 +03:00
Vineeth TM
96d691694a amc: fix check whether we managed to acquire a buffer
https://bugzilla.gnome.org/show_bug.cgi?id=751821
2015-07-02 09:14:45 +01:00
Sebastian Dröge
c51b012991 androidmedia: Prefer software codecs over hardware codecs for audio
Hardware codecs don't make sense for audio and are generally less reliable on
Android than the software codecs.
2015-06-18 14:31:39 +02:00
Sebastian Dröge
6be20ffb79 androidmedia: Move variables into the scope where they are needed 2015-06-15 14:22:00 +02:00
Sebastian Dröge
90c4a6ecd0 androidmedia: Don't query supported color formats for non-video codecs 2015-06-15 12:20:24 +02:00
Sebastian Dröge
d221108857 amc: Only lower ranks of OMX.Exynos. audio codecs, the video codecs are actually working 2015-06-01 20:03:22 +02:00
Sebastian Dröge
bf07b52477 amc: Give marginal rank to codecs that start with OMX.Exynos.
OMX.Exynos. codecs are existing on some devices like the
Galaxy S5 mini, and cause random crashes (of the device,
not the app!) and generally misbehave. That specific device
has other codecs that work with a different name, but let's
just give them marginal rank in case there are devices that
have no other codecs and these are actually the only working
ones
2015-06-01 19:41:21 +02:00
Sebastian Dröge
2e0395aa59 androidmedia: Give lower ranks to codecs not starting with OMX.
On some devices there are codecs that don't start with OMX., while
there are also some that do. And on some of these devices the ones
that don't start with OMX. just crash during initialization while
the others work. To make things even more complicated other devices
have codecs with the same name that work and no alternatives.
So just give a lower rank to these non-OMX codecs and hope that
there's an alternative with a higher rank.

Also stagefright gives codecs starting with OMX. a higher rank too and
considers other codecs that don't start with OMX. as software codecs.
2015-06-01 19:41:21 +02:00
Sebastian Dröge
a6fb482247 androidmedia: Conditionally use get_{input,output}_buffer() Android 21 APIs
Also properly set limit/position on byte buffer, some codecs prefer to have
correct values there.
2015-05-31 21:27:27 +02:00
Matthieu Bouron
3c77fbda87 androidmedia: Add suport for COLOR_FormatYV12
Reference: http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12

https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 12:45:12 +02:00
Matthieu Bouron
21ff3ae0b0 androidmedia: Fix slice-height for Tegra 3 devices
https://bugzilla.gnome.org/show_bug.cgi?id=748867
2015-05-04 10:39:38 +02:00
Edward Hervey
8d41c3e393 androidmedia: Add support for COLOR_FormatYUV420Flexible
https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 09:34:29 +02:00
Edward Hervey
0654442c8f androidmedia: Add suport for Intel color formats
https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 09:34:15 +02:00
Sebastian Dröge
265538ac6e amc: Use new JNI utils almost everywhere 2015-04-11 19:44:34 +02:00
Matthieu Bouron
66f315d6a6 androidmedia: Add more JNI helper functions 2015-03-15 16:28:03 +00:00
Matthieu Bouron
be2378a071 androidmedia: Split jni code to gstjniutils.c 2015-03-15 16:28:03 +00:00
Sebastian Dröge
66a4572c12 androidmedia: Fix calculation of the frame size for COLOR_FormatYUV420Planar
https://bugzilla.gnome.org/show_bug.cgi?id=734156
2014-10-02 10:26:43 +03:00
Sebastian Dröge
74c2e64d5d amc: Properly integrate COLOR_QCOM_FormatYVU420SemiPlanar32m again
https://bugzilla.gnome.org/show_bug.cgi?id=732683
2014-07-03 17:53:33 +02:00
Sebastian Dröge
93bce7aeb7 amcaudiodec: audio/mpeg is always MPEG 1 layer 3
Configuring e.g. layer 2 on such a decoder usually fails unless
it additionally also accepts audio/mpeg-L2.
2014-07-03 15:07:23 +02:00
Sebastian Dröge
337bc06de1 androidmedia: Clear exceptions also when we did not provide a GError 2014-06-20 14:59:12 +02:00
Sebastian Dröge
b44724f662 androidmedia: Actually print the stacktrace into the error string 2014-06-02 12:39:49 +02:00
Sebastian Dröge
40fb09544f androidmedia: Clear the exception before trying to call Java methods to convert it to a string 2014-06-02 11:28:43 +02:00
Sebastian Dröge
0c93a82861 androidmedia: Fix crashes when loading the plugin in a standalone application on Android >= 4.4
Check if libnativehelper is loaded in the process and if
it has these awful wrappers for JNI_CreateJavaVM and
JNI_GetCreatedJavaVMs that crash the app if you don't
create a JniInvocation instance first. If it isn't we
just fail here and don't initialize anything.

See this code for reference:
https://android.googlesource.com/platform/libnativehelper/+/master/JniInvocation.cpp
2014-06-02 11:18:38 +02:00
Sebastian Dröge
f844af2320 androidmedia: Add exceptions from the Java API to error messages, and post more error/warning messages overall 2014-05-30 16:36:11 +02:00
Sebastian Dröge
440574d963 androidmedia: Add a GError argument to all amc methods and catch exceptions there 2014-05-30 15:25:25 +02:00
Sebastian Dröge
22b5abf86c androidmedia: Describe exceptions happening when scanning all codecs 2014-05-30 15:25:21 +02:00
Sebastian Dröge
3cf4c8cad1 androidmedia: Add API to convert an exception into a string 2014-05-30 15:25:21 +02:00
Sebastian Dröge
81716909fe Revert "androidmedia: Place some const keywords in a few places"
This reverts commit 3078b3a34c.

gst_video_frame_map() doesn't take a const GstVideoInfo*, so
all this is rather useless.
2014-05-27 08:51:39 +02:00
Sebastian Dröge
3078b3a34c androidmedia: Place some const keywords in a few places 2014-05-26 16:31:11 +02:00
Chen Jie
8e0bbc9e32 androidmedia: add gst_amc_color_format_copy
gst_amc_color_format_copy will copy in/out a frame resides at a
GstAmcBuffer. Lots of codes in gst_amc_video_*_fill_buffer are moved to
this new function.
2014-05-26 16:29:01 +02:00
Chen Jie
557d6b974f androidmedia: move create_src|sink_caps to gstamc.c
Some hack logic needs also to be present in create_src|sink_caps, for
working around some broken codecs. These hacks are hidden
in color_format/video_format conversion -- the prototypes of these
functions are also changed to include more args for hack judgement.

Also in case of multi-color_formats mapped to one video_format, then
map that video_format back will not give the original color_format, which
causes gst_amc_codec_configure failed with something like
'does not support color format N'.

The new prototype involves with GstAmcCodecInfo and mime, which
ensures the converted color_format is supported by the codec.

A COLOR_FormatYCbYCr to GST_VIDEO_FORMAT_YUY2 mapping is also added, in
order to work around bugs in OMX.k3.video.decoder.avc(which incorrectly
reports supporting COLOR_FormatYCbYCr, which is actually
COLOR_FormatYUV420SemiPlanar). There are already hacks for this in
gst_amc_video_format_to_color_format, gst_amc_color_format_to_video_format
and gst_amc_color_format_info_set, but the codec will still not work(be
ignored because of "has unknown color formats") without adding this mapping.
2014-05-26 16:29:01 +02:00