Commit graph

162 commits

Author SHA1 Message Date
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
Sebastian Dröge
8bacecfb08 amcaudiodec: Add an output adapter for chunking the output into codec frames
Otherwise the base class will be confused.
See https://bugzilla.gnome.org/show_bug.cgi?id=685730
2015-05-19 19:12:41 +03: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
bd21df1056 androidmedia: Declare QOMX_COLOR_FORMATYVU420PackedSemiPlanar32mMultiView constant
This color format is the same as QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m
but stores two images one after the other in a top-bottom layout.

https://bugzilla.gnome.org/show_bug.cgi?id=747126
2015-05-04 12:44:56 +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
Tim-Philipp Müller
699452ef31 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:59:32 +01:00
Sebastian Dröge
774866ad62 androidmedia: Handle queue/release errors non-fatal
They can happen sometimes as a transient problem, e.g. if there
is a problem in the stream. Only handle them as fatal if many of
them happen in a row.
2015-04-17 20:11:46 +02:00
Sebastian Dröge
265538ac6e amc: Use new JNI utils almost everywhere 2015-04-11 19:44:34 +02:00
Sebastian Dröge
7fb0fafed2 amc: Allow creating global and local references of objects 2015-04-11 19:37:34 +02:00
Sebastian Dröge
6c7b64f90c amc: Make GError argument order more consistent 2015-04-11 19:37:34 +02:00
Sebastian Dröge
448867f0aa amc: Add helper function for getting a direct buffer array 2015-04-11 19:37:20 +02:00
Sebastian Dröge
0dbf5d322f amc: Java longs are gint64s 2015-04-11 19:37:20 +02:00
Sebastian Dröge
0914ee4a07 amc: Improve JNI utilities and add some missing ones
We now fill GErrors for everything that could throw an exception, and method
calls now always return a gboolean and their value in an out-parameter to
distinguish failures from other values.
2015-04-11 19:37:20 +02:00
Sebastian Dröge
35ef602b7d androidmedia: Add helpers for calling static methods 2015-03-15 16:59:25 +00:00
Sebastian Dröge
1580336152 androidmedia: Fix indention 2015-03-15 16:41:12 +00: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
Edward Hervey
4b5d3a97ba androidmedia: Remove unused label/variable 2015-03-11 10:17:53 +01: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
Anuj Jaiswal
593f7d520e androidmedia: break statements unnecessary
Code flow never arrives to the break statements due to the goto's. So the
breaks are unecessary. Second part to commit a3958ae65b

https://bugzilla.gnome.org/show_bug.cgi?id=736940
2014-09-24 12:17:41 +01:00
Anuj Jaiswal
a3958ae65b androidmedia: break statement unnecessary
Code flow never arrives to the break statements due to the goto's. So the
breaks are unecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=736942
2014-09-24 12:12:16 +01:00
Sebastian Dröge
f5e73d2808 amcaudiodec: Remove hack for Google MP3 decoder
The first buffer does not contain more garbage than any other MP3 decoder
outputs and we don't really know how much we have to drop or not.

After this change the output has the same duration as with mad.
2014-09-01 17:44:04 +03:00
Sebastian Dröge
8f25220b9c androidmedia: Make sure to unblock any thread waiting on the drain condition variable when errors happen 2014-08-14 15:27:21 +03:00
Sebastian Dröge
ca62186797 androidmedia: Fix draining logic to let the base class handle EOS events
https://bugzilla.gnome.org//show_bug.cgi?id=734775
2014-08-14 15:27:21 +03:00
Sebastian Rasmussen
c1d5aa3da5 amcvideoenc: Avoid leaking copy of caps object
gst_pad_get_pad_template_caps() returns a reference which is unreferenced,
so creating a copy using gst_caps_copy() results in a reference leak.
Also remove the incorrect comment to avoid confusion in the future.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734533
2014-08-10 12:11:10 +01: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
aee9d12b86 androidmedia: Also don't report warnings for queue/dequeue errors during flushing in error cases
... and fix a case where we released an invalid buffer index.
2014-06-19 18:34:05 +02:00
Sebastian Dröge
880f3d8a18 androidmedia: Don't consider input buffer queueing failures as an error during flushing 2014-06-19 18:34:05 +02:00
Sebastian Dröge
71c0e0e19f androidmedia: Clean up flushing code and don't consider output buffer releasing failures during flushing as an error 2014-06-19 18:34:05 +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
Jorge Zapata
ad82575693 Release the codec before freeing it
On Samsung Galaxy S4 it is impossible to have more than one
hardware decoder at the same time. If we do not release it
explicitly the GC only releases it whenever the whole application
is finished not whenever the activity is finished and thus a player
will not be able to work correctly
2014-05-30 12:40:59 +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
Chen Jie
27f4d8237f amcvideoenc: Unit of bitrate property is now bit/sec
https://bugzilla.gnome.org/show_bug.cgi?id=705129
2014-05-26 12:10:44 +02:00
Jorge Zapata
738da7835f androidmedia: Add a new QCOM color format
It is a NV12 based, aligned to 32 bytes

https://bugzilla.gnome.org/show_bug.cgi?id=730635
2014-05-23 15:19:36 +02:00
Sebastian Dröge
158caf952d androidmedia: First try to get symbols from the current program, then load libdvm
If the application is using the new ART runtime it will otherwise
load dalvik and start a dalvik VM next to the ART VM.
Does not work very well obviously.
2014-05-23 15:13:28 +02:00
Chen Jie
22c0464aa6 androidmedia: add support for video encoding
https://bugzilla.gnome.org/show_bug.cgi?id=705129
2014-05-23 09:37:54 +02:00
Sebastian Dröge
5b23cf694c amcaudiodec: Calculate number of samples per frame for MP3 and use that
Some audio decoders (at least the MP3 decoder on MTK based devices) outputs
raw audio in batches of multiple audio frames. We need to handle that
properly, otherwise the base class will be kind of unhappy.
2014-02-14 12:51:50 +01:00