Commit graph

27 commits

Author SHA1 Message Date
Thibault Saunier
481c4ca9cd videotimecode: Mark latest_daily_jame as allow-none in init\() 2019-05-03 09:58:04 -04: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
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
Georg Lippitsch
1a8c6197c7 videotimecode: Allow 24000/1001 frame rate
https://bugzilla.gnome.org/show_bug.cgi?id=796107
2018-05-14 20:32:48 +03:00
Edward Hervey
22c9e5f7c1 libs: Documentation cleanup
* Fix wrong naming, wrong types and typos
* Add missing sections
* Add missing documentation for entries
* Explicitely mark private structure entries
* Remove items that never existed
2018-04-02 08:53:28 +02:00
Vivia Nikolaidou
bdccc98ee2 timecode: Fix invalid drop-frame timecode right before a new second
The previous fix was only working for non-drop-frame timecodes.

https://bugzilla.gnome.org/show_bug.cgi?id=779866
2017-04-09 11:15:27 +03:00
Vivia Nikolaidou
a122135194 videotimecode: Fix invalid timecode right before a new second
When initializing a timecode from a GDateTime, and the remaining time
until the new second is less than half a frame (according to the given
frame rate), it would lead to the creation of an invalid timecode, e.g.
00:00:00:25 (at 25 fps) instead of 00:00:01:00. Fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=779866
2017-03-10 17:47:46 +02:00
Sebastian Dröge
9460d40054 videotimecode: Unref GDateTime in error cases 2017-03-08 15:47:52 +02:00
Georg Lippitsch
d15ad75caf videotimecode: Validate for drop-frame correctness
In gst_video_time_code_is_valid, also check for invalid
ranges when using drop-frame TC. Refactor some code which
broke after the check was added.

https://bugzilla.gnome.org/show_bug.cgi?id=779010
2017-02-23 19:56:26 +02:00
Georg Lippitsch
b3df5786a9 videotimecode: Init from GDateTime
Add a function to init the time code from a GDateTime

https://bugzilla.gnome.org/show_bug.cgi?id=778702
2017-02-23 19:50:39 +02:00
Vivia Nikolaidou
629e8229a7 videotimecode: New GstVideoTimeCodeInterval type, ability to add to a GstVideoTimeCode
Sometimes there is a human-oriented timecode that represents an
interval between two other timecodes. It corresponds to the human
perception of "add X hours" or "add X seconds" to a specific timecode,
taking drop-frame oddities into account. This interval-representing
timecode is now a GstVideoTimeCodeInterval. Also added function to add it to
a GstVideoTimeCode.

https://bugzilla.gnome.org/show_bug.cgi?id=776447
2017-01-11 11:05:21 +11:00
Vivia Nikolaidou
06ff74e51d videotimecode: Add GstValue functions
Add compare, serialization and deserialization functions

https://bugzilla.gnome.org/show_bug.cgi?id=772764
2017-01-09 18:56:16 +02:00
Vivia Nikolaidou
f578c00a14 videotimecode: Fix incorrect nsec_since_daily_jam calculation
For drop-frame timecodes, the nsec_since_daily_jam doesn't necessarily
directly correspond to this many hours/minutes/seconds/frames. We have
to get the frame count as per frames_since_daily_jam and then convert.

https://bugzilla.gnome.org/show_bug.cgi?id=774585
2016-11-17 10:04:26 +02:00
Scott D Phillips
ab3c8caeed Remove 'return' from void functions
https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-12 10:51:30 +02:00
Vivia Nikolaidou
41c9f0b9dc videotimecode: Fix false positive coverity issues
They are false positive overflows, because coverity doesn't realize that
hours <= 24, minutes < 60 and seconds < 60 in all functions. Also casting the
number 60 (seconds in minute, minutes in hour) to guint64 for the
calculations, in order to avoid overflowing once we allow more than 24-hour
timecodes.

CIDs #1371459, #1371458
2016-08-19 15:57:01 +03:00
Vivia Nikolaidou
70149451ea videotimecode: Fix various coverity issues
Most of them are overflow related and false positives, but coverity can't know
that these can't overflow without us giving it more information. Add some
assertions for this.

One was an actual issue with flags comparison.

CIDs #1369051, #1369050, #1369049, #1369048, #1369045
2016-08-17 13:05:26 +03:00
Vivia Nikolaidou
ab35d7394e videotimecode: Added support for SMPTE time code metadata
Can be attached as GstMeta into a video frame.

https://bugzilla.gnome.org/show_bug.cgi?id=766419
2016-08-04 18:59:40 +03:00