GStreamer

 view release on metacpan or  search on metacpan

xs/GstCaps.xs  view on Meta::CPAN


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

MODULE = GStreamer::Caps	PACKAGE = GStreamer::Caps	PREFIX = gst_caps_

=for object GStreamer::Caps Structure describing sets of media formats

=cut

=for position SYNOPSIS

=head1 SYNOPSIS

  my $empty = GStreamer::Caps::Empty -> new();

  my $any = GStreamer::Caps::Any -> new();

  my $structure = {
    name => "urgs",
    fields => [
      [field_one => "Glib::String" => "urgs"],
      [field_two => "Glib::Int" => 23]
    ]
  };
  my $full = GStreamer::Caps::Full -> new($structure);

  my $simple = GStreamer::Caps::Simple -> new(
     	         "audio/mpeg",
                 field_one => "Glib::String" => "urgs",
                 field_two => "Glib::Int" => 23);

=cut


=for position DESCRIPTION

=head1 DESCRIPTION

To create a I<GStreamer::Caps> object, you call one of the following
constructors:

=over

=item GStreamer::Caps::Any-E<gt>new

=item GStreamer::Caps::Empty-E<gt>new

=item GStreamer::Caps::Full-E<gt>new

=item GStreamer::Caps::Simple-E<gt>new

=back

=cut

# GstCaps * gst_caps_make_writable (GstCaps *caps);
GstCaps_own *
gst_caps_make_writable (GstCaps *caps)
    C_ARGS:
	/* gst_caps_make_writable unref's mini_object, so we need to
	 * keep it alive. */
	gst_caps_ref (caps)

# FIXME?
# G_CONST_RETURN GstCaps * gst_static_caps_get (GstStaticCaps *static_caps);

# void gst_caps_append (GstCaps *caps1, GstCaps *caps2);
void
gst_caps_append (caps1, caps2)
	GstCaps *caps1
	GstCaps *caps2
    C_ARGS:
	/* gst_caps_append frees the second caps.  caps1 owns the structures
	   in caps2. */
	caps1, gst_caps_copy (caps2)

# caps owns structure.
# void gst_caps_append_structure (GstCaps *caps, GstStructure  *structure);
void
gst_caps_append_structure (caps, structure);
	GstCaps *caps
	GstStructure *structure

int gst_caps_get_size (const GstCaps *caps);

GstStructure * gst_caps_get_structure (const GstCaps *caps, int index);

void gst_caps_truncate (GstCaps * caps);

# void gst_caps_set_simple (GstCaps *caps, char *field, ...);
# void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs);
void
gst_caps_set_simple (caps, field, type, value, ...)
	GstCaps *caps
	const char *field
	const char *type
	SV *value
    PREINIT:
	GstStructure *structure;
	int i;
    CODE:
	PERL_UNUSED_VAR (field);
	PERL_UNUSED_VAR (type);
	PERL_UNUSED_VAR (value);

	structure = gst_caps_get_structure (caps, 0);

	for (i = 1; i < items; i += 3) {
		const gchar *field = SvPV_nolen (ST (i));
		GType type = gperl_type_from_package (SvPV_nolen (ST (i + 1)));
		GValue value = { 0, };

		g_value_init (&value, type);
		gperl_value_from_sv (&value, ST (i + 2));
		gst_structure_set_value (structure, field, &value);
		g_value_unset (&value);
	}

gboolean gst_caps_is_any (const GstCaps *caps);

gboolean gst_caps_is_empty (const GstCaps *caps);



( run in 1.258 second using v1.01-cache-2.11-cpan-e1769b4cff6 )