Sha256: 68885b291f3ec48cd39ecb2a1e47344eb45bd9ae4fca8ada8ddf3ccf6d216fe0

Contents?: true

Size: 1.75 KB

Versions: 34

Compression:

Stored size: 1.75 KB

Contents

/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
 *  Copyright (C) 2011  Ruby-GNOME2 Project Team
 *  Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *  MA  02110-1301  USA
 */

#include "rbgst-private.h"

VALUE
rb_str_new_with_format (char *fmt, ...)
{
	char buf[1000];
	va_list ap;

	va_start (ap, fmt);
	vsnprintf (buf, sizeof buf, fmt, ap);
	va_end (ap);
	return CSTR2RVAL (buf);
}

VALUE
rb_ary_yield (VALUE arr)
{
	if (rb_block_given_p () == Qfalse)
		rb_raise (rb_eArgError, "No block given");
	rb_ary_each (arr); 
	return Qnil;
}

VALUE
rbgst_new_gstobject (void *o)
{
	GType gtype = G_OBJECT_TYPE (o);
	const gchar *gtypename = g_type_name (gtype);
        if (strncmp (gtypename, "Gst", 3) == 0)
            gtypename += 3;
        if (!rb_const_defined_at (mGst, rb_intern (gtypename)))
            G_DEF_CLASS (gtype, gtypename, mGst);
	return GOBJ2RVAL (o);
}

void
rbgst_initialize_gstobject(VALUE obj, GstObject *gstobj)
{
	gstobj = gst_object_ref (gstobj);
	gst_object_sink (gstobj);
	G_INITIALIZE (obj, gstobj);
}

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
gstreamer-1.2.6-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.6 ext/gstreamer/misc.c
gstreamer-1.2.5-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.5 ext/gstreamer/misc.c
gstreamer-1.2.4-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.4 ext/gstreamer/misc.c
gstreamer-1.2.3-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.3 ext/gstreamer/misc.c
gstreamer-1.2.2-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.2 ext/gstreamer/misc.c
gstreamer-1.2.1-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.1 ext/gstreamer/misc.c
gstreamer-1.2.0-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.2.0 ext/gstreamer/misc.c
gstreamer-1.1.9-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.1.9 ext/gstreamer/misc.c
gstreamer-1.1.8-x86-mingw32 ext/gstreamer/misc.c
gstreamer-1.1.8 ext/gstreamer/misc.c
gstreamer-1.1.7 ext/gstreamer/misc.c
gstreamer-1.1.7-x86-mingw32 ext/gstreamer/misc.c