Commit graph

1004 commits

Author SHA1 Message Date
Shinya Saito
847fc08824 omxvideoenc: Add stride check for input buffer extraction
Stride of input buffer may be different from
that of omx input port even if both sizes are the same.
2019-12-11 15:53:29 +09:00
Guillaume Desmottes
2939a46dd2 omxvideoenc: pass padding requirements to ALLOCATION query
By passing the expected video buffer layout, the upstream producer
may be able to produce buffers fitting those requierements allowing
gst-omx to use dynamic buffer mode rather than having to copy each input
buffer.

This is particularly useful with v4l2src as it can request the capture
driver to produce buffers with the required paddings.
2019-11-05 17:30:21 +05:30
Guillaume Desmottes
800cc4bd67 omxbufferpool: use gst_video_meta_set_alignment()
Tell buffer consumer about our paddings.

v4l2src can now uses these paddings information when trying to import
buffers to configure the v4l2 driver accordingly.
2019-11-05 17:30:21 +05:30
Guillaume Desmottes
611f37c2ae omxvideoenc: fix buffer size in debug log
Use the actual OMX buffer size rather than the info.size as OMX
may require larger buffer if the port requires some padding.
2019-11-02 14:56:53 +01:00
Tim-Philipp Müller
e8a4500d75 Remove autotools build 2019-10-14 00:58:55 +01:00
Stéphane Cerveau
a5a22f03a5 omxallocator: fix leak with a proper chaining finalize 2019-10-07 16:59:10 +00:00
Guillaume Desmottes
d0bc3ed840 omxvideoenc: revert draining on ALLOCATION and DRAIN query
My latest patch introduces some regressions which I have no time to
debug properly at the moment so just revert it for now.
2019-09-23 13:50:54 +05:30
Guillaume Desmottes
df8ba87025 omxvideoenc: let encoder base class handle ALLOCATION query
Fixing a regression introduced in my previous patch
(7c40a91c31).

The ALLOCATION query needs to be handled by GstVideoEncoder (to call
propose_allocation()) so chain up the query handling rather than early
returning.
2019-09-17 13:13:23 +05:30
Guillaume Desmottes
7c40a91c31 omxvideoenc: drain encoder on ALLOCATION and DRAIN queries
Ensure that the encoder releases all its input buffers when requested by
upstream. Encoder input buffers may be shared with downstreaming (when
using dmabuf), upstream may then request the encoder to
drain when reconfiguring before destroying its buffers.

Also drain on ALLOCATION query as we already do in kmssink as that
notify of a format change.

Fix "decoder ! encoder" pipeline when decoding a file with different
resolutions on Zynq.
2019-09-05 09:22:32 +05:30
Guillaume Desmottes
76267ec55d omx: log the number of pending buffers when port is EOS 2019-09-04 10:41:46 +00:00
Guillaume Desmottes
a7ef71dc80 omx: log when an output port is eos 2019-09-04 10:41:46 +00:00
Guillaume Desmottes
35ffd018e2 omxvideoenc: log the full input format
Make it easier to debug dynamic format changes.
2019-09-04 10:41:46 +00:00
Guillaume Desmottes
55ea6d017f omxvideodec: fix dmabuf import
When importing dmabuf, UseBuffer() has to be called with the fd as
pBuffer rather than the mapped address of the buffer.
2019-09-02 09:47:54 +05:30
Guillaume Desmottes
7cd929bc87 omxbufferpool: fix dmabuf import
When importing dmabuf from downstream, we want the allocator to be in
OTHER_POOL mode despite output_mode being DMABUF.
So check first if other_pool is set before checking for pool's
output_mode.
2019-09-02 09:47:51 +05:30
Shinya Saito
8d4d697a58 omxvideoenc: Remove unnecessary gst_video_frame_unmap() 2019-08-22 18:01:56 +09:00
Guillaume Desmottes
a160160419 omxvideodec: log supported caps by the decoder
Can be useful when debugging to check the caps supported by the decoder
before filtering.
2019-08-05 13:43:44 +05:30
Shinya Saito
d8d23bbb3e omxvideoenc: Unref frame of codec config buffer
After handling codec config, codec frame should be unreffed.
2019-07-11 19:02:20 +09:00
Guillaume Desmottes
50d50f47fb omxvideo: check difference between frame and requested ts
This has proven to be very useful when debugging to detect bugs where we
match the wrong gst frame with an output OMX buffer.
2019-06-17 09:17:14 +05:30
Guillaume Desmottes
cfeeb15b1e omxvideo: add debug infos to find_nearest_frame()
Those debug infos have proved to be very helpful when debugging
timestamp issues. They are often linked to gst-omx picking the wrong
frame when trying to map from OMX.
2019-06-17 09:17:14 +05:30
Shinya Saito
a7ecda85b6 omxvideodec: Deactivate negotiated pool when output own buffer
If decoder outputs internal buffer and not use OMX_UseBuffer,
downstream bufferpool should be stopped.
2019-06-07 10:00:15 +00:00
Shinya Saito
5d8d478ff8 omxh264enc: Add 'ref-frames' property
Add a property to control the number of frames for reference.

Min and max value is based on OpenMAX IL 1.2.0 Specification.
2019-06-04 12:25:15 +09:00
Niels De Graef
a0b9c96f48 meson: Bump minimal GLib version to 2.44
This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.
2019-06-03 07:57:02 +02:00
Thibault Saunier
8717cc7108 doc: Build documentation of hotdoc 2019-05-13 19:06:28 -04:00
George Kiagiadakis
fbe0d07068 gstomx: remove gst_omx_buffer_set_omx_buf/get_omx_buf
They are no longer used anywhere
2019-04-25 09:09:42 +05:30
George Kiagiadakis
783e58fc48 omxbufferpool: refactor to allow memory sharing
One big restriction of the OMX buffer pool has always been
that the GstMemory objects were flagged with NO_SHARE.
This was because the buffer pool needed to be sure that when
a buffer returned to the pool, it would be safe to release the
OMX buffer back to OpenMAX.

With this change, this is no longer a restriction. What this
commit introduces is a new allocator that allows us to track
the GstMemory objects independently. Now, when a buffer returns
to the pool, it is not necessary for the memory to be released
as well. We simply track the memory's ref count in the allocator
and we return the OMX buffer back when the memory's ref count
drops to 0.

The reason for doing this is to allow implementing zero-copy
transfers in situations where we may need to copy or map a
certain region of the buffer. For instance, omxh264enc ! h264parse
should be possible to be zero-copy by using an OMX buffer pool
between them.
2019-04-25 09:09:40 +05:30
Guillaume Desmottes
3018ea5843 omxbufferpool: fix memory mapping with offset
gst_memory_map() is already adding the offset to the mapped pointer.
Doing it in the memory implementation was resulting in the offset being
accounted twice.

It doesn't matter yet as we are only creating memory without offset for
now but it will once we'll start sharing OMX memories.
2019-04-23 15:32:05 +05:30
Tim-Philipp Müller
e6639588c0 Back to development 2019-04-19 11:00:07 +01:00
Tim-Philipp Müller
efb55bfa9f Release 1.16.0 2019-04-19 00:38:44 +01:00
Julien Isorce
18927f33ee Fixes build with omx >= 1.2.0
gstomx.c:1405:10: error: ‘OMX_IndexParamCustomContentPipe’ undeclared (first use in this function)
    case OMX_IndexParamCustomContentPipe

Some enums have been deprecated in 1.2.0

https://gitlab.freedesktop.org/gstreamer/gst-omx/issues/27
2019-04-16 12:26:03 -07:00
Guillaume Desmottes
d7c589122b testegl: properly detect and use rpi specific libs
Use pkg-config to detect and configure rpi specific libs used in testegl
rather than hardcoding their flags.
2019-04-12 14:29:19 +05:30
Guillaume Desmottes
9b68aaeeb5 testelg: include eglext.h
Neded for the declaration of eglSaneChooseConfigBRCM().
2019-04-12 14:29:19 +05:30
Guillaume Desmottes
7a964087d0 testegl: move up pi specific macros
We need to define __VCCOREVER__ and disable redundant-decls before
including the egl.h from the pi.
2019-04-12 14:29:19 +05:30
Tim-Philipp Müller
0b9bdbf224 Release 1.15.90 2019-04-11 00:40:53 +01:00
Tim-Philipp Müller
6b29292793 meson: add -Wundef as additional warning flag 2019-04-10 00:21:01 +01:00
Tim-Philipp Müller
6ce69859c5 omx: fix autotools build for generic target
gstomxvideoenc.c:2874:7: error: "USE_OMX_TARGET_ZYNQ_USCALE_PLUS" is not defined, evaluates to 0 [-Werror=undef]
 #elif USE_OMX_TARGET_ZYNQ_USCALE_PLUS

Works on meson because it doesn't use -Wundef
2019-04-10 00:20:37 +01:00
Jordan Petridis
91356c9a7d Add Gitlab CI configuration
This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.

The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.

Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29
2019-04-06 16:23:51 +00:00
Guillaume Desmottes
7d1b77b0c4 omx: disable OMX_API_TRACE code if gst debug is disabled
No need to create debug structs which won't be used as DEBUG macros are
no-op.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes
01bf661d6e omx: log Get/SetParameter/Config calls
Extend OMX_API_TRACE by logging component configuration calls.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes
b53c91d9ef omxbufferpool: don't use CAT_PERFORMANCE if pool will copy
This was the single place where this category was used in gst-omx so
most users, including me, are generally not turning it and were missing this
important information from logs.

The copying code uses gst_video_frame_copy() which is already logging
with CAT_PERFORMANCE so we can still have this information when using
only this debug category.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes
6feac3ed26 omxvideodec: add debug if proposed pool can't provide enough buffers
We were silently ignoring the pool which was pretty confusing when
debugging.
2019-03-26 15:15:21 +01:00
Charlie Turner
7412b39765 omx: Add hardware classifiers to encoders/decoders 2019-03-26 12:17:26 +00:00
Guillaume Desmottes
e4db5d348a meson: sync warnings flags with -good
Add more warnings flags and disabled unused variable warnings if gst
debug system is disabled.

Copied from gst-plugins-good/meson.build
2019-03-25 16:03:24 +01:00
Tim-Philipp Müller
fbd6efcdee Back to development 2019-03-04 09:16:40 +00:00
Tim-Philipp Müller
6c82db2a99 Release 1.15.2 2019-02-26 12:02:24 +00:00
Tim-Philipp Müller
b4b00545c7 meson: add options to disable examples, tests and tools and bump meson requirement 2019-02-14 23:57:09 +00:00
Guillaume Desmottes
9ff4dc533f omxvideo: use GST_VIDEO_CAPS_MAKE() for template caps
Simplify the code and so we advertise the formats actually supported by
gst-omx.
2019-01-25 23:48:11 +00:00
Guillaume Desmottes
09bc1d630f omxvideoenc: validate cpb-size and initial-delay
cpb-size cannot be smaller than initial-delay.
2019-01-25 11:48:44 +01:00
Nicolas Dufresne
aff131dcee omxvideodec: Remove duplicated QoS code
The 'finish' function do the exact same check / drop, there is no
need to duplicate this here.
2019-01-25 00:50:06 +00:00
Nicolas Dufresne
4159ca2bc5 omxvideodec: Remove dead code
The omxvideodec base class have a totally unused prepare_frame() vritual
function, remove it.
2019-01-25 00:50:06 +00:00
Varunkumar Allagadapa
150e7271ab omxvideoenc: add adaptive gop-mode option
Added adaptive gop-mode option to ZYNQ_USCALE_PLUS encoder properties
2019-01-25 00:49:22 +00:00