Commit graph

628 commits

Author SHA1 Message Date
Julien Isorce
7b114b131f omxvideodec: fix buffer leak when eglimage setup fails
Can happen if gst_buffer_pool_acquire_buffer succeeds but
gst_buffer_n_memory (buffer) is not exactly 1.

In theory this should not happen because the decoder requests
EGLImage(RGBA) but better to fix any leak on corner cases.

https://bugzilla.gnome.org/show_bug.cgi?id=784365
2017-07-17 17:11:34 +01:00
Satya Prakash Gupta
5e6c3f170f omx: Possible Memory leak in gst_caps_from_string
https://bugzilla.gnome.org/show_bug.cgi?id=784978
2017-07-17 16:46:29 +03:00
Satya Prakash Gupta
45eaf9cfc6 omxvideoenc: Fix deadlock in error case when draining
https://bugzilla.gnome.org/show_bug.cgi?id=784972
2017-07-17 15:39:02 +03:00
Satya Prakash Gupta
9db720f13e omxaudioenc: Fix deadlock in error case when draining
https://bugzilla.gnome.org/show_bug.cgi?id=784967
2017-07-17 15:38:17 +03:00
Guillaume Desmottes
4488ab97af build: include OMX_IndexExt and OMX_ComponentExt if present
These files may be used by OMX implementation to define custom extensions.
Include them if present as we are already doing with OMX_VideoExt.h

https://bugzilla.gnome.org/show_bug.cgi?id=784847
2017-07-13 14:41:58 +01:00
Jan Schmidt
fe9cdb9b19 omxh264enc: Re-add periodicty-idr property for backward compat
Retain backwards compatibility by adding a duplicate
property for periodicty-idr

https://bugzilla.gnome.org/show_bug.cgi?id=784370
2017-07-13 16:42:24 +10:00
Guillaume Desmottes
2034b26347 omxh264enc: fix typo in "periodicty-idr" property name
Also fix the 'nick' of the property.

https://bugzilla.gnome.org/show_bug.cgi?id=784370
2017-07-12 16:23:29 -04:00
Julien Isorce
80c6dd46a1 omxvideodec: use OMX_UseBuffer
For example this allows the omx decoder to directly fill the
pixmaps coming from the video sink.

It only avoids a buffer copy when the decoder uses a pool provided
by a downstream element. So let's restrict this usage to situations
where the decoder decides to use a downstream buffer pool.

Tested with Tizonia/OMX.Aratelia.video_decoder.vp8
and with Bellagio/OMX.mesa.video_decoder.avc.

If it fails to setup buffers with OMX_UseBuffer the decoders
fallbacks to usual OMX_AllocateBuffer.

Also it allows to test on desktop the GstOMXBufferPool->other_pool
management which was previously only used in the OMX_UseEGLImage
case, i.e. on Rpi.

https://bugzilla.gnome.org/show_bug.cgi?id=784069
2017-07-12 16:36:03 +01:00
Julien Isorce
e60ac7e1c0 omx: do not always print an error if OMX_{UseBuffer,EGLImage} fails
Let the caller decide to print an error. Because it can be part of
a normal trial path.

https://bugzilla.gnome.org/show_bug.cgi?id=784069
2017-07-12 16:26:36 +01:00
Guillaume Desmottes
9928a881b0 meson: add gstomxmp3enc
Commit 02d493e859 didn't add
gstomxmp3enc.c to meson.

https://bugzilla.gnome.org/show_bug.cgi?id=784848
2017-07-12 15:51:55 +01:00
Julien Isorce
02d493e859 omx: add gstomxmp3enc
Initial support and only tested with the software based
encoder OMX.Aratelia.audio_encoder.mp3 from Tizonia which
internally uses libmp3lame.

https://bugzilla.gnome.org/show_bug.cgi?id=782988
2017-07-12 14:29:44 +01:00
Guillaume Desmottes
0aa4c9db4e h264dec: add hack to pass profile and level to OMX
This information can be useful to zynqultrascaleplus decoders. They may
use this information to reduce startup latency by configuring itself
before receiving the first frames.

We also have a custom OMX extension allowing the decoder to report the
latency. The profile/level information helps it reporting a more
accurate latency earlier.

https://bugzilla.gnome.org/show_bug.cgi?id=783114
2017-07-11 11:57:50 -04:00
Guillaume Desmottes
1e570fed17 omxh264enc: move profile and level parsing functions to their own files
Will allow to re-use them in the decoder element.

https://bugzilla.gnome.org/show_bug.cgi?id=783114
2017-07-11 11:57:50 -04:00
Gurkirpal Singh
065878a5d4 omx: always ignore OMX_ErrorPortUnpopulated
It is safe to ignore it always. Tizonia notifies this error to pass
some khronos conformance tests. Problem is that gst-omx saves this
error in comp->last_error and then gst_omx_port_set_enabled early
error out which fails the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=782800
2017-07-05 17:27:27 -04:00
Gurkirpal Singh
fc1a8229b0 omx: guard some omx enums with IL version
Some enums that existed in 1.1.2 just do not exit in 1.2.0
See https://www.khronos.org/registry/OpenMAX-IL/specs/OpenMAX_IL_1_2_0_Specification_redline.pdf

https://bugzilla.gnome.org/show_bug.cgi?id=782800
2017-07-05 17:27:27 -04:00
Julien Isorce
c7e66b473f omxaudioenc: update local port_def after reopening the component
gst_omx_audio_enc_open will only update GstOMXAudioEnc->port->port_def.

Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.

https://bugzilla.gnome.org/show_bug.cgi?id=782418
2017-07-05 10:48:56 +01:00
Julien Isorce
786a2617b2 omxvideoenc: update local port_def after reopening the component
gst_omx_video_enc_open will only update GstOMXVideoEnc->port->port_def.

Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.

https://bugzilla.gnome.org/show_bug.cgi?id=782418
2017-07-05 10:48:52 +01:00
Sejun Park
ebc9b4903c omxvideodec: update local port_def after reopening the component
gst_omx_video_dec_open will only update GstOMXVideoDec->port->port_def.

Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.

https://bugzilla.gnome.org/show_bug.cgi?id=782418
2017-07-05 10:23:01 +01:00
Guillaume Desmottes
a3805116df omxvideodec: increase the minimum number of allocated buffers
Ensure that enough buffers are allocated by adding up component's own
minimal plus the number of buffers requested by downstream.
This should prevent buffers starvation problem if downstream elements
are holding some of the buffers they required.

Also simplify the check on the maximum on buffers. What we actually care
about is to make sure the pool can hold the minimum of required buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=784479
2017-07-03 11:05:24 -04:00
Guillaume Desmottes
8e0dc1d89d omxh264enc: raise a warning if AVCIntraPeriod is not supported
Some platforms may not implement OMX_IndexConfigVideoAVCIntraPeriod and
use OMX_IndexParamVideoAvc instead to configure the GOP pattern.
So raise a warning instead of an error if this API is not implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=784379
2017-07-03 10:22:20 -04:00
Guillaume Desmottes
ebeae6d869 omxh264enc: add 'b-frames' property
Add a property to control the number of B-frames produced by the
encoder using the OMX_VIDEO_PARAM_AVCTYPE OMX API.

https://bugzilla.gnome.org/show_bug.cgi?id=784379
2017-07-03 10:22:20 -04:00
Guillaume Desmottes
1fbb8a3fb8 omxh264enc: fix typo in 'set_avc_intra_period'
https://bugzilla.gnome.org/show_bug.cgi?id=784379
2017-07-03 10:22:20 -04:00
Guillaume Desmottes
752544841d omxh264dec: remove 'parsed=true' from sink pad
The decoder only requires to receive one frame per buffer which is
already enforced with 'alignment=au'. There is no need to require to
have a parser upstream.

Allow to run "encode ! decode" pipeline without having a parser.

https://bugzilla.gnome.org/show_bug.cgi?id=784344
2017-06-29 15:46:14 -04:00
Guillaume Desmottes
1fa2ea274f omxh264enc: set profile/level using OMX_VIDEO_PARAM_AVCTYPE as well
The OMX specification defines two API to set the AVC profile and level:
using OMX_VIDEO_PARAM_PROFILELEVELTYPE and OMX_VIDEO_PARAM_AVCTYPE.

We were already supporting the former but not the latter. We are now
setting both so implementation don't have to rely on a specific one.

https://bugzilla.gnome.org/show_bug.cgi?id=783862
2017-06-29 15:39:56 -04:00
Guillaume Desmottes
0dbe604209 omxh264enc: factor out update_param_profile_level()
https://bugzilla.gnome.org/show_bug.cgi?id=783862
2017-06-29 15:39:56 -04:00
Guillaume Desmottes
af207f8956 omxh264enc: factor out string to profile/level enum conversion
https://bugzilla.gnome.org/show_bug.cgi?id=783862
2017-06-29 15:39:56 -04:00
Guillaume Desmottes
424776ba5e omxh264enc: use OMX_IndexConfigBrcmVideoIntraPeriod on pi
The OMX_VIDEO_CONFIG_AVCINTRAPERIOD.nPFrames setting isn't of any use on
the raspbery pi. Instead it uses a custom extension to define the I
frame period.

https://bugzilla.gnome.org/show_bug.cgi?id=783829
2017-06-28 17:05:46 -04:00
Guillaume Desmottes
895086e2e2 omxh264enc: factor out set_avc_intra_perdiod()
https://bugzilla.gnome.org/show_bug.cgi?id=783829
2017-06-28 17:05:46 -04:00
Graham Leggett
463929af3e omxvideoenc: Improve debug output when setting codec state due to new codec_data fails
https://bugzilla.gnome.org/show_bug.cgi?id=783657
2017-06-12 09:56:20 +03:00
Julien Isorce
1c8f069e42 omx: allow 0 feature
Previously the omx plugin was blacklisted if GST_OMX_CONFIG_DIR
points to an invalid path or if the gstomx.conf contains 0 valid
component.
Problem is that once the plugin is blacklisted, a rescan is not
triggered upon changes of the env var or the gstomx.conf file
despite being setup with gst_plugin_add_dependency.

This also makes it more consistent with other plugins that auto
generate features. For example gst-{ffmeg,libav}, gstreamer-vaapi,
v4l2 video dec.

To clarify the diff, the plugin_init func will return TRUE even if
g_key_file_get_groups returns 0 element and even if
g_key_file_load_from_dirs fails.

https://bugzilla.gnome.org/show_bug.cgi?id=782867
2017-05-21 15:40:11 +01:00
Sejun Park
d980af213b omxvideodec: Removed unreachable code
https://bugzilla.gnome.org/show_bug.cgi?id=782416
2017-05-10 11:54:44 +01:00
Guillaume Desmottes
e8590db808 meson: add dep on GModule
libgstomx uses the GModule API and so needs it in its dependencies list.

https://bugzilla.gnome.org/show_bug.cgi?id=782387
2017-05-09 16:31:03 +02:00
Guillaume Desmottes
623d2df5a3 videoenc: use GST_ROUND_UP_N() macro
Makes the code much easier to read and understand.

https://bugzilla.gnome.org/show_bug.cgi?id=781409
2017-04-26 15:37:41 +01:00
Sebastian Dröge
812e24b06f omxvideoenc: Fix compiler warning
gstomxvideoenc.c: In function ‘gst_omx_video_enc_fill_buffer’:
  CC       libgstomx_la-gstomxaacdec.lo
gstomxvideoenc.c:1316:27: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 8 has type ‘OMX_U32 {aka long unsigned int}’ [-Wformat=]
     GST_LOG_OBJECT (self, "Matched strides - direct copy %u bytes",
                           ^
         outbuf->omx_buf->nFilledLen);
         ~~~~~~~~~~~~~~~~~~
2017-04-07 14:27:23 +03:00
Jan Schmidt
75d9ec634c omxvideoenc: Add an unimplemented mapping for RGBA formats
Add some pixel formats mappings for 2 RGBA formats. Not yet
implemented in the buffer input code though, so no effect for now.
2017-03-14 03:02:06 +11:00
Jan Schmidt
413f05269c omxvideoenc: Add GST_OMX_HACK_HEIGHT_MULTIPLE_16 for Rpi
The Raspberry Pi encoder produces corrupt output unless
the input height is a multiple of 16. Add a hack that adds
zero padding when needed.
2017-03-14 03:00:49 +11:00
Jan Schmidt
f3a7bce442 omxvideoenc: Add a mapping for OMX_COLOR_FormatYUV420PackedSemiPlanar
The RaspberryPi
2017-03-14 02:42:15 +11:00
Jan Schmidt
c3078dd20c omxvideoenc: Filter out unimplemented formats
Don't announce pixel formats in the caps if they've not been
implemented.
2017-03-14 02:40:24 +11:00
Jan Schmidt
7c829886ca omxvideodec: demote ERROR message
There's no need to warn about failing to negotiate EGL output
 - that can be perfectly normal.
2017-03-14 02:34:36 +11:00
Vincent Penquerc'h
4e01a6f7b1 omxaacenc: let encoder know about incoming rate/channels
https://bugzilla.gnome.org/show_bug.cgi?id=777223
2017-01-20 13:37:46 -05:00
Matthew Waters
ed5f63c9ef build: add meson build definition
Currently only been tested on the RPi within gst-build.
2017-01-18 15:23:42 +11:00
Vincent Penquerc'h
a02f1e5c9b omxaudioenc: set base class format instead of just source pad caps 2017-01-11 11:38:05 +00:00
Graham Leggett
a1e613dd89 omx*dec: Flush before we stop the srcpad loop
Flushing could otherwise hang if output port queue of pending buffers was empty

https://bugzilla.gnome.org/show_bug.cgi?id=774654
2016-12-19 10:52:16 +02:00
Reynaldo H. Verdejo Pinochet
7925355d72 Fix broken build due to syntax error
Problem was introduced by 8716c23e2b
2016-12-14 13:32:16 -08:00
Graham Leggett
8716c23e2b Prevent early EOS by resetting eos flag once GST_OMX_ACQUIRE_BUFFER_EOS is triggered
https://bugzilla.gnome.org/show_bug.cgi?id=774600
2016-12-13 11:38:38 +02:00
Graham Leggett
5d5fbcd8f6 Add clear debug logging on all the paths out of gst_omx_port_acquire_buffer()
https://bugzilla.gnome.org/show_bug.cgi?id=774600
2016-12-13 11:38:36 +02:00
George Kiagiadakis
05b137a256 Add a signals-premature-eos hack for egl_render
egl_render seems to have a bug and signals EOS before it has finished
pushing out all data; this hack simply makes acquire_buffer() wait
a bit more before signalling EOS, in case egl_render decides to spit
out some more data.

https://bugzilla.gnome.org/show_bug.cgi?id=741856
2016-12-13 11:38:26 +02:00
Graham Leggett
8b01b06af6 Add support for OMX_COLOR_FormatYUV420PackedSemiPlanar and OMX_COLOR_Format24bitBGR888
https://bugzilla.gnome.org/show_bug.cgi?id=775959
2016-12-13 11:18:43 +02:00
Sebastian Dröge
53d8d353f0 omx: Fix compiler warning with latest clang
gstomx.c:1376:42: error: implicit conversion from enumeration type 'GstOMXAcquireBufferReturn' to different enumeration type 'OMX_ERRORTYPE'
      (aka 'enum OMX_ERRORTYPE') [-Werror,-Wenum-conversion]
  g_return_val_if_fail (!port->tunneled, GST_OMX_ACQUIRE_BUFFER_ERROR);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=775112
2016-11-26 00:07:13 +02:00
Matthew Waters
baaf404f2b videodecoder: remove use of EGLImage orientation
New code should use GstVideoTransformationMeta

(The defaults do the right thing here though).
2016-11-17 19:56:35 +11:00