Commit graph

1398 commits

Author SHA1 Message Date
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
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
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
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
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
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
Tim-Philipp Müller 179409e9b3 video: fix typo in GstVideoCaptionType docs 2018-11-29 20:51:18 +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
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
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
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 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
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
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
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
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
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
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
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
Zeeshan Ali 3880eb819a video: Add GST_VIDEO_INFO_FIELD_RATE_N() macro
Add a new macro that gives you the rate of the fields, which is the
numerator of the field-rate for ALTERNATE interlacing video and FPS for
progressive and other interlacing formats.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali be6c8400b0 video: Add gst_video_decoder_set_interlaced_output_state()
Add a variant of gst_video_decoder_set_output_state() that allows the user
to pass an interlacing mode as well. This is needed to ensure that
gst_video_info_set_interlaced_format() is used instead so that
GstVideoInfo.size is correctly initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali 4879983253 video: Add GST_VIDEO_INFO_FIELD_HEIGHT() macro
Add a new macro that gives you the height of a field. It returns the
height of the full frame unless split-field (alternate) interlacing is
in use. Also GST_VIDEO_INFO_COMP_HEIGHT macro now uses this new macro to
get the height for its calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali 0fbe4634a6 video: Add gst_video_info_set_interlaced_format()
Add a helper to set the interlacing mode while creating the GstVideoInfo
in addition to format and resolution. Using this helper will ensure that
size is correctly calculated for split-field interlacing mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali bd9c7b36d8 video: Add GST_VIDEO_INTERLACE_MODE_ALTERNATE
Add a new interlace mode enum to represent buffers containing a single
field of an interlaced video in a buffer. The name is based on the
equivalent video format in the V4L2 API, V4L2_FIELD_ALTERNATE:

https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/field-order.html

Since caps fields are optional, we also introduce a new caps feature,
"format:Interlaced" that always goes with "alternate" interlace mode to ensure
that caps for this incompatible format are incompatible with other interlaced
and progressive video caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali 8fa9fda226 video: Add format for single fields of interlaced video in a buffer
https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Tim-Philipp Müller ca15315565 gst-libs: include config.h in all source files
This will be needed later when we get our export define from config.h
2018-08-13 09:23:34 +01:00
Bastian Köcher efa9bdccf9 meson: fix install dir for generated header files
Nixos installs into a non-standard includedir, so need
to take account of the 'includedir' option instead of
just hard-coding 'include' here.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-08-10 12:43:38 +01:00
Nicolas Dufresne 62cb08404b videodecoder: Don't always drain on gaps/discont
V4L2 and OMX decoder don't support draining and keeping reference
frames. As a side effect, these decoder just stops working on
gaps/discont. When this drain was introduced, the commit stated that
this was for TRICKMODE_KEY_UNITS, so only drain if running in this mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796771
2018-07-12 15:25:51 -04:00
Guillaume Desmottes 173e2d8db3 videopool: display expected size in warning message
Display the size computed from the caps when rejecting a pool
configuration because the buffer size is too small.

https://bugzilla.gnome.org/show_bug.cgi?id=796768
2018-07-09 11:21:50 +02:00
Olivier Crête 28e5f81021 videosink: Set processing deadline to 15ms
This roughly corresponds to one frame at 60fps, and leave 5ms
of max_lateness to not change the existing behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-07 08:59:30 -04:00
Tim-Philipp Müller 18c457dfb4 video: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 21:59:13 +02:00