Commit graph

223 commits

Author SHA1 Message Date
Thibault Saunier
75065ab244 videotestsrc: Do not try to answer the duration query before negotiation
We have no idea at that moment and this code was trying to divide by 0!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/705>
2020-06-15 17:24:17 +00:00
Mathieu Duponchelle
cc516695b0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:17 +02:00
Mathieu Duponchelle
e666c9ec04 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:23 -04:00
Thibault Saunier
9ce93abb29 videotestsrc: Fix buffer duration in reverse playback
In reverse playback, buffers have to be displayed at buffer.stop running
time, meaning:

    buffer.pts + buffer.duration = prev_buffer.pts
    =>
    buffer.duration = prev_buffer.pts - buffer.pts

We were setting buffer.duration = next_buffer.pts - buffer.pts which
is not correct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/646>
2020-05-06 16:50:01 +00:00
Thibault Saunier
909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Sam Thursfield
f1324f9cb0 videotestsrc: Document the num-buffers property
It's not obvious from the existing docs that this option exists, nor
that it can be used to give a pipeline an exact length in video frames.

https://bugzilla.gnome.org/show_bug.cgi?id=777647
2018-01-12 00:49:20 +00:00
Edward Hervey
a47881100d videotestsrc: Avoid overflow calculation
n_frames could end up being quite big (potentially up to G_MAXINT64). Which
would result in overflowing 64bits when multiplying it by GST_SECOND.

Instead move GST_SECOND to the num argument
2017-11-21 10:15:02 +01:00
Olivier Crête
4fdb5ab675 videotestsrc: Protect videoinfo with object lock
The videoinfo is set in the streaming thread, but can be read by any
thread from the various queries, so protect it with the object lock.
2017-05-23 08:54:25 +02:00
Jan Schmidt
97001a886a videotestsrc: Publish multiview-mode info in the caps
Don't allow downstream to accidentally pretend that
the output is anything than a mono or single-eye
left/right view.

https://bugzilla.gnome.org/show_bug.cgi?id=776172
2017-03-18 02:03:47 +11:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Carl Karsten
99f4899491 videotestsrc: Add options to make ball pattern based on system time, and invert each second.
This adds some extra options that affect pattern=ball mode, allowing the
animation to be synced to running time or wall-time clock for comparing
sync across different instances / pipelines / machines.

Also added is the ability to invert the rendering colours every second,
and some different ball motion patterns.

https://bugzilla.gnome.org/show_bug.cgi?id=740557
2017-01-18 09:52:50 +11:00
Stian Selnes
22ccb687fa videotestsrc: Make snow deterministic
Deterministic generation of snow and smpte is important for tests so
that it's not affected by other videotestsrc elements in current or
possibly previous tests.

https://bugzilla.gnome.org/show_bug.cgi?id=773102
2016-11-01 20:05:18 +02:00
Vineeth TM
44b70ca3a1 base: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763075
2016-03-24 14:25:41 +02:00
Aurélien Zanelli
9b9f913809 videotestsrc: add missing break in set_property switch case
To avoid future issue when adding new properties.

https://bugzilla.gnome.org/show_bug.cgi?id=760204
2016-01-06 13:21:06 +02:00
Joan Pau Beltran
a95a900c21 videotestsrc: fix handling of Bayer format 'gbrg'
Due to a typo, videotestsrc did not handle the Bayer
format 'gbrg' properly and reported it as invalid,
causing negotiation errors.

https://bugzilla.gnome.org/show_bug.cgi?id=757264
2015-10-30 20:29:04 +00:00
Thibault Saunier
ab6b536a66 videotestsrc: Force alpha downstream if foreground color contains alpha
Otherwise the foreground color won't be fully represented in the
outputted frames.

https://bugzilla.gnome.org/show_bug.cgi?id=755482
2015-10-22 11:12:23 +02:00
Jan Schmidt
3f7138a6e4 videotestsrc: Don't fixate framerate if downstream didn't provide one
intersection with a downstream that accepts any video/x-raw caps
with no further detail won't create a framerate field. If it's
not in the caps, don't fixate it, just set it to 30/1
2015-10-02 15:05:26 +10:00
Nicolas Dufresne
7db376d05e videotestsrc: Don't set DTS on buffer
DTS is for encoded data and have no meaning for raw. It better to not
set it, as it's confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=752791
2015-08-04 18:00:35 -04:00
Tim-Philipp Müller
ec5c93f169 docs: update element example pipelines
- gst-launch -> gst-launch-1.0
- use autoaudiosink and audiovideosink more often
- review pipeline examples and descriptions
2015-05-10 11:38:19 +01:00
Luis de Bethencourt
df08f5eabe remove unused enum items PROP_LAST
This were probably added to the enums due to cargo cult programming and are
unused. Removing them.
2015-04-24 17:11:01 +01:00
Wim Taymans
9bbfc3c848 videotestsrc: add all colors mode 2015-03-10 12:27:03 +01:00
Sebastian Dröge
8abfdd127f videotestsrc: Report our latency properly in live mode
While we have no latency at all in theory, any other live source has the
duration of one buffer as minimum latency. Do the same in videotestsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=741879
2014-12-24 12:59:37 +01:00
Vineeth T M
c2224b8059 videotestsrc: assertion error
timestamp_offset is being declared as an int64 variable,
for which the min
value of G_MININT64 is -9223372036854775808
Changing the minimum and maximum limit for the offset variable.

https://bugzilla.gnome.org/show_bug.cgi?id=738568
2014-10-21 11:28:11 +02:00
Wim Taymans
042b25542c videotestsrc: add gradient pattern
Makes a gradient between background and foreground color.
2014-10-08 11:36:33 +02:00
Vincent Penquerc'h
ba8220a9fd videotestsrc: bail out on unsupported caps
This avoids using uninitialized data (and properly rejects caps).

Coverity 1139898
2014-04-10 15:51:05 +01:00
Julien Isorce
c9b493b853 videotestsrc: ensure having caps when setting the buffer pool config
It happens if downstream does not propose a buffer pool.
GST_DEBUG=2 gst-launch-1.0 videotestsrc ! fakesink

https://bugzilla.gnome.org/show_bug.cgi?id=723271
2014-01-31 14:09:03 +00:00
Vincent Penquerc'h
0d66d05c98 videotestsrc: fix unit test breaking on duration query
The new switch caused breaks to not break of the main switch
anymore, causing fall through.
2014-01-10 14:24:12 +00:00
Vincent Penquerc'h
1185fbd29a videotestsrc: do not set TIME duration when asked for another format
This fixes asserts in pipelines such as:

gst-launch-1.0 videotestsrc num-buffers=1000 ! x264enc ! h264parse ! \
   matroskamux name=mux ! filesink location=test.mkv
2014-01-10 09:56:34 +00:00
Sebastian Dröge
eff7866dd0 videotestsrc: Always set pixel-aspect-ratio and interlace-mode in the fixed caps
Otherwise our caps will not be compatible with elements that require a
1/1 pixel-aspect-ratio or progressive video.

https://bugzilla.gnome.org/show_bug.cgi?id=721103
2013-12-30 19:48:29 +01:00
Thiago Santos
c2eb3d4e71 videotestsrc: implement duration query
Add duration query to videotestsrc, it can answer this query when
the num-buffers property is set.

https://bugzilla.gnome.org/show_bug.cgi?id=709646
2013-10-08 16:10:54 -03:00
Thiago Santos
866f132821 videotestsrc: implement reverse playback
Decrement the n_frames counter when doing reverse playback to
have timestamps and offsets reducing instead of increasing

https://bugzilla.gnome.org/show_bug.cgi?id=701813
2013-10-08 09:34:47 -04:00
Edward Hervey
258aca37dd videotestsrc: Demote ERROR statement back to DEBUG
It crawled in with david's latest commit
2013-08-02 11:00:06 +02:00
David Schleef
0c4beda8f0 videotestsrc: Add pinwheel and spokes patterns 2013-07-31 11:37:33 -07:00
Edward Hervey
46ce07333b videotestsrc: Initialize GstVideoInfo in ::start()
Otherwise we end up with bogus values and races
2013-07-26 16:14:05 +02:00
Edward Hervey
96efe720a1 videotestsrc: Don't error on not-negotiated
Base classes will handle re-negotiation if needed, but emitting an
error message will make applications stop.
2013-07-26 16:14:05 +02:00
Patricia Muscalu
f9acd972ef videotestsrc: do not leak lines
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703177
2013-06-27 12:39:47 +02:00
Wim Taymans
e5bc2b0d05 videotestsrc: subsample chroma before packing
Run the chroma subsampler before packing.
2013-05-27 11:05:08 +02:00
Stefan Sauer
c6c27b9926 videotestsrc: make colors controlable
Also trim since markers.
2013-03-07 09:39:14 +01:00
Tim-Philipp Müller
dce49a1a7e video: fix return type of _get_palette() and add since markers to docs
'const gpointer' is not the same as 'gconstpointer', see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35928.
2013-02-06 12:43:51 +00:00
Wim Taymans
ebf24e292e videotestsrc: use video library palette
Use the palette provided and used by the video library instead of making our own
copy.
2013-02-05 11:20:20 +01:00
Tim-Philipp Müller
5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Wim Taymans
d73dcb6af3 videotestsrc: make and copy palette 2012-10-15 16:33:24 +02:00
Thiago Santos
386206e627 videotestsrc: keep track of the correct running time after renegotiations
Need to store the old running time and frame numbers when renegotiating and
start from 0 again when a new caps is set, preventing that framerate changes
cause timestamping issues.

For example, if a stream pushed 10 buffers on framerate=2/1, its
running time will be 5s. If a new framerate of 1/1 is set, it would
make the running time go to 10s as it would count those 10 buffers
as being sent on this new framerate.

Fixes camerbin unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=682973
2012-09-23 17:48:56 +01:00
Wim Taymans
177fd005ab update for query api changes 2012-07-06 11:23:48 +02:00
Wim Taymans
044afd72eb videotestsrc: set DTS and PTS, sync on DTS 2012-06-27 17:18:35 +02:00
Wim Taymans
f28e2e7bea fix interlace-mode 2012-06-26 17:15:49 +02:00
Wim Taymans
7a3830c40a videotestsrc: Remove more redundant code
Use the video library to do the setup instead of keeping a separate incomplete
list.
2012-06-06 11:18:56 +02:00
Wim Taymans
dd907f2a6e videotestsrc: don't artificially restrict caps
Use all the formats that the video library supports without any restrictions on
colorimetry or other parameters such as chroma-siting.
2012-06-06 11:18:56 +02:00
Wim Taymans
0290e116eb videotestsrc: use generic packing code
Use the pack functions of the video library to construct the target
image.
Remove redundant functions.
2012-05-29 17:52:07 +02:00
Sebastian Dröge
4e649b5bff videotestsrc: Update for basesrc API changes 2012-05-01 13:33:20 +02:00