Commit graph

252 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
56ee6c4cee ahs: Don't assert on deinit if initialization failed before
Initialization failure is handled correctly by just not registering the
ahssrc element.

https://bugzilla.gnome.org/show_bug.cgi?id=774048
2016-11-08 13:45:17 +02:00
Matthew Waters
41a6448918 gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2016-11-03 16:16:12 +11:00
Thibault Saunier
2fb716409c Use the new API to post flow ERROR messages on the bus
https://bugzilla.gnome.org/show_bug.cgi?id=770158
2016-08-26 19:23:31 -03: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
2ff2ad9353 androidmedia: Run gst-indent over everything once again 2016-08-01 19:57:06 +03: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
Matthew Waters
989200820d glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2016-06-29 18:04:28 +10:00
Xavier Claessens
26b66a1db5 ahcsrc: Avoid a div by 0 warning
https://bugzilla.gnome.org/show_bug.cgi?id=767302
2016-06-06 21:19:33 +03:00
Xavier Claessens
1ee15d1385 amcvideoenc: Do not call gst_object_unref on GstCaps
https://bugzilla.gnome.org/show_bug.cgi?id=767298
2016-06-06 17:53:01 +01:00
Tim-Philipp Müller
889a1a9b90 androidmedia: fix error debug message when camera doesn't exist
Makes no sense to include the system error here since errno
will likely not be set and then it says 'system error: success'
which is confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=767087
2016-05-31 20:41:14 +01:00
Justin Kim
fe62233b83 ahcsrc: release resources in 'finalize' function
In general, 'dispose' function is used for dropping all references
and 'finalize' is called for releasing instances.

https://bugzilla.gnome.org/show_bug.cgi?id=763309
2016-05-31 12:58:06 +01:00
Martin Kelly
8c236a9f2e ahc: fix potential NULL deref
This bug was found via cppcheck static analysis.

If android.hardware.Camera.getParameters returns NULL, then object will
be NULL, and we won't allocate params. This means that the GST_DEBUG
statement referencing params->object will be invalid. Fix this by
exiting early if android.hardware.Camera.getParameters returns NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=766638
2016-05-20 09:16:28 +03:00
Martin Kelly
537ba5d109 ahc: fix typo in doc blurb
https://bugzilla.gnome.org/show_bug.cgi?id=766679
2016-05-19 20:47:58 +01: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
5d9df5d5d0 ahcsrc: There's no point in read-only CONSTRUCT properties
And creating one is causing assertions. Also get rid of the other CONSTRUCT
property as it's a) unneeded for default initialization and b) you're not
supposed to use constructor properties when creating element instances and the
GStreamer API doesn't provide direct ways for doing so.

https://bugzilla.gnome.org/show_bug.cgi?id=764339
2016-03-30 10:35:53 +03:00
Martin Kelly
d6a17cd3cc ahc: use g_slice_new instead of g_slice_new0
In many cases, we use g_slice_new0 and then immediately overwrite the
allocated memory. This is inefficient. Since we're going to immediately
overwrite it, we might as well use plain g_slice_new.

https://bugzilla.gnome.org/show_bug.cgi?id=763998
2016-03-24 14:59:42 +02:00
Justin Kim
b9ecc42b76 ahcsrc: remove probe_properties
It's a residue of 0.10.

https://bugzilla.gnome.org/show_bug.cgi?id=763100
2016-03-24 14:57:39 +02:00
Vineeth TM
8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Martin Kelly
c257829213 ahc: eliminate AHC*_CALL macros
Currently, we use AHC*_CALL macros to call many of the Camera functions.
However, we already have helper classes to call the Camera functions, so
eliminate the macros.

As a nice side-benefit, we also get improved error handling and
reporting when something goes wrong calling these functions, because a
GError gets populated, and we log a GST_ERROR when something fails. This
was harder to do using macros, as all error handling was hidden from the
caller.

https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-24 14:55:14 +02:00
Martin Kelly
a2f270b316 ahc: use gst unref functions
https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-24 14:55:14 +02:00
Martin Kelly
1bfd6526d4 ahc: use gst new object functions
https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-24 14:55:14 +02: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
Justin Kim
10c6d1b558 androidmedia: Remove unused file
ahcsrc is registered by gstamc.c

https://bugzilla.gnome.org/show_bug.cgi?id=763098
2016-03-05 10:04:39 +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
Martin Kelly
ddebf1ff66 ahc: correct error message
The error message is specific to only one of the failure cases and is
misleading in the others. Correct it to be more generic and cover all
the failure cases.

https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-04 09:42:14 +02:00
Martin Kelly
e337918a06 ahc: remove unneeded #include <stdio.h>
https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-04 09:42:14 +02:00
Martin Kelly
21d1eaa6c8 ahc: typo fix
https://bugzilla.gnome.org/show_bug.cgi?id=763065
2016-03-04 09:42:14 +02:00
Sebastian Dröge
476d5b6940 amcvideodec: When outputting on a surface, accept all color formats
We don't have to understand them, we handle them as a GL texture.

https://bugzilla.gnome.org/show_bug.cgi?id=762792
2016-02-28 11:10:39 +02:00
Matthew Waters
cd4a93da3b glsyncmeta: separate out gpu/cpu waits.
CPU waits are more expensive and are only required if the CPU is ever going to
access the data. GPU waits perform inter-context synchronisation and are cheaper
as they don't require CPU intervention.
2016-02-09 12:30:25 +11:00
Matthew Waters
9efdfb1a29 amcvideodec: pass the correct time value to wait_for_sync
When we are not waiting, we need to pass -1 to signal that we just want to check
that the frame was/n't rendered.  Avoids waiting for frames that will never be
rendered.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-02-04 15:46:22 +11:00
Matthew Waters
3c29dcaddb amcvideodec: advance the ready counter ourselves when render=FALSE
When not rendering the video frame, e.g. when freeing an unreleased sync frame,
we will not receive a frame listener callback.

Reduces the amount of 'on_frame_available miss detected' messages when dropping
frames.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-02-04 15:46:22 +11:00
Matthew Waters
b276de7827 amcvideodec: guard against not finding a valid frame in loop
Fixes sporadic crashes on finishing decoding a video.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-01-29 23:52:15 +11:00
Matthew Waters
1fceac8122 amcvideodec: set our data pointer in java to NULL on close
The frame available callback can be called after deconfiguring the amc codec.
Guard against this by setting the back pointer to NULL on close() and ignoring
any NULL data pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-01-29 23:52:15 +11:00
Sebastian Dröge
c9d9042aff ahc: Fail gracefully if our callback class can't be found
Instead of just ignoring that error and then calling JNI functions with NULL,
which will kill the virtual machine.

The error handling here needs some further improvements though, errors in more
places are just ignored.
2016-01-22 17:25:28 +02:00
Sebastian Dröge
551b0a5f28 ahc: Initialize GError pointer with NULL
Otherwise there will be assertions.
2016-01-22 17:22:47 +02:00
Sebastian Dröge
f585a66bd1 amcvideodec: Only free GstAmcBuffer if it's not NULL
And also free it on GL errors.
2016-01-22 17:19:29 +02:00
Sebastian Dröge
8c57341241 amc: Add an assertion for NULL GErrors
Should never happen! But an assertion is better than a NULL pointer
dereference.
2016-01-22 16:22:25 +02:00
Sebastian Dröge
31e1b7ceeb ahc: Fix indentation 2016-01-22 16:14:46 +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
Nicolas Dufresne
09dbc5b298 ahcsrc: Fix latency reporting
Currently it was wrongly reporting min/max as being the shortest and
longest possible frame duration. This is not how latency works in
GStreamer.

Fix by reporting min latency as being the longest possible duration of
one frame. As we don't know how many buffers the stack can accumulate, we
simply assume that max latency is the same (the usual default behaviour).
2016-01-21 13:49:18 -05:00
George Kiagiadakis
9a53d79876 ahcsrc: fix deadlock when flushing
_data_queue_item_free() calls gst_buffer_unref(), which
calls gst_ahc_src_buffer_free_func(), which calls
g_mutex_lock() on self->mutex and there you go... deadlock!
2016-01-21 13:49:18 -05:00
Justin Kim
f1809c4d93 ahcsrc: porting from 0.10 to 1.0 2016-01-21 13:49:17 -05:00
Justin Kim
becaf2852d move androidcamera into androidmedia
This commit is a part of portng android hardware camera from 0.10 implementation.
To preserve history and get diff clearly, the interesting files are moved to
deployment directory and the remaining files are removed.
2016-01-21 13:49:17 -05:00
Youness Alaoui
c84878ad4b androidmedia: Fix get_level and get_profile exception checking by not using return 2016-01-21 13:49:17 -05:00