Skip to content

Instantly share code, notes, and snippets.

@albert-tomanek
Created July 1, 2020 12:38
Show Gist options
  • Save albert-tomanek/f6dcf4af0aadbc4792b1af7e4e30531b to your computer and use it in GitHub Desktop.
Save albert-tomanek/f6dcf4af0aadbc4792b1af7e4e30531b to your computer and use it in GitHub Desktop.
// Compile: valac ex.vala --pkg gstreamer-1.0
//
// From VAPI:
//
// [ SimpleType ]
// public struct ClockTime : uint64
// {
// }
//
// From gstclock.h:
//
// /**
// * GstClockTime:
// *
// * A datatype to hold a time, measured in nanoseconds.
// */
// typedef guint64 GstClockTime;
//
// /**
// * GST_TYPE_CLOCK_TIME:
// *
// * The #GType of a #GstClockTime.
// */
// #define GST_TYPE_CLOCK_TIME G_TYPE_UINT64
namespace _Gst
{
[SimpleType]
[CCode(type_id = "G_TYPE_UINT64")]
public struct ClockTime : uint64
{
}
}
class Foo : Object
{
public _Gst.ClockTime duration { get; set; default = 4 * Gst.SECOND; }
}
void main()
{
var f = new Foo();
f.duration = 5;
print(@"$(f.duration)\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment