After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627826 - GstInt64Range type
GstInt64Range type
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 623121
 
 
Reported: 2010-08-24 10:32 UTC by Philippe Normand
Modified: 2010-09-01 09:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstvalue: new GstInt64Range type (36.25 KB, patch)
2010-08-25 10:23 UTC, Philippe Normand
none Details | Review
gstvalue: new GstInt64Range type (36.41 KB, patch)
2010-08-25 13:59 UTC, Philippe Normand
needs-work Details | Review
gstvalue: new GstInt64Range type (36.46 KB, patch)
2010-08-26 07:07 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2010-08-24 10:32:06 UTC
Just like GstIntRange but for 64bits integers. Would be needed to fix bug 623121.
Comment 1 Philippe Normand 2010-08-25 10:23:51 UTC
Created attachment 168716 [details] [review]
gstvalue: new GstInt64Range type

fixes bug 627826
Comment 2 Philippe Normand 2010-08-25 13:59:46 UTC
Created attachment 168735 [details] [review]
gstvalue: new GstInt64Range type

new GstInt64Range to store gint64 ranges.

API: GST_TYPE_INT64_RANGE
API: gst_value_set_int64_range
API: gst_value_get_int64_range_min
API: gst_value_get_int64_range_max

Fixes bug 627826

(added new API in commit message)
Comment 3 Sebastian Dröge (slomo) 2010-08-25 17:26:14 UTC
Review of attachment 168735 [details] [review]:

Looks good in general, some minor comments below :)

Also, while we're at it, it might make sense to add real C types for the ranges, fractions, lists, arrays and fourccs. But that's for another patch. Maybe you want to use that for the buffering ranges though

::: gst/gststructure.c
@@ +1857,3 @@
+    g_value_init (value, range_type);
+    gst_value_set_int64_range (value, gst_g_value_get_int_unchecked (&value1),
+        gst_g_value_get_int_unchecked (&value2));

Use gst_g_value_get_int64_unchecked() here, otherwise you'll drop 32 bits of the value

::: tests/check/gst/gstvalue.c
@@ +2427,3 @@
+    g_strdup_printf ("[ 0, %" G_GINT64_FORMAT " ]", (gint64) G_MAXINT),
+    g_strdup_printf ("[ 5, %" G_GINT64_FORMAT " ]", (gint64) G_MAXINT32),
+    g_strdup_printf ("[ 5, %" G_GINT64_FORMAT " ]", G_MAXINT64),

You're leaking these strings
Comment 4 Philippe Normand 2010-08-26 07:07:21 UTC
Created attachment 168783 [details] [review]
gstvalue: new GstInt64Range type

new GstInt64Range to store gint64 ranges.

API: GST_TYPE_INT64_RANGE
API: gst_value_set_int64_range
API: gst_value_get_int64_range_min
API: gst_value_get_int64_range_max

Fixes bug 627826

Fixed the two issues pointed out by Sebastian.
Comment 5 Sebastian Dröge (slomo) 2010-09-01 09:08:17 UTC
commit 0107c7e793fed42eecf2797c7837c1f8f2059180
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Sep 1 11:06:57 2010 +0200

    gstvalue: Fix memory leaks in the int64range tests

commit b2e6379be832d92a0363291fe55c3f4670e2dde9
Author: Philippe Normand <pnormand@igalia.com>
Date:   Tue Aug 24 12:27:30 2010 +0200

    gstvalue: Add new GstInt64Range type
    
    new GstInt64Range to store gint64 ranges.
    
    API: GST_TYPE_INT64_RANGE
    API: gst_value_set_int64_range
    API: gst_value_get_int64_range_min
    API: gst_value_get_int64_range_max
    
    Fixes bug #627826.