summaryrefslogtreecommitdiff
path: root/gst/gstdatetime.c
AgeCommit message (Collapse)Author
2020-06-04gstdatetime: Add missing NULL check to gst_date_time_new_local_timeOndřej Hruška
Also add a unit test for this. Fixes #524
2019-01-29datetime: new() and new_local_time() constructors are not nullableSebastian Dröge
2018-08-03gst: Add poisoning to more typesSebastian Dröge
2018-05-21datetime: Update/fix documentationEdward Hervey
2018-01-27gst: Fix up a bunch of GIR annotationsArun Raghavan
This is mostly on nullable return values, and some other minor ones that I ran across. https://bugzilla.gnome.org/show_bug.cgi?id=789319
2017-01-15datetime: fix potential out-of-bound read on malformed datetime stringTim-Philipp Müller
https://bugzilla.gnome.org/show_bug.cgi?id=777263
2016-04-21datetime: Sanity check year, month and day when parsing ISO-8601 stringsSebastian Dröge
Passing years > 9999, months > 12 or days > 31 to gst_date_time_new() will cause an assertion and generally does not make much sense. Instead consider it as a parsing error like hours > 24 and return NULL.
2015-08-11datetime: accept just a time as ISO 8601 string and use today's date thenVivia Nikolaidou
If no date and only a time is given in gst_date_time_new_from_iso8601_string(), assume that it is "today" and try to parse the time-only string. "Today" is assumed to be in the timezone provided by the user (if any), otherwise Z - just like the behavior of the existing code. https://bugzilla.gnome.org/show_bug.cgi?id=753455
2014-06-26introspection: add missing (nullable) annotations to return valuesEvan Nemerson
Support for (nullable) was added to G-I at the same time as nullable return values. Previous versions of G-I will not mark return values as nullable, even when an (allow-none) annotation is present, so it is not necessary to add (allow-none) annotations for compatibility with older versions of G-I. https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-19gst: Store more basic type GTypes in variablesSebastian Dröge
Micro optimization to change a function call to a variable access for all our basic types.
2014-06-03datetime: change internal implementation to mini objectTim-Philipp Müller
And move type stuff from GstValue to GstDateTime.
2014-05-30docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSEEvan Nemerson
This should help improve documentation generated for languages other than C. https://bugzilla.gnome.org/show_bug.cgi?id=730961
2013-12-07docs: Fix typos in function/object descriptionsSebastian Rasmussen
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720029
2013-10-15datetime: Make sure to include gst_private.h before glib-compat-private.hSebastian Dröge
We need to define the GLib log domain before including glib.h, which is included by glib-compat-private.h.
2012-11-03Fix FSF addressTim-Philipp Müller
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-07-16datetime: just return NULL on short input strings instead of a warningTim-Philipp Müller
We want to be able to use this function on random non-NULL input, this should not result in a runtime-critical.
2012-07-10Remove 0.10-related documentation and "Since" markersEdward Hervey
2012-07-07datetime: do our own serialisation so we can serialise microseconds as wellTim-Philipp Müller
We still don't do that in _to_iso8601_string() though, since this will probably mostly be used in tags, where it doesn't matter so much and the microsecond argument might not be well-received by some tag readers.
2012-07-07datetime: when deserialising parse microseconds if availableTim-Philipp Müller
2012-07-07datetime: fix second parsing failure case when deserialising datetimeTim-Philipp Müller
When we fail to parse the number of seconds, reset the value to -1 instead of passing some error value as seconds. Also, we can still try to parse timezone information.
2012-07-04datetime: add conversion to/from GDateTimeJoshua M. Doe
Exposes existing constructor. API: gst_date_time_to_g_date_time() API: gst_date_time_new_from_g_date_time() https://bugzilla.gnome.org/show_bug.cgi?id=679080
2012-06-27datetime: ignore 0 days or months in datesTim-Philipp Müller
Handle 0 months or days correctly in date strings, so that 2012-06-00 is parsed the same as 2012-06, for example.
2012-06-27datetime: fix compare functionTim-Philipp Müller
Take into account that not all fields might be valid (though they are valid in the GDateTime structure). But we should just return unordered if the set fields don't match. Also, don't check microseconds when comparing datetimes, since we don't serialise those by default if they're available. This ensures date times are still regarded as equal after serialising+deserialising.
2012-06-27datetime: add serialisation to and deserialisation from ISO 8601 stringsOleksij Rempel
Some tag parsers and writers use same datetime format based on ISO 8601. We can reduce some code by creating some general functions for it. API: gst_date_time_to_iso8601_string() API: gst_date_time_new_from_iso8601_string() https://bugzilla.gnome.org/show_bug.cgi?id=678031
2012-06-12datetime: clean-ups and new API adjustmentsTim-Philipp Müller
Remove constructors we don't want: gst_date_time_new_ymd_h() because we don't want to support hour-only for now; gst_date_time_new_ymd_hm() because we don't want to add constructors with time info where the caller doesn't have to think about what timezone the time is in. Lots of compulsive clean-up. Docs fixes. Replace has_minute() and has_hour() with has_time().
2012-06-12datetime: allow GstDateTime where not all fields are setOleksij Rempel
In order to deserialise and re-serialise dates and date times from tags properly, we need to be able to express partial dates (e.g. YYYY or YYYY-MM) and date times. We only support partial date times where all the more significant fields above the first unset field are set (e.g. YYYY-00-DD is not supported). Calling _get_foo() when foo is not set is not allowed any more, callers need to check which fields are set first. https://bugzilla.gnome.org/show_bug.cgi?id=677757
2012-06-09datetime: remove fallback code for old GLibsTim-Philipp Müller
2012-01-22Use recent GLib API unconditionally now that we depend on the latest GLibTim-Philipp Müller
2011-01-05gstdatetime: Disable usage of GDateTime on MacOSXEdward Hervey
GLib's GDateTime doesn't handle properly the gmt offset. Therefore use our own internal version instead on MacOSX. See bug #638666
2010-12-17gstdatetime: Fix documentationEdward Hervey
second => seconds microsecond argument was dropped
2010-12-07docs: gst: more gobject introspection annotationsTim-Philipp Müller
Many of these are superfluous, added for clarity.
2010-12-02gstdatetime: Fix handling of timezonesThiago Santos
Fix returning of timezones on systems with gdatetime to use floats on the math expression to avoid truncating the fractional part. Also adds a test for covering this case.
2010-11-17datetime: Add _from_unix_epoch variantsThiago Santos
Adds 2 variants for the gst_date_time_from_unix_epoch function, one for UTC and another for local time. API: gst_date_time_new_from_unix_epoch_utc API: gst_date_time_new_from_unix_epoch_local_time Fixes #653031 https://bugzilla.gnome.org/show_bug.cgi?id=635031
2010-10-13datetime: Use seconds as doubleThiago Santos
Use seconds as double to make API similar to glib's gdatetime. Also move timezone parameter to the first position, just like glib's. https://bugzilla.gnome.org/show_bug.cgi?id=628408
2010-10-13gstdatetime: Move doc outside the ifdefsThiago Santos
Move the datetime documentation of the functions outside the ifdefs https://bugzilla.gnome.org/show_bug.cgi?id=628408
2010-10-13datetime: Use GDateTime if availableThiago Santos
Use GDateTime internally on GstDateTime if glib already provides it. https://bugzilla.gnome.org/show_bug.cgi?id=628408
2010-09-13docs: fix warnings pointed out by gtk-docStefan Kost
2010-07-27gstdatetime: Fix localtime usageThiago Santos
localtime only takes one parameter and returns a statically allocated tm struct. Use it correctly. Fixes #625368
2010-07-26gstvalue: Adds datetime functionsThiago Santos
Adds a datetime functions to gstvalue Fixes #594504
2010-07-26gstdatetime: Adds GstDateTimeThiago Santos
Adds GstDateTime to represent dates + time + timezone information. Tests included. API: GstDateTime API: gst_date_time_get_day API: gst_date_time_get_month API: gst_date_time_get_year API: gst_date_time_get_hour API: gst_date_time_get_microsecond API: gst_date_time_get_minute API: gst_date_time_get_second API: gst_date_time_get_time_zone_offset API: gst_date_time_new API: gst_date_time_new_local_time API: gst_date_time_new_from_unix_epoch API: gst_date_time_new_now_local_time API: gst_date_time_new_now_utc API: gst_date_time_ref API: gst_date_time_unref Fixes #594504