Commit graph

954 commits

Author SHA1 Message Date
Seungha Yang
d1e7290109 d3d11: Add support for packed 4:2:2 and 4:4:4 10bits formats
Add support for Y210 and Y410 formats which are commonly used format
for en/decoders on Windows. Note that those formats cannot be used for
render target (output) of shader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1821>
2020-11-20 02:28:54 +09:00
Jan Schmidt
be131dba6a tests: Don't set dtlsenc state before linking.
Link the dtlsenc in the testsuite before setting it to paused, as it
starts a pad task that can generate a not-linked error otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1744>
2020-10-31 21:46:16 +11:00
Jan Schmidt
c1be9c53e1 dtls: Catch bus errors and fail instead of hanging.
If the DTLS elements fail, they post a bus error and don't signal any
key negotiation. Catch the bus error and fail the test early instead
of letting it hang and time out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1741>
2020-10-31 01:47:06 +00:00
Seungha Yang
f62ecc1625 tests: Add CUDA filter unit tests
Adding a test for buffer meta and colorspace conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
2020-10-16 15:56:49 +00:00
Jan Alexander Steffens (heftig)
3ea6387f96 tests: svthevcenc: Fix test_encode_simple
Pick the same I420 format the other test use. Without this, the source
picks AYUV64, which fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1573>
2020-10-10 04:34:56 +00:00
Ederson de Souza
8335039ecd tests/avtp: Fix coverity issues
Fixes sign extension issues, unchecked return values and some constant
expression results.

CID: 1465073, 1465074, 1465075, 1465076, 1465077
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1398>
2020-09-28 18:40:43 +00:00
Seungha Yang
ea24a2e527 d3d11: Add support for packed 8bits 4:2:2 YUV formats
Note that newly added formats (YUY2, UYVY, and VYUY) are not supported
render target view formats. So such formats can be only input of d3d11convert
or d3d11videosink. Another note is that YUY2 format is a very common
format for hardware en/decoders on Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1581>
2020-09-18 14:47:21 +00:00
Matthew Waters
e2d88f0569 webrtc: propagate more errors through the promise
Return errors on promises when things fail where available.

Things like parsing errors, invalid states, missing fields, unsupported
transitions, etc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1565>
2020-09-14 04:04:29 +00:00
Seungha Yang
2b152eae69 videoparsers: Add vp9parse element
Adding vp9parse element to parse various stream information such as
resolution, profile, and so on. If upstream does not provide resolution and/or
profile, this would be useful for decodebin pipeline for autoplugging
suitable decoder element depending on template caps of each decoder element.

In addition, vp9parse element supports unpacking superframe into
single frame for decoders. The vp9 superframe is a frame which consists
of multiple frames (or superframe with one frame is allowed) followed by superframe
index block. Then unpacked each frame will be considered as normal frame
by decoder. The decision for unpacking will be done by downstream element's
"alignment" caps field, which can be "super-frame" or "frame".
If downstream specifies the "alignment" as "frame",
then vp9parse element will split an incoming superframe into single frames
and the superframe index (located at the end of the superframe) data
will be discarded by vp9parse element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1041>
2020-09-10 14:56:52 +00:00
Mathieu Duponchelle
c58357fb66 line21enc: add remove-caption-meta property
Similar to #GstCCExtractor:remove-caption-meta

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1554>
2020-09-09 22:11:28 +02:00
Mathieu Duponchelle
c07e2a89ba line21enc: heavily constrain video height
We can only determine a correct placement for the CC line
with:

* height == 525 (standard NTSC, line 21 / 22)
* height == 486 (NTSC usable lines + 6 lines for VBI, line 1 / 2)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1554>
2020-09-09 19:38:58 +02:00
Jan Alexander Steffens (heftig)
ebe397892b tests: mpegtsmux: Test that we can manipulate pads after stop
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1552>
2020-09-01 14:01:56 +00:00
Matthew Waters
e4b848e2a8 tests/webrtc: unref GBytes after use
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1535>
2020-08-24 17:02:35 +10:00
Sebastian Dröge
1d1b3eb8b4 cccombiner: Update for additional info parameter to the "samples-selected" signal
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/590

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1498>
2020-08-07 17:53:14 +00:00
Mathieu Duponchelle
265128e7f7 cccombiner: implement samples selection API
Call gst_aggregator_selected_samples() after identifying the
caption buffers that will be added as a meta on the next video
buffer.

Implement GstAggregator.peek_next_sample.

Add an example that demonstrates usage of the new API in
combination with the existing buffer-consumed signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1390>
2020-07-30 23:10:33 +00:00
Tim-Philipp Müller
395ecb3d2f avtp: rename tstamp-mode to timestamp-mode
I thnk w cn spre the xtra lttrs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1397>
2020-07-11 00:14:44 +01:00
Jan Alexander Steffens (heftig)
9c2982d22c tests: mpegtsmux: Test we don't crash releasing unused pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
2020-07-07 14:05:04 +02:00
Jan Alexander Steffens (heftig)
076189e2dc tests: mpegtsmux: Avoid use-after-unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
2020-07-07 14:05:04 +02:00
Matthew Waters
ebd1b2c929 ccconverter: write the cdp timecode data correctly
We were mixing up the tens part with the unit parts all over the place.

e.g. 12 seconds would be encoded as 0x21 instead of the correct 0x12

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1400>
2020-07-03 06:54:46 +00:00
Matthew Waters
c6c4d42c4a ccconverter: fail negotiation when framerate conversion is not possible
Converting between anything but cdp will fail at converting
framerates and negotiation should reflect that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1393>
2020-07-01 19:33:56 +00:00
Matthew Waters
4f334234c8 ccconverter: fix missing output framerate on the caps
A pipeline like this:

closedcaption/x-cea-708,format=cdp,framerate=30000/1001 ! ccconverter ! closedcaption/x-cea-708,format=cc_data

would produce a critical/assert:

GStreamer-CRITICAL **: 14:21:11.509: gst_util_fraction_multiply: assertion 'a_d != 0' failed

because there would be no framerate field on ccconverter's output.

Fixed by always fixating a framerate if the input has a framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1393>
2020-07-01 19:33:56 +00:00
Seungha Yang
57c8ad1dbc tests: wasapi2: Add unit test for reusing wasapisrc
Test state change between playing and null and playing again

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1264>
2020-06-08 03:10:05 +00:00
Ederson de Souza
6caea9e19b tests/avtp: Plug some (more) leaks
Some leaks were introduced in new tests - this patch fix them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1312>
2020-06-01 18:03:19 +00:00
Jan Alexander Steffens (heftig)
aad9cf8096 mpegtsdemux: tests: Test that tsparse doesn't drop padding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1300>
2020-05-28 16:41:30 +00:00
Jan Schmidt
737cfc40de avtp: Initialise strack structures to 0 in tests
Avoid valgrind warnings about accessing uninitialised memory
in the tests by initialisting structures to 0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1305>
2020-05-28 10:58:02 +00:00
Jan Schmidt
0e578b1096 avtp: Fix some leaks in the tests
Fix valgrind errors that area showing on the CI now
that AVTP elements are built.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1305>
2020-05-28 10:58:02 +00:00
Jan Alexander Steffens (heftig)
055de3cdff mpegtsdemux: tests: Add simple tests for tsparse and tsdemux
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1274>
2020-05-18 14:11:40 +00:00
Matthew Waters
ba1558a7ab ccconverter: use a better padding byte sequence for writing cdp
0xf8 can be interpreted as cea608 data at the beginning of a cdp packet
as the cc_valid bit is not checked when cc_valid in (0b00 or 0b01).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
7ed0bc539f ccconverter: split temporary storage into 3
Instead of storing the raw cc_data, store the 2 cea608 fields individually
as well as the ccp data.

Simply copying the input cc_data to the output cc_data violates a number of
requirements in the cea708 specification.  The most prominent being, that
cea608 triples must be placed at the beginning of each cdp.

We also need to comply with the framerate-dpendent limits for both the
cea608 and the ccp data which may involve splitting or merging some
cea608 data but not ccp data or vice versa.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
3417a1709c ccconvert: compact input cc_data where possible
Skip over padding cc_data triples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
7d028af675 ccconverter: implement support for CDP framerate conversions
- Any format involving CDP is supported.
- Time codes (if present) are scaled as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
ddc7563ac9 tests/ccconverter: test the time codes are successfully passed through
Where time codes are not stored in the caption data themselves

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
31a0bf367d ccconverter: cc_count limits are per framerate
Enforce this and add a test for cdp input being too large.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Nicolas Dufresne
fac627ba1b test: h265parse: Test parsing buffer the ends with half a NAL header
This test cover the case where we are parsing, but our current buffers ends
with half the NAL header (which is 2 bytes in HEVC). Previously we would
throw an error message on the bus.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
2020-05-07 14:17:28 -04:00
Nicolas Dufresne
26296646d7 test: h264/h265: Add test for four bytes start code initial skip
This test detects if the parser have skipped too much and dropped meaninful
NALs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
2020-05-07 13:59:23 -04:00
Nicolas Dufresne
fd423c8468 test: h264/h265: Constify all test buffers
This ensure that no test modify other tests data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
dc4c470d75 h264parse: Properly handle 4 bytes start code
This will stop stripping four bytes start code. This was fixed and broken
again as it was causing the a timestamp shift. We now call
gst_base_parse_set_ts_at_offset() with the offset of the first NAL to ensure
that fixing a moderatly broken input stream won't affect the timestamps. We
also fixes the unit test, removing a comment about the stripping behaviour not
being correct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
2020-05-07 12:08:36 -04:00
Matthew Waters
02c8e66ff1 webrtc: fix an off-by-one calculating low-threshold
We were not signalling low-threshold when the previous amount was at
exactly the low-threshold mark.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1247>
2020-05-06 15:49:58 +10:00
Matthew Waters
d0b20f8bba webrtc: fix a slightly racy test
There is no guarantee that the peer data channel has transitioned to
open when we do.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1247>
2020-05-06 15:49:58 +10:00
Matthew Waters
d0be6b74f2 tests/webrtc: fix a data channel leak in a test
test_data_channel_create_after_negotiate overrides the data_channel_data
without ever freeing it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1240>
2020-05-06 02:53:27 +00:00
Matthew Waters
7aa58954c1 tests/webrtc: move bus thread creation earlier
Fixes a small deadlock race where the bus watch GSource could execute before
the unlock mutex GSource.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1240>
2020-05-06 02:53:27 +00:00
Edward Hervey
cbd89f0381 check: Fix dash mpd unit test
Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstMPDBaseURLNode' has no property named 'service location'

Stack trace:
gst_debug_get_stack_trace (gstinfo.c:3021)
gst_check_log_critical_func (gstcheck.c:281)
g_logv (gmessages.c:1350)
g_log (gmessages.c:1415)
g_object_set_valist (gobject.c:2327)
gst_mpd_client_add_baseurl_node (gstmpdclient.c:3142)
dash_mpdparser_check_mpd_client_set_methods (dash_mpd.c:6192)
srunner_run_tagged (check_run.c:465)
gst_check_run_suite (gstcheck.c:1086)
main (dash_mpd.c:6521)
__libc_start_main (libc-start.c:308)
_start (/home/bilboed/work/devel/gst-build/build/subprojects/gst-plugins-bad/tests/check/elements_dash_mpd:0x40554a)
2020-05-05 16:07:40 +02:00
Tim-Philipp Müller
c79db43299 tests: curlhttpsrc: fix compiler warning on raspbian
tests/check/elements/curlhttpsrc.c:142:14: warning: format ‘%lu’
expects argument of type ‘long unsigned int’, but argument 8 has
type ‘gsize’ {aka ‘unsigned int’}

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1239>
2020-05-03 12:21:09 +01:00
Ederson de Souza
12838af353 avtpcvfpay: Ensure NAL fragments are transmitted following stream specs
TSN streams are expected to send packets to the network in a well
defined "pace", which is arbitrarily defined for each stream. This pace
is defined by the "measurement interval" property of a stream.

When the AVTP CVF payloader element - avtpcvfpay - fragments a video
frame that is too big to be sent to the network, it currently defines
that all fragments should be transmitted at the same time (via DTS
property of GstBuffers generated, as sink will use those to time the
transmission of the AVTPDU). This doesn't comply with stream definition,
which also has a limit on how many packets can be sent on a given
measurement interval.

This patch solves that by spreading in time the DTS of the GstBuffers
containing the AVTPDUs. Two new properties, "measurement-interval" and
"max-interval-frames", added to avptcvfpay element so that it knows
stream measurement interval and how many AVTPDUs it can send on any of
them. More details on the method used to proper spread DTS/PTS according
to measurement interval can be found in a code commentary inside this patch.

Tests also added for the new property and behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1004>
2020-05-02 17:42:15 +00:00
Vedang Patel
2510052d12 tests: add tests for functions in gstavtpcrfutil.c
This adds tests for the helper functions in ext/avtp/gstavtpcrfutils.c
2020-04-30 23:31:25 +00:00
Vedang Patel
4b6a290beb tests: Add the tests for CRF Checker element
This adds tests to ensure the avtpcrfchecker element validates and drops the
packets which do not match the CRF Synchronization criteria.
2020-04-30 23:31:25 +00:00
Vedang Patel
da810db63d tests: Add tests for GstAvtpCrfBase base class.
This adds tests which test the functions which do not call any external
syscalls and the properties.
2020-04-30 23:31:25 +00:00
Vedang Patel
551258b2c4 tests: Add tests for CRF Synchronizer element
This adds tests to validate whether the avtpcrfsync element applies the
adjustment correctly.

Also, the infrastructure to include additional source files while compiling
is added. This change is exactly the same as the one in gst-plugins-good.
2020-04-30 23:31:25 +00:00
Ederson de Souza
3ea0f694de clockselect: Add TAI clock support
Via new value for property clock-id, "tai", it's possible to use
GST_CLOCK_TYPE_TAI as pipeline clock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1009>
2020-04-30 19:21:37 +00:00
Ederson de Souza
443c01e119 clockselect: Remove non-sense comment
Commentary appears to assume `gst_harness_find_element` return value was
"transfer none", but it is not the case. So, element must be unrefed
before the end.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1009>
2020-04-30 19:21:37 +00:00