summaryrefslogtreecommitdiff
path: root/sys/androidmedia/gstamcaudiodec.c
Commit message (Collapse)AuthorAgeFilesLines
* gst: don't use volatile to mean atomicMatthew Waters2021-03-221-1/+1
| | | | | | | | | | | | volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2098>
* amc: Select between encoder/decoder at GstAmcCodec construct timeXavier Claessens2019-08-201-2/+2
| | | | | Magical 0/1 values where passed to gst_amc_codec_configure() flags argument. It's more natural to have a boolean is gst_amc_codec_new().
* amc: Remove gst_amc_format_contains_key()Xavier Claessens2019-08-201-3/+2
| | | | | It is not needed, we can just try to get the key and ignore error. NdkMediaFormat doesn't have that method.
* androidmedia: when flushing, better handle IllegalStateException received ↵Ursula Maplehurst2017-12-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | from getOutputBuffer 1. Similar to 880f3d8, don't consider not getting an output buffer as an error during flushing. I've seen the following sometimes when encoding: W GStreamer+amcvideoenc: java.lang.IllegalStateException W GStreamer+amcvideoenc: at android.media.MediaCodec.getBuffer(Native Method) W GStreamer+amcvideoenc: at android.media.MediaCodec.getOutputBuffer(MediaCodec.java:2886) 2. For amcvideodec/enc, call _find_nearest_frame (which grabs a fresh reference on a GstVideoCodecFrame) after we have an output buffer, so as to not leak the reference, in case getting an output buffer fails. Otherwise, if we get an error grabbing the output buffer, we leak the reference to the frame. This can cause issues with a v4l2bufferpool feeding the encoder not being able to clean itself up properly due to buffers still being marked as in-use. https://bugzilla.gnome.org/show_bug.cgi?id=791258
* androidmedia: Add support for Opus in the decoderSebastian Dröge2017-01-051-0/+2
|
* amcaudiodec: Set "is-adts" to 1 for ADTS AACSebastian Dröge2016-12-151-0/+15
| | | | | | Otherwise it fails to decode. https://bugzilla.gnome.org/show_bug.cgi?id=740101
* Use the new API to post flow ERROR messages on the busThibault Saunier2016-08-261-3/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770158
* amc: Correctly handle NULL input buffersSebastian Dröge2016-03-111-1/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=763401
* amc: MediaCodec::getOutputBuffer() can return NULL without exceptionSebastian Dröge2016-01-221-1/+19
| | | | | | | | 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
* androidmedia: Add support for GL output in amcvideodecMatthieu Bouron2015-10-211-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731204
* androidmedia: Conditionally use get_{input,output}_buffer() Android 21 APIsSebastian Dröge2015-05-311-99/+69
| | | | | Also properly set limit/position on byte buffer, some codecs prefer to have correct values there.
* amcaudiodec: Add an output adapter for chunking the output into codec framesSebastian Dröge2015-05-191-10/+43
| | | | | Otherwise the base class will be confused. See https://bugzilla.gnome.org/show_bug.cgi?id=685730
* androidmedia: Handle queue/release errors non-fatalSebastian Dröge2015-04-171-2/+12
| | | | | | 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.
* androidmedia: Remove unused label/variableEdward Hervey2015-03-111-2/+0
|
* androidmedia: break statements unnecessaryAnuj Jaiswal2014-09-241-3/+3
| | | | | | | 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
* amcaudiodec: Remove hack for Google MP3 decoderSebastian Dröge2014-09-011-12/+0
| | | | | | | 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.
* androidmedia: Make sure to unblock any thread waiting on the drain condition ↵Sebastian Dröge2014-08-141-0/+32
| | | | variable when errors happen
* androidmedia: Fix draining logic to let the base class handle EOS eventsSebastian Dröge2014-08-141-13/+9
| | | | https://bugzilla.gnome.org//show_bug.cgi?id=734775
* androidmedia: Also don't report warnings for queue/dequeue errors during ↵Sebastian Dröge2014-06-191-5/+13
| | | | | | flushing in error cases ... and fix a case where we released an invalid buffer index.
* androidmedia: Don't consider input buffer queueing failures as an error ↵Sebastian Dröge2014-06-191-1/+6
| | | | during flushing
* androidmedia: Clean up flushing code and don't consider output buffer ↵Sebastian Dröge2014-06-191-3/+11
| | | | releasing failures during flushing as an error
* androidmedia: Add exceptions from the Java API to error messages, and post ↵Sebastian Dröge2014-05-301-48/+105
| | | | more error/warning messages overall
* Release the codec before freeing itJorge Zapata2014-05-301-1/+3
| | | | | | | | 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
* androidmedia: move create_src|sink_caps to gstamc.cChen Jie2014-05-261-148/+7
| | | | | | | | | | | | | | | | | | | | | | | 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.
* amcaudiodec: Calculate number of samples per frame for MP3 and use thatSebastian Dröge2014-02-141-5/+32
| | | | | | 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.
* amcaudiodec: Error out if we get an invalid raw audio buffer sizeSebastian Dröge2014-02-141-0/+14
|
* amcaudiodec: Release buffer back to Android if allocating output failsSebastian Dröge2014-02-141-0/+1
|
* androidmedia: Don't handle FLUSHING or NOT_LINKED as errorSebastian Dröge2014-01-251-1/+4
| | | | And also just stop the task for FLUSHING.
* androidmedia: fix access to invalid buffers in the decoding loopAndoni Morales Alastruey2013-10-301-2/+1
| | | | | | | | Flushing the decoder invalidates all buffers, so it should be done after quiting the decoding loop. Otherwise we can jump into "failed_release" and stop everything https://bugzilla.gnome.org/show_bug.cgi?id=711156
* androidmedia: Fix indentionSebastian Dröge2013-05-201-3/+5
|
* amcaudiodec: Properly set output format instead of just setting capsSebastian Dröge2013-04-161-5/+2
|
* androidmedia: Set parent class in class_initSebastian Dröge2013-04-161-0/+2
|
* androidmedia: Handle refcounts of pad templates correctlySebastian Dröge2013-04-161-2/+2
| | | | | | gst_pad_template_new() does not take ownership of caps anymore and gst_element_class_add_pad_template() does take ownership of the pad template now.
* amcaudiodec: Use 1.0-style raw audio capsSebastian Dröge2013-04-161-5/+2
|
* androidmedia: Properly set subclasses metadata/pad templates in base_initSebastian Dröge2013-04-161-26/+60
|
* androidmedia: Update to new GLib thread APISebastian Dröge2012-11-121-16/+16
|
* androidmedia: Port to 1.0Sebastian Dröge2012-10-251-100/+130
|
* Try to handle format changes more gracefullySebastian Dröge2012-10-151-2/+11
| | | | And make stop() faster and more robust
* Add workaround for Google MP3 decoder outputting garbage in first output bufferSebastian Dröge2012-10-151-1/+19
| | | | | And assume one decoded input frame per output buffer to fix timestamp handling by the base class.
* Also add some more output format checks to the audio decoderSebastian Dröge2012-10-151-0/+5
|
* Don't set timestamps, the baseclass handles this for us anywaySebastian Dröge2012-10-151-4/+0
|
* Merge structures into caps instead of appending themSebastian Dröge2012-10-151-10/+10
|
* Use orc_memcpy() instead of memcpy() as it should be faster for larger ↵Sebastian Dröge2012-10-151-2/+8
| | | | memory areas
* Add support for audio/mpeg-L2 for the Nexus 7Sebastian Dröge2012-10-151-3/+19
|
* Only mpegversion=4 is supported for AACSebastian Dröge2012-10-151-2/+1
|
* Remove some obsolete FIXMEsSebastian Dröge2012-10-151-10/+1
|
* Fix flushing logic to unbreak handling of flushing seeksSebastian Dröge2012-10-151-2/+1
|
* Fix Vorbis decodingSebastian Dröge2012-10-151-4/+13
|
* Wait at most 100ms for dequeueing a buffer, and retry after thatSebastian Dröge2012-10-151-2/+6
| | | | | Some codecs don't fail the dequeueing if the codec is flushed, causing deadlocks when shutting down the element.
* Release output buffers a bit earlierSebastian Dröge2012-10-151-3/+3
|