Commit graph

21 commits

Author SHA1 Message Date
Matthew Waters e2ff6b61ce cccombiner: initial implementation of using CCBuffer helper
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 088597b430 closedcaption: move CC buffering to helper object
Move most of the interesting code from ccconverter to this new helper
object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 06a20f9243 closedcaption: move cdp->cc_data into shared location
So it can be used by both ccconverter and cccombiner

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters fde92ec43f closedcaption: move cc_data->cdp to shared file
Used by both ccconverter and cccombiner

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 9f1b54f6ee ccconverter: avoid different indent versions indenting !! differently.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 067185e7da closedcaption: move cdp framerate table to common file
shared by both cccombiner and ccconverter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 5dd199f7e8 cccombiner: don't assume a single cea608 data packet per buffer
e.g. 24fps can have up to 3 and would include either two field0 or
field1 cea608 data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 741cfd18b5 ccconverter: drop data when overflow on extracting cea608 from cc_data
If the buffer overflows, then drop rather than causing a failure and
fropping the output buffer indefinitely.  This may have caused downstream to
be waiting for data the will never arrive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 542060fea7 ccconverter: fix framerate passthrough with malformed input
If an input is malformed (only produces cea608 field 1 cc_data) then
when in passthrough we would effectively be dropping every second cea608
on output as we would not store any unused cea608 data.

Fix by having all code paths go through the framerate conversion code
which will store and retrieve any relevant data across buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Thibault Saunier 6a4425e46a meson: Call pkgconfig.generate in the loop where we declare plugins dependencies
Removing some copy pasted code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Mathieu Duponchelle f10e2eb88f cccombiner: expose output-padding property
When schedule=true and output-padding=false, cccombiner will not
inject padding in the output closed caption meta stream.

The property has no effect when schedule=false.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1621>
2022-06-17 14:11:46 +00:00
Matthew Waters 2e69886a02 ccconverter: ensure correct ordering of cea608 across output buffers
e.g. if a 60fps output is configured, we can only produce a single field
of cea608 that must alternate between field 1 and field 2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2019>
2022-03-26 00:00:36 +00:00
Matthew Waters 6977119f99 ccconverter: ignore padding cea608 data even if marked as 'valid'
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2019>
2022-03-26 00:00:36 +00:00
Matthew Waters 098ff9a453 ccconverter: drop data with a warning if scratch buffers overflow
Instead of asserting which could bring down the entire application.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1972>
2022-03-17 21:46:44 +11:00
Mathieu Duponchelle d8c8737e71 cccombiner: fix s334-1a scheduling
The previous code was mistakenly trying to compute a cc_type out
of the first byte in the byte triplet, whereas it is to be interpreted
as:

> Bit b7 of the LINE value is the field number (0 for field 2; 1 for field 1).
> Bits b6 and b5 are 0. Bits b4-b0 form a 5-bit unsigned integer which
> represents the offset

The same mistake was made when creating padding packets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1496>
2022-01-12 14:34:22 +00:00
Mathieu Duponchelle 6861ea8fe1 cccombiner: merge buffers for both fields with caption type s334-1a
Other elements such as line21encoder expect both fields to be present
in the same meta, not one meta per field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1496>
2022-01-12 14:34:22 +00:00
Mathieu Duponchelle e6f39394f5 cccombiner: fix default value when installing schedule property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1252>
2021-10-26 14:48:13 +00:00
Mathieu Duponchelle e730bdaa8e cccombiner: fix emission of selected-samples in one case
Detected while reading the code, cccombiner must set
self->current_video_buffer to NULL *after* emitting selected-samples
in order for the application to get a useful return when peeking
the next video sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1252>
2021-10-26 14:48:13 +00:00
Mathieu Duponchelle fa1805d531 cccombiner: stop attaching caption buffers when caption pad has gone EOS
When schedule is true (as is the case by default), we insert padding
when no caption data is present in the schedule queue, and previously
weren't checking whether the caption pad had gone EOS, leading to
infinite scheduling of padding after EOS on the caption pad.

Rectify that by adding a "drain" parameter to dequeue_caption()

In addition, update the captions_and_eos test to push valid cc_data
in: without this cccombiner was attaching padding buffers it had
generated itself, and with that patch would now stop attaching
said padding to the second buffer. By pushing valid, non-padding
cc_data we ensure a caption buffer is indeed attached to the first
and second video buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1252>
2021-10-26 14:48:13 +00:00
Seungha Yang 05496df0d1 closedcaption: Fix broken debug function macros with MSVC build
warning C4003: not enough arguments for function-like macro invocation 'warning'

G_STMT_END macro is extended to the below form with MSVC
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
while(0) \
__pragma(warning(pop))

So MSVC preprocessor will extend it further to
__pragma(VBI_CAT_LEVEL_LOG(push)) ...

Should rename warning() debug macro function therefore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 23:03:20 +09:00
Thibault Saunier 019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00