Commit graph

51 commits

Author SHA1 Message Date
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
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
Jan Schmidt
1df82fc14f androidmedia: Add new color format, and enhance debug output
Add a new color format seen on my Galaxy S3
(OMX_SEC_COLOR_FormatNV12Tiled = 0x7fc00002) to the table,
but don't actually implement it - the decoder doesn't choose it.

Remove an assert that makes the plugin fail noisily and take the app down
if it sees a color format it doesn't recognise (just skip the codec instead)

Modify the debug output when plugin scanning to print color format info to
make this sort of thing easier in the future.
2013-12-31 23:24:06 +11:00
Andoni Morales Alastruey
786f5e4f7c androidmedia: fix rank for more software decoders
In Galaxy S4 the codecs list contains some OMX.SEC.foo.sw.dec
as software decoders

https://bugzilla.gnome.org/show_bug.cgi?id=711214
2013-10-31 16:38:41 +01:00
Chen Jie
b05a1f75fd androidmedia: make gst_amc_avc_profile_from_string recognize alt name
https://bugzilla.gnome.org/show_bug.cgi?id=710433
2013-10-18 10:01:43 +01:00
Jorge Luis Zapata
48484f04a2 androidmedia: add support for a new qualcomm colorspace 2013-09-03 11:06:00 +02:00
Edward Hervey
97426a1caa all: Fix for GST_DISABLE_GST_DEBUG
Where applicable, remove methods that don't do anything different than
the default implementation.
2013-07-29 09:42:12 +02:00
Chen Jie
a36c9c1cc9 androidmedia: Hacks for HuaweiMediaPad which reports wrong color format
COLOR_FormatYCbYCr is reported but it is actually COLOR_TI_FormatYUV420PackedSemiPlanar.
2013-06-07 11:08:52 +02:00
Sebastian Dröge
92fffc8cbe androidmedia: Skip Aricent codecs for now
The HTC One X claims to have one (but doesn't) and loading
the library for it hangs forever.
2012-11-01 13:55:54 +01:00
Sebastian Dröge
079c68e4de androidmedia: Port to 1.0 2012-10-25 14:05:48 +02:00
Sebastian Dröge
6fa3f058b1 androidmedia: Rename plugin 2012-10-15 16:37:54 +02:00
Sebastian Dröge
f3682a0a6b Don't try to use the NVidia DRM codecs 2012-10-15 16:28:43 +02:00
Sebastian Dröge
7341ed62fa Add some more default channel layouts, these should be good for AAC at least 2012-10-15 16:28:42 +02:00
Sebastian Dröge
41862dff59 Ignore the *law and Vorbis decoders
They are broken unfortunately.
2012-10-15 16:28:42 +02:00
Sebastian Dröge
742816df69 Remove some obsolete FIXMEs 2012-10-15 16:28:41 +02:00
Sebastian Dröge
77fbaae250 Add support for audio decoders, completely untested so far 2012-10-15 16:28:40 +02:00
Sebastian Dröge
290d6f61c5 Ignore codecs with unknown color formats for stability purposes
They can be registered nonetheless if an environment variable
or compile-time #define is set.
2012-10-15 16:28:40 +02:00
Sebastian Dröge
024ac3560d Fix typo in previous commit 2012-10-15 16:28:39 +02:00
Sebastian Dröge
f2c5afd031 Don't allow using non-Google codecs if we started the Java VM ourselves
Hardware codecs, e.g. the TI ones, only work in processes that had their
Java VM started via the non-public AndroidRuntime class.
2012-10-15 16:28:39 +02:00
Sebastian Dröge
6feb6433d5 Rename to amc from androidmediacodec everywhere 2012-10-15 16:28:39 +02:00
Sebastian Dröge
0df00d68b5 Print the MediaFormats we get in the debug logs 2012-10-15 16:28:39 +02:00
Sebastian Dröge
d06af02637 Improve level/profile handling 2012-10-15 16:28:39 +02:00
Sebastian Dröge
2eff8bf82d Allow registering as static plugin with the GStreamer SDK API 2012-10-15 16:28:39 +02:00
Sebastian Dröge
525ecbb76a Fix plugin cache creation 2012-10-15 16:28:38 +02:00
Sebastian Dröge
e7b21d5796 Cache the codec informations inside the registry
Otherwise we would always load all codecs during plugin initialization
which can take quite some time (because of hardware) and also loads
lots of shared libraries (which number is limited by 64 in Android).
2012-10-15 16:28:38 +02:00
Sebastian Dröge
a98a627370 Properly attach and detach the current threads to the Java VM
Attaching a thread after it was detached will cause segfaults,
as such we use a pthread_key_t to keep track of the JNIEnv* of
the attached threads and in the destructor (i.e. when the
thread exits) we detach the thread.
2012-10-15 16:28:38 +02:00
Sebastian Dröge
30b25fea35 Fix JNI method call signatures 2012-10-15 16:28:38 +02:00
Sebastian Dröge
686b9cf2fa Initialize the VM will full debugging for now 2012-10-15 16:28:37 +02:00
Sebastian Dröge
d7148efb8e Use NewStringUTF() instead of our own method for that 2012-10-15 16:28:37 +02:00
Sebastian Dröge
5bbaa1f359 Add the TI format to the mapping table too 2012-10-15 16:28:37 +02:00
Sebastian Dröge
e9790ae693 Add another TI specific OpenMAX color format 2012-10-15 16:28:37 +02:00
Sebastian Dröge
4966f68512 Fixes to element/elementfactory creation 2012-10-15 16:28:37 +02:00
Sebastian Dröge
32d4d29706 Some bugfixes to the codec scanning code
Also it's not possible to attach a thread after it was
detached once. As such we simply never detach any thread
at all now.
2012-10-15 16:28:37 +02:00
Sebastian Dröge
a48d2feae0 Fix some compilation errors 2012-10-15 16:28:37 +02:00
Sebastian Dröge
1e73da2941 Add video decoder element 2012-10-15 16:28:37 +02:00
Sebastian Dröge
c846605082 Add some more JNI wrapping 2012-10-15 16:28:37 +02:00
Sebastian Dröge
d0ebf261ff Implement basic wrapper around MediaCodec API
Ideally nothing else will be needed from the elements later.
2012-10-15 16:28:37 +02:00
Sebastian Dröge
f99214a657 Some more WIP
Scanning all codecs now and have data structures for holding codec
information and codec contexts. Also function declarations for
working with them.
2012-10-15 16:28:36 +02:00