GStreamer

 view release on metacpan or  search on metacpan

xs/GstClock.xs  view on Meta::CPAN


	EXTEND (SP, 3);
	PUSHs (sv_2mortal (newSVGstClock (clock)));
	PUSHs (sv_2mortal (newSVGstClockTime (time)));
	/* We need to keep the clock id alive so we ref it to counter DESTROY's
	 * unref */
	PUSHs (sv_2mortal (newSVGstClockID (gst_clock_id_ref (id))));
	if (callback->data)
		XPUSHs (sv_2mortal (newSVsv (callback->data)));

	PUTBACK;

	call_sv (callback->func, G_SCALAR);

	SPAGAIN;

	retval = POPi;

	PUTBACK;
	FREETMPS;
	LEAVE;

	return retval;
}

/* ------------------------------------------------------------------------- */

MODULE = GStreamer::Clock	PACKAGE = GStreamer::Clock	PREFIX = gst_clock_

=for object GStreamer::Clock Abstract class for global clocks

=cut

BOOT:
	gperl_object_set_no_warn_unreg_subclass (GST_TYPE_CLOCK, TRUE);

guint64 gst_clock_set_resolution (GstClock *clock, guint64 resolution);

guint64 gst_clock_get_resolution (GstClock *clock);

GstClockTime gst_clock_get_time (GstClock *clock);

void gst_clock_set_calibration (GstClock *clock, GstClockTime internal, GstClockTime external, GstClockTime rate_num, GstClockTime rate_denom);

# void gst_clock_get_calibration (GstClock *clock, GstClockTime *internal, GstClockTime *external, GstClockTime *rate_num, GstClockTime *rate_denom);
void gst_clock_get_calibration (GstClock *clock, OUTLIST GstClockTime internal, OUTLIST GstClockTime external, OUTLIST GstClockTime rate_num, OUTLIST GstClockTime rate_denom);

gboolean gst_clock_set_master (GstClock *clock, GstClock *master)
    C_ARGS:
	/* We need to keep master alive. */
	clock, gst_object_ref (master)

GstClock_ornull * gst_clock_get_master (GstClock *clock);

# gboolean gst_clock_add_observation (GstClock *clock, GstClockTime slave, GstClockTime master, gdouble *r_squared);
void
gst_clock_add_observation (GstClock *clock, GstClockTime slave, GstClockTime master)
    PREINIT:
	gboolean retval;
	gdouble r_squared;
    PPCODE:
	retval = gst_clock_add_observation (clock, slave, master, &r_squared);
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVuv (retval)));
	PUSHs (sv_2mortal (newSVnv (r_squared)));

GstClockTime gst_clock_get_internal_time (GstClock *clock);

GstClockTime gst_clock_adjust_unlocked (GstClock *clock, GstClockTime internal);

GstClockID gst_clock_new_single_shot_id (GstClock *clock, GstClockTime time);

GstClockID gst_clock_new_periodic_id (GstClock *clock, GstClockTime start_time, GstClockTime interval);

# --------------------------------------------------------------------------- #

MODULE = GStreamer::Clock	PACKAGE = GStreamer::ClockID	PREFIX = gst_clock_id_

=for object GStreamer::ClockID Abstract class for global clocks

=cut

void
DESTROY (id)
	GstClockID id
    CODE:
	gst_clock_id_unref (id);

# GstClockID gst_clock_id_ref (GstClockID id);
# void gst_clock_id_unref (GstClockID id);
# gint gst_clock_id_compare_func (gconstpointer id1, gconstpointer id2);

GstClockTime gst_clock_id_get_time (GstClockID id);

# GstClockReturn gst_clock_id_wait (GstClockID id, GstClockTimeDiff *jitter);
void
gst_clock_id_wait (id)
	GstClockID id
    PREINIT:
	GstClockReturn retval = 0;
	GstClockTimeDiff jitter = 0;
    PPCODE:
	retval = gst_clock_id_wait (id, &jitter);
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVGstClockReturn (retval)));
	PUSHs (sv_2mortal (newSVGstClockTime (jitter)));

# GstClockReturn gst_clock_id_wait_async (GstClockID id, GstClockCallback func, gpointer user_data);
GstClockReturn
gst_clock_id_wait_async (id, func, data=NULL);
	GstClockID id
	SV *func
	SV *data
    PREINIT:
	GPerlCallback *callback;
    CODE:
	callback = gst2perl_clock_callback_create (func, data);
	RETVAL = gst_clock_id_wait_async (id,
	                                  gst2perl_clock_callback,
	                                  callback);
	/* FIXME: When to free the callback? */
    OUTPUT:
	RETVAL

void gst_clock_id_unschedule (GstClockID id);



( run in 0.456 second using v1.01-cache-2.11-cpan-5511b514fd6 )