Commit graph

7418 commits

Author SHA1 Message Date
Seungha Yang b32b59ce76 discoverer: Hold GSource object instead of source id
g_source_remove() works only for a GSource which was attached
to default GMainContext, but the GSource might be attached to
custom context depending on how gst_discoverer_start() was called.

Whatever the attached context was, g_source_destroy() can clean it up.
2019-01-28 18:53:39 +09:00
Tim-Philipp Müller 6330eb0cb3 meson: opengl: fix enabled_gl_apis in pkg-config file
Make consistent with what autotools puts into enabled_gl_apis
variable. Autotools puts 'gl' in there instead of 'opengl'.

This would cause problems when building -bad glmixers plugin
in meson against a -base that was built with autotools.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/871
2019-01-22 13:35:38 +00:00
Haihao Xiang 7874c74cfb gstglwindow_x11: require a resize event at once after XResizeWindow
Otherwise surface_width/surface_height stored in GstGLWindowPrivate
isn't changed, sometimes an unnecessary reconfigure event is sent on
sinkpad, then result in upstream reconfiguring.

Example pipeline:

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink
2019-01-21 01:27:15 +00:00
George Kiagiadakis 358ed9f9b4 videoaggregator: remove broken rate adjustment
The start_time and end_time in this context have already
been adjusted for the input's rate by converting them to running
time above. What is needed afterwards is to compare these
with the output's start/stop running time, which also takes
into account the rate, so we are comparing equal things.

Multiplying these with the output's rate here is only breaking
this logic. In most cases the input and output rate is the same,
so this multiplication effectively reverses the rate adjustment
that happened while converting to running time, which is why
we see the video playing with the original rate in tests.

Fixes #541
2019-01-18 11:33:33 +01:00
Sebastian Dröge acc098a736 gl: Only unbind buffers/vertex attrib arrays if we can't directly bind the vertex array to 0
Binding the vertex array to 0 will unbind everything else already.

In the previous order older versions of the Intel GL driver caused
errors to be printed for every single call when disabling the vertex
attrib arrays after binding the vertex array to 0.
2019-01-16 14:09:18 +02:00
Tim-Philipp Müller 37b56c9735 video-format: minor docs improvement 2019-01-16 00:28:16 +00:00
Seungha Yang e48b8033e3 gl: Fix some type conversion warnings with MSVC
MSVC complained about implicit conversion between GstGLFormat* and guint*
2019-01-14 01:48:34 +00:00
Wim Taymans a6552ee02e video-converter: fix number of allocated lines
We make an allocator for temporary lines and then use this for all
the steps in the conversion that can do in-place processing.

Keep track of the number of lines each step needs and use this to
allocate the right number of lines.

Previously we would not always allocate enough lines and we would
end up with conversion errors as lines would be reused prematurely.

Fixes #350
2019-01-11 11:47:51 -05:00
Alex Ashley 5767d65321 codec-utils: support extension audio object type and sample rate
ISO 14496-3 defines that audioObjectType 5 is a special case that
indicates SBR is present and that an additional field has to be
parsed to find the true audioObjectType.

There are two ways of signaling SBR within an AAC stream - implicit
and explicit (see [1] section 4.2). When explicit signaling is used,
the presence of SBR data is signaled by means of the SBR
audioObjectType in the AudioSpecificConfig data.

Normally the sample rate is specified by an index into a
table of common sample rates. However index 0x0f is a special case
that indicates that the next 24 bits contain the real sample rate.

[1] https://www.telosalliance.com/support/A-closer-look-into-MPEG-4-High-Efficiency-AAC

Fixes #39
2019-01-11 17:41:15 +05:30
Tim-Philipp Müller 5dc33afbcc video: link to design docs in GstVideoFormat docs
Which is where the memory layout of the various pixel formats
is explained in detail.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/538
2019-01-11 11:24:50 +00:00
Tim-Philipp Müller 4c06e9e6eb audiometa: fix docs typo 2019-01-06 00:48:56 +00:00
Seungha Yang c389dbf332 rtcpbuffer: Remove invalid sanity check
Checking the address distance between given begin/end sequence
doesn't make sense. They are output params.

This is to fix weird failure of libs_rtp on Windows
2018-12-30 23:25:14 +00:00
Tim-Philipp Müller 83806dc4e1 rtcpbuffer: fix typo 2018-12-30 18:06:58 +00:00
Tim-Philipp Müller 44b18ea2b6 rtcpbuffer: fix function guards with side effects
Code in g_return_*() must not have side effects, as it
might be compiled out if -DG_DISABLE_CHECKS is used, in
which case we would read garbage off the stack.
2018-12-30 17:28:38 +00:00
Tim-Philipp Müller a9cf6f238f video: build GstVideoAggregator which was moved from -bad 2018-12-28 12:16:12 +01:00
Tim-Philipp Müller f11571f398 Move GstVideoAggregator, compositor and OpenGL mixers from -bad
Merge branch 'videoaggregator-compositor-glmixers-move'

Fixes #137 and #138.
2018-12-28 12:15:39 +01:00
Sebastian Dröge acd7010576 videotimecode: Set the DROP_FRAME flag when parsing timecodes with a ,/; from a string
And also add a test for parsing a few valid and invalid timecodes
2018-12-19 23:11:24 +00:00
Sebastian Dröge 571e0abd8a videotimecode: Allow serializing invalid timecodes 2018-12-19 23:11:24 +00:00
Sebastian Dröge be516c2fbd videotimecode: Allow deserializing invalid timecodes
Timecode strings don't contain a framerate and that has to be provided
first separately before it can be converted into a valid timecode.
2018-12-19 23:11:24 +00:00
Sebastian Dröge 615fa4790f videotimecode: Don't consider 0/1 a valid framerate for timecodes
It breaks all the calculations. While it can make sense during
initialization, there's very little API that can be called with such
timecodes without ending up with wrong results.
2018-12-19 23:11:24 +00:00
Sebastian Dröge 6aa8936eee videotimecode: Remove various unneeded checks 2018-12-19 23:11:24 +00:00
Sebastian Dröge 905dcce61b videotimecode: Fix handling of timecodes without daily jam in gst_video_time_code_to_date_time()
So that it behaves according to documentation.
2018-12-19 23:11:24 +00:00
Sebastian Dröge 17cc4beaa1 videotimecode: Various documentation and annotation fixes 2018-12-19 23:11:24 +00:00
Sebastian Dröge df14532b0f videotimecode: Add some more guards for function parameters 2018-12-19 23:11:24 +00:00
Sebastian Dröge c02d3b03c2 videotimecode: Add API for initializing from a GDateTime with validation
The old API would only assert or return an invalid timecode, the new API
returns a boolean or NULL. We can't change the existing API
unfortunately but can at least deprecate it.
2018-12-19 23:11:24 +00:00
Sebastian Dröge ac6ae25b53 videotimecode: We only support 30000/1001 and 60000/1001 as drop-frame framerates
24000/1001 is *not* a drop-frame framerate.
2018-12-19 23:11:24 +00:00
Sebastian Dröge ef63c44f41 videotimecode: Fix division by zero in timecode validation function
And add some comments about what exactly we're testing in the
non-trivial cases.
2018-12-19 23:11:24 +00:00
Sebastian Dröge fbcbbd363b video: Add deprecation macros 2018-12-19 23:11:24 +00:00
Mathieu Duponchelle 1edb2c4242 audio-converter: add API to determine passthrough mode
audioconvert's passthrough status can no longer be determined
strictly from input / output caps equality, as a mix-matrix can
now be specified.

We now call gst_base_transform_set_passthrough dynamically, based
on the return from the new gst_audio_converter_is_passthrough()
API, which takes the mix matrix into account.
2018-12-17 14:23:49 +00:00
Edward Hervey bb6b518506 video-converter: Remove unused variable/calculation
Since the refactoring in cdd86d025a
calculating the stride was no longer needed in setup_scale.
2018-12-17 12:21:01 +01:00
Edward Hervey 3519b39131 videodecoder: Remove dead assignment
structure is never used afterwards
2018-12-17 12:21:01 +01:00
Edward Hervey 66ad2c3d40 sdpmessage: Remove dead assignment
p is overridden before being used (as the for() loop iterator)
2018-12-17 12:21:01 +01:00
Edward Hervey f4c9267265 sdpmessage: Remove dead assignment
The presence of `key-mgmt` attribute will set the mikey appropriately.
We therefore don't need to check the return value (which will
be overwritten afterwards).
2018-12-17 12:21:01 +01:00
Edward Hervey 962df52fef rtspconnection: Properly exit infinite loop
In the unlikeliness the builder state is invalid, exit the
top-level while(TRUE) loop.
2018-12-17 12:21:01 +01:00
Edward Hervey d42294114f audiobasesink: Remove dead assignment
out_samples is set and used in the 'no_align' block.
Dead assignment since 3e312e6e16
2018-12-17 12:21:01 +01:00
Edward Hervey f9176b8288 codec-utils: Don't leak bytewriter data
In error cases, don't forget to reset it.
2018-12-17 09:27:25 +01:00
Tim-Philipp Müller aa910c3cb7 rtp: fix g-i warnings
Use same variable name in function declaration as in function
definition and gtk-doc/g-i blurb.
2018-12-16 23:15:57 +00:00
Sebastian Dröge fd1a31ee11 video-anc: Add API for converting GstVideoCaptionType from/to GstCaps 2018-12-15 21:31:14 +00:00
Sebastian Dröge 1eb3a20617 video-anc: Replace GST_VIDEO_CAPTION_TYPE_CEA608_IN_CEA708_RAW with CEA608_S334_1A
CEA608_IN_CEA708_RAW is the same format as CEA708_RAW. It's only
difference is that it must contain only CEA608 and a format like this
does not exist in practice. In practice every element that handles raw
cc_data triplets must check each triplet for their actual content and
handle them accordingly.

For CC-only streams a parser could signal the existence of CEA608 and/or
CEA708 inside the caps but for metas this can only potentially be
signalled via the ALLOCATION query for negotiation purposes.

A separate format for this is not very useful and instead it should be a
format qualifier.

CEA608_S334_1A is the format defined by SMPTE S334-1 Annex A and which
is used for transferring CEA608 over SDI instead of CEA708 CDP packets.
2018-12-15 21:31:14 +00:00
Niels De Graef 3ce6bf65c7 gl/wayland: destroy wl_shell instance at finalize 2018-12-14 14:15:59 +01:00
Justin Kim c961dc9f8f gl/meson: Add OpenGL dependency by OSX way
Otherwise, it fails to link with the message below:

```
ld: can't map file, errno=22 file '...'
```
https://gitlab.freedesktop.org/gstreamer/gst-build/issues/13
2018-12-14 12:02:36 +09:00
Olivier Crête 01a25d81c1 rtcpbuffer: Validate the length of RTCP packets 2018-12-13 14:01:06 -05:00
Justin Kim 5303e2c32b rtcpbuffer: add support XR packet parsing
According to RFC3611, the extended report blocks in XR packet can
have variable length. To visit each block, the iterator should look
into block header. Once XR type is extracted, users can parse the
detailed information by given functions.

Loss/Duplicate RLE
The Loss RLE and the Duplicate RLE have same format so
they can share parsers. For unit test, randomly generated
pseudo packet is used.

Packet Receipt Times
The packet receipt times report block has a list of receipt
times which are in [begin_seq, end_seq).

Receiver Reference Time paser for XR packet
The receiver reference time has ntptime which is 64 bit type.

DLRR
The DLRR report block consists of sub-blocks which has ssrc, last RR,
and delay since last RR. The number of sub-blocks should be calculated
from block length.

Statistics Summary
The Statistics Summary report block provides fixed length
information.

VoIP Metrics
VoIP Metrics consists of several metrics even though they are in
a report block. Data retrieving functions are added per metrics.

https://bugzilla.gnome.org/show_bug.cgi?id=789822
2018-12-13 14:01:06 -05:00
Philipp Zabel 18c9babef9 glupload: dmabuf: use out_info to create allocation params for non-direct dmabuf uploads as well
Non-direct dmabuf uploads, just as direct dmabuf uploads, create EGL
images and thus GL textures of the same width as the imported image.
The input dmabuf line stride is not relevant to the resulting texture
in both cases.

This fixes the case where non-direct uploads of input dmabufs with line
stride larger than the width will for example cause glcolorconvert to
sample only the left part (width * bytes per pixel / stride) of the
image, causing a horizontally stretched and cropped output image.
2018-12-13 15:52:13 +01:00
Matthew Waters cfae8bd6c1 glmemory: normalize the internal format we pass into glTex* functions
Passing unsized formats sometimes breaks on embedded platforms

Take 2 at 694e30f858,
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/49
2018-12-13 00:10:10 +11:00
Matthew Waters 56ff61eac4 Revert "glformat: return sized formats in from_video_info"
This broke videotestsrc ! video/x-raw,format=NV12 ! glimagesink on
the desktop

Reverts: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/49
This reverts commit 694e30f858.
2018-12-13 00:09:59 +11:00
Sebastian Dröge f441b5216e video-overlay-composition: Optimize premultiplication/unpremultiplication loops
Pull in video frame fields into local variables. Without this the
compiler must assume that they could've changed on every use and read
them from memory again.

This reduces the inner loop from 6 memory reads per pixels to 4, and the
number of writes stays at 3.
2018-12-07 19:23:49 +02:00
Per Forlin 76aa92be51 rtspconnection: Replace Auth header instead of append
gst_rtsp_connection_send() adds the Authorization header to the request.
If this function is being called multiple times with the same request
it will add one more Authorization header every time.

To fix to this issue do not append a new Authorization header on
top of an existing ones. Remove any existing Authorization headers first
and then add the new one.

Fixes gst-plugins-good#425
2018-12-07 11:36:11 +00:00
Nicolas Dufresne f7d5dff921 gl: window-gbm: Restore CRTC on close
This simply try and restore the state of the CRTC when the window
is closed. This is a bit cosmetic, but it allow resuming fbcon
when we exit.
2018-12-05 13:41:11 +00:00
Nicolas Dufresne 46b503d674 gl: window-gbm: Remove unused private class member
The display class member is not used, not set and rather
confusing.
2018-12-05 13:41:11 +00:00
Nicolas Dufresne 6f7fbbfa71 gl: window-gbm: Remove unneeded extra function
The cleanup function was only called in _close() which was only
calling that function. This indirection didn't make much sense.
2018-12-05 13:41:11 +00:00
Wangfei 0ac7d1187b video: add Y410 pixel format.
This pixel format is packed format with 4:4:4 sample. And 10
available bits of Y/U/V and 2 available bits of alpha stored
in 4 Bytes.

Format defined in:
https://docs.microsoft.com/en-us/windows/desktop/medfound/10-bit-and-16-bit-yuv-video-formats
2018-12-01 21:05:36 -05:00
Carlos Rafael Giani 08ea7d676e gl/gbm: Add GST_GL_GBM_DRM_CONNECTOR environment variable
If multiple DRM connectors are connected, currently the first one is
picked. Improve this by adding an environment variable that allows for
choosing a connector by name. The connector name has been made so they
are compatible with modetest/modeprint DRM utilities.

Related to #490
2018-12-01 13:44:26 -05:00
Carlos Rafael Giani 3663ad787d gl/gbm: Improve logging output
* List all connectors, modes, and encoders, even after picking one
* Add missing DRM_MODE_CONNECTOR_DPI string for logging and improve
  existing strings
* Make sure the names matches modetest/modeprint from DRM utilities

Related to #490
2018-12-01 13:36:17 -05:00
Sebastian Dröge 48460f5ace video: convertframe: Shut down pipeline asynchronously via the thread pool
If we use the main loop it might happen that the caller (e.g. our unit
test) already shut down the loop once the result was received and in
that case the pipeline would never ever be shut down (and our unit test
would hang).
2018-11-30 12:40:19 +02:00
Marouen Ghodhbane 0f3efc4b84 audio-convert: Fix endianness conversion function init
Endianness conversion should be based on the sample width instead of the
sample depth.

Fixes #510
2018-11-30 09:14:33 +00:00
Matthew Waters 694e30f858 glformat: return sized formats in from_video_info
Fixes green output on e.g. Android when converting between YUV->RGBA
2018-11-30 18:05:58 +11:00
Tim-Philipp Müller 179409e9b3 video: fix typo in GstVideoCaptionType docs 2018-11-29 20:51:18 +00:00
Matthew Waters 9bd8da6ed4 gl/meson: Allow for the use of libGL as well as OpenGL
OpenGL.framework and libGL are two different providers of a GL
implementation that can be linked into an application together.
2018-11-29 04:53:50 +00:00
Sebastian Dröge db1722c9cb video-anc: G_GNUC_CHECK_VERSION was added in GLib 2.42
Define our own version if compiling with older versions. We currently
only require GLib 2.40.
2018-11-28 13:06:35 +00:00
Maciej Wolny f1556c1660 gst-gl: Remove duplicate declarations
This causes 'redefinition of typedef ...' errors on GCC 4.5.3
2018-11-28 11:59:25 +00:00
Jordan Petridis 2229d53f60
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:51:53 +02:00
Freyr666 5d7ceeae61 opengl: gbm: Adds missing unrefs for gl context and drm node release in finalizer
This adds a few missing gst_object_unref calls for the opengl context in
gstglwindow_gbm_egl.c, as well as the missing close call for the
drm node fd in gst_gl_display_gbm_finalize.
2018-11-23 15:41:01 +00:00
Sebastian Dröge de69fc148d convertframe: Error out directly in the sync variant if the state change to PAUSED failed 2018-11-23 11:52:16 +00:00
Sebastian Dröge 963a318c86 convertframe: Only go to PAUSED state for the async variant
We only care for the pre-roll sample.
2018-11-23 11:52:16 +00:00
Sebastian Dröge d9cf2973da convertframe: Error out directly if changing the pipeline state to PLAYING failed 2018-11-23 11:52:16 +00:00
Sebastian Dröge 98109bd5de convertframe: Use refcounting for the context
While this creates a circular reference between the pipeline and the
context, this ensures that the context stays alive for as long as any
callbacks could be called on it. The circular reference is broken once
the conversion is finished (or error, or timeout), which will then cause
everything to be freed.

Previously it was possible that a callback could be called on the
context right after it was freed already.

Also use only a single context structure, the second structure does not
simplify anything and duplicates storage.
2018-11-23 11:52:16 +00:00
Víctor Manuel Jáquez Leal 9be278d4f5 gl: libs: glib might not define G_HAVE_ISO_VARARGS
This will fix the compiler warning
"G_HAVE_ISO_VARARGS" is not defined, evaluates to 0 [-Wundef]
2018-11-23 11:20:36 +00:00
Xavier Claessens d3f9daf07c Check for zlib header 2018-11-22 20:03:33 -05:00
Xavier Claessens 7298139ba1 Fix zlib detection when there is no pkg-config file 2018-11-21 14:56:56 +00:00
Tomasz Andrzejak e0268c02ab audiodecoder: add API for setting caps on the source pad
This patch adds API in the audio decoder base class for setting the arbitrary
caps on the source pad.  Previously only caps converted from audio info were
possible.  This is particularly useful when subclass wants to set caps features
for audio decoder producing metadata.
2018-11-21 10:11:40 +00:00
Xavier Claessens 720e9ec2cc gl: Fix subclassing of GstGLContextEGL 2018-11-15 13:49:39 -05:00
Philippe Normand 94e3a1af2a video-format: Move Y210 format declaration to avoid ABI break
The Y210 format was added in the middle of the formats enum and list,
introducing an ABI break.

This issue was detected thanks to the gstreamer-rs test harness.
2018-11-15 11:28:11 +02:00
Linus Svensson 72ecbe2aef rtpbasepayload: Update current seqnum for buffer lists
The current sequence number will be the one from the first RTP buffer
when a buffer list is pushed, but should be the last one.

Fixes #495
2018-11-14 12:30:06 +00:00
Nirbheek Chauhan 998749d2a6 meson: Cleanup old FIXMEs that relied on meson bugfixes 2018-11-13 10:04:21 +05:30
Sebastian Dröge 6e9c71e6c1 video-anc: Implement a VBI encoder
This allows writing out data from caption meta and similar to VBI
2018-11-12 14:09:28 +00:00
Sebastian Dröge 369c79abd3 video-anc: Add comment about our assumption of the ADF user data format
We assume here the same data format for the user data as for the
DID/SDID: 10 bits with parity in the upper 2 bits. In theory some
standards could define this differently and even have full 10 bits of
user data but there does not seem to be a single such standard after
all these years.
2018-11-12 13:14:57 +00:00
Sebastian Dröge 932e9f5eee video-anc: Add support for parsing composite ADF and check the packets' checksum
And add the checksum to the data we test in the unit test.
2018-11-12 13:14:57 +00:00
Sebastian Dröge ca702a9190 video-anc: Fix documentation about SDID_block_number field
It was giving type 2 for both variants.
2018-11-12 13:14:57 +00:00
Sebastian Dröge eac38b47d4 video-anc: Add invalid-argument guards to public GstVideoVBIParser API 2018-11-12 13:14:57 +00:00
Sebastian Dröge d05d52e0ad gl: Make sure that GST_GLSL_PROFILE_ANY gets the correct value in introspection
Currently in Python it would become a signed 64 bit value but should
actually be an unsigned 32 bit value with all bits set.

This is the same problem as with GST_MESSAGE_TYPE_ANY.

See https://bugzilla.gnome.org/show_bug.cgi?id=732633
2018-11-12 05:30:38 +00:00
Sjoerd Simons 989f53383b glupload: dmabuf: be explicit about gl formats used
Rather then letting gst_gl_memory_setup_buffer guess the GL format used
for an eglimage after importing a dmabuf be explicit about it. This
fixes issues where dmabuf import may have used another format then
gst_gl_format_from_video_info would guess on the basis of the available
GL extensions.

In particular on etnaviv the gst_gl_format_from_video_info would
assuming a luminance + alpha GL format is used for YUY2, but the dmabuf
import will always use RG88. Which causes images to end up somewhat pink when
displayed on the screen.
2018-11-11 16:15:59 -05:00
Sjoerd Simons 99ac4e6600 gl/egl: Determine correct format on dmabuf import
When importing an egl image from dmabuf gst_gl_format_from_video_info
was used to work what the result GL format will be. Unfortunately that
will only work if the conventional format and the choosen DRM fourcc for
the format match up.

On etnaviv platforms there is no support for GL_EXT_texture_rg, so the
GL format chosen for YUY2 ends up being GST_GL_LUMINANCE_ALPHA. However
DRM does not do luminance + alpha as it's a legacy GL thing, so the
dmabuf import ends up using DRM_FORMAT_GR88.

To fix this, tie the DRM_FORMAT and the GL format together so they
always match up.
2018-11-11 16:15:54 -05:00
Sebastian Dröge d3a35870a2 audio: const gpointer is not the same as gconstpointer/const void *
See https://bugzilla.gnome.org/show_bug.cgi?id=664491
2018-11-05 08:16:16 +00:00
Sebastian Dröge 4666444955 video-anc: Fix bounds checks when parsing VBI data
We were reading more bytes than we allocated.

https://bugzilla.gnome.org/show_bug.cgi?id=797363
2018-11-01 19:30:41 +02:00
Nicolas Dufresne e074eff5ef glupload: Only renegotiate if the caps are incompatible
There is new code that ensures that we renegotiate after an
uploader transition if the negotiated caps have changed.

The problem is that the raw uploader will not really try and
fixate the input caps, but instead of return a subset with the
only the supported target texture.

This had two effect, raw uploads was always done renegotiated
once and the raw upload unit test was now failing as it didn't
expect a renegotiation.

As it's a valid check, simply relax the gst_caps_is_equal() check
and use a gst_caps_is_subset() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-11-01 06:22:28 -04:00
Nicolas Dufresne c8c7672ffb glupload: Do prepend the preferred caps
The direct dmabuf upload does color conversion, so when it transforms
the caps, it replaces the format with all formats found through the
format query. When this uploader can't be used, it makes the upstream
source pick a unsupported format.

To fix this, we only append the caps with a list of format. So the
source will only pick one of these formats if the downstream preferred
format is not supported. A negotiation failure after this would be
normal.

This fixes pipelines without a glcolorconvert element.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-11-01 06:22:28 -04:00
Wangfei cc0bcd5856 video: add Y210 pixel format.
This pixel format is packed format with 4:2:2 sample and 10
available bits of each channel.

https://bugzilla.gnome.org/show_bug.cgi?id=797267
2018-10-31 15:01:34 +00:00
Philipp Zabel 3c8ac7de80 glupload: dmabuf-direct: report driver limitations to debug log
Report in the DEBUG log if the driver does not support importing a given
format with linear modifiers non-externally.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel eb20293a02 glupload: dmabuf-direct: query formats before modifiers
The EXT_image_dma_buf_import_modifiers extension [1] states regarding
eglQueryDmaBufModifiersEXT:

    The format must be one of those returned by the
    eglQueryDmaBufFormatsEXT command.

To comply with this requirement eglQueryDmaBufFormatsEXT must be called
before eglQueryDmaBufModifiersEXT.

[1] https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel c4edd80c8c glupload: debug output from dmabuf and dmabuf_direct upload transform_caps
https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel 58399b20bd glupload: calculate DRM fourcc once for direct dmabuf upload
Calculate DRM fourcc and report to the DEBUG log about it only once
instead of three times in gst_egl_image_from_dmabuf_direct().

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Michael Olbrich 507e31dfc0 glupload: Implement direct dmabuf uploader
The idea is that some GPUs (like the Vivante series) can actually
perform the YUV->RGB conversion internally, so no custom conversion
shaders are needed. To make use of this feature, we need an additional
uploader that can import DMABUF FDs and also directly pass the pixel
format, relying on the GPU to do the conversion.

Based on patches from Nicolas Dufresne <nicolas.dufresne@collabora.com> and
Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Michael Olbrich f349cdccf5 glupload: handle upload methods with different caps
If a upload method is selected then use it exclusively in transform_caps().
Also, reconfigure if the current caps don't match the current upload
method.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Michael Olbrich f3292dc156 glupload: allow system memory for dmabuf in transform_caps
This should not be necessary, but currently not all plugins that provide
dmabuf memory announce this with caps features, e.g. v4l2.
The static caps already contain the system memory. It didn't break before
because other upload methods provide the necessary transformation.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Michael Olbrich 4d9abc6bed glupload: try to use the last method after reconfigure
Reconfigure will trigger a set_caps which clears the upload method.
Remember the method in this case and start with it.
Wrap around once to try all methods if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:07 +01:00
Michael Olbrich 5d0e191710 gl/egl: Add gst_egl_image_from_dmabuf_direct() function
The colorspace conversion happens during the upload so the necessary hints
must be provided to ensure that the conversion works correctly.

At least the Mesa Intel driver will create a texture without error but
produces an incorrect result. Use eglQueryDmaBufModifiersEXT() to check if
non-external upload is supported for the given format.

Based on a patch from Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:02 +01:00
Nicolas Dufresne 0ac646f7f4 glmemory: Fix n_wrapped_pointers usage
gst_gl_memory_setup_buffer() was not properly using the number
of pointers to wrapped. This also fixes the validation, as we
only support 1 wrapper per view, or num_planes * views wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 10:47:01 +01:00
Seungha Yang 3499d9ea64 meson: Replace empty configuration_data() with copy keyword
Use 'copy' keyword to avoid meson warning message.
Note that 'copy' keyword in configure_file() is available
since meson 0.47.0

https://bugzilla.gnome.org/show_bug.cgi?id=797298
2018-10-17 13:48:47 +01:00
Nirbheek Chauhan 76ba8d8759 videometa: Log map errors with GST_ERROR, not DEBUG
Otherwise it's very easy to miss them when gst_video_frame_map() fails
2018-10-15 19:46:48 +05:30
Mathieu Duponchelle aa6daaafc6 rtspconnection: do not duplicate authentication headers
rtsp_connection_send takes care of adding those already,
and some reverse proxies such as nginx will reject the request
altogether if the Authorization header is present twice,
even with the same value.

https://bugzilla.gnome.org/show_bug.cgi?id=797272
2018-10-11 15:35:56 +02:00
Stian Selnes f766b85b96 rtpbasepayload: rtpbasedepayload: Add source-info property
Add a source-info property that will read/write meta to the buffers
about RTP source information. The GstRTPSourceMeta can be used to
transport information about the origin of a buffer, e.g. the sources
that is included in a mixed audio buffer.

A new function gst_rtp_base_payload_allocate_output_buffer() is added
for payloaders to use to allocate the output RTP buffer with the correct
number of CSRCs according to the meta and fill it.

RTPSourceMeta does not make sense on RTP buffers since the information
is in the RTP header. So the payloader will strip the meta from the
output buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=761947
2018-10-10 14:38:01 -04:00
Matthew Waters d63add22d2 gl/overlaycompositor: don't force unpremultiplied alpha
Remove testing code from 2315936561
2018-10-04 23:24:15 +10:00
Matthew Waters 2315936561 gl/overlaycompositor: support both (un)premultiplied alpha
Using the correct blend modes for each case or converting to
premultipled in the very unlikely case that separate blend modes are
unavailable on ancient opengl hardware.
2018-10-04 23:04:07 +10:00
Sebastian Dröge 5a3666395e gl: GstGLAPI should be gst_gl_api_ in lower-case 2018-10-04 14:50:43 +03:00
Sebastian Dröge ee98f056b1 glviewconvert: Add backwards compatibility gst_gl_stereo_downmix_mode_get_type()
It's proper new name is gst_gl_stereo_downmix_get_type().
2018-10-04 13:38:59 +03:00
Sebastian Dröge 62197270dd gl: Add gl-enumtypes.[ch] to CLEANFILES 2018-10-04 13:33:30 +03:00
Sebastian Dröge d09eccc06b video-overlay-composition: Correctly mark GstVideoOverlayFormatFlags as flags
And register a GType for it.
2018-10-04 11:36:36 +03:00
Matthew Waters e9c519e5f3 gl/overlaycompositor: add support for flipping the output
This is required to use gloverlaycompositor outside of glimagesink where
the output is not automatically flipped
2018-10-04 14:28:35 +10:00
Matthew Waters 1359d0995e gl/overlaycompositor: handle ANY caps features gracefully 2018-10-04 14:28:35 +10:00
Matthew Waters 0086dfcf7f glfilter: don't complete overwrite caps features from the subclass
We can get away with ensuring that the memory:GLMemory caps feature is
present in the output caps
2018-10-04 14:28:35 +10:00
Sebastian Dröge 919083d082 gl: Add gl-enumtypes.h to nodist_HEADERS 2018-10-03 23:27:32 +03:00
Sebastian Dröge 2b0298d847 glviewconvert: Create an anonymous enum for GstGLStereoDownmix
Older glib-mkenums completely fails to parse it otherwise.
2018-10-03 23:17:56 +03:00
Sebastian Dröge 2b4dfb9941 gl: Generate enum GTypes via glib-mkenums
https://bugzilla.gnome.org/show_bug.cgi?id=797240
https://bugzilla.gnome.org/show_bug.cgi?id=797144
2018-10-03 13:13:24 +03:00
Sebastian Dröge 48e1c8e12d glsl: Fix error quark string to be more consistent 2018-10-02 21:01:31 +03:00
Sebastian Dröge fdacdf502b glbasememory: Fix error quark string and move documentation to the right place 2018-10-02 20:59:25 +03:00
Thiago Santos 6be312a759 encoding-profile: set_restriction should accept null as valid
It was checking for GST_IS_CAPS only and that would fail if the new
restriction caps was NULL and its documentation says it accepts NULL as
valid input.
2018-10-01 18:05:39 -07:00
Sebastian Dröge bb0d58a905 video-overlay-composition: Handle miniobject writability correctly
By tracking parents and using the proper GstMiniObject API for detecting
writability instead of just the reference count.

https://bugzilla.gnome.org/show_bug.cgi?id=797230
2018-10-01 12:19:22 +03:00
Sebastian Dröge 4e125c20ac video: Fix annotations for gst_buffer_add_video_meta_full() 2018-09-29 11:26:54 +03:00
Edward Hervey 8707914d23 tagdemux: Use upstream GST_EVENT_STREAM_START if present
If we have an upstream GST_EVENT_STREAM_START, use that one instead
of creating a new one which could be completely different from the
upstream one and drop information (like the stream flags and stream
object).

Only create a new event if we don't already have one from upstream

https://bugzilla.gnome.org/show_bug.cgi?id=797215
2018-09-27 15:09:06 +02:00
Matthew Waters 2c44c5fb40 glviewconvert: wait and set the gl sync meta on buffers
This may be a cause of out-of-place frames when transforming multiview
buffers.
2018-09-26 13:44:48 +10:00
Sebastian Dröge 4d534ad8e8 glviewconvert: Copy composition meta from the primary buffer to both outputs
Without this, glviewconvert (and thus glimagesink) will drop all overlay
composition metas.
2018-09-25 17:01:15 +03:00
Sebastian Dröge 64774ece0c glcolorconvert: Don't copy overlay composition meta over to NULL outbufs 2018-09-25 17:01:15 +03:00
Nirbheek Chauhan d002cd33d3 gstaudioutilsprivate: Fix warnings while setting thread priority
Also use G_OS_WIN32 instead of _WIN32 for clarity.
2018-09-24 19:44:28 +05:30
Tim-Philipp Müller dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Sebastian Dröge cde4cfe384 gl/win32: Use g_io_channel_win32_new_messages() instead of our custom GSource
Removes some unneeded code duplication between here and GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=797184
2018-09-21 11:57:01 +03:00
Víctor Manuel Jáquez Leal 982b212485 gl/egl: fix annotation for gst_egl_image_new_wrapped()
https://bugzilla.gnome.org/show_bug.cgi?id=797158
2018-09-18 11:37:39 +02:00
Víctor Manuel Jáquez Leal e12a55a4ea gl: meson: add missing headers for gir generations
There are a lot of symbols in GstGL-1.0.gir generated by automake that
are not when it is generated by meson, because a lot of headers were
not included in meson's gir generation.

https://bugzilla.gnome.org/show_bug.cgi?id=797158
2018-09-18 11:37:39 +02:00
Matthew Waters 5765641729 gl/build: don't pass OpenGL headers to GIR
g-ir-scanner does not have a good enough C parser to parse the GL system
headers
2018-09-18 11:13:27 +10:00
Matthew Waters 333566c53e glshader: macro out all the extremely similar uniform setting 2018-09-18 11:13:27 +10:00
Víctor Manuel Jáquez Leal fae3f7cb56 glviewconvert: fix GEnumValue declaration
The purpose of value_name in GEnumValue structure is to express in
text format the name of the enum, not a description of the value, so
it can be use later for the gir file generation.

https://bugzilla.gnome.org/show_bug.cgi?id=797144
2018-09-14 17:43:04 +02:00
Nicolas Dufresne bccc69fadb Revert "glmemory: Fix n_wrapped_pointers usage"
This reverts commit b1299c179b.
2018-09-13 20:02:43 -04:00
Nicolas Dufresne ffcab084d5 Revert "glupload: allow system memory for dmabuf in transform_caps"
This reverts commit d7eb48cce7.
2018-09-13 20:02:41 -04:00
Nicolas Dufresne da30327b94 Revert "glupload: handle upload methods with different caps"
This reverts commit 87336b1957.
2018-09-13 20:02:40 -04:00
Nicolas Dufresne 4a72dada3a Revert "gl/egl: Add gst_egl_image_from_dmabuf_direct() function"
This reverts commit 8f0d75d4d6.
2018-09-13 20:02:39 -04:00
Nicolas Dufresne 7b48561b8a Revert "glupload: Implement direct dmabuf uploader"
This reverts commit 3b1ae6262b.
2018-09-13 20:02:38 -04:00
Nicolas Dufresne 25df27698f Revert "glupload: try to use the last method after reconfigure"
This reverts commit c1053e17d5.
2018-09-13 20:02:37 -04:00
Michael Olbrich c1053e17d5 glupload: try to use the last method after reconfigure
Reconfigure will trigger a set_caps which clears the upload method.
Remember the method in this case and start with it.
Wrap around once to try all methods if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Michael Olbrich 3b1ae6262b glupload: Implement direct dmabuf uploader
The idea is that some GPUs (like the Vivante series) can actually
perform the YUV->RGB conversion internally, so no custom conversion
shaders are needed. To make use of this feature, we need an additional
uploader that can import DMABUF FDs and also directly pass the pixel
format, relying on the GPU to do the conversion.

Based on patches from Nicolas Dufresne <nicolas.dufresne@collabora.com> and
Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Nicolas Dufresne 8f0d75d4d6 gl/egl: Add gst_egl_image_from_dmabuf_direct() function
The colorspace conversion happens during the upload so the necessary hints
must be provided to ensure that the conversion works correctly.

At least the Mesa Intel driver will create a texture without error but
produces an incorrect result. Use eglQueryDmaBufModifiersEXT() to check if
non-external upload is supported for the given format.

Based on a patch from Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Michael Olbrich 87336b1957 glupload: handle upload methods with different caps
If a upload method is selected then use it exclusively in transform_caps().
Also, reconfigure if the current caps don't match the current upload
method.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:03:03 -04:00
Michael Olbrich d7eb48cce7 glupload: allow system memory for dmabuf in transform_caps
This should not be necessary, but currently not all plugins that provide
dmabuf memory announce this with caps features, e.g. v4l2.
The static caps already contain the system memory. It didn't break before
because other upload methods provide the necessary transformation.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:03:03 -04:00
Nicolas Dufresne b1299c179b glmemory: Fix n_wrapped_pointers usage
gst_gl_memory_setup_buffer() was not properly using the number
of pointers to wrapped. This also fixes the validation, as we
only support 1 wrapper per view, or num_planes * views wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:02:46 -04:00
Nicolas Dufresne 8ffd15ab28 videodecoder: Delete the link before pushing
The gst_video_decoder_clip_and_push_buf() now drops the internal stream
lock while pushing. This means, the output_queued list could be modififed
during that time. To make the code safe again, we delete the link before
pushing the data. The walk pointer will later be updated with the list
head, which makes it safe in case the list was modififed.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-09-10 17:08:25 -04:00
Nirbheek Chauhan 1733233060 gstaudiosrc/sink: Set audio ringbuffer thread priority
On Windows, the ringbuffer thread function must have the "Pro Audio"
priority set, otherwise it sometimes doesn't get scheduled for
200-300ms, which will immediately cause an underrun unless you set
a very high latency-time and buffer-time.

This has no compile-time deps since it tries to load avrt.dll at
runtime to set the thread priority.
2018-09-11 00:41:59 +05:30
Matthew Waters 22f6ff094a gl/meson: check for EGL headers before allowing use of EGL
For distros that provide headers in seperate dev/devel packages this
won't build egl support without the necessary EGL headers.
2018-09-05 18:34:06 +10:00
Sebastian Dröge 14031f1c63 discoverer: Consider closedcaption/ as subtitles and improve subtitle caps detection
Generally all subtitle/, subpicture/, text/, closedcaption/ and
application/x-subtitle caps instead of hardcoding a small set of caps.

https://bugzilla.gnome.org/show_bug.cgi?id=797072
2018-09-04 11:59:46 +03:00
Alexey Chernov 595dd27ede videoencoder: Release STREAM_LOCK during gst_pad_push()
Release STREAM_LOCK before calling gst_pad_push() and take it
back afterward so that upstream isn't blocked while output
buffer is being pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-08-31 16:11:04 -04:00
Alexey Chernov fb49674a39 videodecoder: Release STREAM_LOCK during gst_pad_push()
Release STREAM_LOCK before calling gst_pad_push() and take it
back afterward so that upstream isn't blocked while output
buffer is being pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-08-31 16:10:57 -04:00
Nirbheek Chauhan a9cab426d0 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:43 +05:30