GStreamer-0.19/000755 001750 000024 00000000000 12221737451 013571 5ustar00brianstaff000000 000000 GStreamer-0.19/ChangeLog.pre-git000644 001750 000024 00000045545 11705716742 016734 0ustar00brianstaff000000 000000 === ChangeLog discontinued === With the move to git, we stop maintaining a separate ChangeLog and rely on proper commit messages instead. Web view of changes: . 2009-02-22 Torsten Schoenfeld * lib/GStreamer.pm * NEWS: Release 0.15. 2009-02-22 Torsten Schoenfeld * Makefile.PL * MANIFEST * GStreamer.pm (removed) * lib/GStreamer.pm (added): Move GStreamer.pm into the new lib directory. 2009-02-22 Torsten Schoenfeld * t/GstPad.t * xs/GstPad.xs: Wrap gst_pad_is_blocking, gst_pad_peer_query, gst_pad_iterate_internal_links, and gst_pad_iterate_internal_links_default. 2009-02-22 Torsten Schoenfeld * xs/GstIterator.xs (newSVGstIterator): Convert NULL iterators to undef. 2009-02-21 Torsten Schoenfeld * xs/GstFormat.xs (SvGstFormat): Throw an exception if gst_format_get_by_nick failed to convert the string to a format. This means that unregistered format strings now cause errors instead of being silently turned into GST_FORMAT_UNDEFINED. 2009-02-21 Torsten Schoenfeld * t/GstClock.t: Make the clock resolution and master clock tests more robust. 2009-02-21 Torsten Schoenfeld * t/GstIndex.t: Make the GstIndexEntry tests more robust and correct. 2009-02-21 Torsten Schoenfeld * xs/GstIndex.xs: We don't own the GstIndexEntry objects returned by the various GstIndex methods, so don't use the _own typemap variant. 2009-01-18 Torsten Schoenfeld * GStreamer.pm * NEWS: Release 0.14. 2009-01-18 Torsten Schoenfeld * t/GstClock.t: Skip the wait_async test for now as it appears to be broken. 2008-12-20 Torsten Schoenfeld * t/Gst.t: Print version information. 2008-12-20 Torsten Schoenfeld * xs/GstBus.xs (bus_watch): Don't mix declarations and expressions. 2008-12-20 Torsten Schoenfeld * t/GstRegistry.t: Don't assume an 'alsa' plugin is present. 2008-12-16 Torsten Schoenfeld * GStreamer.pm * NEWS: Release 0.13. 2008-12-16 Torsten Schoenfeld * Makefile.PL: Improve formatting a bit. 2008-12-15 Torsten Schoenfeld * GStreamer.pm (GST_TIME_ARGS): Improve the formatting of the return statement. 2008-12-15 Torsten Schoenfeld * gst.typemap: Always use our custom wrappers for GstClockTime and GstClockTimeDiff. 2008-12-15 Torsten Schoenfeld * t/GstClock.t: Use a pipeline element for the clock tests. Also fix a possible dead lock. 2008-12-15 Torsten Schoenfeld * t/GstElement.t * xs/GstElement.xs: Properly marshal the return values of gst_element_add_pad, gst_element_remove_pad, and gst_element_set_locked_state. 2008-12-15 Torsten Schoenfeld * Makefile.PL: Tell the CPAN indexer to ignore stuff in the xs directory. 2008-11-26 Torsten Schoenfeld * GStreamer.pm * NEWS: Release 0.12. 2008-11-26 Torsten Schoenfeld * t/GstElement.t: Fix test failure. 2008-11-26 Torsten Schoenfeld * xs/GstIndex.xs * xs/GstStructure.xs * xs/GstTag.xs * xs/GstValue.xs: Use gperl_sv_is_defined, gperl_sv_is_array_ref, and gperl_sv_is_hash_ref where appropriate. 2008-11-26 Torsten Schoenfeld * t/GstValue.t * xs/GstValue.xs: Add support for GST_TYPE_FOURCC, GST_TYPE_DOUBLE_RANGE, GST_TYPE_ARRAY, GST_TYPE_FRACTION, and GST_TYPE_FRACTION_RANGE. 2008-11-26 Torsten Schoenfeld * xs/GstStructure.xs (SvGstStructure): Fail loudly with a meaningful error message when an unregistered package name is encountered. 2008-11-26 Torsten Schoenfeld * Makefile.PL: Use META_MERGE instead of EXTRA_META. 2008-05-04 Torsten Schoenfeld * GStreamer.pm * NEWS: Release 0.11. 2008-05-04 Torsten Schoenfeld * t/GstPad.t: Skip the task tests for now: they cause a segfault as threading support isn't there yet. * xs/GstQuery.xs (get_package): Add a default branch to the type switch to avoid compilation errors when a new type is introduced and to explicitly codify the behavior for unknown types. * t/GstRegistry.t: Fix test failures related to the XML cache. 2008-03-23 Torsten Schoenfeld * t/GstBin.t * t/GstChildProxy.t * t/GstClock.t * t/GstElement.t * t/GstIndex.t * t/GstIterator.t * t/GstMessage.t * t/GstPlugin.t * t/GstPluginFeature.t * t/GstRegistry.t: Make the tests work when gstreamer doesn't have alsa plugins, as for example on some BSDs. * xs/GstBus.xs * xs/GstClock.xs * xs/GstIndex.xs * xs/GstStructure.xs: Fix compiler warnings. * xs/GstMiniObject.xs (gst2perl_register_mini_object): Actually make real a string comparison to determine which packages' @ISA to modify. * xs/GstPad.xs: Fix the GstTaskFunc marshalling. * Makefile.PL: Trap exceptions thrown by EU::PkgConfig->find. When one occurs, exit with status 0 to indicate to CPAN testers that their system isn't supported. 2008-03-16 Torsten Schoenfeld * GStreamer.pm * NEWS * README * copyright.pod: Release 0.10. 2008-03-16 Torsten Schoenfeld * Makefile.PL: Announce our Makefile.PL-time dependencies via META.yml's configure_requires key. * gst2perl.h * xs/Gst.xs: When available, prefer libgstreamer's own version checking macros. 2008-01-19 Torsten Schoenfeld * Makefile.PL: Remove an unused variable. * t/GstMessage.t * xs/GstMessage.xs: Add GStreamer::Message::timestamp() and src(). * t/GstMessage.t * xs/GstMessage.xs: Add support for latency, async-start, and async-done messages. * t/GstElement.t * t/GstGhostPad.t * t/GstStructure.t * t/GstValue.t: Fix test failures. 2007-01-31 kaffeetisch * t/GstRegistry.t: Fix test failure. 2006-12-02 kaffeetisch * xs/GstIterator.xs: Get rid of that curious second argument to FETCHSIZE by correctly using Nullch instead of "" in the sv_magic call. 2006-08-27 kaffeetisch * xs/Gst.xs: Add a FIXME comment about gperl_handle_logs_for not having any effect since GStreamer itself installs a log handler. * xs/GstElement.xs: gst_element_get_index can return NULL, use an appropriate typemap. Ref the message before passing it to gst_element_post_message since it assumes ownership. 2006-08-27 kaffeetisch * t/GstPlugin.t: Try harder to find a suitable libgstalsa.so. (#352750) 2006-08-26 kaffeetisch * t/GstStructure.t, t/GstValue.t, xs/GstStructure.xs: Make GStreamer::Structure::from_string return only one value, the new structure. The second return value was useless. Should be backwards-compatible. Scream if this breaks your code. * t/GstValue.t: Set the timezone to UTC so the timestamp means the same everywhere. (#348454) 2006-08-09 kaffeetisch * GStreamer.pm, NEWS: Release 0.09. 2006-08-06 kaffeetisch * t/Gst.t: Disable some tests that were too loud. 2006-07-17 kaffeetisch * xs/GstBuffer.xs: Patch from Jeremy Messenger uses g_strndup instead of strndup since the latter isn't portable. * t/GstClock.t, t/GstElement.t, t/GstMessage.t: Fail gracefully if no clock can be found. 2006/07/07 kaffeetisch * GStreamer.pm, NEWS, copyright.pod: Release 0.08. 2006/05/21 kaffeetisch * t/GstClock.t, t/GstElementFactory.t, t/GstPad.t, t/GstTypeFindFactory.t: Fix test failures. 2006/05/13 kaffeetisch * xs/Gst.xs: Hide gst_version_string from the doc genereator to keep it from creating a GStreamer.pod. 2006/03/21 kaffeetisch * GStreamer.pm, Makefile.PL, NEWS, README: Release 0.07. 2006/03/21 kaffeetisch * t/GstClock.t, t/GstElement.t: Use alsasink instead of alsasrc for the clock tests. Skip some tests that I'm unable to fix at the moment. * xs/GstClock.xs (gst2perl_clock_callback): Ref the clock id to keep it alive. This should make GStreamer::Clock::wait_async work correctly. 2006/01/29 kaffeetisch * GStreamer.pm, NEWS: Release 0.06. 2006/01/29 kaffeetisch * t/GstClock.t: "Fix" a test failure. Implement, but skip an async wait test. It seems to cause segfaults. 2006/01/29 kaffeetisch * examples/tagger.pl, examples/player.pl: Port to the 0.10 API. * exampels/queue.pl, examples/read-metadata.pl: Use the fully qualified name for Glib::filename_to_unicode and Glib::filename_display_name instead of importing them. 2006/01/24 kaffeetisch * Makefile.PL: Require Glib 1.114 for the recent type-to-package mapping improvements. * t/GstRegistry.t: Ask for a feature that actually exists. * t/GstTagSetter.t: Use vorbisenc instead of id3tag. * xs/GstElement.xs: Don't call gperl_object_set_no_warn_unreg_subclass on GST_TYPE_ELEMENT. This would prevent elements from getting a unique package name with all implemented interfaces set up correctly. * xs/GstGhostPad.xs, xs/GstTagSetter.xs: Remove now unneeded gperl_set_isa calls. * xs/GstTypeFindFactory.xs: Hush a compiler warning. 2005/12/25 kaffeetisch * examples/read-metadata.pl: Don't try to print fields with undefined values. * t/GstValue.t, xs/GstValue.xs: Implement and test GstDate converters. 2005/12/19 kaffeetisch * examples/manual/query.pl: Turn off output buffering so you can actually see the timer. * t/GstQuery.t: Remove the TODO block now that the problem is fixed. * gst2perl.h, xs/GstEvent.xs, xs/GstMessage.xs, xs/GstQuery.xs, xs/GstMiniObject.xs: Provide a way for GstMiniObject subclasses to register custom package name lookup functions. Make use of it in GstEvent, GstMessage and GstQuery. In addition to being cleaner, this also fixes an obscure GstQuery bug. 2005/12/07 kaffeetisch * GStreamer.pm, Makefile.PL, NEWS, README: Depend on GStreamer >= 0.10.0 and Glib >= 1.110. Release 0.05. 2005/12/07 kaffeetisch * t/GstElement.t: alsasink apparently doesn't require a clock anymore. * t/GstMessage.t: Don't use Glib::Int64 since Glib didn't the register the fundamental until after the 1.110 release. 2005/12/04 kaffeetisch * GStreamer.pm: Update the synopsis. Remove the main loop stuff. * TODO: Update. * doctypes, gst.typemap: Remove unused stuff. * t/GstQuery.t: Put TODO blocks around the failing tests. * xs/GstCaps.xs, xs/GstChildProxy.xs, xs/GstEvent.xs, xs/GstIterator.xs, xs/GstMessage.xs, xs/GstQuery.xs: Add synopsis and/or description sections. * xs/GstEvent.xs: Add a "type" method that returns an event's type. 2005/12/03 kaffeetisch * GStreamer.pm, MANIFEST, MANIFEST.SKIP, Makefile.PL, TODO, gst.typemap, gst2perl.h, maps, examples/player.pl, examples/queue.pl, examples/read-metadata.pl, examples/tagger.pl, examples/manual/bus.pl, examples/manual/decodebin.pl, examples/manual/dynamic.pl, examples/manual/elementfactory.pl, examples/manual/fakesrc.pl, examples/manual/ghostpad.pl, examples/manual/helloworld.pl, examples/manual/pad.pl, examples/manual/playbin.pl, examples/manual/query.pl, examples/manual/threads.pl, examples/manual/typefind.pl, t/Gst.t, t/GstBin.t, t/GstBuffer.t, t/GstBus.t, t/GstCaps.t, t/GstChildProxy.t, t/GstClock.t, t/GstData.tM t/GstElement.t, t/GstElementFactory.t, t/GstEvent.tM t/GstFormat.t, t/GstGhostPad.t, t/GstIndex.t, t/GstIndexFactory.t, t/GstIterator.t, t/GstMessage.t, t/GstMiniObject.t, t/GstObject.t, t/GstPad.t, t/GstPadTemplate.t, t/GstParse.t, t/GstPipeline.tM t/GstPlugin.t, t/GstPluginFeature.t, t/GstQuery.t, t/GstRegistry.t, t/GstRegistryPool.t, t/GstScheduler.t, t/GstStructure.t, t/GstSystemClock.t, t/GstThread.t, t/GstTypeFindFactory.t, t/GstValue.t, xs/Gst.xs, xs/GstBin.xs, xs/GstBuffer.xs xs/GstBus.xs, xs/GstCaps.xs, xs/GstChildProxy.xs, xs/GstClock.xs, xs/GstData.xs, xs/GstElement.xs, xs/GstElementFactory.xs, xs/GstError.xs, xs/GstEvent.xs, xs/GstFormat.xs, xs/GstGhostPad.xs, xs/GstIndex.xs, xs/GstIndexFactory.xs, xs/GstIterator.xs, xs/GstMessage.xs, xs/GstMiniObject.xs, xs/GstObject.xs, xs/GstPad.xs, xs/GstPadTemplate.xs, xs/GstParse.xs, xs/GstPipeline.xs, xs/GstPlugin.xs, xs/GstPluginFeature.xs, xs/GstQuery.xs, xs/GstRegistry.xs, xs/GstRegistryPool.xs, xs/GstScheduler.xs, xs/GstSystemClock.xs, xs/GstTagSetter.xs, xs/GstThread.xs, xs/GstTypeFindFactory.xs, xs/GstValue.xs: Port to 0.9/0.10. Implement and test new stuff; rigorously remove old things. * gst.typemap, xs/GstBuffer.xs, xs/GstClock.xs, xs/GstElement.xs, xs/GstIndex.xs, xs/GstTag.xs: Use Glib's new 64-bit converters. * xs/GstStructure.xs: Plug a leak. Fix some const issues. * xs/GstValue.xs (gst2perl_int_range_unwrap): Check for SVt_PVAV instead of SVt_PVHV. 2005/09/28 kaffeetisch * xs/GstElement.xs, xs/GstTagSetter.xs: Move the GStreamer::TagSetter @ISA manipulation to GstTagSetter.xs. 2005/09/09 kaffeetisch * GStreamer.pm, NEWS, README: Release 0.04. 2005/09/09 kaffeetisch * Makefile.PL: Require Glib 1.100. Use Glib::CodeGen instead of Gtk2::CodeGen. Drop the Gtk2 dependency. 2005/08/13 kaffeetisch * GStreamer.pm, NEWS: Release 0.03. 2005/08/13 kaffeetisch * MANIFEST, META.yml: Remove the stub META.yml. * t/GstRegistry.t, t/GstTagSetter.t: Fix test failures. 2005/07/26 kaffeetisch * MANIFEST, MANIFEST.SKIP: Add a skip file that lists everything that is not to be distributed. * t/GstPad.t: Fix a potential test failure. 2005/07/21 muppetman * MANIFEST: Don't distribute generated files. * .cvsignore, xs/.cvsignore: Updated ignores. 2005/06/20 kaffeetisch * TODO: Update. * GStreamer.pm, t/GstCaps.t: Implement and test overloaded operators for GStreamer::Caps: +, -, &, |, <=, >=, == and "". * xs/GstStructure.xs (newSVGstStructure): Return undef if the structure is NULL. 2005/06/17 kaffeetisch * GStreamer.pm, MANIFEST, META.yml, NEWS: Release 0.02. 2005/06/15 kaffeetisch * examples/tagger.pl: Add a small example demonstrating the recently bound tag editing facilities. * examples/player.pl: Small cosmetic changes. 2005/06/12 kaffeetisch * maps, t/GstTagSetter.t, xs/GstTagSetter.xs: Bind and test gst_tag_setter_merge, gst_tag_setter_add, gst_tag_setter_get_list, gst_tag_setter_set_merge_mode and gst_tag_setter_get_merge_mode as GStreamer::TagSetter::merge_tags, add_tags, get_tag_list, set_tag_merge_mode and get_tag_merge_mode respectively. * maps, t/GstTag.t, xs/GstTag.xs: Bind and test gst_tag_exists, gst_tag_get_type, gst_tag_get_nick, gst_tag_get_description, gst_tag_get_flag and gst_tag_is_fixed. Also move the GstTagList converters from GstElement.xs to this file. * xs/GstElement.xs: Handle 64bit integers in the bindings for gst_element_set and gst_element_get. Also handle the "location" property specially: don't use the GChar converters for since they'd mangle the filename. * xs/Gst.xs, xs/GstPad.xs: Update some comments. * t/GstPlugin.t, xs/GstPlugin.xs: Bind and test gst_plugin_check_file, gst_plugin_load_file, gst_plugin_load and gst_library_load. * xs/GstFormat.xs, xs/GstParse.xs, xs/GstQuery.xs: Fix the docs to display functions as functions, not methods. 2005/06/01 kaffeetisch * gst2perl.h: Add a comment. * xs/GstElement.xs: Handle 64bit types separately in gst_tag_list_wrap and gst_tag_list_unwrap -- the standard GValue wrappers don't convert them correctly yet. 2005/05/29 kaffeetisch * gst2perl.h, gst.typemap, xs/GstBuffer.xs, xs/GstClock.xs, xs/GstElement.xs, xs/GstIndex.xs, xs/GstPad.xs: Implement and use custom type wrappers for gint64 and guint64. They convert the long longs to and from Perl strings. 2005/05/24 kaffeetisch * xs/GstElement.xs (SvGstSeekType): Initialize `value' to zero. This should fix the remaining seek bugs. 2005/05/23 kaffeetisch * gst2perl.h, t/GstElement.t, xs/GstElement.xs: Add a custom SvGstSeekType that also accepts values of type GstFormatType. This should make GStreamer::Element::seek work like expected. * xs/Gst.xs, xs/GstRegistryPool.xs: Hush some compiler warnings about unused variables. 2005/05/08 kaffeetisch * maps, t/GstElement.t, xs/GstElement.xs: Add and test support for GstTagList's which makes gst_element_found_tags, gst_element_found_tags_for_pad and the found-tag signal usable. * examples/player.pl: Add an example using the above. * xs/GstBin.xs: Update a FIXME comment. 2005/04/25 kaffeetisch * MANIFEST, META.yml, Makefile.PL, NEWS, README: Release 0.01. 2005/04/03 kaffeetisch * t/GstPad.t: Also include 0.8.7 in the set_explicit_caps() skip. 2005/03/29 kaffeetisch * MANIFEST, README: Add a rudimentary README. * Makefile.PL: Add FIXMEs so I remember to bump the required version of Glib and Gtk2 once the releases are out. 2005/03/29 kaffeetisch * xs/Gst.xs: Call gst_buffer_get_type() during BOOT to make sure GstBuffer's type macro is valid. * t/GstBuffer.t, t/GstCaps.t, t/GstClockt.t, t/GstElement.t, t/GstPad.t, t/GstPlugin.t, xs/GstBuffer.xs, xs/GstCaps.xs, xs/GstClock.xs, xs/GstElement.xs, xs/GstPad.xs, xs/GstPlugin.xs: Add version guards and skips around function that appeared during the 0.8.x series of GStreamer. * MANIFEST, TODO: Add TODO file that lists things that still need some love. 2005/03/25 kaffeetisch * GStreamer.pm, t/Gst.t, examples/manual/dynamic.pl: Bind, test, and use the GST_RANK_NONE GST_RANK_MARGINAL GST_RANK_SECONDARY GST_RANK_PRIMARY constants. * gst2perl.h, xs/GstClock.xs: Add GstClockTime and GstClockTimeDiff converters in addition to the typemap. Use them whereever appropriate. * t/GstElement.t, t/GstScheduler.t, xs/GstElement.xs, xs/GstScheduler.xs: Bind and test gst_element_clock_wait and gst_scheduler_clock_wait. * xs/GstCaps.xs, xs/GstPluginFeature.xs: Fix some comments. 2005/03/23 kaffeetisch * GStreamer.pm, LICENSE, MANIFEST, Makefile.PL, copyright.pod, doctypes, gst.typemap, gst2perl.h, maps, examples/manual/bin.pl, examples/manual/decodebin.pl, examples/manual/dynamic.pl, examples/manual/elementcreate.pl, examples/manual/elementfactory.pl, examples/manual/elementget.pl, examples/manual/elementlink.pl, examples/manual/elementmake.pl, examples/manual/fakesrc.pl, examples/manual/ghostpad.pl, examples/manual/helloworld.pl, examples/manual/init.pl, examples/manual/pad.pl, examples/manual/playbin.pl, examples/manual/query.pl, examples/manual/threads.pl, examples/manual/typefind.pl, t/Gst.t, t/GstBin.t, t/GstBuffer.t, t/GstCaps.t, t/GstClock.t, t/GstData.t, t/GstElement.t, t/GstEvent.t, t/GstFormat.t, t/GstIndex.t, t/GstObject.t, t/GstPad.t, t/GstParse.t, t/GstPipeline.t, t/GstPlugin.t, t/GstPluginFeature.t, t/GstQuery.t, t/GstRegistry.t, t/GstRegistryPool.t, t/GstScheduler.t, t/GstStructure.t, t/GstThread.t, xs/Gst.xs, xs/GstBin.xs, xs/GstBuffer.xs, xs/GstCaps.xs, xs/GstClock.xs, xs/GstData.xs, xs/GstElement.xs, xs/GstError.xs, xs/GstEvent.xs, xs/GstFormat.xs, xs/GstIndex.xs, xs/GstObject.xs, xs/GstPad.xs, xs/GstParse.xs, xs/GstPipeline.xs, xs/GstPlugin.xs, xs/GstPluginFeature.xs, xs/GstQuery.xs, xs/GstRegistry.xs, xs/GstRegistryPool.xs, xs/GstScheduler.xs, xs/GstStructure.xs, xs/GstThread.xs, xs/GstValue.xs: Intial import. GStreamer-0.19/copyright.pod000644 001750 000024 00000000177 11664366505 016322 0ustar00brianstaff000000 000000 Copyright (C) 2005-2011 by the gtk2-perl team. This software is licensed under the LGPL. See L for a full notice. GStreamer-0.19/doctypes000644 001750 000024 00000000301 11664366505 015350 0ustar00brianstaff000000 000000 GstMessage_noinc GStreamer::Message GstClockTime unsigned integer GstClockTimeDiff integer GstClockID GStreamer::ClockID GstIterator GStreamer::Iterator GstStructure GStreamer::Structure GStreamer-0.19/examples/000755 001750 000024 00000000000 12221737451 015407 5ustar00brianstaff000000 000000 GStreamer-0.19/gst.typemap000644 001750 000024 00000000373 11664366505 016002 0ustar00brianstaff000000 000000 TYPEMAP GstClockTime T_GPERL_GENERIC_WRAPPER GstClockTimeDiff T_GPERL_GENERIC_WRAPPER GstStructure * T_GPERL_GENERIC_WRAPPER const GstStructure * T_GPERL_GENERIC_WRAPPER GstClockID T_GPERL_GENERIC_WRAPPER GstIterator * T_GPERL_GENERIC_WRAPPER GStreamer-0.19/gst2perl.h000644 001750 000024 00000004313 11722734576 015517 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #ifndef _GST2PERL_H_ #define _GST2PERL_H_ #include #include /* Starting with 0.10.17, libgstreamer provides this macro. */ #ifndef GST_CHECK_VERSION # include "gst2perl-version.h" #endif #include "gst2perl-autogen.h" /* GstMiniObject support. */ void gst2perl_register_mini_object (GType type, const char *package); typedef const char * (*Gst2PerlMiniObjectPackageLookupFunc) (GstMiniObject *object); void gst2perl_register_mini_object_package_lookup_func (GType type, Gst2PerlMiniObjectPackageLookupFunc func); SV * gst2perl_sv_from_mini_object (GstMiniObject *object, gboolean own); GstMiniObject * gst2perl_mini_object_from_sv (SV *sv); /* Custom enum handling. */ #undef newSVGstFormat #undef SvGstFormat SV * newSVGstFormat (GstFormat format); GstFormat SvGstFormat (SV *sv); #undef newSVGstQueryType #undef SvGstQueryType SV * newSVGstQueryType (GstQueryType type); GstQueryType SvGstQueryType (SV *sv); /* Custom type converters. */ SV * newSVGstStructure (const GstStructure *structure); GstStructure * SvGstStructure (SV *sv); SV * newSVGstIterator (const GstIterator *iter); GstIterator * SvGstIterator (SV *sv); SV * newSVGstClockTime (GstClockTime time); GstClockTime SvGstClockTime (SV *time); SV * newSVGstClockTimeDiff (GstClockTimeDiff diff); GstClockTimeDiff SvGstClockTimeDiff (SV *diff); SV * newSVGstClockID (GstClockID id); GstClockID SvGstClockID (SV *sv); #endif /* _GST2PERL_H_ */ GStreamer-0.19/lib/000755 001750 000024 00000000000 12221737451 014337 5ustar00brianstaff000000 000000 GStreamer-0.19/LICENSE000644 001750 000024 00000063476 11722734576 014630 0ustar00brianstaff000000 000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! GStreamer-0.19/Makefile.PL000644 001750 000024 00000015547 12104044201 015537 0ustar00brianstaff000000 000000 #!/usr/bin/perl use 5.008; use strict; use warnings; use ExtUtils::MakeMaker; use Cwd qw(cwd); # $Id$ our %build_reqs = ( 'perl-ExtUtils-Depends' => '0.205', 'perl-ExtUtils-PkgConfig' => '1.07', 'perl-Glib' => '1.180', 'libgstreamer' => '0.10.0', ); our %PREREQ_PM = ( 'Glib' => $build_reqs{'perl-Glib'}, 'ExtUtils::Depends' => $build_reqs{'perl-ExtUtils-Depends'}, 'ExtUtils::PkgConfig' => $build_reqs{'perl-ExtUtils-PkgConfig'}, ); my %meta_merge = ( q(meta-spec) => { version => '2', url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', }, author => ['gtk2-perl Team '], release_status => 'stable', # valid values: https://metacpan.org/module/CPAN::Meta::Spec#license license => 'lgpl_2_1', resources => { license => 'http://www.gnu.org/licenses/lgpl-2.1.html', homepage => 'http://gtk2-perl.sourceforge.net', x_MailingList => 'https://mail.gnome.org/mailman/listinfo/gtk-perl-list', bugtracker => { web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=GStreamer', mailto => 'bug-GStreamer [at] rt.cpan.org', }, repository => { url => 'git://git.gnome.org/perl-GStreamer', type => 'git', web => 'http://git.gnome.org/browse/perl-GStreamer', }, }, prereqs => { configure => { requires => {%PREREQ_PM}, # no direct ref for 5.14 compatibility }, }, no_index => { directory => [qw/xs/] }, ); unless (eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';" . "use ExtUtils::PkgConfig '$build_reqs{'perl-ExtUtils-PkgConfig'}';" . "use Glib '$build_reqs{'perl-Glib'}';" . "use Glib::MakeHelper;" . "use Glib::CodeGen;" . "1") { warn "$@\n"; WriteMakefile( PREREQ_FATAL => 1, PREREQ_PM => \%PREREQ_PM, ); exit 1; # not reached } # If the package can't be found, warn and exit with status 0 to indicate to # CPAN testers that their system is not supported. my %pkgcfg; unless (eval { %pkgcfg = ExtUtils::PkgConfig->find ( "gstreamer-0.10 >= $build_reqs{'libgstreamer'}"); 1; }) { warn $@; exit 0; } mkdir 'build', 0777; our @xs_files = ; our %pod_files = ( 'lib/GStreamer.pm' => '$(INST_MAN3DIR)/GStreamer.$(MAN3EXT)', Glib::MakeHelper->do_pod_files (@xs_files), ); # --------------------------------------------------------------------------- # sub gen_object_stuff { my ($typemacro, $classname, $root, $package) = @_; Glib::CodeGen::add_typemap("$classname *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("$classname\_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname\_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_register(<<"EOT"); #ifdef $typemacro gperl_register_object ($typemacro, "$package"); #endif /* $typemacro */ EOT Glib::CodeGen::add_header(<<"EOT"); #ifdef $typemacro typedef $classname $classname\_ornull; # define Sv$classname(sv) (($classname *) gperl_get_object_check (sv, $typemacro)) # define newSV$classname(val) (gperl_new_object (G_OBJECT (val), TRUE)) # define Sv$classname\_ornull(sv) (((sv) && SvOK (sv)) ? Sv$classname (sv) : NULL) # define newSV$classname\_ornull(val) (((val) == NULL) ? &PL_sv_undef : newSV$classname (val)) #endif /* $typemacro */ EOT } sub gen_mini_object_stuff { my ($typemacro, $classname, $root, $package) = @_; Glib::CodeGen::add_typemap("$classname *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("$classname\_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname\_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("$classname\_noinc *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname\_noinc *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("$classname\_noinc_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_typemap("const $classname\_noinc_ornull *", "T_GPERL_GENERIC_WRAPPER"); Glib::CodeGen::add_register(<<"EOT"); #ifdef $typemacro gst2perl_register_mini_object ($typemacro, "$package"); #endif /* $typemacro */ EOT Glib::CodeGen::add_header(<<"EOT"); #ifdef $typemacro typedef $classname $classname\_ornull; typedef $classname $classname\_noinc; typedef $classname $classname\_noinc_ornull; # define Sv$classname(sv) (($classname *) gst2perl_mini_object_from_sv (sv)) # define Sv$classname\_ornull(sv) (((sv) && SvOK (sv)) ? Sv$classname(sv) : NULL) # define newSV$classname(val) (gst2perl_sv_from_mini_object (GST_MINI_OBJECT (val), TRUE)) # define newSV$classname\_ornull(val) (((val) == NULL) ? &PL_sv_undef : newSV$classname(val)) # define newSV$classname\_noinc(val) (gst2perl_sv_from_mini_object (GST_MINI_OBJECT (val), FALSE)) # define newSV$classname\_noinc_ornull(val) (((val) == NULL) ? &PL_sv_undef : newSV$classname\_noinc(val)) #endif /* $typemacro */ EOT } Glib::CodeGen->add_type_handler (GstObject => \&gen_object_stuff); Glib::CodeGen->add_type_handler (GstMiniObject => \&gen_mini_object_stuff); Glib::CodeGen->parse_maps('gst2perl'); Glib::CodeGen->write_boot(ignore => qr/^GStreamer$/); # --------------------------------------------------------------------------- # ExtUtils::PkgConfig->write_version_macros ( "build/gst2perl-version.h", "gstreamer-0.10" => "GST", ); my $gst = ExtUtils::Depends->new('GStreamer', 'Glib'); $gst->set_inc($pkgcfg{cflags} . ' -I./build '); $gst->set_libs($pkgcfg{libs}); $gst->add_xs(@xs_files); $gst->add_pm('lib/GStreamer.pm' => '$(INST_LIBDIR)/GStreamer.pm'); $gst->add_typemaps(map {File::Spec->catfile(cwd(), $_)} ('gst.typemap', 'build/gst2perl.typemap')); $gst->install(qw(gst2perl.h build/gst2perl-autogen.h build/gst2perl-version.h doctypes)); $gst->save_config('build/IFiles.pm'); WriteMakefile( NAME => 'GStreamer', VERSION_FROM => 'lib/GStreamer.pm', ABSTRACT_FROM => 'lib/GStreamer.pm', PREREQ_PM => \%PREREQ_PM, XSPROTOARG => '-noprototypes', MAN3PODS => \%pod_files, META_MERGE => \%meta_merge, $gst->get_makefile_vars, ); sub MY::postamble { return Glib::MakeHelper->postamble_clean () . Glib::MakeHelper->postamble_docs_full ( DEPENDS => $gst, DOCTYPES => 'doctypes', COPYRIGHT_FROM => 'copyright.pod'); } GStreamer-0.19/MANIFEST000644 001750 000024 00000003576 12221737451 014735 0ustar00brianstaff000000 000000 ChangeLog.pre-git copyright.pod doctypes examples/manual/bin.pl examples/manual/bus.pl examples/manual/decodebin.pl examples/manual/dynamic.pl examples/manual/elementcreate.pl examples/manual/elementfactory.pl examples/manual/elementget.pl examples/manual/elementlink.pl examples/manual/elementmake.pl examples/manual/fakesrc.pl examples/manual/ghostpad.pl examples/manual/helloworld.pl examples/manual/init.pl examples/manual/pad.pl examples/manual/playbin.pl examples/manual/query.pl examples/manual/typefind.pl examples/player.pl examples/queue.pl examples/read-metadata.pl examples/tagger.pl gst.typemap gst2perl.h lib/GStreamer.pm LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP maps NEWS perl-GStreamer.doap README t/Gst.t t/GstBin.t t/GstBuffer.t t/GstBus.t t/GstCaps.t t/GstChildProxy.t t/GstClock.t t/GstElement.t t/GstElementFactory.t t/GstEvent.t t/GstFormat.t t/GstGhostPad.t t/GstIndex.t t/GstIndexFactory.t t/GstIterator.t t/GstMessage.t t/GstMiniObject.t t/GstObject.t t/GstPad.t t/GstPadTemplate.t t/GstPipeline.t t/GstPlugin.t t/GstPluginFeature.t t/GstQuery.t t/GstRegistry.t t/GstStructure.t t/GstSystemClock.t t/GstTag.t t/GstTagSetter.t t/GstTypeFindFactory.t t/GstValue.t TODO xs/Gst.xs xs/GstBin.xs xs/GstBuffer.xs xs/GstBus.xs xs/GstCaps.xs xs/GstChildProxy.xs xs/GstClock.xs xs/GstElement.xs xs/GstElementFactory.xs xs/GstEvent.xs xs/GstFormat.xs xs/GstGhostPad.xs xs/GstIndex.xs xs/GstIndexFactory.xs xs/GstIterator.xs xs/GstMessage.xs xs/GstMiniObject.xs xs/GstObject.xs xs/GstPad.xs xs/GstPadTemplate.xs xs/GstPipeline.xs xs/GstPlugin.xs xs/GstPluginFeature.xs xs/GstQuery.xs xs/GstRegistry.xs xs/GstStructure.xs xs/GstSystemClock.xs xs/GstTag.xs xs/GstTagSetter.xs xs/GstTypeFindFactory.xs xs/GstValue.xs META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) GStreamer-0.19/MANIFEST.SKIP000644 001750 000024 00000000113 11664366505 015472 0ustar00brianstaff000000 000000 \.git build Makefile$ \.bak$ \.bs$ blib xs/\w+\.c$ xs/\w+\.o$ \.releaserc$ GStreamer-0.19/maps000644 001750 000024 00000007422 11664366505 014471 0ustar00brianstaff000000 000000 # $Id$ GST_TYPE_BIN GstBin GstObject GStreamer::Bin GST_TYPE_BUS GstBus GstObject GStreamer::Bus GST_TYPE_CLOCK GstClock GstObject GStreamer::Clock GST_TYPE_ELEMENT GstElement GstObject GStreamer::Element GST_TYPE_ELEMENT_FACTORY GstElementFactory GstObject GStreamer::ElementFactory GST_TYPE_GHOST_PAD GstGhostPad GstObject GStreamer::GhostPad GST_TYPE_INDEX GstIndex GstObject GStreamer::Index GST_TYPE_INDEX_FACTORY GstIndexFactory GstObject GStreamer::IndexFactory GST_TYPE_OBJECT GstObject GstObject GStreamer::Object GST_TYPE_PAD GstPad GstObject GStreamer::Pad GST_TYPE_PAD_TEMPLATE GstPadTemplate GstObject GStreamer::PadTemplate GST_TYPE_PIPELINE GstPipeline GstObject GStreamer::Pipeline GST_TYPE_PLUGIN GstPlugin GstObject GStreamer::Plugin GST_TYPE_PLUGIN_FEATURE GstPluginFeature GstObject GStreamer::PluginFeature GST_TYPE_QUEUE GstQueue GstObject GStreamer::Queue GST_TYPE_REGISTRY GstRegistry GstObject GStreamer::Registry GST_TYPE_SYSTEM_CLOCK GstSystemClock GstObject GStreamer::SystemClock GST_TYPE_TASK GstTask GstObject GStreamer::Task GST_TYPE_TYPE_FIND_FACTORY GstTypeFindFactory GstObject GStreamer::TypeFindFactory GST_TYPE_CHILD_PROXY GstChildProxy GInterface GStreamer::ChildProxy GST_TYPE_TAG_SETTER GstTagSetter GInterface GStreamer::TagSetter GST_TYPE_URI_HANDLER GstURIHandler GInterface GStreamer::URIHandler GST_TYPE_BUFFER GstBuffer GstMiniObject GStreamer::Buffer GST_TYPE_EVENT GstEvent GstMiniObject GStreamer::Event GST_TYPE_MESSAGE GstMessage GstMiniObject GStreamer::Message GST_TYPE_MINI_OBJECT GstMiniObject GstMiniObject GStreamer::MiniObject GST_TYPE_QUERY GstQuery GstMiniObject GStreamer::Query GST_TYPE_CAPS GstCaps GBoxed GStreamer::Caps GST_TYPE_INDEX_ENTRY GstIndexEntry GBoxed GStreamer::IndexEntry GST_TYPE_TAG_LIST GstTagList GBoxed GStreamer::TagList GST_TYPE_CLOCK_RETURN GstClockReturn GEnum GStreamer::ClockReturn GST_TYPE_EVENT_TYPE GstEventType GEnum GStreamer::EventType GST_TYPE_FLOW_RETURN GstFlowReturn GEnum GStreamer::FlowReturn GST_TYPE_FORMAT GstFormat GEnum GStreamer::Format GST_TYPE_INDEX_CERTAINTY GstIndexCertainty GEnum GStreamer::IndexCertainty GST_TYPE_INDEX_LOOKUP_METHOD GstIndexLookupMethod GEnum GStreamer::IndexLookupMethod GST_TYPE_PAD_DIRECTION GstPadDirection GEnum GStreamer::PadDirection GST_TYPE_PAD_LINK_RETURN GstPadLinkReturn GEnum GStreamer::PadLinkReturn GST_TYPE_PAD_PRESENCE GstPadPresence GEnum GStreamer::PadPresence GST_TYPE_QUERY_TYPE GstQueryType GEnum GStreamer::QueryType GST_TYPE_SEEK_TYPE GstSeekType GEnum GStreamer::SeekType GST_TYPE_STATE GstState GEnum GStreamer::State GST_TYPE_STATE_CHANGE_RETURN GstStateChangeReturn GEnum GStreamer::StateChangeReturn GST_TYPE_TAG_MERGE_MODE GstTagMergeMode GEnum GStreamer::TagMergeMode GST_TYPE_URI_TYPE GstURIType GEnum GStreamer::URIType GST_TYPE_ASSOC_FLAGS GstAssocFlags GFlags GStreamer::AssocFlags GST_TYPE_BUFFER_FLAG GstBufferFlag GFlags GStreamer::BufferFlag GST_TYPE_EVENT_TYPE_FLAGS GstEventTypeFlags GFlags GStreamer::EventTypeFlags GST_TYPE_MESSAGE_TYPE GstMessageType GFlags GStreamer::MessageType GST_TYPE_SEEK_FLAGS GstSeekFlags GFlags GStreamer::SeekFlags GST_TYPE_TAG_FLAG GstTagFlag GFlags GStreamer::TagFlag GST_CORE_ERROR GST_TYPE_CORE_ERROR GError GStreamer::CoreError GST_CORE_ERROR_MISSING_PLUGIN GST_TYPE_CORE_ERROR_MISSING_PLUGIN GError GStreamer::CoreErrorMissingPlugin GST_LIBRARY_ERROR GST_TYPE_LIBRARY_ERROR GError GStreamer::LibraryError GST_PARSE_ERROR GST_TYPE_PARSE_ERROR GError GStreamer::ParseError GST_PLUGIN_ERROR GST_TYPE_PLUGIN_ERROR GError GStreamer::PluginError GST_RESOURCE_ERROR GST_TYPE_RESOURCE_ERROR GError GStreamer::ResourceError GST_STREAM_ERROR GST_TYPE_STREAM_ERROR GError GStreamer::StreamError GStreamer-0.19/META.json000644 001750 000024 00000002537 12221737451 015221 0ustar00brianstaff000000 000000 { "abstract" : "Perl interface to the GStreamer library", "author" : [ "gtk2-perl Team " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "GStreamer", "no_index" : { "directory" : [ "t", "inc", "xs" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::Depends" : "0.205", "ExtUtils::PkgConfig" : "1.07", "Glib" : "1.180" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-GStreamer [at] rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=GStreamer" }, "homepage" : "http://gtk2-perl.sourceforge.net", "license" : [ "http://www.gnu.org/licenses/lgpl-2.1.html" ], "repository" : { "type" : "git", "url" : "git://git.gnome.org/perl-GStreamer", "web" : "http://git.gnome.org/browse/perl-GStreamer" }, "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list" }, "version" : "0.19" } GStreamer-0.19/META.yml000644 001750 000024 00000001462 12221737451 015045 0ustar00brianstaff000000 000000 --- abstract: 'Perl interface to the GStreamer library' author: - 'gtk2-perl Team ' build_requires: {} configure_requires: ExtUtils::Depends: 0.205 ExtUtils::PkgConfig: 1.07 Glib: 1.180 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: GStreamer no_index: directory: - t - inc - xs resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=GStreamer homepage: http://gtk2-perl.sourceforge.net license: http://www.gnu.org/licenses/lgpl-2.1.html repository: git://git.gnome.org/perl-GStreamer x_MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list version: 0.19 GStreamer-0.19/NEWS000644 001750 000024 00000010377 12221735070 014273 0ustar00brianstaff000000 000000 Overview of changes in GStreamer 0.19 ===================================== * Avoid misusing the macro PL_na, thus preventing potential issues when GStreamer is used in conjunction with certain XS modules, among them XML::Parser and String::Approx. Overview of changes in GStreamer 0.18 ===================================== * Add GStreamer::Buffer::data_ptr() to access the buffer's data without copying it. (RT#82826) ∗ Make a few tests more robust * Created %meta_merge which follows v2 of CPAN Meta Spec - %meta_merge is used for generating metadata via ExtUtils::MakeMaker/CPAN::Meta Overview of changes in GStreamer 0.17 ===================================== * Make GStreamer::Buffer not leak all data. ∗ Change FSF address in license notices (RT#72664/74533) Overview of changes in GStreamer 0.16 ===================================== [The actual 0.16 release did not contain these notes due to an oversight.] * Make the read-metadata.pl example more robust. * Fix many test failures. Overview of changes in GStreamer 0.15 ===================================== * Wrap gst_pad_is_blocking, gst_pad_peer_query, gst_pad_iterate_internal_links, and gst_pad_iterate_internal_links_default. * Don't assume ownership of GstIndexEntry objects returned by the various GstIndex methods. * Throw an exception if unknown GstFormat values are encountered. * Convert NULL GstIterator objects to undef. * Fix a few test failures. Overview of changes in GStreamer 0.14 ===================================== * Fix a few test failures. * Hush compiler warnigns. Overview of changes in GStreamer 0.13 ===================================== * Make the return value of GStreamer::Element::add_pad, GStreamer::Element::remove_pad, and GStreamer::Element::set_locked_state meaningful. * Fix a few test and build issues. Overview of changes in GStreamer 0.12 ===================================== * Add support for GST_TYPE_FOURCC, GST_TYPE_DOUBLE_RANGE, GST_TYPE_ARRAY, GST_TYPE_FRACTION, and GST_TYPE_FRACTION_RANGE. Overview of changes in GStreamer 0.11 ===================================== * Fix build and test suite issues. Overview of changes in GStreamer 0.10 ===================================== * Alter GStreamer::Structure::from_string to return only one value. * Add support for latency, async-start, and async-done messages. * Add GStreamer::Message::timestamp() and src(). * Fix test failures. Overview of changes in GStreamer 0.09 ===================================== * Fix a portability issue. [Jeremy Messenger] * Fix a few test suite issues. Overview of changes in GStreamer 0.08 ===================================== * Fix a few more test suite issues. Overview of changes in GStreamer 0.07 ===================================== * Make GStreamer::Clock::wait_async work correctly. * Fix some test suite issues. Overview of changes in GStreamer 0.06 ===================================== * Fix an obscure GStreamer::Query bug. * Add handlers for GstDate. They convert to and from seconds since epoch. * Require Glib 1.114 for the type-to-package mapping changes. This greatly improves support for interfaces like GStreamer::TagSetter. Overview of changes in GStreamer 0.05 ===================================== * Port to GStreamer 0.10.0. - Wrap and test most of the new API. - Remove old stuff. * Use Glib's 64-bit integer converters. * Rename the various GStreamer::Caps and GStreamer::Event constructors from new_thing to GStreamer::Caps::Thing::new and GStreamer::Event::Thing::new respectively. Overview of changes in GStreamer 0.04 ===================================== * Get rid of the Gtk2 dependency by using Glib 1.100's Glib::CodeGen. Overview of changes in GStreamer 0.03 ===================================== * Implement overloaded operators for GStreamer::Caps: +, -, &, |, <=, >=, == and "". * Fix a few test failures. Overview of changes in GStreamer 0.02 ===================================== * Fix handling of 64bit integers all over the place. * Fix the processing of GStreamer::Element::seek's seek-type argument. * Fix the "location" property to not mangle filenames. * Add support for tag reading and writing. * Add plugin and library loading support. Overview of changes in GStreamer 0.01 ===================================== * Initial release. GStreamer-0.19/perl-GStreamer.doap000644 001750 000024 00000001417 11664366505 017302 0ustar00brianstaff000000 000000 GStreamer Perl interface to the GStreamer library Torsten Schönfeld tsch GStreamer-0.19/README000644 001750 000024 00000001103 11664366505 014454 0ustar00brianstaff000000 000000 GStreamer ----------- This module allows you to use the GStreamer library from Perl. GStreamer comes with automatically generated API documentation. Its index can be accessed with: perldoc GStreamer::index Installation -------------- To install GStreamer, run the following commands: perl Makefile.PL make make test make install Dependencies -------------- GStreamer depends on any release of the 0.10 series of the GStreamer library and on the following Perl modules: ExtUtils::Depends ExtUtils::PkgConfig Glib >= 1.180 GStreamer-0.19/t/000755 001750 000024 00000000000 12221737451 014034 5ustar00brianstaff000000 000000 GStreamer-0.19/TODO000644 001750 000024 00000001075 11664366505 014274 0ustar00brianstaff000000 000000 # $Id$ Stuff that still needs some love: * Make GStreamer::Buffer more robust. Find out if enough of the related macros are bound. * Wrap missing API. Many macros are not bound and need to be either exported or worked around. Missing xsubs are mostly marked with FIXMEs. Completely or nearly completely unbound headers include: - gstfilter.h - gstinterface.h - gstsegment.h - gsttask.h - gsttrace.h - gsttypefind.h - gsturi.h - gsturitype.h - gstutils.h - gstvalue.h - gstxml.h * Figure out how to handle documentation generation for plugins. GStreamer-0.19/xs/000755 001750 000024 00000000000 12221737451 014223 5ustar00brianstaff000000 000000 GStreamer-0.19/xs/Gst.xs000644 001750 000024 00000007442 11722734576 015355 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer PACKAGE = GStreamer PREFIX = gst_ BOOT: #include "register.xsh" #include "boot.xsh" /* FIXME: This seems to have no effect since libgstreamer installs its * own log handler. Since it's installed later, it seems to be * preferred, so our's is never actually invoked. */ gperl_handle_logs_for ("GStreamer"); # --------------------------------------------------------------------------- # =for apidoc __hide__ =cut void GET_VERSION_INFO (class) PPCODE: EXTEND (SP, 3); /* 0.10.17 provides these macros, but with a different name. */ #if GST_CHECK_VERSION (0, 10, 17) PUSHs (sv_2mortal (newSViv (GST_VERSION_MAJOR))); PUSHs (sv_2mortal (newSViv (GST_VERSION_MINOR))); PUSHs (sv_2mortal (newSViv (GST_VERSION_MICRO))); #else PUSHs (sv_2mortal (newSViv (GST_MAJOR_VERSION))); PUSHs (sv_2mortal (newSViv (GST_MINOR_VERSION))); PUSHs (sv_2mortal (newSViv (GST_MICRO_VERSION))); #endif PERL_UNUSED_VAR (ax); =for apidoc __hide__ =cut bool CHECK_VERSION (class, major, minor, micro) int major int minor int micro CODE: RETVAL = GST_CHECK_VERSION (major, minor, micro); OUTPUT: RETVAL =for apidoc __hide__ =cut # void gst_version (guint *major, guint *minor, guint *micro, guint *nano); void gst_version (class) PREINIT: guint major, minor, micro, nano; PPCODE: PERL_UNUSED_VAR (ax); gst_version (&major, &minor, µ, &nano); EXTEND (sp, 3); PUSHs (sv_2mortal (newSVuv (major))); PUSHs (sv_2mortal (newSVuv (minor))); PUSHs (sv_2mortal (newSVuv (micro))); PUSHs (sv_2mortal (newSVuv (nano))); =for apidoc __hide__ =cut # gchar * gst_version_string (void); gchar_own * gst_version_string (class) C_ARGS: /* void */ # --------------------------------------------------------------------------- # =for apidoc __hide__ =cut # void gst_init (int *argc, char **argv[]); void gst_init (class) PREINIT: GPerlArgv *pargv; CODE: pargv = gperl_argv_new (); gst_init (&pargv->argc, &pargv->argv); gperl_argv_update (pargv); gperl_argv_free (pargv); =for apidoc __hide__ =cut # gboolean gst_init_check (int *argc, char **argv[], GError ** err); gboolean gst_init_check (class) PREINIT: GPerlArgv *pargv; GError *error = NULL; CODE: pargv = gperl_argv_new (); RETVAL = gst_init_check (&pargv->argc, &pargv->argv, &error); gperl_argv_update (pargv); gperl_argv_free (pargv); if (error) gperl_croak_gerror (NULL, error); OUTPUT: RETVAL # GOptionGroup * gst_init_get_option_group (void); =for apidoc __hide__ =cut # void gst_deinit (void); void gst_deinit (class) C_ARGS: /* void */ # --------------------------------------------------------------------------- # =for apidoc __hide__ =cut # GstElement* gst_parse_launch (const gchar *pipeline_description, GError **error); GstElement * gst_parse_launch (pipeline_description) const gchar *pipeline_description PREINIT: GError *error = NULL; CODE: RETVAL = gst_parse_launch (pipeline_description, &error); if (!RETVAL) gperl_croak_gerror (NULL, error); OUTPUT: RETVAL GStreamer-0.19/xs/GstBin.xs000644 001750 000024 00000004531 11722734576 016002 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Bin PACKAGE = GStreamer::Bin PREFIX = gst_bin_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_BIN, TRUE); # GstElement* gst_bin_new (const gchar *name); GstElement * gst_bin_new (class, name) const gchar *name C_ARGS: name # void gst_bin_add (GstBin *bin, GstElement *element); void gst_bin_add (bin, element, ...) GstBin *bin GstElement *element PREINIT: int i; CODE: PERL_UNUSED_VAR (element); for (i = 1; i < items; i++) gst_bin_add (bin, SvGstElement (ST (i))); # void gst_bin_remove (GstBin *bin, GstElement *element); void gst_bin_remove (bin, element, ...) GstBin *bin GstElement *element PREINIT: int i; CODE: PERL_UNUSED_VAR (element); for (i = 1; i < items; i++) gst_bin_remove (bin, SvGstElement (ST (i))); GstElement* gst_bin_get_by_name (GstBin *bin, const gchar *name); GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin, const gchar *name); # GstElement* gst_bin_get_by_interface (GstBin *bin, GType interface); GstElement* gst_bin_get_by_interface (GstBin *bin, const char *interface) C_ARGS: bin, gperl_type_from_package (interface) GstIterator* gst_bin_iterate_elements (GstBin *bin); GstIterator* gst_bin_iterate_sorted (GstBin *bin); GstIterator* gst_bin_iterate_recurse (GstBin *bin); GstIterator* gst_bin_iterate_sinks (GstBin *bin); # GstIterator* gst_bin_iterate_all_by_interface (GstBin *bin, GType interface); GstIterator* gst_bin_iterate_all_by_interface (GstBin *bin, const char *interface) C_ARGS: bin, gperl_type_from_package (interface) GStreamer-0.19/xs/GstBuffer.xs000644 001750 000024 00000007055 12104044201 016455 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005, 2012-2013 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Buffer PACKAGE = GStreamer::Buffer PREFIX = gst_buffer_ # DESTROY inherited from GStreamer::MiniObject. GstBufferFlag flags (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_FLAGS (buffer); OUTPUT: RETVAL SV * data (buffer) GstBuffer *buffer CODE: RETVAL = newSVpv ((gchar *) GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); OUTPUT: RETVAL void * data_ptr (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_DATA (buffer); OUTPUT: RETVAL guint size (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_SIZE (buffer); OUTPUT: RETVAL GstClockTime timestamp (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_TIMESTAMP (buffer); OUTPUT: RETVAL GstClockTime duration (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_DURATION (buffer); OUTPUT: RETVAL guint64 offset (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_OFFSET (buffer); OUTPUT: RETVAL guint64 offset_end (buffer) GstBuffer *buffer CODE: RETVAL = GST_BUFFER_OFFSET_END (buffer); OUTPUT: RETVAL # --------------------------------------------------------------------------- # # GstBuffer* gst_buffer_new (void); # GstBuffer* gst_buffer_new_and_alloc (guint size); GstBuffer_noinc * gst_buffer_new (class) C_ARGS: /* void */ # #define gst_buffer_set_data(buf, data, size) void gst_buffer_set_data (buf, data) GstBuffer *buf SV *data PREINIT: STRLEN length; gchar *raw_data; CODE: if (buf->malloc_data) { #if GST_CHECK_VERSION (0, 10, 22) if (buf->free_func) buf->free_func (buf->malloc_data); else g_free (buf->malloc_data); #else g_free (buf->malloc_data); #endif } raw_data = SvPV (data, length); buf->malloc_data = (guchar*) g_strndup (raw_data, length); #if GST_CHECK_VERSION (0, 10, 22) buf->free_func = g_free; #endif gst_buffer_set_data (buf, buf->malloc_data, length); GstCaps_own_ornull * gst_buffer_get_caps (GstBuffer *buffer); void gst_buffer_set_caps (GstBuffer *buffer, GstCaps *caps); GstBuffer_noinc * gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size); gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2); GstBuffer_noinc * gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len); void gst_buffer_stamp (GstBuffer *dest, const GstBuffer *src); # GstBuffer* gst_buffer_join (GstBuffer *buf1, GstBuffer *buf2); GstBuffer_noinc * gst_buffer_join (buf1, buf2) GstBuffer *buf1 GstBuffer *buf2 C_ARGS: /* gst_buffer_join unrefs the old buffers, but our SVs still point to them, so we need to keep them alive. */ gst_buffer_ref (buf1), gst_buffer_ref (buf2) GstBuffer_noinc * gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2); GStreamer-0.19/xs/GstBus.xs000644 001750 000024 00000006305 11722734576 016024 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" #include static GPerlCallback * bus_watch_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static gboolean bus_watch (GstBus *bus, GstMessage *message, gpointer data) { gboolean retval; int count; GPerlCallback *callback; dGPERL_CALLBACK_MARSHAL_SP; callback = data; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (sv_2mortal (newSVGstBus (bus))); PUSHs (sv_2mortal (newSVGstMessage (message))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; count = call_sv (callback->func, G_SCALAR); if (count != 1) croak ("a bus watch must return one boolean"); SPAGAIN; retval = POPu; PUTBACK; FREETMPS; LEAVE; return retval; } MODULE = GStreamer::Bus PACKAGE = GStreamer::Bus PREFIX = gst_bus_ # GstBus * gst_bus_new (void); GstBus * gst_bus_new (class) C_ARGS: /* void */ # gboolean gst_bus_post (GstBus * bus, GstMessage * message); gboolean gst_bus_post (GstBus * bus, GstMessage * message) C_ARGS: /* bus takes ownership of message. */ bus, gst_message_ref (message) gboolean gst_bus_have_pending (GstBus * bus); GstMessage_noinc_ornull * gst_bus_peek (GstBus * bus); GstMessage_noinc_ornull * gst_bus_pop (GstBus * bus); void gst_bus_set_flushing (GstBus * bus, gboolean flushing); # FIXME: Needed? # void gst_bus_set_sync_handler (GstBus * bus, GstBusSyncHandler func, gpointer data); # GSource * gst_bus_create_watch (GstBus * bus); # guint gst_bus_add_watch_full (GstBus * bus, gint priority, GstBusFunc func, gpointer user_data, GDestroyNotify notify); # guint gst_bus_add_watch (GstBus * bus, GstBusFunc func, gpointer user_data); guint gst_bus_add_watch (GstBus *bus, SV *func, SV *data=NULL) PREINIT: GPerlCallback *callback = NULL; CODE: callback = bus_watch_create (func, data); RETVAL = gst_bus_add_watch_full ( bus, G_PRIORITY_DEFAULT, bus_watch, callback, (GDestroyNotify) gperl_callback_destroy); OUTPUT: RETVAL GstMessage_noinc_ornull * gst_bus_poll (GstBus *bus, GstMessageType events, GstClockTimeDiff timeout); # FIXME: Needed? # gboolean gst_bus_async_signal_func (GstBus *bus, GstMessage *message, gpointer data); # GstBusSyncReply gst_bus_sync_signal_handler (GstBus *bus, GstMessage *message, gpointer data); void gst_bus_add_signal_watch (GstBus * bus); void gst_bus_remove_signal_watch (GstBus * bus); GStreamer-0.19/xs/GstCaps.xs000644 001750 000024 00000014423 11722734576 016161 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Caps PACKAGE = GStreamer::Caps::Empty # GstCaps * gst_caps_new_empty (void); GstCaps_own * new (class) CODE: RETVAL = gst_caps_new_empty (); OUTPUT: RETVAL MODULE = GStreamer::Caps PACKAGE = GStreamer::Caps::Any # GstCaps * gst_caps_new_any (void); GstCaps_own * new (class) CODE: RETVAL = gst_caps_new_any (); OUTPUT: RETVAL MODULE = GStreamer::Caps PACKAGE = GStreamer::Caps::Simple # GstCaps * gst_caps_new_simple (const char *media_type, const char *fieldname, ...); GstCaps_own * new (class, media_type, field, type, value, ...) const char *media_type 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); RETVAL = gst_caps_new_empty (); structure = gst_structure_empty_new (media_type); for (i = 2; 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); } /* RETVAL owns structure. */ gst_caps_append_structure (RETVAL, structure); OUTPUT: RETVAL MODULE = GStreamer::Caps PACKAGE = GStreamer::Caps::Full # GstCaps * gst_caps_new_full (GstStructure *struct1, ...); # GstCaps * gst_caps_new_full_valist (GstStructure *structure, va_list var_args); GstCaps_own * new (class, structure, ...) GstStructure *structure PREINIT: int i; CODE: PERL_UNUSED_VAR (structure); RETVAL = gst_caps_new_empty (); for (i = 1; i < items; i++) { /* RETVAL owns the structure. */ gst_caps_append_structure (RETVAL, SvGstStructure (ST (i))); } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Caps PACKAGE = GStreamer::Caps PREFIX = gst_caps_ =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 object, you call one of the following constructors: =over =item GStreamer::Caps::Any-Enew =item GStreamer::Caps::Empty-Enew =item GStreamer::Caps::Full-Enew =item GStreamer::Caps::Simple-Enew =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); gboolean gst_caps_is_fixed (const GstCaps *caps); gboolean gst_caps_is_always_compatible (const GstCaps *caps1, const GstCaps *caps2); gboolean gst_caps_is_subset (const GstCaps *subset, const GstCaps *superset); gboolean gst_caps_is_equal (const GstCaps *caps1, const GstCaps *caps2); gboolean gst_caps_is_equal_fixed (const GstCaps * caps1, const GstCaps * caps2); GstCaps_own * gst_caps_subtract (const GstCaps *minuend, const GstCaps *subtrahend); gboolean gst_caps_do_simplify (GstCaps *caps); GstCaps_own * gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2); GstCaps_own * gst_caps_union (const GstCaps *caps1, const GstCaps *caps2); GstCaps_own * gst_caps_normalize (const GstCaps *caps); # FIXME? # void gst_caps_replace (GstCaps **caps, GstCaps *newcaps); gchar_own * gst_caps_to_string (const GstCaps *caps); # GstCaps * gst_caps_from_string (const gchar *string); GstCaps_own * gst_caps_from_string (class, string) const gchar *string C_ARGS: string GStreamer-0.19/xs/GstChildProxy.xs000644 001750 000024 00000007656 11722734576 017372 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::ChildProxy PACKAGE = GStreamer::ChildProxy PREFIX = gst_child_proxy_ =for position DESCRIPTION =head1 DESCRIPTION To avoid a name clash with Glib::Object::get, gst_child_proxy_get and gst_child_proxy_set are bound as I and I respectively. =cut GstObject_ornull *gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name); GstObject_ornull *gst_child_proxy_get_child_by_index (GstChildProxy * parent, guint index); guint gst_child_proxy_get_children_count (GstChildProxy * parent); # FIXME: Needed? # gboolean gst_child_proxy_lookup (GstObject *object, const gchar *name, GstObject **target, GParamSpec **pspec); # void gst_child_proxy_get_property (GstObject * object, const gchar *name, GValue *value); # void gst_child_proxy_get_valist (GstObject * object, const gchar * first_property_name, va_list var_args); # void gst_child_proxy_get (GstObject * object, const gchar * first_property_name, ...); void gst_child_proxy_get_child_property (GstObject *object, const gchar *property, ...) PREINIT: int i; PPCODE: for (i = 1; i < items; i++) { char *name = SvGChar (ST (i)); SV *sv; GParamSpec *pspec; GValue value = { 0, }; GstObject *target = NULL; if (!gst_child_proxy_lookup (object, name, &target, &pspec)) { const char * classname = gperl_object_package_from_type (G_OBJECT_TYPE (object)); if (!classname) classname = G_OBJECT_TYPE_NAME (object); croak ("type %s does not support property '%s'", classname, name); } g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); g_object_get_property (G_OBJECT (target), pspec->name, &value); sv = gperl_sv_from_value (&value); g_value_unset (&value); gst_object_unref (target); XPUSHs (sv_2mortal (sv)); } # void gst_child_proxy_set_property (GstObject * object, const gchar *name, const GValue *value); # void gst_child_proxy_set_valist (GstObject* object, const gchar * first_property_name, va_list var_args); # void gst_child_proxy_set (GstObject * object, const gchar * first_property_name, ...); void gst_child_proxy_set_child_property (GstObject *object, const gchar *property, SV *value, ...) PREINIT: int i; CODE: PERL_UNUSED_VAR (value); for (i = 1; i < items; i += 2) { char *name = SvGChar (ST (i)); SV *value = ST (i + 1); GParamSpec *pspec; GValue real_value = { 0, }; GstObject *target = NULL; if (!gst_child_proxy_lookup (object, name, &target, &pspec)) { const char * classname = gperl_object_package_from_type (G_OBJECT_TYPE (object)); if (!classname) classname = G_OBJECT_TYPE_NAME (object); croak ("type %s does not support property '%s'", classname, name); } g_value_init (&real_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); gperl_value_from_sv (&real_value, value); g_object_set_property (G_OBJECT (target), pspec->name, &real_value); g_value_unset (&real_value); gst_object_unref (target); } void gst_child_proxy_child_added (GstObject * object, GstObject * child); void gst_child_proxy_child_removed (GstObject * object, GstObject * child); GStreamer-0.19/xs/GstClock.xs000644 001750 000024 00000013470 11722734576 016327 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ SV * newSVGstClockTime (GstClockTime time) { return newSVGUInt64 (time); } GstClockTime SvGstClockTime (SV *time) { return SvGUInt64 (time); } /* ------------------------------------------------------------------------- */ SV * newSVGstClockTimeDiff (GstClockTimeDiff diff) { return newSVGInt64 (diff); } GstClockTimeDiff SvGstClockTimeDiff (SV *diff) { return SvGInt64 (diff); } /* ------------------------------------------------------------------------- */ SV * newSVGstClockID (GstClockID id) { SV *sv; if (id == NULL) return &PL_sv_undef; sv = newSV (0); return sv_setref_pv (sv, "GStreamer::ClockID", id); } GstClockID SvGstClockID (SV *sv) { return INT2PTR (GstClockID, SvIV (SvRV (sv))); } /* ------------------------------------------------------------------------- */ #include static GPerlCallback * gst2perl_clock_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static gboolean gst2perl_clock_callback (GstClock *clock, GstClockTime time, GstClockID id, gpointer user_data) { gboolean retval; GPerlCallback *callback; dGPERL_CALLBACK_MARSHAL_SP; callback = user_data; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); 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_ 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_ 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); GStreamer-0.19/xs/GstElement.xs000644 001750 000024 00000015622 11722734576 016666 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Element PACKAGE = GStreamer::Element PREFIX = gst_element_ # FIXME? # void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ); # GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name); # GList* gst_element_class_get_pad_template_list (GstElementClass *element_class); # void gst_element_class_set_details (GstElementClass *klass, const GstElementDetails *details); gboolean gst_element_requires_clock (GstElement *element); gboolean gst_element_provides_clock (GstElement *element); GstClock_ornull * gst_element_provide_clock (GstElement *element); GstClock_ornull * gst_element_get_clock (GstElement *element); void gst_element_set_clock (GstElement *element, GstClock_ornull *clock); void gst_element_set_base_time (GstElement *element, GstClockTime time); GstClockTime gst_element_get_base_time (GstElement *element); void gst_element_no_more_pads (GstElement *element); gboolean gst_element_is_indexable (GstElement *element); void gst_element_set_index (GstElement *element, GstIndex *index); GstIndex_ornull* gst_element_get_index (GstElement *element); # Docs say "for internal use only". # void gst_element_set_bus (GstElement * element, GstBus * bus); GstBus_ornull * gst_element_get_bus (GstElement * element); gboolean gst_element_add_pad (GstElement *element, GstPad *pad); gboolean gst_element_remove_pad (GstElement *element, GstPad *pad); GstPad_ornull * gst_element_get_pad (GstElement *element, const gchar *name); GstPad_ornull * gst_element_get_static_pad (GstElement *element, const gchar *name); GstPad_ornull * gst_element_get_request_pad (GstElement *element, const gchar *name); # FIXME: Needed? # void gst_element_release_request_pad (GstElement *element, GstPad *pad); GstIterator * gst_element_iterate_pads (GstElement * element); GstIterator * gst_element_iterate_src_pads (GstElement * element); GstIterator * gst_element_iterate_sink_pads (GstElement * element); GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad, const GstCaps *caps); GstPadTemplate_ornull* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl); # gboolean gst_element_link (GstElement *src, GstElement *dest); gboolean gst_element_link (src, dest, ...) GstElement *src GstElement *dest PREINIT: int i; CODE: RETVAL = TRUE; for (i = 1; i < items && RETVAL != FALSE; i++) { dest = SvGstElement (ST (i)); if (!gst_element_link (src, dest)) RETVAL = FALSE; src = dest; } OUTPUT: RETVAL gboolean gst_element_link_filtered (GstElement *src, GstElement *dest, GstCaps_ornull *filtercaps); # void gst_element_unlink (GstElement *src, GstElement *dest); void gst_element_unlink (src, dest, ...) GstElement *src GstElement *dest PREINIT: int i; CODE: for (i = 1; i < items; i++) { dest = SvGstElement (ST (i)); gst_element_unlink (src, dest); src = dest; } gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname); gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname, GstCaps_ornull *filtercaps); void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname, GstElement *dest, const gchar *destpadname); # gboolean gst_element_send_event (GstElement *element, GstEvent *event); gboolean gst_element_send_event (element, event) GstElement *element GstEvent *event C_ARGS: /* event gets unref'ed, we need to keep it alive. */ element, gst_event_ref (event) gboolean gst_element_seek (GstElement *element, gdouble rate, GstFormat format, GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekType stop_type, gint64 stop); # G_CONST_RETURN GstQueryType* gst_element_get_query_types (GstElement *element); void gst_element_get_query_types (element) GstElement *element PREINIT: GstQueryType *types; PPCODE: types = (GstQueryType *) gst_element_get_query_types (element); if (types) while (*types++) XPUSHs (sv_2mortal (newSVGstQueryType (*types))); gboolean gst_element_query (GstElement *element, GstQuery *query); # gboolean gst_element_post_message (GstElement * element, GstMessage * message); gboolean gst_element_post_message (GstElement * element, GstMessage * message) C_ARGS: /* element takes ownership of message. */ element, gst_message_ref (message) void gst_element_found_tags (GstElement *element, GstTagList *tag_list); # void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstTagList *list); void gst_element_found_tags_for_pad (element, pad, list) GstElement *element GstPad *pad GstTagList *list C_ARGS: /* gst_element_found_tags_for_pad takes ownership of list. */ element, pad, gst_tag_list_copy (list) # FIXME? # gchar * _gst_element_error_printf (const gchar *format, ...); # void gst_element_message_full (GstElement * element, GstMessageType type, GQuark domain, gint code, gchar * text, gchar * debug, const gchar * file, const gchar * function, gint line); gboolean gst_element_is_locked_state (GstElement *element); gboolean gst_element_set_locked_state (GstElement *element, gboolean locked_state); gboolean gst_element_sync_state_with_parent (GstElement *element); # GstStateChangeReturn gst_element_get_state (GstElement * element, GstState * state, GstState * pending, GstClockTime timeout); void gst_element_get_state (GstElement * element, GstClockTime timeout) PREINIT: GstStateChangeReturn retval; GstState state; GstState pending; PPCODE: retval = gst_element_get_state (element, &state, &pending, timeout); EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGstStateChangeReturn (retval))); PUSHs (sv_2mortal (newSVGstState (state))); PUSHs (sv_2mortal (newSVGstState (pending))); GstStateChangeReturn gst_element_set_state (GstElement *element, GstState state); void gst_element_abort_state (GstElement * element); GstStateChangeReturn gst_element_continue_state (GstElement * element, GstStateChangeReturn ret); void gst_element_lost_state (GstElement * element); GstElementFactory* gst_element_get_factory (GstElement *element); GStreamer-0.19/xs/GstElementFactory.xs000644 001750 000024 00000007232 11722734576 020214 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::ElementFactory PACKAGE = GStreamer::ElementFactory PREFIX = gst_element_factory_ # FIXME? # gboolean gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type); # GstElementFactory * gst_element_factory_find (const gchar *name); GstElementFactory_ornull * gst_element_factory_find (class, name) const gchar *name C_ARGS: name # GType gst_element_factory_get_element_type (GstElementFactory *factory); const char * gst_element_factory_get_element_type (GstElementFactory *factory) CODE: RETVAL = gperl_package_from_type (gst_element_factory_get_element_type (factory)); OUTPUT: RETVAL const gchar * gst_element_factory_get_longname (GstElementFactory *factory); const gchar * gst_element_factory_get_klass (GstElementFactory *factory); const gchar * gst_element_factory_get_description (GstElementFactory *factory); const gchar * gst_element_factory_get_author (GstElementFactory *factory); # FIXME: Need GstStaticPadTemplate handlers. # # guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); # # const GList * gst_element_factory_get_static_pad_templates (GstElementFactory *factory); # void # gst_element_factory_get_static_pad_templates (factory) # GstElementFactory *factory # PREINIT: # GList *templates, *i; # PPCODE: # templates = (GList *) gst_element_factory_get_static_pad_templates (factory); # for (i = templates; i != NULL; i = i->next) # XPUSHs (sv_2mortal (newSVGstPadTemplate (i->data))); GstURIType gst_element_factory_get_uri_type (GstElementFactory *factory); # gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory); void gst_element_factory_get_uri_protocols (factory) GstElementFactory *factory PREINIT: gchar **uris; PPCODE: uris = gst_element_factory_get_uri_protocols (factory); if (uris) { gchar *uri; while ((uri = *(uris++)) != NULL) XPUSHs (sv_2mortal (newSVGChar (uri))); } GstElement_ornull * gst_element_factory_create (GstElementFactory *factory, const gchar_ornull *name); # GstElement * gst_element_factory_make (const gchar *factoryname, const gchar *name); void gst_element_factory_make (class, factoryname, name, ...); const gchar *factoryname const gchar *name PREINIT: int i; PPCODE: for (i = 1; i < items; i += 2) XPUSHs ( sv_2mortal ( newSVGstElement_ornull ( gst_element_factory_make (SvGChar (ST (i)), SvGChar (ST (i + 1)))))); # void __gst_element_factory_add_static_pad_template (GstElementFactory *elementfactory, GstStaticPadTemplate *templ); # void __gst_element_factory_add_interface (GstElementFactory *elementfactory, const gchar *interfacename); gboolean gst_element_factory_can_src_caps (GstElementFactory *factory, const GstCaps *caps); gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory, const GstCaps *caps); GStreamer-0.19/xs/GstEvent.xs000644 001750 000024 00000027574 11722734576 016367 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static const char * get_package (GstEvent *event) { switch (event->type) { case GST_EVENT_FLUSH_START: return "GStreamer::Event::FlushStart"; case GST_EVENT_FLUSH_STOP: return "GStreamer::Event::FlushStop"; case GST_EVENT_EOS: return "GStreamer::Event::EOS"; case GST_EVENT_NEWSEGMENT: return "GStreamer::Event::NewSegment"; case GST_EVENT_TAG: return "GStreamer::Event::Tag"; case GST_EVENT_BUFFERSIZE: return "GStreamer::Event::BufferSize"; case GST_EVENT_QOS: return "GStreamer::Event::QOS"; case GST_EVENT_SEEK: return "GStreamer::Event::Seek"; case GST_EVENT_NAVIGATION: return "GStreamer::Event::Navigation"; case GST_EVENT_CUSTOM_UPSTREAM: return "GStreamer::Event::Custom::Upstream"; case GST_EVENT_CUSTOM_DOWNSTREAM: return "GStreamer::Event::Custom::Downstream"; case GST_EVENT_CUSTOM_BOTH: return "GStreamer::Event::Custom::Both"; case GST_EVENT_CUSTOM_BOTH_OOB: return "GStreamer::Event::Custom::Both::OOB"; case GST_EVENT_UNKNOWN: return "GStreamer::Event"; default: croak ("Unknown GstEvent type encountered: %d", event->type); } } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Event PACKAGE = GStreamer::Event PREFIX = gst_event_ BOOT: gperl_set_isa ("GStreamer::Event::FlushStart", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::FlushStop", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::EOS", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::NewSegment", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Tag", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::BufferSize", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::QOS", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Seek", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Navigation", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Custom::UP", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Custom::DS", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Custom::DS::OOB", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Custom::Both", "GStreamer::Event"); gperl_set_isa ("GStreamer::Event::Custom::Both::OOB", "GStreamer::Event"); gst2perl_register_mini_object_package_lookup_func ( GST_TYPE_EVENT, (Gst2PerlMiniObjectPackageLookupFunc) get_package); =for position DESCRIPTION =head1 DESCRIPTION The various event types are represented as subclasses: =over =item GStreamer::Event::FlushStart =item GStreamer::Event::FlushStop =item GStreamer::Event::EOS =item GStreamer::Event::NewSegment =item GStreamer::Event::Tag =item GStreamer::Event::BufferSize =item GStreamer::Event::QOS =item GStreamer::Event::Seek =item GStreamer::Event::Navigation =item GStreamer::Event::Custom::UP =item GStreamer::Event::Custom::DS =item GStreamer::Event::Custom::DS::OOB =item GStreamer::Event::Custom::Both =item GStreamer::Event::Custom::Both::OOB =back To create a new event, you call the constructor of the corresponding class. To check if an event is of a certain type, use the I method: if ($event -> type eq "newsegment") { # ... } elsif ($event -> type eq "eos") { # ... } To get to the content of an event, call the corresponding accessor: if ($event -> type eq "newsegment") { my $update = $event -> update; my $rate = $event -> rate; my $format = $event -> format; my $start_value = $event -> start_value; my $stop_value = $event -> stop_value; my $stream_time = $event -> stream_time; # ... } elsif ($event -> type eq "tag") { my $tag = $event -> tag; # ... } =cut const GstStructure * gst_event_get_structure (GstEvent *event); GstEventType type (GstEvent *event) CODE: RETVAL = GST_EVENT_TYPE (event); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::Custom # GstEvent * gst_event_new_custom (GstEventType type, GstStructure *structure); GstEvent_noinc * new (class, GstEventType type, GstStructure *structure) CODE: /* The event will own structure. */ RETVAL = gst_event_new_custom (type, structure); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::FlushStart # GstEvent * gst_event_new_flush_start (void); GstEvent_noinc * new (class) CODE: RETVAL = gst_event_new_flush_start (); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::FlushStop # GstEvent * gst_event_new_flush_stop (void); GstEvent_noinc * new (class) CODE: RETVAL = gst_event_new_flush_stop (); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::EOS # GstEvent * gst_event_new_eos (void); GstEvent_noinc * new (class) CODE: RETVAL = gst_event_new_eos (); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::NewSegment # GstEvent * gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format, gint64 start_value, gint64 stop_value, gint64 stream_time); GstEvent_noinc * new (class, gboolean update, gdouble rate, GstFormat format, gint64 start_value, gint64 stop_value, gint64 stream_time) CODE: RETVAL = gst_event_new_new_segment (update, rate, format, start_value, stop_value, stream_time); OUTPUT: RETVAL # void gst_event_parse_new_segment (GstEvent *event, gboolean *update, gdouble *rate, GstFormat *format, gint64 *start_value, gint64 *stop_value, gint64 *stream_time); SV * update (GstEvent *event) ALIAS: rate = 1 format = 2 start_value = 3 stop_value = 4 stream_time = 5 PREINIT: gboolean update; gdouble rate; GstFormat format; gint64 start_value; gint64 stop_value; gint64 stream_time; CODE: gst_event_parse_new_segment (event, &update, &rate, &format, &start_value, &stop_value, &stream_time); switch (ix) { case 0: RETVAL = newSVuv (update); break; case 1: RETVAL = newSVnv (rate); break; case 2: RETVAL = newSVGstFormat (format); break; case 3: RETVAL = newSVGInt64 (start_value); break; case 4: RETVAL = newSVGInt64 (stop_value); break; case 5: RETVAL = newSVGInt64 (stream_time); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::Tag # GstEvent * gst_event_new_tag (GstTagList *taglist); GstEvent_noinc * new (class, GstTagList *taglist) CODE: /* The event will own taglist. */ RETVAL = gst_event_new_tag (taglist); OUTPUT: RETVAL # void gst_event_parse_tag (GstEvent *event, GstTagList **taglist); GstTagList * tag (GstEvent *event) CODE: gst_event_parse_tag (event, &RETVAL); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::BufferSize # GstEvent * gst_event_new_buffer_size (GstFormat format, gint64 minsize, gint64 maxsize, gboolean async); GstEvent_noinc * new (class, GstFormat format, gint64 minsize, gint64 maxsize, gboolean async) CODE: RETVAL = gst_event_new_buffer_size (format, minsize, maxsize, async); OUTPUT: RETVAL # void gst_event_parse_buffer_size (GstEvent *event, GstFormat *format, gint64 *minsize, gint64 *maxsize, gboolean *async); SV * format (GstEvent *event) ALIAS: minsize = 1 maxsize = 2 async = 3 PREINIT: GstFormat format; gint64 minsize; gint64 maxsize; gboolean async; CODE: gst_event_parse_buffer_size (event, &format, &minsize, &maxsize, &async); switch (ix) { case 0: RETVAL = newSVGstFormat (format); break; case 1: RETVAL = newSVGInt64 (minsize); break; case 2: RETVAL = newSVGInt64 (maxsize); break; case 3: RETVAL = newSVuv (async); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::QOS # GstEvent * gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff, GstClockTime timestamp); GstEvent_noinc * new (class, gdouble proportion, GstClockTimeDiff diff, GstClockTime timestamp) CODE: RETVAL = gst_event_new_qos (proportion, diff, timestamp); OUTPUT: RETVAL # void gst_event_parse_qos (GstEvent *event, gdouble *proportion, GstClockTimeDiff *diff, GstClockTime *timestamp); SV * proportion (GstEvent *event) ALIAS: diff = 1 timestamp = 2 PREINIT: gdouble proportion; GstClockTimeDiff diff; GstClockTime timestamp; CODE: gst_event_parse_qos (event, &proportion, &diff, ×tamp); switch (ix) { case 0: RETVAL = newSVnv (proportion); break; case 1: RETVAL = newSVGstClockTimeDiff (diff); break; case 2: RETVAL = newSVGstClockTime (timestamp); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::Seek # GstEvent * gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekType stop_type, gint64 stop); GstEvent_noinc * new (class, gdouble rate, GstFormat format, GstSeekFlags flags, GstSeekType cur_type, gint64 cur, GstSeekType stop_type, gint64 stop) CODE: RETVAL = gst_event_new_seek (rate, format, flags, cur_type, cur, stop_type, stop); OUTPUT: RETVAL # void gst_event_parse_seek (GstEvent *event, gdouble *rate, GstFormat *format, GstSeekFlags *flags, GstSeekType *cur_type, gint64 *cur, GstSeekType *stop_type, gint64 *stop); SV * rate (GstEvent *event) ALIAS: format = 1 flags = 2 cur_type = 3 cur = 4 stop_type = 5 stop = 6 PREINIT: gdouble rate; GstFormat format; GstSeekFlags flags; GstSeekType cur_type; gint64 cur; GstSeekType stop_type; gint64 stop; CODE: gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, &stop_type, &stop); switch (ix) { case 0: RETVAL = newSVnv (rate); break; case 1: RETVAL = newSVGstFormat (format); break; case 2: RETVAL = newSVGstSeekFlags (flags); break; case 3: RETVAL = newSVGstSeekType (cur_type); break; case 4: RETVAL = newSVGInt64 (cur); break; case 5: RETVAL = newSVGstSeekType (stop_type); break; default: RETVAL = newSVGInt64 (stop); break; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Event PACKAGE = GStreamer::Event::Navigation # GstEvent * gst_event_new_navigation (GstStructure *structure); GstEvent_noinc * new (class, GstStructure *structure) CODE: /* The event will own structure. */ RETVAL = gst_event_new_navigation (structure); OUTPUT: RETVAL GStreamer-0.19/xs/GstFormat.xs000644 001750 000024 00000005202 11722734576 016516 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ SV * newSVGstFormat (GstFormat format) { SV *sv = gperl_convert_back_enum_pass_unknown (GST_TYPE_FORMAT, format); if (looks_like_number (sv)) { const GstFormatDefinition *details; details = gst_format_get_details (format); if (details) sv_setpv (sv, details->nick); } return sv; } GstFormat SvGstFormat (SV *sv) { GstFormat format; if (gperl_try_convert_enum (GST_TYPE_FORMAT, sv, (gint *) &format)) return format; format = gst_format_get_by_nick (SvPV_nolen (sv)); if (GST_FORMAT_UNDEFINED == format) croak ("`%s' is not a valid GstFormat value", gperl_format_variable_for_output (sv)); return format; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Format PACKAGE = GStreamer::Format PREFIX = gst_format_ =for apidoc __function__ =cut # GstFormat gst_format_register (const gchar *nick, const gchar *description); GstFormat gst_format_register (nick, description) const gchar *nick const gchar *description =for apidoc __function__ =cut # GstFormat gst_format_get_by_nick (const gchar *nick); GstFormat gst_format_get_by_nick (nick) const gchar *nick # FIXME? # gboolean gst_formats_contains (const GstFormat *formats, GstFormat format); =for apidoc __function__ =cut # G_CONST_RETURN GstFormatDefinition* gst_format_get_details (GstFormat format); void gst_format_get_details (format) GstFormat format PREINIT: const GstFormatDefinition *details; PPCODE: details = gst_format_get_details (format); if (details) { EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGstFormat (details->value))); PUSHs (sv_2mortal (newSVGChar (details->nick))); PUSHs (sv_2mortal (newSVGChar (details->description))); } # FIXME # GstIterator * gst_format_iterate_definitions (void); GStreamer-0.19/xs/GstGhostPad.xs000644 001750 000024 00000002632 11722734576 017003 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::GhostPad PACKAGE = GStreamer::GhostPad PREFIX = gst_ghost_pad_ # GstPad * gst_ghost_pad_new (const gchar *name, GstPad *target); GstPad_ornull * gst_ghost_pad_new (class, const gchar_ornull *name, GstPad *target) C_ARGS: name, target # GstPad * gst_ghost_pad_new_no_target (const gchar *name, GstPadDirection dir); GstPad_ornull * gst_ghost_pad_new_no_target (class, const gchar_ornull *name, GstPadDirection dir) C_ARGS: name, dir GstPad_ornull * gst_ghost_pad_get_target (GstGhostPad *gpad); gboolean gst_ghost_pad_set_target (GstGhostPad *gpad, GstPad *newtarget); GStreamer-0.19/xs/GstIndex.xs000644 001750 000024 00000016463 11722734576 016350 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static GPerlCallback * gst2perl_index_filter_create (SV *func, SV *data) { GType param_types [2]; param_types[0] = GST_TYPE_INDEX; param_types[1] = GST_TYPE_INDEX_ENTRY; return gperl_callback_new (func, data, G_N_ELEMENTS (param_types), param_types, G_TYPE_BOOLEAN); } static gboolean gst2perl_index_filter (GstIndex *index, GstIndexEntry *entry, gpointer data) { GPerlCallback *callback = data; GValue value = { 0, }; gboolean retval; g_value_init (&value, callback->return_type); gperl_callback_invoke (callback, &value, entry); retval = g_value_get_boolean (&value); g_value_unset (&value); return retval; } /* ------------------------------------------------------------------------- */ /* Implemented in gstindex.c, but not exported for some reason. */ extern GstIndexEntry * gst_index_add_associationv (GstIndex * index, gint id, GstAssocFlags flags, int n, const GstIndexAssociation * list); /* ------------------------------------------------------------------------- */ #include static GQuark gst2perl_index_resolver_quark (void) { static GQuark q = 0; if (q == 0) q = g_quark_from_static_string ("gst2perl_index_resolver"); return q; } static GPerlCallback * gst2perl_index_resolver_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static gboolean gst2perl_index_resolver (GstIndex *index, GstObject *writer, gchar **writer_string, gpointer user_data) { int n; SV *string; gboolean retval; GPerlCallback *callback; dGPERL_CALLBACK_MARSHAL_SP; callback = user_data; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (sv_2mortal (newSVGstIndex (index))); PUSHs (sv_2mortal (newSVGstObject (writer))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; n = call_sv (callback->func, G_SCALAR); SPAGAIN; if (n != 1) croak ("resolver callback must return one value: the writer string"); string = POPs; if (gperl_sv_is_defined (string)) { *writer_string = g_strdup (SvGChar (string)); retval = TRUE; } else { *writer_string = NULL; retval = FALSE; } PUTBACK; FREETMPS; LEAVE; return retval; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Index PACKAGE = GStreamer::Index PREFIX = gst_index_ # GstIndex * gst_index_new (void); GstIndex * gst_index_new (class) C_ARGS: /* void */ void gst_index_commit (GstIndex *index, gint id); gint gst_index_get_group (GstIndex *index); gint gst_index_new_group (GstIndex *index); gboolean gst_index_set_group (GstIndex *index, gint groupnum); void gst_index_set_certainty (GstIndex *index, GstIndexCertainty certainty); GstIndexCertainty gst_index_get_certainty (GstIndex *index); # void gst_index_set_filter (GstIndex *index, GstIndexFilter filter, gpointer user_data); void gst_index_set_filter (index, func, data=NULL) GstIndex *index SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = gst2perl_index_filter_create (func, data); gst_index_set_filter_full (index, gst2perl_index_filter, callback, (GDestroyNotify) gperl_callback_destroy); # void gst_index_set_resolver (GstIndex *index, GstIndexResolver resolver, gpointer user_data); void gst_index_set_resolver (index, func, data=NULL) GstIndex *index SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = gst2perl_index_resolver_create (func, data); g_object_set_qdata_full (G_OBJECT (index), gst2perl_index_resolver_quark (), callback, (GDestroyNotify) gperl_callback_destroy); gst_index_set_resolver (index, gst2perl_index_resolver, callback); # gboolean gst_index_get_writer_id (GstIndex *index, GstObject *writer, gint *id); gint gst_index_get_writer_id (index, writer) GstIndex *index GstObject *writer CODE: if (!gst_index_get_writer_id (index, writer, &RETVAL)) XSRETURN_UNDEF; OUTPUT: RETVAL GstIndexEntry_ornull * gst_index_add_format (GstIndex *index, gint id, GstFormat format); # GstIndexEntry * gst_index_add_association (GstIndex *index, gint id, GstAssocFlags flags, GstFormat format, gint64 value, ...); GstIndexEntry_ornull * gst_index_add_association (index, id, flags, format, value, ...) GstIndex *index gint id GstAssocFlags flags GstFormat format gint64 value PREINIT: GArray *array; int i, n_assocs = 0; GstIndexAssociation *list; CODE: PERL_UNUSED_VAR (format); PERL_UNUSED_VAR (value); array = g_array_new (FALSE, FALSE, sizeof (GstIndexAssociation)); for (i = 3; i < items; i += 2) { GstIndexAssociation a; a.format = SvGstFormat (ST (i)); a.value = SvGInt64 (ST (i + 1)); g_array_append_val (array, a); n_assocs++; } list = (GstIndexAssociation *) g_array_free (array, FALSE); RETVAL = gst_index_add_associationv (index, id, flags, n_assocs, list); g_free (list); OUTPUT: RETVAL # GstIndexEntry * gst_index_add_object (GstIndex *index, gint id, gchar *key, GType type, gpointer object); GstIndexEntry_ornull * gst_index_add_object (index, id, key, object) GstIndex *index gint id gchar *key SV *object PREINIT: GType type; CODE: type = gperl_object_type_from_package (sv_reftype (SvRV (object), TRUE)); RETVAL = gst_index_add_object (index, id, key, type, gperl_get_object_check (object, type)); OUTPUT: RETVAL GstIndexEntry_ornull * gst_index_add_id (GstIndex *index, gint id, gchar *description); GstIndexEntry_ornull * gst_index_get_assoc_entry (GstIndex *index, gint id, GstIndexLookupMethod method, GstAssocFlags flags, GstFormat format, gint64 value); # FIXME? # GstIndexEntry * gst_index_get_assoc_entry_full (GstIndex *index, gint id, GstIndexLookupMethod method, GstAssocFlags flags, GstFormat format, gint64 value, GCompareDataFunc func, gpointer user_data); # --------------------------------------------------------------------------- # MODULE = GStreamer::Index PACKAGE = GStreamer::IndexEntry PREFIX = gst_index_entry_ # gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, GstFormat format, gint64 *value); gint64 gst_index_entry_assoc_map (entry, format) GstIndexEntry *entry GstFormat format CODE: if (!gst_index_entry_assoc_map (entry, format, &RETVAL)) XSRETURN_UNDEF; OUTPUT: RETVAL GStreamer-0.19/xs/GstIndexFactory.xs000644 001750 000024 00000003324 11722734576 017670 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::IndexFactory PACKAGE = GStreamer::IndexFactory PREFIX = gst_index_factory_ # GstIndexFactory * gst_index_factory_new (const gchar *name, const gchar *longdesc, GType type); GstIndexFactory * gst_index_factory_new (class, name, longdesc, type) const gchar *name const gchar *longdesc const char *type PREINIT: GType real_type; CODE: real_type = gperl_type_from_package (type); RETVAL = gst_index_factory_new (name, longdesc, real_type); OUTPUT: RETVAL void gst_index_factory_destroy (GstIndexFactory *factory); # GstIndexFactory * gst_index_factory_find (const gchar *name); GstIndexFactory * gst_index_factory_find (class, name) const gchar *name C_ARGS: name GstIndex * gst_index_factory_create (GstIndexFactory *factory); # GstIndex * gst_index_factory_make (const gchar *name); GstIndex * gst_index_factory_make (class, name) const gchar *name C_ARGS: name GStreamer-0.19/xs/GstIterator.xs000644 001750 000024 00000013672 11722734576 017071 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ SV * newSVGstIterator (const GstIterator *iter) { AV *av, *dummy; SV *tie, *ref; HV *stash; if (!iter) return &PL_sv_undef; av = newAV (); dummy = newAV (); ref = newRV_noinc ((SV *) av); stash = gv_stashpv ("GStreamer::Iterator", TRUE); sv_bless (ref, stash); tie = newRV_noinc ((SV *) dummy); stash = gv_stashpv ("GStreamer::Iterator::Tie", TRUE); sv_bless (tie, stash); /* Both the dummy and the real array need to have the path stored in * the ext slot. SvGstIterator looks for it in the real array. * FETCHSIZE and FETCH look for it in the dummy. */ sv_magic ((SV *) dummy, 0, PERL_MAGIC_ext, (const char *) iter, 0); sv_magic ((SV *) av, 0, PERL_MAGIC_ext, (const char *) iter, 0); sv_magic ((SV *) av, tie, PERL_MAGIC_tied, Nullch, 0); return ref; } GstIterator * SvGstIterator (SV *sv) { MAGIC *mg; if (!sv || !SvROK (sv) || !(mg = mg_find (SvRV (sv), PERL_MAGIC_ext))) return NULL; return (GstIterator *) mg->mg_ptr; } /* ------------------------------------------------------------------------- */ SV * sv_from_pointer (gpointer pointer, GType gtype, gboolean own) { GType fundamental = G_TYPE_FUNDAMENTAL (gtype); switch (fundamental) { case G_TYPE_INTERFACE: case G_TYPE_OBJECT: return gperl_new_object (G_OBJECT (pointer), own); case G_TYPE_BOXED: /* special case for SVs, which are stored directly * rather than inside blessed wrappers. */ if (gtype == GPERL_TYPE_SV) { SV * sv = pointer; return sv ? g_boxed_copy (GPERL_TYPE_SV, pointer) : &PL_sv_undef; } return gperl_new_boxed (pointer, gtype, own); case G_TYPE_PARAM: return newSVGParamSpec (pointer); case G_TYPE_POINTER: return newSViv (PTR2IV (pointer)); default: croak ("FIXME: unhandled type - %d (%s fundamental for %s)\n", fundamental, g_type_name (fundamental), g_type_name (gtype)); } } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Iterator PACKAGE = GStreamer::Iterator PREFIX = gst_iterator_ =for position SYNOPSIS =head1 SYNOPSIS foreach ($bin -> iterate_elements()) { do_something($_); } my $iter = $bin -> iterate_elements(); while ($_ = $iter -> next()) { do_something($_); } =cut =for position DESCRIPTION =head1 DESCRIPTION There are two ways to use a I. The first is to use normal Perl looping stuff: foreach ($bin -> iterate_elements()) { do_something($_); } This is very elegant and Perl-ish, but may also be a bit slower. The alternative is to use the I method: my $iter = $bin -> iterate_elements(); while ($_ = $iter -> next()) { do_something($_); } This is hardly beautiful but avoids looping over the elements unnecessarily and is thus faster. =cut void DESTROY (GstIterator *iter) CODE: gst_iterator_free (iter); # GstIteratorResult gst_iterator_next (GstIterator *it, gpointer *elem); SV * gst_iterator_next (iter) GstIterator *iter PREINIT: gboolean done = FALSE; gpointer item; CODE: while (!done) { switch (gst_iterator_next (iter, &item)) { case GST_ITERATOR_OK: RETVAL = sv_from_pointer (item, iter->type, TRUE); done = TRUE; break; case GST_ITERATOR_RESYNC: gst_iterator_resync (iter); break; case GST_ITERATOR_DONE: RETVAL = &PL_sv_undef; done = TRUE; break; case GST_ITERATOR_ERROR: croak ("An error occured while iterating"); } } OUTPUT: RETVAL # FIXME: Needed? # void gst_iterator_push (GstIterator *it, GstIterator *other); # FIXME? # GstIterator * gst_iterator_filter (GstIterator *it, GCompareFunc func, gpointer user_data); # GstIteratorResult gst_iterator_fold (GstIterator *iter, GstIteratorFoldFunction func, GValue *ret, gpointer user_data); # GstIteratorResult gst_iterator_foreach (GstIterator *iter, GFunc func, gpointer user_data); # gpointer gst_iterator_find_custom (GstIterator *it, GCompareFunc func, gpointer user_data); MODULE = GStreamer::Iterator PACKAGE = GStreamer::Iterator::Tie IV FETCHSIZE (GstIterator *iter) PREINIT: gboolean done = FALSE; gpointer item; CODE: RETVAL = 0; gst_iterator_resync (iter); while (!done) { switch (gst_iterator_next (iter, &item)) { case GST_ITERATOR_OK: RETVAL++; break; case GST_ITERATOR_RESYNC: RETVAL = 0; gst_iterator_resync (iter); break; /* FIXME: Is it ok to handle ERROR like this? */ case GST_ITERATOR_ERROR: case GST_ITERATOR_DONE: done = TRUE; break; } } OUTPUT: RETVAL SV * FETCH (GstIterator *iter, IV index) PREINIT: gboolean done = FALSE; gpointer item; IV counter = -1; CODE: RETVAL = &PL_sv_undef; gst_iterator_resync (iter); while (!done) { switch (gst_iterator_next (iter, &item)) { case GST_ITERATOR_OK: counter++; break; case GST_ITERATOR_RESYNC: counter = -1; gst_iterator_resync (iter); break; /* FIXME: Is it ok to handle ERROR like this? */ case GST_ITERATOR_ERROR: case GST_ITERATOR_DONE: done = TRUE; break; } if (counter == index) { RETVAL = sv_from_pointer (item, iter->type, TRUE); done = TRUE; } } OUTPUT: RETVAL GStreamer-0.19/xs/GstMessage.xs000644 001750 000024 00000044642 11722734576 016665 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" static const char * get_package (GstMessage *message) { const char *package = "GStreamer::Message"; switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_EOS: package = "GStreamer::Message::EOS"; break; case GST_MESSAGE_ERROR: package = "GStreamer::Message::Error"; break; case GST_MESSAGE_WARNING: package = "GStreamer::Message::Warning"; break; case GST_MESSAGE_INFO: package = "GStreamer::Message::Info"; break; case GST_MESSAGE_TAG: package = "GStreamer::Message::Tag"; break; case GST_MESSAGE_BUFFERING: package = "GStreamer::Message::Buffering"; break; case GST_MESSAGE_STATE_CHANGED: package = "GStreamer::Message::StateChanged"; break; case GST_MESSAGE_STATE_DIRTY: package = "GStreamer::Message::StateDirty"; break; case GST_MESSAGE_STEP_DONE: package = "GStreamer::Message::StepDone"; break; case GST_MESSAGE_CLOCK_PROVIDE: package = "GStreamer::Message::ClockProvide"; break; case GST_MESSAGE_CLOCK_LOST: package = "GStreamer::Message::ClockLost"; break; case GST_MESSAGE_NEW_CLOCK: package = "GStreamer::Message::NewClock"; break; case GST_MESSAGE_STRUCTURE_CHANGE: package = "GStreamer::Message::StructureChange"; break; case GST_MESSAGE_STREAM_STATUS: package = "GStreamer::Message::StreamStatus"; break; case GST_MESSAGE_APPLICATION: package = "GStreamer::Message::Application"; break; case GST_MESSAGE_ELEMENT: package = "GStreamer::Message::Element"; break; case GST_MESSAGE_SEGMENT_START: package = "GStreamer::Message::SegmentStart"; break; case GST_MESSAGE_SEGMENT_DONE: package = "GStreamer::Message::SegmentDone"; break; case GST_MESSAGE_DURATION: package = "GStreamer::Message::Duration"; break; #if GST_CHECK_VERSION (0, 10, 12) case GST_MESSAGE_LATENCY: package = "GStreamer::Message::Latency"; break; #endif #if GST_CHECK_VERSION (0, 10, 13) case GST_MESSAGE_ASYNC_START: package = "GStreamer::Message::AsyncStart"; break; case GST_MESSAGE_ASYNC_DONE: package = "GStreamer::Message::AsyncDone"; break; #endif case GST_MESSAGE_UNKNOWN: case GST_MESSAGE_ANY: /* Use the default package name */ break; } return package; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Message PACKAGE = GStreamer::Message PREFIX = gst_message_ BOOT: gperl_set_isa ("GStreamer::Message::EOS", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Error", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Warning", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Info", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Tag", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Buffering", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::StateChanged", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::StateDirty", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::StepDone", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::ClockProvide", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::ClockLost", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::NewClock", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::StructureChange", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::StreamStatus", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Application", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Element", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::SegmentStart", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::SegmentDone", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Duration", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::Latency", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::AsyncStart", "GStreamer::Message"); gperl_set_isa ("GStreamer::Message::AsyncDone", "GStreamer::Message"); gst2perl_register_mini_object_package_lookup_func ( GST_TYPE_MESSAGE, (Gst2PerlMiniObjectPackageLookupFunc) get_package); =for position DESCRIPTION =head1 DESCRIPTION The various nmessage types are represented as subclasses: =over =item GStreamer::Message::EOS =item GStreamer::Message::Error =item GStreamer::Message::Warning =item GStreamer::Message::Info =item GStreamer::Message::Tag =item GStreamer::Message::Buffering =item GStreamer::Message::StateChanged =item GStreamer::Message::StateDirty =item GStreamer::Message::StepDone =item GStreamer::Message::ClockProvide =item GStreamer::Message::ClockLost =item GStreamer::Message::NewClock =item GStreamer::Message::StructureChange =item GStreamer::Message::StreamStatus =item GStreamer::Message::Application =item GStreamer::Message::Element =item GStreamer::Message::SegmentStart =item GStreamer::Message::SegmentDone =item GStreamer::Message::Duration =item GStreamer::Message::Latency [0.10.12] =item GStreamer::Message::AsyncStart [0.10.13] =item GStreamer::Message::AsyncDone [0.10.13] =back To create a new message, you call the constructor of the corresponding class. To check if a message is of a certain type, use the I<&> operator on the I method: if ($message -> type & "error") { # ... } elsif ($message -> type & "eos") { # ... } To get to the content of a message, call the corresponding accessor: if ($message -> type & "state-changed") { my $old_state = $message -> old_state; my $new_state = $message -> new_state; my $pending = $message -> pending; # ... } elsif ($message -> type & "segment-done") { my $format = $message -> format; my $position = $message -> position; # ... } =cut # DESTROY inherited from GStreamer::MiniObject. const GstStructure * gst_message_get_structure (GstMessage *message); GstMessageType type (GstMessage *message) CODE: RETVAL = GST_MESSAGE_TYPE (message); OUTPUT: RETVAL guint64 timestamp (GstMessage *message) CODE: RETVAL = GST_MESSAGE_TIMESTAMP (message); OUTPUT: RETVAL GstObject * src (GstMessage *message) CODE: RETVAL = GST_MESSAGE_SRC (message); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Custom # GstMessage * gst_message_new_custom (GstMessageType type, GstObject * src, GstStructure * structure); GstMessage_noinc * new (class, GstMessageType type, GstObject * src, GstStructure * structure) CODE: /* gst_message_new_custom takes ownership of structure. */ RETVAL = gst_message_new_custom (type, src, structure); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::EOS # GstMessage * gst_message_new_eos (GstObject * src); GstMessage_noinc * new (class, GstObject * src) CODE: RETVAL = gst_message_new_eos (src); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Error # GstMessage * gst_message_new_error (GstObject * src, GError * error, gchar * debug); GstMessage_noinc * new (class, GstObject * src, SV * error, gchar * debug) PREINIT: GError *real_error = NULL; CODE: gperl_gerror_from_sv (error, &real_error); RETVAL = gst_message_new_error (src, real_error, debug); OUTPUT: RETVAL # void gst_message_parse_error (GstMessage *message, GError **gerror, gchar **debug); SV * error (GstMessage *message) ALIAS: debug = 1 PREINIT: GError *error = NULL; gchar *debug = NULL; CODE: gst_message_parse_error (message, &error, &debug); switch (ix) { case 0: RETVAL = gperl_sv_from_gerror (error); g_error_free (error); break; case 1: RETVAL = newSVGChar (debug); g_free (debug); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Warning # GstMessage * gst_message_new_warning (GstObject * src, GError * error, gchar * debug); GstMessage_noinc * new (class, GstObject * src, SV * error, gchar * debug) PREINIT: GError *real_error = NULL; CODE: gperl_gerror_from_sv (error, &real_error); RETVAL = gst_message_new_warning (src, real_error, debug); OUTPUT: RETVAL # void gst_message_parse_warning (GstMessage *message, GError **gerror, gchar **debug); SV * error (GstMessage *message) ALIAS: debug = 1 PREINIT: GError *error = NULL; gchar *debug = NULL; CODE: gst_message_parse_warning (message, &error, &debug); switch (ix) { case 0: RETVAL = gperl_sv_from_gerror (error); g_error_free (error); break; case 1: RETVAL = newSVGChar (debug); g_free (debug); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Tag # GstMessage * gst_message_new_tag (GstObject * src, GstTagList * tag_list); GstMessage_noinc * new (class, GstObject * src, GstTagList * tag_list) CODE: /* gst_message_new_tag takes ownership of tag_list. */ RETVAL = gst_message_new_tag (src, tag_list); OUTPUT: RETVAL # void gst_message_parse_tag (GstMessage *message, GstTagList **tag_list); GstTagList_own * tag_list (GstMessage *message) CODE: gst_message_parse_tag (message, &RETVAL); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::StateChanged # GstMessage * gst_message_new_state_changed (GstObject * src, GstState oldstate, GstState newstate, GstState pending); GstMessage_noinc * new (class, GstObject * src, GstState oldstate, GstState newstate, GstState pending) CODE: RETVAL = gst_message_new_state_changed (src, oldstate, newstate, pending); OUTPUT: RETVAL # void gst_message_parse_state_changed (GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending); GstState old_state (GstMessage *message) ALIAS: new_state = 1 pending = 2 PREINIT: GstState old, new, pending; CODE: gst_message_parse_state_changed (message, &old, &new, &pending); switch (ix) { case 0: RETVAL = old; break; case 1: RETVAL = new; break; case 2: RETVAL = pending; break; default: XSRETURN_UNDEF; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::StateDirty # GstMessage * gst_message_new_state_dirty (GstObject * src); GstMessage_noinc * new (class, GstObject * src) CODE: RETVAL = gst_message_new_state_dirty (src); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::ClockProvide # GstMessage * gst_message_new_clock_provide (GstObject * src, GstClock *clock, gboolean ready); GstMessage_noinc * new (class, GstObject * src, GstClock * clock, gboolean ready) CODE: RETVAL = gst_message_new_clock_provide (src, clock, ready); OUTPUT: RETVAL # void gst_message_parse_clock_provide (GstMessage *message, GstClock **clock, gboolean *ready); SV * clock (GstMessage *message) ALIAS: ready = 1 PREINIT: gboolean ready; GstClock *clock = NULL; CODE: gst_message_parse_clock_provide (message, &clock, &ready); switch (ix) { case 0: RETVAL = newSVGstClock (clock); break; case 1: RETVAL = newSVuv (ready); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::ClockLost # GstMessage * gst_message_new_clock_lost (GstObject * src, GstClock *clock); GstMessage_noinc * new (class, GstObject * src, GstClock * clock) CODE: RETVAL = gst_message_new_clock_lost (src, clock); OUTPUT: RETVAL # void gst_message_parse_clock_lost (GstMessage *message, GstClock **clock); GstClock * clock (GstMessage *message) CODE: gst_message_parse_clock_lost (message, &RETVAL); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::NewClock # GstMessage * gst_message_new_new_clock (GstObject * src, GstClock *clock); GstMessage_noinc * new (class, GstObject * src, GstClock * clock) CODE: RETVAL = gst_message_new_new_clock (src, clock); OUTPUT: RETVAL # void gst_message_parse_new_clock (GstMessage *message, GstClock **clock); GstClock * clock (GstMessage *message) CODE: gst_message_parse_new_clock (message, &RETVAL); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Application # GstMessage * gst_message_new_application (GstObject * src, GstStructure * structure); GstMessage_noinc * new (class, GstObject * src, GstStructure * structure) CODE: /* gst_message_new_application takes ownership of structure. */ RETVAL = gst_message_new_application (src, structure); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Element # GstMessage * gst_message_new_element (GstObject * src, GstStructure * structure); GstMessage_noinc * new (class, GstObject * src, GstStructure * structure) CODE: /* gst_message_new_element takes ownership of structure. */ RETVAL = gst_message_new_element (src, structure); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::SegmentStart # GstMessage * gst_message_new_segment_start (GstObject * src, GstFormat format, gint64 position); GstMessage_noinc * new (class, GstObject * src, GstFormat format, gint64 position) CODE: RETVAL = gst_message_new_segment_start (src, format, position); OUTPUT: RETVAL # void gst_message_parse_segment_start (GstMessage *message, GstFormat *format, gint64 *position); SV * format (GstMessage *message) ALIAS: position = 1 PREINIT: GstFormat format; gint64 position; CODE: gst_message_parse_segment_start (message, &format, &position); switch (ix) { case 0: RETVAL = newSVGstFormat (format); break; case 1: RETVAL = newSVGInt64 (position); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::SegmentDone # GstMessage * gst_message_new_segment_done (GstObject * src, GstFormat format, gint64 position); GstMessage_noinc * new (class, GstObject * src, GstFormat format, gint64 position) CODE: RETVAL = gst_message_new_segment_done (src, format, position); OUTPUT: RETVAL # void gst_message_parse_segment_done (GstMessage *message, GstFormat *format, gint64 *position); SV * format (GstMessage *message) ALIAS: position = 1 PREINIT: GstFormat format; gint64 position; CODE: gst_message_parse_segment_done (message, &format, &position); switch (ix) { case 0: RETVAL = newSVGstFormat (format); break; case 1: RETVAL = newSVGInt64 (position); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Duration # GstMessage * gst_message_new_duration (GstObject * src, GstFormat format, gint64 duration); GstMessage_noinc * new (class, GstObject * src, GstFormat format, gint64 duration) CODE: RETVAL = gst_message_new_duration (src, format, duration); OUTPUT: RETVAL # void gst_message_parse_duration (GstMessage *message, GstFormat *format, gint64 *duration); SV * format (GstMessage *message) ALIAS: duration = 1 PREINIT: GstFormat format; gint64 duration; CODE: gst_message_parse_duration (message, &format, &duration); switch (ix) { case 0: RETVAL = newSVGstFormat (format); break; case 1: RETVAL = newSVGInt64 (duration); break; default: RETVAL = &PL_sv_undef; } OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::Latency #if GST_CHECK_VERSION (0, 10, 12) # GstMessage * gst_message_new_latency (GstObject * src); GstMessage_noinc * new (class, GstObject * src) CODE: RETVAL = gst_message_new_latency (src); OUTPUT: RETVAL #endif # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::AsyncStart #if GST_CHECK_VERSION (0, 10, 13) # GstMessage * gst_message_new_async_start (GstObject * src, gboolean new_base_time); GstMessage_noinc * new (class, GstObject * src, gboolean new_base_time) CODE: RETVAL = gst_message_new_async_start (src, new_base_time); OUTPUT: RETVAL # void gst_message_parse_async_start (GstMessage *message, gboolean *new_base_time); gboolean new_base_time (GstMessage *message) CODE: gst_message_parse_async_start (message, &RETVAL); OUTPUT: RETVAL #endif # --------------------------------------------------------------------------- # MODULE = GStreamer::Message PACKAGE = GStreamer::Message::AsyncDone #if GST_CHECK_VERSION (0, 10, 13) # GstMessage * gst_message_new_async_done (GstObject * src); GstMessage_noinc * new (class, GstObject * src) CODE: RETVAL = gst_message_new_async_done (src); OUTPUT: RETVAL #endif GStreamer-0.19/xs/GstMiniObject.xs000644 001750 000024 00000012321 11722734576 017311 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static GHashTable *package_by_type = NULL; static GHashTable *package_lookup_by_type = NULL; G_LOCK_DEFINE_STATIC (package_by_type); G_LOCK_DEFINE_STATIC (package_lookup_by_type); void gst2perl_register_mini_object (GType type, const char *package) { G_LOCK (package_by_type); if (!package_by_type) package_by_type = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); g_hash_table_insert (package_by_type, (gpointer) type, (gpointer) package); G_UNLOCK (package_by_type); if (0 != strncmp (package, "GStreamer::MiniObject", sizeof ("GStreamer::MiniObject"))) gperl_set_isa(package, "GStreamer::MiniObject"); } void gst2perl_register_mini_object_package_lookup_func (GType type, Gst2PerlMiniObjectPackageLookupFunc func) { G_LOCK (package_lookup_by_type); if (!package_lookup_by_type) package_lookup_by_type = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); g_hash_table_insert (package_lookup_by_type, (gpointer) type, (gpointer) func); G_UNLOCK (package_lookup_by_type); } /* ------------------------------------------------------------------------- */ static const char * get_package (GstMiniObject *object) { GType type = G_TYPE_FROM_INSTANCE (&object->instance); Gst2PerlMiniObjectPackageLookupFunc func = NULL; const char *result = NULL; func = g_hash_table_lookup (package_lookup_by_type, (gpointer) type); if (func) return func (object); result = g_hash_table_lookup (package_by_type, (gpointer) type); if (!result) { GType parent = type; while (result == NULL) { parent = g_type_parent (parent); result = g_hash_table_lookup ( package_by_type, (gpointer) parent); } } return result; } SV * gst2perl_sv_from_mini_object (GstMiniObject *object, gboolean own) { if (!object) return &PL_sv_undef; if (!GST_IS_MINI_OBJECT (object)) croak ("object 0x%p is not really a GstMiniObject", object); if (own) gst_mini_object_ref (object); return sv_setref_pv (newSV (0), get_package (object), object); } GstMiniObject * gst2perl_mini_object_from_sv (SV *sv) { return INT2PTR (GstMiniObject *, SvIV (SvRV (sv))); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_mini_object_wrapper_class; static SV * gst2perl_mini_object_wrap (const GValue *value) { /* The object's refcount didn't get incremented, so we must not use * _noinc. */ return newSVGstMiniObject (gst_value_get_mini_object (value)); } static void gst2perl_mini_object_unwrap (GValue *value, SV *sv) { gst_value_set_mini_object (value, SvGstMiniObject (sv)); } static void gst2perl_mini_object_initialize (void) { gst2perl_mini_object_wrapper_class.wrap = gst2perl_mini_object_wrap; gst2perl_mini_object_wrapper_class.unwrap = gst2perl_mini_object_unwrap; gperl_register_fundamental_full (GST_TYPE_MINI_OBJECT, "GStreamer::MiniObject", &gst2perl_mini_object_wrapper_class); } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::MiniObject PACKAGE = GStreamer::MiniObject PREFIX = gst_mini_object_ BOOT: gst2perl_mini_object_initialize (); void DESTROY (GstMiniObject *object) CODE: gst_mini_object_unref (object); # FIXME: Needed? # GstMiniObject * gst_mini_object_new (GType type); # GstMiniObject * gst_mini_object_copy (const GstMiniObject *mini_object); gboolean gst_mini_object_is_writable (const GstMiniObject *mini_object); # GstMiniObject * gst_mini_object_make_writable (GstMiniObject *mini_object); GstMiniObject_noinc * gst_mini_object_make_writable (GstMiniObject *mini_object) C_ARGS: /* gst_mini_object_make_writable unref's mini_object, so we need to * keep it alive. */ gst_mini_object_ref (mini_object) # FIXME: Needed? # void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata); # GParamSpec * gst_param_spec_mini_object (const char *name, const char *nick, const char *blurb, GType object_type, GParamFlags flags); # void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object); # void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object); # GstMiniObject * gst_value_get_mini_object (const GValue *value); GStreamer-0.19/xs/GstObject.xs000644 001750 000024 00000004161 11722734576 016477 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Object PACKAGE = GStreamer::Object PREFIX = gst_object_ BOOT: /* Register gst_object_sink() as the sink function to get the ref-counting right. */ gperl_register_sink_func (GST_TYPE_OBJECT, (GPerlObjectSinkFunc) gst_object_sink); void gst_object_set_name (GstObject *object, const gchar_ornull *name); gchar_ornull * gst_object_get_name (GstObject *object) CLEANUP: g_free (RETVAL); void gst_object_set_name_prefix (GstObject *object, const gchar_ornull *name_prefix); gchar_ornull * gst_object_get_name_prefix (GstObject *object) CLEANUP: g_free (RETVAL); void gst_object_set_parent (GstObject *object, GstObject *parent); GstObject_ornull * gst_object_get_parent (GstObject *object); void gst_object_unparent (GstObject *object); gboolean gst_object_has_ancestor (GstObject *object, GstObject *ancestor); # FIXME? # void gst_object_default_deep_notify (GObject *object, GstObject *orig, GParamSpec *pspec, gchar **excluded_props); # void gst_object_replace (GstObject **oldobj, GstObject *newobj); gchar_own * gst_object_get_path_string (GstObject *object); # FIXME? # gboolean gst_object_check_uniqueness (GList *list, const gchar *name); # guint gst_class_signal_connect (GstObjectClass *klass, const gchar *name, gpointer func, gpointer func_data); GStreamer-0.19/xs/GstPad.xs000644 001750 000024 00000020474 11722734576 016002 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static GPerlCallback * gst2perl_task_func_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, G_TYPE_NONE); } static void gst2perl_task_func (gpointer data) { GPerlCallback *callback = data; gperl_callback_invoke (callback, NULL); } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Pad PACKAGE = GStreamer::Pad PREFIX = gst_pad_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_PAD, TRUE); # GstPad * gst_pad_new (const gchar *name, GstPadDirection direction); GstPad_ornull * gst_pad_new (class, name, direction) const gchar *name GstPadDirection direction C_ARGS: name, direction # GstPad * gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name); GstPad_ornull * gst_pad_new_from_template (class, templ, name) GstPadTemplate *templ const gchar *name C_ARGS: /* We need to ref templ since gst_pad_new_from_template sinks it. */ g_object_ref (G_OBJECT (templ)), name GstPadDirection gst_pad_get_direction (GstPad *pad); void gst_pad_set_active (GstPad *pad, gboolean active); gboolean gst_pad_is_active (GstPad *pad); gboolean gst_pad_activate_pull (GstPad *pad, gboolean active); gboolean gst_pad_activate_push (GstPad *pad, gboolean active); gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked); # FIXME? # gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked, GstPadBlockCallback callback, gpointer user_data); gboolean gst_pad_is_blocked (GstPad *pad); # FIXME? # void gst_pad_set_element_private (GstPad *pad, gpointer priv); # gpointer gst_pad_get_element_private (GstPad *pad); GstPadTemplate * gst_pad_get_pad_template (GstPad *pad); # FIXME? # void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc); # GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf); # FIXME? # void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate); # void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull); # void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush); # void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain); # void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get); # void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check); # void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event); # FIXME? # void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link); # void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink); gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad); void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad); gboolean gst_pad_is_linked (GstPad *pad); GstPad* gst_pad_get_peer (GstPad *pad); # FIXME? # void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); # void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps); # void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps); # void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps); const GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); GstCaps_own * gst_pad_get_caps (GstPad *pad); void gst_pad_fixate_caps (GstPad * pad, GstCaps *caps); gboolean gst_pad_accept_caps (GstPad * pad, GstCaps *caps); gboolean gst_pad_set_caps (GstPad * pad, GstCaps_ornull *caps); GstCaps_own * gst_pad_peer_get_caps (GstPad * pad); gboolean gst_pad_peer_accept_caps (GstPad * pad, GstCaps *caps); GstCaps_own_ornull * gst_pad_get_allowed_caps (GstPad * srcpad); GstCaps_own_ornull * gst_pad_get_negotiated_caps (GstPad * pad); GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer) C_ARGS: /* We need to keep the buffer alive. */ pad, gst_buffer_ref (buffer) gboolean gst_pad_check_pull_range (GstPad *pad); # GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer); void gst_pad_pull_range (GstPad *pad, guint64 offset, guint size) PREINIT: GstFlowReturn retval; GstBuffer *buffer = NULL; PPCODE: retval = gst_pad_pull_range (pad, offset, size, &buffer); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGstFlowReturn (retval))); PUSHs (sv_2mortal (newSVGstBuffer_ornull (buffer))); gboolean gst_pad_push_event (GstPad *pad, GstEvent *event) C_ARGS: /* Need to keep event alive. */ pad, gst_event_ref (event) gboolean gst_pad_event_default (GstPad *pad, GstEvent *event) C_ARGS: /* Need to keep event alive. */ pad, gst_event_ref (event) GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer) C_ARGS: /* We need to keep the buffer alive. */ pad, gst_buffer_ref (buffer) # GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer); void gst_pad_get_range (GstPad *pad, guint64 offset, guint size); PREINIT: GstFlowReturn retval; GstBuffer *buffer = NULL; PPCODE: retval = gst_pad_get_range (pad, offset, size, &buffer); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGstFlowReturn (retval))); PUSHs (sv_2mortal (newSVGstBuffer_ornull (buffer))); gboolean gst_pad_send_event (GstPad *pad, GstEvent *event) C_ARGS: /* Need to keep event alive. */ pad, gst_event_ref (event) # gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func, gpointer data); gboolean gst_pad_start_task (GstPad *pad, SV *func, SV *data=NULL) PREINIT: GPerlCallback *callback; CODE: callback = gst2perl_task_func_create (func, data); RETVAL = gst_pad_start_task (pad, gst2perl_task_func, callback); OUTPUT: RETVAL gboolean gst_pad_pause_task (GstPad *pad); gboolean gst_pad_stop_task (GstPad *pad); # FIXME? # void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink); # GList* gst_pad_get_internal_links (GstPad *pad); # GList* gst_pad_get_internal_links_default (GstPad *pad); void gst_pad_get_internal_links (pad) GstPad *pad ALIAS: get_internal_links_default = 1 PREINIT: GList *list, *i; PPCODE: list = ix == 1 ? gst_pad_get_internal_links_default (pad) : gst_pad_get_internal_links (pad); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPad (i->data))); # FIXME? # void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func); # G_CONST_RETURN GstQueryType* gst_pad_get_query_types (GstPad *pad); # G_CONST_RETURN GstQueryType* gst_pad_get_query_types_default (GstPad *pad); void gst_pad_get_query_types (pad) GstPad *pad ALIAS: get_query_types_default = 1 PREINIT: const GstQueryType *types = NULL; PPCODE: types = ix == 1 ? gst_pad_get_query_types_default (pad) : gst_pad_get_query_types (pad); if (types) while (*types++) XPUSHs (sv_2mortal (newSVGstQueryType (*types))); gboolean gst_pad_query (GstPad *pad, GstQuery *query); # FIXME? # void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query); gboolean gst_pad_query_default (GstPad *pad, GstQuery *query); # FIXME? # gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data); #if GST_CHECK_VERSION (0, 10, 11) gboolean gst_pad_is_blocking (GstPad *pad); #endif #if GST_CHECK_VERSION (0, 10, 15) gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query); #endif #if GST_CHECK_VERSION (0, 10, 21) GstIterator * gst_pad_iterate_internal_links (GstPad *pad); GstIterator * gst_pad_iterate_internal_links_default (GstPad *pad); #endif GStreamer-0.19/xs/GstPadTemplate.xs000644 001750 000024 00000004125 11722734576 017471 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::PadTemplate PACKAGE = GStreamer::PadTemplate PREFIX = gst_pad_template_ # GstPadTemplate* gst_pad_template_new (const gchar *name_template, GstPadDirection direction, GstPadPresence presence, GstCaps *caps); GstPadTemplate * gst_pad_template_new (class, name_template, direction, presence, caps) const gchar *name_template GstPadDirection direction GstPadPresence presence GstCaps *caps C_ARGS: /* The template takes over ownership of caps, so we have to hand it a copy. */ name_template, direction, presence, gst_caps_copy (caps) # FIXME? # GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *pad_template); # GstCaps * gst_static_pad_template_get_caps (GstStaticPadTemplate *templ); const GstCaps * gst_pad_template_get_caps (GstPadTemplate *templ); void gst_pad_template_pad_created (GstPadTemplate * templ, GstPad * pad); # FIXME: File bug reports about these missing accessors? const gchar * get_name_template (templ) GstPadTemplate *templ CODE: RETVAL = templ->name_template; OUTPUT: RETVAL GstPadDirection get_direction (templ) GstPadTemplate *templ CODE: RETVAL = templ->direction; OUTPUT: RETVAL GstPadPresence get_presence (templ) GstPadTemplate *templ CODE: RETVAL = templ->presence; OUTPUT: RETVAL GStreamer-0.19/xs/GstPipeline.xs000644 001750 000024 00000003077 11722734576 017043 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::Pipeline PACKAGE = GStreamer::Pipeline PREFIX = gst_pipeline_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_PIPELINE, TRUE); # GstElement* gst_pipeline_new (const gchar *name); GstElement * gst_pipeline_new (class, name) const gchar_ornull *name C_ARGS: name GstBus * gst_pipeline_get_bus (GstPipeline *pipeline); void gst_pipeline_set_new_stream_time (GstPipeline *pipeline, GstClockTime time); GstClockTime gst_pipeline_get_last_stream_time (GstPipeline *pipeline); void gst_pipeline_use_clock (GstPipeline *pipeline, GstClock *clock); void gst_pipeline_set_clock (GstPipeline *pipeline, GstClock *clock); GstClock * gst_pipeline_get_clock (GstPipeline *pipeline); void gst_pipeline_auto_clock (GstPipeline *pipeline); GStreamer-0.19/xs/GstPlugin.xs000644 001750 000024 00000006130 11722734576 016525 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ /* Implemented in GstPluginFeature.xs. */ extern GPerlCallback * gst2perl_plugin_feature_filter_create (SV *func, SV *data); extern gboolean gst2perl_plugin_feature_filter (GstPluginFeature *feature, gpointer user_data); /* ------------------------------------------------------------------------- */ /* Used in GstRegistry.xs and GstRegistryPool.xs. */ GPerlCallback * gst2perl_plugin_filter_create (SV *func, SV *data) { GType param_types [1]; param_types[0] = GST_TYPE_PLUGIN; return gperl_callback_new (func, data, G_N_ELEMENTS (param_types), param_types, G_TYPE_BOOLEAN); } gboolean gst2perl_plugin_filter (GstPlugin *plugin, gpointer user_data) { GPerlCallback *callback = user_data; GValue value = { 0, }; gboolean retval; g_value_init (&value, callback->return_type); gperl_callback_invoke (callback, &value, plugin); retval = g_value_get_boolean (&value); g_value_unset (&value); return retval; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Plugin PACKAGE = GStreamer::Plugin PREFIX = gst_plugin_ const gchar* gst_plugin_get_name (GstPlugin *plugin); const gchar* gst_plugin_get_description (GstPlugin *plugin); const gchar* gst_plugin_get_filename (GstPlugin *plugin); const gchar* gst_plugin_get_version (GstPlugin *plugin); const gchar* gst_plugin_get_license (GstPlugin *plugin); const gchar* gst_plugin_get_source (GstPlugin *plugin); const gchar* gst_plugin_get_package (GstPlugin *plugin); const gchar* gst_plugin_get_origin (GstPlugin *plugin); # FIXME? # GModule * gst_plugin_get_module (GstPlugin *plugin); gboolean gst_plugin_is_loaded (GstPlugin *plugin); gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name); =for apidoc __function__ =cut # GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error); GstPlugin * gst_plugin_load_file (filename) const gchar *filename PREINIT: GError *error = NULL; CODE: RETVAL = gst_plugin_load_file (filename, &error); if (!RETVAL) gperl_croak_gerror (NULL, error); OUTPUT: RETVAL GstPlugin * gst_plugin_load (GstPlugin *plugin); =for apidoc __function__ =cut GstPlugin * gst_plugin_load_by_name (const gchar *name); GStreamer-0.19/xs/GstPluginFeature.xs000644 001750 000024 00000004767 11722734576 020057 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ /* Used in GstPlugin.xs, GstRegistry.xs, and GstRegistryPool.xs. */ GPerlCallback * gst2perl_plugin_feature_filter_create (SV *func, SV *data) { GType param_types [1]; param_types[0] = GST_TYPE_PLUGIN_FEATURE; return gperl_callback_new (func, data, G_N_ELEMENTS (param_types), param_types, G_TYPE_BOOLEAN); } gboolean gst2perl_plugin_feature_filter (GstPluginFeature *feature, gpointer user_data) { GPerlCallback *callback = user_data; GValue value = { 0, }; gboolean retval; g_value_init (&value, callback->return_type); gperl_callback_invoke (callback, &value, feature); retval = g_value_get_boolean (&value); g_value_unset (&value); return retval; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::PluginFeature PACKAGE = GStreamer::PluginFeature PREFIX = gst_plugin_feature_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_PLUGIN_FEATURE, TRUE); GstPluginFeature * gst_plugin_feature_load (GstPluginFeature *feature); # FIXME: Is this needed? It's not documented. # gboolean gst_plugin_feature_type_name_filter (GstPluginFeature *feature, GstTypeNameData *data); void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint rank); void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name); # FIXME: Use enum typemap instead? guint gst_plugin_feature_get_rank (GstPluginFeature *feature); const gchar *gst_plugin_feature_get_name (GstPluginFeature *feature); gboolean gst_plugin_feature_check_version (GstPluginFeature *feature, guint min_major, guint min_minor, guint min_micro); GStreamer-0.19/xs/GstQuery.xs000644 001750 000024 00000024525 11722734576 016404 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ SV * newSVGstQueryType (GstQueryType type) { SV *sv = gperl_convert_back_enum_pass_unknown (GST_TYPE_QUERY_TYPE, type); if (looks_like_number (sv)) { const GstQueryTypeDefinition *details; details = gst_query_type_get_details (type); if (details) sv_setpv (sv, details->nick); } return sv; } GstQueryType SvGstQueryType (SV *sv) { GstQueryType format; if (gperl_try_convert_enum (GST_TYPE_QUERY_TYPE, sv, (gint *) &format)) return format; return gst_query_type_get_by_nick (SvPV_nolen (sv)); } /* ------------------------------------------------------------------------- */ static const char * get_package (GstQuery *query) { const char *package = "GStreamer::Query"; switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: package = "GStreamer::Query::Position"; break; case GST_QUERY_DURATION: package = "GStreamer::Query::Duration"; break; case GST_QUERY_LATENCY: package = "GStreamer::Query::Latency"; break; case GST_QUERY_JITTER: package = "GStreamer::Query::Jitter"; break; case GST_QUERY_RATE: package = "GStreamer::Query::Rate"; break; case GST_QUERY_SEEKING: package = "GStreamer::Query::Seeking"; break; case GST_QUERY_SEGMENT: package = "GStreamer::Query::Segment"; break; case GST_QUERY_CONVERT: package = "GStreamer::Query::Convert"; break; case GST_QUERY_FORMATS: package = "GStreamer::Query::Formats"; break; case GST_QUERY_NONE: break; default: /* Happens for dynamically registered types, for example. Use * the standard package. */ break; } return package; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Query PACKAGE = GStreamer::QueryType PREFIX = gst_query_type_ BOOT: gst2perl_register_mini_object_package_lookup_func ( GST_TYPE_QUERY, (Gst2PerlMiniObjectPackageLookupFunc) get_package); =for apidoc __function__ =cut # GstQueryType gst_query_type_register (const gchar *nick, const gchar *description); GstQueryType gst_query_type_register (nick, description) const gchar *nick const gchar *description =for apidoc __function__ =cut # GstQueryType gst_query_type_get_by_nick (const gchar *nick); GstQueryType gst_query_type_get_by_nick (nick) const gchar *nick # FIXME? # gboolean gst_query_types_contains (const GstQueryType *types, GstQueryType type); =for apidoc __function__ =cut # G_CONST_RETURN GstQueryTypeDefinition* gst_query_type_get_details (GstQueryType type); void gst_query_type_get_details (type) GstQueryType type PREINIT: const GstQueryTypeDefinition *details; PPCODE: details = gst_query_type_get_details (type); if (details) { EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGstQueryType (details->value))); PUSHs (sv_2mortal (newSVGChar (details->nick))); PUSHs (sv_2mortal (newSVGChar (details->description))); } # FIXME: Need to somehow apply our converter to the content. # GstIterator * gst_query_type_iterate_definitions (void); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query PREFIX = gst_query_ BOOT: gperl_set_isa ("GStreamer::Query::Position", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Duration", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Latency", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Jitter", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Rate", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Seeking", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Segment", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Convert", "GStreamer::Query"); gperl_set_isa ("GStreamer::Query::Formats", "GStreamer::Query"); =for position DESCRIPTION =head1 DESCRIPTION The various query types are represented as subclasses: =over =item GStreamer::Query::Position =item GStreamer::Query::Duration =item GStreamer::Query::Latency =item GStreamer::Query::Jitter =item GStreamer::Query::Rate =item GStreamer::Query::Seeking =item GStreamer::Query::Segment =item GStreamer::Query::Convert =item GStreamer::Query::Formats =back To create a new query, you call the constructor of the corresponding class. To modify or retrieve the content of a query, call the corresponding mutator: my $query = GStreamer::Query::Position -> new("time"); $query -> position("time", 23); my ($format, $position) = $query -> position; my $query = GStreamer::Query::Duration -> new("time"); $query -> duration("time", 23); my ($format, $duration) = $query -> duration; =cut # DESTROY inherited from GStreamer::MiniObject. # query still owns the structure. GstStructure * gst_query_get_structure (GstQuery *query); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query::Position # GstQuery* gst_query_new_position (GstFormat format); GstQuery_noinc * new (class, GstFormat format) CODE: RETVAL = gst_query_new_position (format); OUTPUT: RETVAL # void gst_query_set_position (GstQuery *query, GstFormat format, gint64 cur); # void gst_query_parse_position (GstQuery *query, GstFormat *format, gint64 *cur); void position (GstQuery *query, GstFormat format=0, gint64 cur=0) PREINIT: GstFormat old_format; gint64 old_cur; PPCODE: gst_query_parse_position (query, &old_format, &old_cur); if (items == 3) gst_query_set_position (query, format, cur); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGstFormat (old_format))); PUSHs (sv_2mortal (newSVGInt64 (old_cur))); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query::Duration # GstQuery* gst_query_new_duration (GstFormat format); GstQuery_noinc * new (class, GstFormat format) CODE: RETVAL = gst_query_new_duration (format); OUTPUT: RETVAL # void gst_query_set_duration (GstQuery *query, GstFormat format, gint64 duration); # void gst_query_parse_duration (GstQuery *query, GstFormat *format, gint64 *duration); void duration (GstQuery *query, GstFormat format=0, gint64 duration=0) PREINIT: GstFormat old_format; gint64 old_duration; PPCODE: gst_query_parse_duration (query, &old_format, &old_duration); if (items == 3) gst_query_set_duration (query, format, duration); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGstFormat (old_format))); PUSHs (sv_2mortal (newSVGInt64 (old_duration))); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query::Convert # GstQuery* gst_query_new_convert (GstFormat src_format, gint64 value, GstFormat dest_format); GstQuery_noinc * new (class, GstFormat src_format, gint64 value, GstFormat dest_format) CODE: RETVAL = gst_query_new_convert (src_format, value, dest_format); OUTPUT: RETVAL # void gst_query_set_convert (GstQuery *query, GstFormat src_format, gint64 src_value, GstFormat dest_format, gint64 dest_value); # void gst_query_parse_convert (GstQuery *query, GstFormat *src_format, gint64 *src_value, GstFormat *dest_format, gint64 *dest_value); void convert (GstQuery *query, GstFormat src_format=0, gint64 src_value=0, GstFormat dest_format=0, gint64 dest_value=0) PREINIT: GstFormat old_src_format; gint64 old_src_value; GstFormat old_dest_format; gint64 old_dest_value; PPCODE: gst_query_parse_convert (query, &old_src_format, &old_src_value, &old_dest_format, &old_dest_value); if (items == 5) gst_query_set_convert (query, src_format, src_value, dest_format, dest_value); EXTEND (sp, 4); PUSHs (sv_2mortal (newSVGstFormat (old_src_format))); PUSHs (sv_2mortal (newSVGInt64 (old_src_value))); PUSHs (sv_2mortal (newSVGstFormat (old_dest_format))); PUSHs (sv_2mortal (newSVGInt64 (old_dest_value))); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query::Segment # GstQuery* gst_query_new_segment (GstFormat format); GstQuery_noinc * new (class, GstFormat format) CODE: RETVAL = gst_query_new_segment (format); OUTPUT: RETVAL # void gst_query_set_segment (GstQuery *query, gdouble rate, GstFormat format, gint64 start_value, gint64 stop_value); # void gst_query_parse_segment (GstQuery *query, gdouble *rate, GstFormat *format, gint64 *start_value, gint64 *stop_value); void segment (GstQuery *query, gdouble rate=0.0, GstFormat format=0, gint64 start_value=0, gint64 stop_value=0) PREINIT: gdouble old_rate; GstFormat old_format; gint64 old_start_value; gint64 old_stop_value; PPCODE: gst_query_parse_segment (query, &old_rate, &old_format, &old_start_value, &old_stop_value); if (items == 5) gst_query_set_segment (query, rate, format, start_value, stop_value); EXTEND (sp, 4); PUSHs (sv_2mortal (newSVnv (old_rate))); PUSHs (sv_2mortal (newSVGstFormat (old_format))); PUSHs (sv_2mortal (newSVGInt64 (old_start_value))); PUSHs (sv_2mortal (newSVGInt64 (old_stop_value))); # --------------------------------------------------------------------------- # MODULE = GStreamer::Query PACKAGE = GStreamer::Query::Application # GstQuery * gst_query_new_application (GstQueryType type, GstStructure *structure); GstQuery_noinc * new (class, GstQueryType type, GstStructure *structure) CODE: /* RETVAL owns structure. */ RETVAL = gst_query_new_application (type, structure); OUTPUT: RETVAL # void gst_query_set_seeking (GstQuery *query, GstFormat format, gboolean seekable, gint64 segment_start, gint64 segment_end); # void gst_query_set_formats (GstQuery *query, gint n_formats, ...); GStreamer-0.19/xs/GstRegistry.xs000644 001750 000024 00000014035 11722734576 017102 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ /* Implemented in GstPlugin.xs. */ extern GPerlCallback * gst2perl_plugin_filter_create (SV *func, SV *data); extern gboolean gst2perl_plugin_filter (GstPlugin *plugin, gpointer user_data); /* ------------------------------------------------------------------------- */ /* Implemented in GstPluginFeature.xs. */ extern GPerlCallback * gst2perl_plugin_feature_filter_create (SV *func, SV *data); extern gboolean gst2perl_plugin_feature_filter (GstPluginFeature *feature, gpointer user_data); /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Registry PACKAGE = GStreamer::Registry PREFIX = gst_registry_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_REGISTRY, TRUE); # GstRegistry * gst_registry_get_default (void); GstRegistry * gst_registry_get_default (class) C_ARGS: /* void */ void gst_registry_scan_path (GstRegistry *registry, const gchar *path); # GList* gst_registry_get_path_list (GstRegistry *registry); void gst_registry_get_path_list (registry) GstRegistry *registry PREINIT: GList *paths, *i; PPCODE: paths = gst_registry_get_path_list (registry); for (i = paths; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGChar (i->data))); g_list_free (paths); gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin); void gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin); gboolean gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature); void gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature); # GList * gst_registry_get_plugin_list (GstRegistry *registry); void gst_registry_get_plugin_list (registry) GstRegistry *registry PREINIT: GList *plugins, *i; PPCODE: plugins = gst_registry_get_plugin_list (registry); for (i = plugins; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPlugin (i->data))); g_list_free (plugins); # GList* gst_registry_plugin_filter (GstRegistry *registry, GstPluginFilter filter, gboolean first, gpointer user_data); void gst_registry_plugin_filter (registry, filter, first, data=NULL) GstRegistry *registry SV *filter gboolean first SV *data PREINIT: GPerlCallback *callback; GList *list, *i; PPCODE: callback = gst2perl_plugin_filter_create (filter, data); list = gst_registry_plugin_filter (registry, gst2perl_plugin_filter, first, callback); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPlugin (i->data))); g_list_free (list); gperl_callback_destroy (callback); # GList* gst_registry_feature_filter (GstRegistry *registry, GstPluginFeatureFilter filter, gboolean first, gpointer user_data); void gst_registry_feature_filter (registry, filter, first, data=NULL) GstRegistry *registry SV *filter gboolean first SV *data PREINIT: GPerlCallback *callback; GList *list, *i; PPCODE: callback = gst2perl_plugin_feature_filter_create (filter, data); list = gst_registry_feature_filter (registry, gst2perl_plugin_feature_filter, first, callback); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPluginFeature (i->data))); g_list_free (list); gperl_callback_destroy (callback); # GList * gst_registry_get_feature_list (GstRegistry *registry, GType type); void gst_registry_get_feature_list (registry, type) GstRegistry *registry const char *type PREINIT: GList *features, *i; PPCODE: features = gst_registry_get_feature_list (registry, gperl_type_from_package (type)); for (i = features; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPluginFeature (i->data))); g_list_free (features); # GList * gst_registry_get_feature_list_by_plugin (GstRegistry *registry, const gchar *name); void gst_registry_get_feature_list_by_plugin (registry, name) GstRegistry *registry const gchar *name PREINIT: GList *features, *i; PPCODE: features = gst_registry_get_feature_list_by_plugin (registry, name); for (i = features; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstPluginFeature (i->data))); g_list_free (features); GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name); # GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type); GstPluginFeature * gst_registry_find_feature (registry, name, type) GstRegistry *registry const gchar *name const char *type C_ARGS: registry, name, gperl_type_from_package (type) GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename); GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name); gboolean gst_registry_xml_read_cache (GstRegistry * registry, const char *location); gboolean gst_registry_xml_write_cache (GstRegistry * registry, const char *location); # void _gst_registry_remove_cache_plugins (GstRegistry *registry); # void _gst_registry_cleanup (void); # FIXME? # gboolean gst_default_registry_check_feature_version (const gchar *feature_name, guint min_major, guint min_minor, guint min_micro); GStreamer-0.19/xs/GstStructure.xs000644 001750 000024 00000011341 12221715321 017245 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ /* SvGstStructure returns a newly allocated structure which does *not* get * freed when the next LEAVE is reached. So the caller must take ownership. */ GstStructure * SvGstStructure (SV *sv) { GstStructure *structure; HV *hv; SV **name, **fields; if (!gperl_sv_is_hash_ref (sv)) croak ("GstStructure must be a hash reference"); hv = (HV *) SvRV (sv); name = hv_fetch (hv, "name", 4, 0); if (!name || !gperl_sv_is_defined (*name)) croak ("GstStructure must contain a 'name' key"); /* This leaks the structure when we croak further down, but I think * that's ok since errors here are rather fatal. */ structure = gst_structure_empty_new (SvPV_nolen (*name)); fields = hv_fetch (hv, "fields", 6, 0); if (fields && gperl_sv_is_defined (*fields)) { AV *fields_av; int i; if (!SvRV (*fields) || SvTYPE (SvRV (*fields)) != SVt_PVAV) croak ("The value of the 'fields' key must be an array reference"); fields_av = (AV *) SvRV (*fields); for (i = 0; i <= av_len (fields_av); i++) { SV **field, **field_name, **field_type, **field_value; AV *field_av; field = av_fetch (fields_av, i, 0); if (!field || !gperl_sv_is_array_ref (*field)) croak ("The 'fields' array must contain array references"); field_av = (AV *) SvRV (*field); if (av_len (field_av) != 2) croak ("The arrays in the 'fields' array must contain three values: name, type, and value"); field_name = av_fetch (field_av, 0, 0); field_type = av_fetch (field_av, 1, 0); field_value = av_fetch (field_av, 2, 0); if (field_name && gperl_sv_is_defined (*field_name) && field_type && gperl_sv_is_defined (*field_type) && field_value && gperl_sv_is_defined (*field_value)) { GValue value = { 0, }; const char *package = SvPV_nolen (*field_type); GType type = gperl_type_from_package (package); if (!type) croak ("unregistered package %s encountered", package); g_value_init (&value, type); gperl_value_from_sv (&value, *field_value); gst_structure_set_value (structure, SvGChar (*field_name), &value); g_value_unset (&value); } } } return structure; } static gboolean fill_av (GQuark field_id, const GValue *value, gpointer user_data) { AV *field, *fields = (AV *) user_data; const gchar *id = g_quark_to_string (field_id); const char *type = gperl_package_from_type (G_VALUE_TYPE (value)); /* Use the C name if there's no Perl name. */ if (!type) type = g_type_name (G_VALUE_TYPE (value)); field = newAV (); av_push (field, newSVGChar (id)); av_push (field, newSVpv (type, 0)); av_push (field, gperl_sv_from_value (value)); av_push (fields, newRV_noinc ((SV *) field)); return TRUE; } SV * newSVGstStructure (const GstStructure *structure) { HV *hv; AV *av; const gchar *name; if (!structure) return &PL_sv_undef; hv = newHV (); av = newAV (); name = gst_structure_get_name (structure); hv_store (hv, "name", 4, newSVGChar (name), 0); gst_structure_foreach (structure, fill_av, av); hv_store (hv, "fields", 6, newRV_noinc ((SV *) av), 0); return newRV_noinc ((SV *) hv); } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Structure PACKAGE = GStreamer::Structure PREFIX = gst_structure_ =for position SYNOPSIS =head1 SYNOPSIS my $structure = { name => $name, fields => [ [$field_name, $type, $value], [$field_name, $type, $value], ... ] } =cut =for apidoc __function__ =cut gchar_own * gst_structure_to_string (const GstStructure *structure); =for apidoc __function__ =cut # GstStructure * gst_structure_from_string (const gchar *string, gchar **end); GstStructure * gst_structure_from_string (string) const gchar *string PREINIT: gchar *end = NULL; CODE: RETVAL = gst_structure_from_string (string, &end); OUTPUT: RETVAL CLEANUP: if (RETVAL) gst_structure_free (RETVAL); GStreamer-0.19/xs/GstSystemClock.xs000644 001750 000024 00000002134 11722734576 017527 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::SystemClock PACKAGE = GStreamer::SystemClock PREFIX = gst_system_clock_ BOOT: gperl_object_set_no_warn_unreg_subclass (GST_TYPE_SYSTEM_CLOCK, TRUE); # GstClock * gst_system_clock_obtain (void); GstClock * gst_system_clock_obtain (class) C_ARGS: /* void */ GStreamer-0.19/xs/GstTag.xs000644 001750 000024 00000010310 11722734576 015775 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static GPerlBoxedWrapperClass gst_tag_list_wrapper_class; static void fill_hv (const GstTagList *list, const gchar *tag, gpointer user_data) { HV *hv = (HV *) user_data; AV *av = newAV (); guint size, i; size = gst_tag_list_get_tag_size (list, tag); for (i = 0; i < size; i++) { const GValue *value; SV *sv; value = gst_tag_list_get_value_index (list, tag, i); sv = gperl_sv_from_value (value); av_store (av, i, sv); } hv_store (hv, tag, strlen (tag), newRV_noinc ((SV *) av), 0); } static SV * gst_tag_list_wrap (GType gtype, const char *package, GstTagList *list, gboolean own) { HV *hv = newHV (); gst_tag_list_foreach (list, fill_hv, hv); if (own) gst_tag_list_free (list); return newRV_noinc ((SV *) hv); } static GstTagList * gst_tag_list_unwrap (GType gtype, const char *package, SV *sv) { /* FIXME: Do we leak the list? */ GstTagList *list = gst_tag_list_new (); HV *hv = (HV *) SvRV (sv); HE *he; hv_iterinit (hv); while (NULL != (he = hv_iternext (hv))) { I32 length, i; char *tag; GType type; SV *ref; AV *av; tag = hv_iterkey (he, &length); if (!gst_tag_exists (tag)) continue; ref = hv_iterval (hv, he); if (!gperl_sv_is_array_ref (ref)) croak ("The values inside of GstTagList's have to be array references"); type = gst_tag_get_type (tag); av = (AV *) SvRV (ref); for (i = 0; i <= av_len (av); i++) { GValue value = { 0 }; SV **entry = av_fetch (av, i, 0); if (!(entry && gperl_sv_is_defined (*entry))) continue; /* FIXME: Why not croak here, too? */ g_value_init (&value, type); gperl_value_from_sv (&value, *entry); gst_tag_list_add_values (list, GST_TAG_MERGE_APPEND, tag, &value, NULL); g_value_unset (&value); } } return list; } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Tag PACKAGE = GStreamer::Tag PREFIX = gst_tag_ BOOT: gst_tag_list_wrapper_class = *gperl_default_boxed_wrapper_class (); gst_tag_list_wrapper_class.wrap = (GPerlBoxedWrapFunc) gst_tag_list_wrap; gst_tag_list_wrapper_class.unwrap = (GPerlBoxedUnwrapFunc) gst_tag_list_unwrap; gperl_register_boxed (GST_TYPE_TAG_LIST, "GStreamer::TagList", &gst_tag_list_wrapper_class); gperl_set_isa ("GStreamer::TagList", "Glib::Boxed"); # FIXME: Might be handy. But GstTagMergeFunc looks ugly. # void gst_tag_register (const gchar * name, GstTagFlag flag, GType type, const gchar * nick, const gchar * blurb, GstTagMergeFunc func); # void gst_tag_merge_use_first (GValue * dest, const GValue * src); # void gst_tag_merge_strings_with_comma (GValue * dest, const GValue * src); =for apidoc __function__ =cut gboolean gst_tag_exists (const gchar * tag); =for apidoc __function__ =cut # GType gst_tag_get_type (const gchar * tag); const char * gst_tag_get_type (tag) const gchar * tag CODE: RETVAL = gperl_package_from_type (gst_tag_get_type (tag)); OUTPUT: RETVAL =for apidoc __function__ =cut const gchar * gst_tag_get_nick (const gchar * tag); =for apidoc __function__ =cut const gchar * gst_tag_get_description (const gchar * tag); =for apidoc __function__ =cut GstTagFlag gst_tag_get_flag (const gchar * tag); =for apidoc __function__ =cut gboolean gst_tag_is_fixed (const gchar * tag); GStreamer-0.19/xs/GstTagSetter.xs000644 001750 000024 00000004421 11722734576 017172 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::TagSetter PACKAGE = GStreamer::TagSetter PREFIX = gst_tag_setter_ void gst_tag_setter_merge_tags (GstTagSetter *setter, const GstTagList *list, GstTagMergeMode mode); # void gst_tag_setter_add_tags (GstTagSetter *setter, GstTagMergeMode mode, const gchar *tag, ...); # void gst_tag_setter_add_tag_values (GstTagSetter *setter, GstTagMergeMode mode, const gchar *tag, ...); # void gst_tag_setter_add_tag_valist (GstTagSetter *setter, GstTagMergeMode mode, const gchar *tag, va_list var_args); # void gst_tag_setter_add_tag_valist_values (GstTagSetter *setter, GstTagMergeMode mode, const gchar *tag, va_list var_args); void gst_tag_setter_add_tags (setter, mode, tag, sv, ...) GstTagSetter *setter GstTagMergeMode mode const gchar *tag SV *sv PREINIT: int i; CODE: for (i = 2; i < items; i += 2) { GType type = 0; GValue value = { 0, }; tag = SvGChar (ST (i)); sv = ST (i + 1); type = gst_tag_get_type (tag); if (!type) croak ("Could not determine type for tag `%s'", tag); g_value_init (&value, type); gperl_value_from_sv (&value, sv); gst_tag_setter_add_tag_values (setter, mode, tag, &value, NULL); g_value_unset (&value); } const GstTagList* gst_tag_setter_get_tag_list (GstTagSetter *setter); void gst_tag_setter_set_tag_merge_mode (GstTagSetter *setter, GstTagMergeMode mode); GstTagMergeMode gst_tag_setter_get_tag_merge_mode (GstTagSetter *setter); GStreamer-0.19/xs/GstTypeFindFactory.xs000644 001750 000024 00000003406 11722734576 020344 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" MODULE = GStreamer::TypeFindFactory PACKAGE = GStreamer::TypeFindFactory PREFIX = gst_type_find_factory_ # GList * gst_type_find_factory_get_list (void); void gst_type_find_factory_get_list (class) PREINIT: GList *list, *i; PPCODE: PERL_UNUSED_VAR (ax); list = gst_type_find_factory_get_list (); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGstTypeFindFactory (i->data))); g_list_free (list); # gchar ** gst_type_find_factory_get_extensions (GstTypeFindFactory *factory); void gst_type_find_factory_get_extensions (GstTypeFindFactory *factory) PREINIT: gchar **list; gchar *ext; PPCODE: list = gst_type_find_factory_get_extensions (factory); while (list && (ext = *list++)) XPUSHs (sv_2mortal (newSVGChar (ext))); GstCaps * gst_type_find_factory_get_caps (GstTypeFindFactory *factory); # FIXME: Need GstTypeFind support. # void gst_type_find_factory_call_function (GstTypeFindFactory *factory, GstTypeFind *find); GStreamer-0.19/xs/GstValue.xs000644 001750 000024 00000032540 12221715321 016325 0ustar00brianstaff000000 000000 /* * Copyright (C) 2005 by the gtk2-perl team * * 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 * * $Id$ */ #include "gst2perl.h" /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_fourcc_wrapper_class; static SV * gst2perl_fourcc_wrap (const GValue *value) { return newSVpvf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (gst_value_get_fourcc (value))); ; } static void gst2perl_fourcc_unwrap (GValue *value, SV *sv) { STRLEN length = 0; const char *string = SvPV (sv, length); if (length != 4) croak ("GStreamer::Fourcc values must be strings of length 4"); gst_value_set_fourcc (value, GST_STR_FOURCC (string)); } static void gst2perl_fourcc_initialize (void) { gst2perl_fourcc_wrapper_class.wrap = gst2perl_fourcc_wrap; gst2perl_fourcc_wrapper_class.unwrap = gst2perl_fourcc_unwrap; gperl_register_fundamental_full (GST_TYPE_FOURCC, "GStreamer::Fourcc", &gst2perl_fourcc_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_double_range_wrapper_class; static SV * gst2perl_double_range_wrap (const GValue *value) { AV *av = newAV (); av_push (av, newSVnv (gst_value_get_double_range_min (value))); av_push (av, newSVnv (gst_value_get_double_range_max (value))); return newRV_noinc ((SV *) av); } static void gst2perl_double_range_unwrap (GValue *value, SV *sv) { AV *av; SV **start, **end; if (!gperl_sv_is_array_ref (sv)) croak ("GStreamer::DoubleRange values must be array references"); av = (AV *) SvRV (sv); if (av_len (av) != 1) croak ("GStreamer::DoubleRange values must contain two values: start and end"); start = av_fetch (av, 0, 0); end = av_fetch (av, 1, 0); if (start && gperl_sv_is_defined (*start) && end && gperl_sv_is_defined (*end)) gst_value_set_double_range (value, SvNV (*start), SvNV (*end)); } static void gst2perl_double_range_initialize (void) { gst2perl_double_range_wrapper_class.wrap = gst2perl_double_range_wrap; gst2perl_double_range_wrapper_class.unwrap = gst2perl_double_range_unwrap; gperl_register_fundamental_full (GST_TYPE_DOUBLE_RANGE, "GStreamer::DoubleRange", &gst2perl_double_range_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_int_range_wrapper_class; static SV * gst2perl_int_range_wrap (const GValue *value) { AV *av = newAV (); av_push (av, newSViv (gst_value_get_int_range_min (value))); av_push (av, newSViv (gst_value_get_int_range_max (value))); return newRV_noinc ((SV *) av); } static void gst2perl_int_range_unwrap (GValue *value, SV *sv) { AV *av; SV **start, **end; if (!gperl_sv_is_array_ref (sv)) croak ("GstIntRange must be an array reference"); av = (AV *) SvRV (sv); if (av_len (av) != 1) croak ("GstIntRange must contain two values: start and end"); start = av_fetch (av, 0, 0); end = av_fetch (av, 1, 0); if (start && gperl_sv_is_defined (*start) && end && gperl_sv_is_defined (*end)) gst_value_set_int_range (value, SvIV (*start), SvIV (*end)); } static void gst2perl_int_range_initialize (void) { gst2perl_int_range_wrapper_class.wrap = gst2perl_int_range_wrap; gst2perl_int_range_wrapper_class.unwrap = gst2perl_int_range_unwrap; gperl_register_fundamental_full (GST_TYPE_INT_RANGE, "GStreamer::IntRange", &gst2perl_int_range_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_value_list_wrapper_class; static SV * gst2perl_value_list_wrap (const GValue *value) { AV *av = newAV (); guint size, i; size = gst_value_list_get_size (value); for (i = 0; i < size; i++) { const GValue *list_value = gst_value_list_get_value (value, i); AV *list_av = newAV (); /* FIXME: Can this cause deadlocks? */ av_push (list_av, gperl_sv_from_value (list_value)); av_push (list_av, newSVpv (gperl_package_from_type (G_VALUE_TYPE (list_value)), 0)); av_push (av, newRV_noinc ((SV *) list_av)); } return newRV_noinc ((SV *) av); } static void gst2perl_value_list_unwrap (GValue *value, SV *sv) { AV *av; int i; if (!gperl_sv_is_array_ref (sv)) croak ("GstValueList must be an array reference"); av = (AV *) SvRV (sv); for (i = 0; i <= av_len (av); i++) { SV **list_value, **element, **type; AV *list_av; list_value = av_fetch (av, i, 0); if (!list_value || !gperl_sv_is_array_ref (*list_value)) croak ("GstValueList must contain array references"); list_av = (AV *) SvRV (*list_value); if (av_len (list_av) != 1) croak ("GstValueList must contain array references with two elements: value and type"); element = av_fetch (list_av, 0, 0); type = av_fetch (list_av, 1, 0); if (element && gperl_sv_is_defined (*element) && type && gperl_sv_is_defined (*type)) { GValue new_value = { 0, }; const char *package = SvPV_nolen (*type); GType gtype = gperl_type_from_package (package); if (!type) croak ("unregistered package %s encountered", package); g_value_init (&new_value, gtype); /* FIXME: Can this cause deadlocks? */ gperl_value_from_sv (&new_value, *element); gst_value_list_append_value (value, &new_value); g_value_unset (&new_value); } } } static void gst2perl_value_list_initialize (void) { gst2perl_value_list_wrapper_class.wrap = gst2perl_value_list_wrap; gst2perl_value_list_wrapper_class.unwrap = gst2perl_value_list_unwrap; gperl_register_fundamental_full (GST_TYPE_LIST, "GStreamer::ValueList", &gst2perl_value_list_wrapper_class); } /* ------------------------------------------------------------------------- */ /* This array stuff is a copy of the list stuff. */ static GPerlValueWrapperClass gst2perl_value_array_wrapper_class; static SV * gst2perl_value_array_wrap (const GValue *value) { AV *av = newAV (); guint size, i; size = gst_value_array_get_size (value); for (i = 0; i < size; i++) { const GValue *list_value = gst_value_array_get_value (value, i); AV *list_av = newAV (); /* FIXME: Can this cause deadlocks? */ av_push (list_av, gperl_sv_from_value (list_value)); av_push (list_av, newSVpv (gperl_package_from_type (G_VALUE_TYPE (list_value)), 0)); av_push (av, newRV_noinc ((SV *) list_av)); } return newRV_noinc ((SV *) av); } static void gst2perl_value_array_unwrap (GValue *value, SV *sv) { AV *av; int i; if (!gperl_sv_is_array_ref (sv)) croak ("GstValueArray must be an array reference"); av = (AV *) SvRV (sv); for (i = 0; i <= av_len (av); i++) { SV **list_value, **element, **type; AV *list_av; list_value = av_fetch (av, i, 0); if (!list_value || !gperl_sv_is_array_ref (*list_value)) croak ("GstValueArray must contain array references"); list_av = (AV *) SvRV (*list_value); if (av_len (list_av) != 1) croak ("GstValueArray must contain array references with two elements: value and type"); element = av_fetch (list_av, 0, 0); type = av_fetch (list_av, 1, 0); if (element && gperl_sv_is_defined (*element) && type && gperl_sv_is_defined (*type)) { GValue new_value = { 0, }; const char *package = SvPV_nolen (*type); GType gtype = gperl_type_from_package (package); if (!type) croak ("unregistered package %s encountered", package); g_value_init (&new_value, gtype); /* FIXME: Can this cause deadlocks? */ gperl_value_from_sv (&new_value, *element); gst_value_array_append_value (value, &new_value); g_value_unset (&new_value); } } } static void gst2perl_value_array_initialize (void) { gst2perl_value_array_wrapper_class.wrap = gst2perl_value_array_wrap; gst2perl_value_array_wrapper_class.unwrap = gst2perl_value_array_unwrap; gperl_register_fundamental_full (GST_TYPE_ARRAY, "GStreamer::ValueArray", &gst2perl_value_array_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_fraction_wrapper_class; static SV * gst2perl_fraction_wrap (const GValue *value) { AV *av = newAV (); av_push (av, newSViv (gst_value_get_fraction_numerator (value))); av_push (av, newSViv (gst_value_get_fraction_denominator (value))); return newRV_noinc ((SV *) av); } static void gst2perl_fraction_unwrap (GValue *value, SV *sv) { AV *av; SV **numerator, **denominator; if (!gperl_sv_is_array_ref (sv)) croak ("GstFraction must be an array reference"); av = (AV *) SvRV (sv); if (av_len (av) != 1) croak ("GstFraction must contain two values: numerator and denominator"); numerator = av_fetch (av, 0, 0); denominator = av_fetch (av, 1, 0); if (numerator && gperl_sv_is_defined (*numerator) && denominator && gperl_sv_is_defined (*denominator)) gst_value_set_fraction (value, SvIV (*numerator), SvIV (*denominator)); } static void gst2perl_fraction_initialize (void) { gst2perl_fraction_wrapper_class.wrap = gst2perl_fraction_wrap; gst2perl_fraction_wrapper_class.unwrap = gst2perl_fraction_unwrap; gperl_register_fundamental_full (GST_TYPE_FRACTION, "GStreamer::Fraction", &gst2perl_fraction_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlValueWrapperClass gst2perl_fraction_range_wrapper_class; static SV * gst2perl_fraction_range_wrap (const GValue *value) { AV *av = newAV (); av_push (av, gperl_sv_from_value (gst_value_get_fraction_range_min (value))); av_push (av, gperl_sv_from_value (gst_value_get_fraction_range_max (value))); return newRV_noinc ((SV *) av); } static void gst2perl_fraction_range_unwrap (GValue *value, SV *sv) { AV *av; SV **start, **end; if (!gperl_sv_is_array_ref (sv)) croak ("GstFractionRange must be an array reference"); av = (AV *) SvRV (sv); if (av_len (av) != 1) croak ("GstFractionRange must contain two values: start and end"); start = av_fetch (av, 0, 0); end = av_fetch (av, 1, 0); if (start && gperl_sv_is_defined (*start) && end && gperl_sv_is_defined (*end)) { GValue start_value = { 0, }, end_value = { 0, }; g_value_init (&start_value, GST_TYPE_FRACTION); g_value_init (&end_value, GST_TYPE_FRACTION); /* FIXME: Can this cause deadlocks? */ gperl_value_from_sv (&start_value, *start); gperl_value_from_sv (&end_value, *end); gst_value_set_fraction_range (value, &start_value, &end_value); g_value_unset (&start_value); g_value_unset (&end_value); } } static void gst2perl_fraction_range_initialize (void) { gst2perl_fraction_range_wrapper_class.wrap = gst2perl_fraction_range_wrap; gst2perl_fraction_range_wrapper_class.unwrap = gst2perl_fraction_range_unwrap; gperl_register_fundamental_full (GST_TYPE_FRACTION_RANGE, "GStreamer::FractionRange", &gst2perl_fraction_range_wrapper_class); } /* ------------------------------------------------------------------------- */ static GPerlBoxedWrapperClass gst2perl_date_wrapper_class; static SV * gst2perl_date_wrap (GType gtype, const char *package, GDate *date, gboolean own) { struct tm tm; time_t seconds; g_date_to_struct_tm (date, &tm); if (own) g_date_free (date); seconds = mktime (&tm); return seconds == -1 ? &PL_sv_undef : newSViv (seconds); } static GDate * gst2perl_date_unwrap (GType gtype, const char *package, SV *sv) { GDate *date; time_t seconds; date = g_date_new (); seconds = SvIV (sv); #if GLIB_CHECK_VERSION (2, 10, 0) g_date_set_time_t (date, seconds); #else g_date_set_time (date, (GTime) seconds); #endif return date; } static void gst2perl_date_initialize (void) { GPerlBoxedWrapperClass *default_wrapper_class; default_wrapper_class = gperl_default_boxed_wrapper_class (); gst2perl_date_wrapper_class = *default_wrapper_class; gst2perl_date_wrapper_class.wrap = (GPerlBoxedWrapFunc) gst2perl_date_wrap; gst2perl_date_wrapper_class.unwrap = (GPerlBoxedUnwrapFunc) gst2perl_date_unwrap; gperl_register_boxed (GST_TYPE_DATE, "GStreamer::Date", &gst2perl_date_wrapper_class); } /* ------------------------------------------------------------------------- */ MODULE = GStreamer::Value PACKAGE = GStreamer::Value PREFIX = gst_value_ BOOT: gst2perl_fourcc_initialize (); gst2perl_int_range_initialize (); gst2perl_double_range_initialize (); gst2perl_value_list_initialize (); gst2perl_value_array_initialize (); gst2perl_fraction_initialize (); gst2perl_fraction_range_initialize (); gst2perl_date_initialize (); GStreamer-0.19/t/Gst.t000644 001750 000024 00000002656 11664366505 014777 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 13; # $Id$ use_ok("GStreamer", qw( GST_SECOND GST_MSECOND GST_USECOND GST_NSECOND GST_TIME_FORMAT GST_TIME_ARGS GST_RANK_NONE GST_RANK_MARGINAL GST_RANK_SECONDARY GST_RANK_PRIMARY )); my $number = qr/^\d+$/; my ($x, $y, $z) = GStreamer -> GET_VERSION_INFO(); like($x, $number); like($y, $number); like($z, $number); my ($a, $b, $c, $d) = GStreamer -> version(); like($a, $number); like($b, $number); like($c, $number); like($d, $number); diag 'Testing GStreamer ', $GStreamer::VERSION; diag ' Compiled against libgstreamer ', join '.', GStreamer -> GET_VERSION_INFO(); diag ' Running against libgstreamer ', join '.', GStreamer -> version(); ok(defined GStreamer -> version_string()); ok(GStreamer -> CHECK_VERSION(0, 0, 0)); ok(!GStreamer -> CHECK_VERSION(100, 100, 100)); ok(GStreamer -> init_check()); GStreamer -> init(); # --------------------------------------------------------------------------- # my $element = GStreamer::parse_launch(qq(filesrc location="$0" ! filesink location="$0.bak")); isa_ok($element, "GStreamer::Element"); # Commented since they're too loud. # eval { $element = GStreamer::parse_launch(qq(!!)); }; # isa_ok($@, "GStreamer::ParseError"); # is($@ -> { domain }, "gst_parse_error"); # is($@ -> { value }, "syntax"); # --------------------------------------------------------------------------- # GStreamer -> deinit(); GStreamer-0.19/t/GstBin.t000644 001750 000024 00000002323 11664366505 015417 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 9; # $Id$ use GStreamer -init; my $bin = GStreamer::Bin -> new("urgs"); isa_ok($bin, "GStreamer::Bin"); my $factory = GStreamer::ElementFactory -> find("alsasink"); SKIP: { skip 'failed to create an alsasink factory', 8 unless defined $factory; my $element_one = $factory -> create("sink one"); my $element_two = $factory -> create("sink two"); my $element_three = $factory -> create("sink three"); my $element_four = $factory -> create("sink four"); $bin -> add($element_one); $bin -> add($element_two, $element_three, $element_four); is($bin -> get_by_name("sink one"), $element_one); is($bin -> get_by_name_recurse_up("sink one"), $element_one); is($bin -> get_by_interface("GStreamer::TagSetter"), undef); isa_ok($bin -> iterate_elements(), "GStreamer::Iterator"); isa_ok($bin -> iterate_sorted(), "GStreamer::Iterator"); isa_ok($bin -> iterate_recurse(), "GStreamer::Iterator"); isa_ok($bin -> iterate_sinks(), "GStreamer::Iterator"); isa_ok($bin -> iterate_all_by_interface("GStreamer::TagSetter"), "GStreamer::Iterator"); $bin -> remove($element_four); $bin -> remove($element_three, $element_two, $element_one); } GStreamer-0.19/t/GstBuffer.t000644 001750 000024 00000002115 12104044201 016067 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 16; # $Id$ use GStreamer -init; my $buffer = GStreamer::Buffer -> new(); isa_ok($buffer, "GStreamer::Buffer"); isa_ok($buffer, "GStreamer::MiniObject"); ok (!$buffer -> data_ptr()); $buffer -> set_data("urgs"); ok (defined $buffer -> data_ptr()); $buffer -> stamp(GStreamer::Buffer -> new()); my $caps = GStreamer::Caps::Simple -> new("audio/mpeg", foo => "Glib::String" => "bar"); $buffer -> set_caps($caps); is($buffer -> get_caps(), $caps); isa_ok($buffer -> create_sub(0, 4), "GStreamer::Buffer"); isa_ok($buffer -> merge(GStreamer::Buffer -> new()), "GStreamer::Buffer"); isa_ok($buffer -> span(0, GStreamer::Buffer -> new(), 4), "GStreamer::Buffer"); isa_ok($buffer -> join(GStreamer::Buffer -> new()), "GStreamer::Buffer"); like($buffer -> is_span_fast(GStreamer::Buffer -> new()), qr/^(?:1|)$/); is($buffer -> data(), "urgs"); is($buffer -> size(), 4); ok($buffer -> timestamp() > 0); ok($buffer -> duration() > 0); ok($buffer -> offset() > 0); ok($buffer -> offset_end() > 0); GStreamer-0.19/t/GstBus.t000644 001750 000024 00000001754 11664366505 015447 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use Test::More tests => 14; # $Id$ use GStreamer -init; my $bus = GStreamer::Bus -> new(); isa_ok($bus, "GStreamer::Bus"); my $src = GStreamer::Bin -> new("urgs"); my $message = GStreamer::Message::EOS -> new($src); ok($bus -> post($message)); ok($bus -> have_pending()); isa_ok($bus -> peek(), "GStreamer::Message"); isa_ok($bus -> pop(), "GStreamer::Message"); is($bus -> peek(), undef); is($bus -> pop(), undef); $bus -> set_flushing(FALSE); is($bus -> poll("any", 0), undef); $bus -> add_signal_watch(); $bus -> remove_signal_watch(); my $loop = Glib::MainLoop -> new(); Glib::Idle -> add(sub { $bus -> post($message); $bus -> post($message); FALSE; }); my $id = $bus -> add_watch(sub { my ($bussy, $messy, $data) = @_; my $i = 0 if 0; is($bussy, $bus); isa_ok($messy, "GStreamer::Message::EOS"); is($data, "bla"); $loop -> quit() if $i++; TRUE; }, "bla"); $loop -> run(); Glib::Source -> remove($id); GStreamer-0.19/t/GstCaps.t000644 001750 000024 00000006214 11664366505 015600 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 40; # $Id$ use GStreamer -init; my $caps = GStreamer::Caps::Empty -> new(); isa_ok($caps, "GStreamer::Caps"); ok($caps -> is_empty()); $caps = GStreamer::Caps::Any -> new(); isa_ok($caps, "GStreamer::Caps"); ok($caps -> is_any()); my $structure = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; $caps = GStreamer::Caps::Full -> new($structure); isa_ok($caps, "GStreamer::Caps"); ok($caps -> is_fixed()); ok($caps -> is_equal_fixed($caps)); is($caps -> make_writable(), $caps); $caps -> append($caps); $caps -> append_structure($structure); is($caps -> get_size(), 3); is_deeply($caps -> get_structure(0), $structure); is_deeply($caps -> get_structure(1), $structure); is_deeply($caps -> get_structure(2), $structure); $caps -> truncate(); $caps = GStreamer::Caps::Simple -> new("audio/mpeg", field_one => "Glib::String" => "urgs", field_two => "Glib::Int" => 23); isa_ok($caps, "GStreamer::Caps"); $caps -> set_simple(field_one => "Glib::String" => "urgs", field_two => "Glib::Int" => 23); ok($caps -> is_always_compatible($caps)); isa_ok($caps -> intersect($caps), "GStreamer::Caps"); isa_ok($caps -> union($caps), "GStreamer::Caps"); isa_ok($caps -> normalize(), "GStreamer::Caps"); ok($caps -> is_subset($caps)); ok($caps -> is_equal($caps)); isa_ok($caps -> subtract($caps), "GStreamer::Caps"); ok(!$caps -> do_simplify()); my $string = $caps -> to_string(); ok(defined($string)); isa_ok(GStreamer::Caps -> from_string($string), "GStreamer::Caps"); ############################################################################### my $structure_one = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; my $structure_two = { name => "sgru", fields => [ [field_one => "Glib::String" => "sgru"], [field_two => "Glib::Int" => 32], [field_three => "Glib::Int" => 24] ] }; my $caps_one = GStreamer::Caps::Full -> new($structure_one); my $caps_two = GStreamer::Caps::Full -> new($structure_two); $caps = $caps_one + $caps_two; is_deeply($caps -> get_structure(0), $structure_one); is_deeply($caps -> get_structure(1), $structure_two); $caps += $caps; is_deeply($caps -> get_structure(0), $structure_one); is_deeply($caps -> get_structure(1), $structure_two); is_deeply($caps -> get_structure(2), $structure_one); is_deeply($caps -> get_structure(3), $structure_two); $caps = $caps_two; $caps += $caps_one; is_deeply($caps -> get_structure(0), $structure_two); is_deeply($caps -> get_structure(1), $structure_one); ok($caps >= $caps_one); ok($caps >= $caps_two); ok($caps_one <= $caps); ok($caps_two <= $caps); ok($caps == $caps); $caps -= $caps_one; is_deeply($caps -> get_structure(0), $structure_two); $caps = $caps_one & $caps_one; is_deeply($caps -> get_structure(0), $structure_one); # FIXME: Why are those reversed? $caps = $caps_one | $caps_two; is_deeply($caps -> get_structure(0), $structure_two); is_deeply($caps -> get_structure(1), $structure_one); GStreamer-0.19/t/GstChildProxy.t000644 001750 000024 00000001735 11664366505 017002 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 8; # $Id$ use GStreamer -init; my $bin = GStreamer::Bin -> new("urgs"); isa_ok($bin, "GStreamer::ChildProxy"); my $element = GStreamer::ElementFactory -> make(alsasink => "sink"); SKIP: { skip 'failed to create an alsasinnk', 7 unless defined $element; $bin -> add($element); $bin -> child_added($element); is($bin -> get_children_count(), 1); is($bin -> get_child_by_name("sink"), $element); is($bin -> get_child_by_index(0), $element); is($bin -> get_child_by_name("knis"), undef); is($bin -> get_child_by_index(1), undef); $bin -> set_child_property("sink::device" => "/dev/dsp"); is($bin -> get_child_property("sink::device"), "/dev/dsp"); $bin -> set_child_property("sink::buffer-time" => 23, "sink::latency-time" => 42); is_deeply([$bin -> get_child_property("sink::buffer-time", "sink::latency-time")], [23, 42]); $bin -> remove($element); $bin -> child_removed($element); } GStreamer-0.19/t/GstClock.t000644 001750 000024 00000004605 11664366505 015747 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 20; # $Id$ use Glib qw(TRUE FALSE); use GStreamer qw(-init GST_SECOND); my $element = GStreamer::ElementFactory -> make("pipeline", "src"); SKIP: { skip 'failed to create a pipeline element', 20 unless defined $element; my $clock = $element -> provide_clock(); skip 'failed to find a clock', 20 unless defined $clock; ok(defined $clock -> set_resolution(1000)); ok(defined $clock -> get_resolution()); ok($clock -> get_time() >= 0); $clock -> set_calibration(0, 2, 3, 4); is_deeply([$clock -> get_calibration()], [0, 2, 3, 4]); SKIP: { my $master_element = GStreamer::ElementFactory -> make("alsamixer", "sink"); skip "master clock tests: couldn't find master element", 2 unless defined $master_element; my $master_clock = $master_element -> provide_clock(); skip "master clock tests: couldn't find master clock", 2 unless defined $master_clock; ok($clock -> set_master($master_clock)); is($clock -> get_master(), $master_clock); } my ($result, $r) = $clock -> add_observation(23, 42); ok(defined $result); ok(defined $r); ok($clock -> get_internal_time() >= 0); ok($clock -> adjust_unlocked(23) >= 0); my $id = $clock -> new_single_shot_id($clock -> get_time()); isa_ok($id, "GStreamer::ClockID"); $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND); isa_ok($id, "GStreamer::ClockID"); ok($id -> get_time() > 0); $id -> unschedule(); # wait() { my $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND); my ($return, $jitter) = $id -> wait(); is($return, "ok"); ok($jitter >= 0); } # wait_async SKIP: { skip 'wait_async is broken currently', 5; my $id = $clock -> new_periodic_id($clock -> get_time(), GST_SECOND); my $loop = Glib::MainLoop -> new(); my $been_here = 0; my $status = $id -> wait_async(sub { my ($clock, $time, $id, $data) = @_; return TRUE if $been_here++; isa_ok($clock, "GStreamer::Clock"); ok($time > 0); isa_ok($id, "GStreamer::ClockID"); is($data, "bla"); $loop -> quit(); return TRUE; }, "bla"); is($status, "ok"); # It might happen that the callback has already been invoked. If so, don't # run the main loop or we will cause a dead lock! if (!$been_here) { $loop -> run(); } } } GStreamer-0.19/t/GstElement.t000644 001750 000024 00000010616 11664366505 016304 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 39; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $factory = GStreamer::ElementFactory -> find("queue"); my $element = $factory -> create(undef); isa_ok($element, "GStreamer::Element"); $element = $factory -> create("source"); isa_ok($element, "GStreamer::Element"); my ($tmp_one, $tmp_two) = GStreamer::ElementFactory -> make("alsasink", "tmp one", "alsasink", "tmp two"); SKIP: { skip 'failed to create alsa elements', 37 unless defined $tmp_one && defined $tmp_two; isa_ok($tmp_one, "GStreamer::Element"); isa_ok($tmp_two, "GStreamer::Element"); $element = GStreamer::ElementFactory -> make("alsasrc", "src"); isa_ok($element, "GStreamer::Element"); my @types = $element -> get_query_types(); ok(grep { $_ eq 'seeking' } @types); ok(defined $element -> requires_clock()); ok(defined $element -> provides_clock()); is($element -> get_clock(), undef); my $clock = $element -> provide_clock(); SKIP: { skip "clock test", 1 unless defined $clock; isa_ok($clock, "GStreamer::Clock"); } $element = GStreamer::ElementFactory -> make("alsasink", "sink"); $element -> set_clock($clock); $element -> set_base_time(23); is($element -> get_base_time(), 23); $element -> set_state("ready"); $element -> no_more_pads(); ok(!$element -> is_indexable()); $element -> set_index(GStreamer::Index -> new()); is($element -> get_index(), undef); is($element -> get_bus(), undef); my $pad = GStreamer::Pad -> new("urgs", "src"); ok($element -> add_pad($pad)); is($element -> get_pad("urgs"), $pad); is($element -> get_static_pad("urgs"), $pad); is($element -> get_request_pad("urgs"), undef); my $caps = GStreamer::Caps::Any -> new(); my $compatible_pad = $element -> get_compatible_pad($pad, $caps); SKIP: { skip 'get_compatible_pad returned undef', 1 unless defined $compatible_pad; isa_ok($compatible_pad, "GStreamer::Pad"); } ok($element -> remove_pad($pad)); isa_ok($element -> iterate_pads(), "GStreamer::Iterator"); isa_ok($element -> iterate_src_pads(), "GStreamer::Iterator"); isa_ok($element -> iterate_sink_pads(), "GStreamer::Iterator"); my $element_one = $factory -> create("source one"); my $element_two = $factory -> create("source two"); my $element_three = $factory -> create("source three"); my $element_four = $factory -> create("source four"); my $element_five = $factory -> create("source five"); my $bin = GStreamer::Pipeline -> new("urgs"); $bin -> add($element_one, $element_two, $element_three, $element_four, $element_five); ok($element_one -> link($element_two)); ok($element_two -> link($element_three, $element_four)); ok($element_four -> link_filtered($element_five, $caps)); $element_one -> unlink($element_two); $element_two -> unlink($element_three, $element_four, $element_five); my $pad_one = GStreamer::Pad -> new("urgs", "src"); my $pad_two = GStreamer::Pad -> new("urgs", "sink"); my $pad_three = GStreamer::Pad -> new("urgs", "src"); my $pad_four = GStreamer::Pad -> new("urgs", "sink"); $element_one -> add_pad($pad_one); $element_two -> add_pad($pad_two); $element_three -> add_pad($pad_three); $element_four -> add_pad($pad_four); ok(!$element_one -> link_pads("urgs", $element_two, "urgs")); ok(!$element_three -> link_pads_filtered("urgs", $element_four, "urgs", $caps)); $element_three -> unlink_pads("urgs", $element_four, "urgs"); ok(defined $element -> send_event(GStreamer::Event::EOS -> new())); ok(defined $element -> seek(1.0, "default", [qw(flush accurate)], "cur", 23, "set", 42)); ok(!$element -> query(GStreamer::Query::Duration -> new("time"))); ok(!$element -> post_message(GStreamer::Message::EOS -> new($element))); my $test_tags = { title => ["Urgs"], artist => [qw(Screw You)] }; $element_one -> found_tags($test_tags); $element_one -> found_tags_for_pad($pad_one, $test_tags); ok($element -> set_locked_state(TRUE)); ok($element -> is_locked_state()); ok(!$element -> sync_state_with_parent()); isa_ok($element -> get_factory(), "GStreamer::ElementFactory"); $element -> abort_state(); $element -> lost_state(); is($element -> set_state("null"), "success"); is($element -> continue_state("success"), "success"); is_deeply([$element -> get_state(0)], ["success", "null", "void-pending"]); } GStreamer-0.19/t/GstElementFactory.t000644 001750 000024 00000001566 11664366505 017640 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 12; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $factory = GStreamer::ElementFactory -> find("__nada__"); is($factory, undef); $factory = GStreamer::ElementFactory -> find("queue"); isa_ok($factory, "GStreamer::ElementFactory"); # Can't reliably test this. my $type = $factory -> get_element_type(); ok(defined $factory -> get_longname()); ok(defined $factory -> get_klass()); ok(defined $factory -> get_description()); ok(defined $factory -> get_author()); is($factory -> get_uri_type(), "unknown"); is($factory -> get_uri_protocols(), ()); isa_ok($factory -> create("urgs"), "GStreamer::Element"); isa_ok(GStreamer::ElementFactory -> make(queue => "urgs"), "GStreamer::Element"); my $caps = GStreamer::Caps::Any -> new(); ok($factory -> can_src_caps($caps)); ok($factory -> can_sink_caps($caps)); GStreamer-0.19/t/GstEvent.t000644 001750 000024 00000007042 11664366505 015773 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 53; # $Id$ use GStreamer -init; use Glib qw(TRUE FALSE); my $structure = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; my $event = GStreamer::Event::Custom -> new("seek", $structure); isa_ok($event, "GStreamer::Event::Seek"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is_deeply($event -> get_structure(), $structure); # --------------------------------------------------------------------------- # $event = GStreamer::Event::FlushStart -> new(); isa_ok($event, "GStreamer::Event::FlushStart"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); # --------------------------------------------------------------------------- # $event = GStreamer::Event::FlushStop -> new(); isa_ok($event, "GStreamer::Event::FlushStop"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); # --------------------------------------------------------------------------- # $event = GStreamer::Event::EOS -> new(); isa_ok($event, "GStreamer::Event::EOS"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); # --------------------------------------------------------------------------- # $event = GStreamer::Event::NewSegment -> new(TRUE, 1.0, "time", 1, 2, 3); isa_ok($event, "GStreamer::Event::NewSegment"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); ok($event -> update()); is($event -> rate(), 1.0); is($event -> format(), "time"); is($event -> start_value(), 1); is($event -> stop_value(), 2); is($event -> stream_time(), 3); # --------------------------------------------------------------------------- # my $tag = { title => ["Urgs"], artist => [qw(Screw You)] }; $event = GStreamer::Event::Tag -> new($tag); isa_ok($event, "GStreamer::Event::Tag"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is_deeply($event -> tag(), $tag); # --------------------------------------------------------------------------- # $event = GStreamer::Event::Navigation -> new($structure); isa_ok($event, "GStreamer::Event::Navigation"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is_deeply($event -> get_structure(), $structure); # --------------------------------------------------------------------------- # $event = GStreamer::Event::BufferSize -> new("time", 1, 2, TRUE); isa_ok($event, "GStreamer::Event::BufferSize"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is($event -> format(), "time"); is($event -> minsize(), 1); is($event -> maxsize(), 2); ok($event -> async()); # --------------------------------------------------------------------------- # $event = GStreamer::Event::QOS -> new(1.0, 23, 42); isa_ok($event, "GStreamer::Event::QOS"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is($event -> proportion(), 1.0); is($event -> diff(), 23); is($event -> timestamp(), 42); # --------------------------------------------------------------------------- # $event = GStreamer::Event::Seek -> new(1.0, "time", [qw(flush accurate)], "cur", 23, "set", 42); isa_ok($event, "GStreamer::Event::Seek"); isa_ok($event, "GStreamer::Event"); isa_ok($event, "GStreamer::MiniObject"); is($event -> rate(), 1.0); is($event -> format(), "time"); ok($event -> flags() == [qw(flush accurate)]); is($event -> cur_type(), "cur"); is($event -> cur(), 23); is($event -> stop_type(), "set"); is($event -> stop(), 42); GStreamer-0.19/t/GstFormat.t000644 001750 000024 00000000444 11664366505 016141 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; # $Id$ use GStreamer -init; is(GStreamer::Format::register("urgs", "Urgs!"), "urgs"); is(GStreamer::Format::get_by_nick("bytes"), "bytes"); is_deeply([GStreamer::Format::get_details("urgs")], ["urgs", "urgs", "Urgs!"]); GStreamer-0.19/t/GstGhostPad.t000644 001750 000024 00000001426 11664366505 016423 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 8; # $Id$ use GStreamer -init; my $pad = GStreamer::Pad -> new("urgs", "src"); my $gpad = GStreamer::GhostPad -> new("urgs", $pad); SKIP: { skip 'new() returned undef', 4 unless defined $gpad; isa_ok($gpad, "GStreamer::GhostPad"); is($gpad -> get_target(), $pad); ok($gpad -> set_target($pad)); is($gpad -> get_target(), $pad); } $pad = GStreamer::Pad -> new("urgs", "src"); $gpad = GStreamer::GhostPad -> new(undef, $pad); SKIP: { skip 'new() returned undef', 2 unless defined $gpad; isa_ok($gpad, "GStreamer::GhostPad"); is($gpad -> get_target(), $pad); } $gpad = GStreamer::GhostPad -> new_no_target("urgs", "src"); isa_ok($gpad, "GStreamer::GhostPad"); is($gpad -> get_target(), undef); GStreamer-0.19/t/GstIndex.t000644 001750 000024 00000003245 11664366505 015762 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 15; # $Id$ use GStreamer -init; my $index = GStreamer::Index -> new(); isa_ok($index, "GStreamer::Index"); $index -> commit(23); is($index -> new_group(), 1); ok($index -> set_group(1)); is($index -> get_group(), 1); $index -> set_certainty("fuzzy"); is($index -> get_certainty(), "fuzzy"); $index -> set_filter(sub { warn @_; 1; }, "bla"); my $object = GStreamer::ElementFactory -> make("alsasink", "sink"); SKIP: { skip 'index entry tests: failed to create an alsasink', 10 unless defined $object; # Called by get_writer_id() $index -> set_resolver(sub { my ($index, $element, $data) = @_; isa_ok($index, "GStreamer::Index"); isa_ok($element, "GStreamer::Element"); is($data, "blub"); return "urgs"; }, "blub"); my $id = $index -> get_writer_id($object); skip 'index entry tests: failed to obtain a writer id', 7 unless defined $id; my $entry = $index -> add_format($id, "bytes"); isa_ok($entry, "GStreamer::IndexEntry"); $entry = $index -> add_association($id, "key-unit", bytes => 12, time => 13); isa_ok($entry, "GStreamer::IndexEntry"); is($entry -> assoc_map("bytes"), 12); is($entry -> assoc_map("time"), 13); $entry = $index -> add_object($id, "urgs", $object); TODO: { local $TODO = 'add_object always returns undef'; isa_ok($entry, "GStreamer::IndexEntry"); } $entry = $index -> add_id($id, "sgru"); isa_ok($entry, "GStreamer::IndexEntry"); $entry = $index -> get_assoc_entry($id, "exact", "key-unit", bytes => 12); TODO: { local $TODO = 'get_assoc_entry always returns undef'; isa_ok($entry, "GStreamer::IndexEntry"); } } GStreamer-0.19/t/GstIndexFactory.t000644 001750 000024 00000000642 11664366505 017310 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; # $Id$ use GStreamer -init; my $factory = GStreamer::IndexFactory -> new("urgs", "Urgs!", "GStreamer::Index"); isa_ok($factory, "GStreamer::IndexFactory"); # FIXME # isa_ok($factory -> create(), "GStreamer::Index"); is(GStreamer::IndexFactory -> find("urgs"), undef); is(GStreamer::IndexFactory -> make("urgs"), undef); $factory -> destroy(); GStreamer-0.19/t/GstIterator.t000644 001750 000024 00000002061 11664366505 016477 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 32; # $Id$ use GStreamer -init; my $bin = GStreamer::Bin -> new("urgs"); my $factory = GStreamer::ElementFactory -> find("alsasink"); SKIP: { skip 'failed to create an alsasink factory', 32 unless defined $factory; my $element_one = $factory -> create("sink one"); my $element_two = $factory -> create("sink two"); my $element_three = $factory -> create("sink three"); my $element_four = $factory -> create("sink four"); $bin -> add($element_one, $element_two, $element_three, $element_four); foreach ($bin -> iterate_elements(), $bin -> iterate_sorted(), $bin -> iterate_recurse(), $bin -> iterate_sinks()) { isa_ok($_, "GStreamer::Iterator"); isa_ok($_, "ARRAY"); is($#$_, 3); is($_ -> [0], $element_four); is($_ -> [1], $element_three); is($_ -> [2], $element_two); is($_ -> [3], $element_one); } my $iter = $bin -> iterate_elements(); while ($_ = $iter -> next()) { isa_ok($_, "GStreamer::Element"); } } GStreamer-0.19/t/GstMessage.t000644 001750 000024 00000015550 11664366505 016301 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use Test::More; # $Id$ use GStreamer -init; my $src = GStreamer::ElementFactory -> make(alsasrc => "urgs"); if (not defined $src) { plan skip_all => 'failed to create an alsasrc'; } else { plan tests => 82; } # --------------------------------------------------------------------------- # my $message = GStreamer::Message::EOS -> new($src); isa_ok($message, "GStreamer::Message::EOS"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); ok($message -> type() & "eos"); ok(defined $message -> timestamp()); is($message -> src(), $src); # --------------------------------------------------------------------------- # my $error = Glib::Error::new("Glib::File::Error", "noent", "oops!"); $message = GStreamer::Message::Error -> new($src, $error, "oops!"); isa_ok($message, "GStreamer::Message::Error"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); isa_ok($message -> error(), "Glib::File::Error"); is($message -> error() -> value(), "noent"); is($message -> error() -> message(), "oops!"); is($message -> debug(), "oops!"); # --------------------------------------------------------------------------- # $message = GStreamer::Message::Warning -> new($src, $error, "oops!"); isa_ok($message, "GStreamer::Message::Warning"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); isa_ok($message -> error(), "Glib::File::Error"); is($message -> error() -> value(), "noent"); is($message -> error() -> message(), "oops!"); is($message -> debug(), "oops!"); # --------------------------------------------------------------------------- # my $tags = { title => ["Urgs"], artist => [qw(Screw You)] }; $message = GStreamer::Message::Tag -> new($src, $tags); isa_ok($message, "GStreamer::Message::Tag"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is_deeply($message -> tag_list(), $tags); # --------------------------------------------------------------------------- # $message = GStreamer::Message::StateChanged -> new($src, "null", "ready", "playing"); isa_ok($message, "GStreamer::Message::StateChanged"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> old_state(), "null"); is($message -> new_state(), "ready"); is($message -> pending(), "playing"); # --------------------------------------------------------------------------- # $message = GStreamer::Message::StateDirty -> new($src); isa_ok($message, "GStreamer::Message::StateDirty"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); # --------------------------------------------------------------------------- # my $clock = $src -> provide_clock(); SKIP: { skip "clock tests", 13 unless defined $clock; $message = GStreamer::Message::ClockProvide -> new($src, $clock, TRUE); isa_ok($message, "GStreamer::Message::ClockProvide"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> clock(), $clock); is($message -> ready(), TRUE); $message = GStreamer::Message::ClockLost -> new($src, $clock); isa_ok($message, "GStreamer::Message::ClockLost"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> clock(), $clock); $message = GStreamer::Message::NewClock -> new($src, $clock); isa_ok($message, "GStreamer::Message::NewClock"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> clock(), $clock); } # --------------------------------------------------------------------------- # my $structure = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; $message = GStreamer::Message::Application -> new($src, $structure); isa_ok($message, "GStreamer::Message::Application"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is_deeply($message -> get_structure(), $structure); # --------------------------------------------------------------------------- # $message = GStreamer::Message::Element -> new($src, $structure); isa_ok($message, "GStreamer::Message::Element"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is_deeply($message -> get_structure(), $structure); # --------------------------------------------------------------------------- # $message = GStreamer::Message::SegmentStart -> new($src, "time", 23); isa_ok($message, "GStreamer::Message::SegmentStart"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> format(), "time"); is($message -> position(), 23); # --------------------------------------------------------------------------- # $message = GStreamer::Message::SegmentDone -> new($src, "time", 23); isa_ok($message, "GStreamer::Message::SegmentDone"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> format(), "time"); is($message -> position(), 23); # --------------------------------------------------------------------------- # $message = GStreamer::Message::Duration -> new($src, "time", 23); isa_ok($message, "GStreamer::Message::Duration"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> format(), "time"); is($message -> duration(), 23); # --------------------------------------------------------------------------- # SKIP: { skip 'latency', 3 unless GStreamer -> CHECK_VERSION(0, 10, 12); $message = GStreamer::Message::Latency -> new($src); isa_ok($message, "GStreamer::Message::Latency"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); } # --------------------------------------------------------------------------- # SKIP: { skip 'async start & done', 7 unless GStreamer -> CHECK_VERSION(0, 10, 13); $message = GStreamer::Message::AsyncStart -> new($src, TRUE); isa_ok($message, "GStreamer::Message::AsyncStart"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is($message -> new_base_time, TRUE); $message = GStreamer::Message::AsyncDone -> new($src); isa_ok($message, "GStreamer::Message::AsyncDone"); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); } # --------------------------------------------------------------------------- # $structure = { name => "urgs", fields => [ [format => "GStreamer::Format" => "time"], [position => "Glib::Int" => 42], [duration => "Glib::Int" => 23], [sgru => "Glib::String" => "urgs"] ] }; $message = GStreamer::Message::Custom -> new([qw(segment-done duration)], $src, $structure); isa_ok($message, "GStreamer::Message"); isa_ok($message, "GStreamer::MiniObject"); is_deeply($message -> get_structure(), $structure); GStreamer-0.19/t/GstMiniObject.t000644 001750 000024 00000000423 11664366505 016731 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; # $Id$ use GStreamer -init; my $object = GStreamer::Buffer -> new(); isa_ok($object, "GStreamer::MiniObject"); ok($object -> is_writable()); isa_ok($object -> make_writable(), "GStreamer::MiniObject"); GStreamer-0.19/t/GstObject.t000644 001750 000024 00000001123 11664366505 016112 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 6; # $Id$ use GStreamer -init; my $object = GStreamer::ElementFactory -> make("queue", "source"); isa_ok($object, "GStreamer::Object"); $object -> set_name("urgs"); is($object -> get_name(), "urgs"); $object -> set_name_prefix("urgs"); is($object -> get_name_prefix(), "urgs"); my $parent = GStreamer::ElementFactory -> make("queue", "source"); $object -> set_parent($parent); is($object -> get_parent(), $parent); ok($object -> has_ancestor($parent)); ok(defined($object -> get_path_string())); $object -> unparent(); GStreamer-0.19/t/GstPad.t000644 001750 000024 00000006015 11664366505 015415 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 43; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $caps = GStreamer::Caps::Empty -> new(); my $template = GStreamer::PadTemplate -> new("urgs", "src", "always", $caps); my $pad = GStreamer::Pad -> new("urgs", "src"); isa_ok($pad, "GStreamer::Pad"); $pad = GStreamer::Pad -> new_from_template($template, "urgs"); isa_ok($pad, "GStreamer::Pad"); is($pad -> get_direction(), "src"); $pad -> set_active(TRUE); ok($pad -> is_active()); ok($pad -> activate_push(FALSE)); ok($pad -> activate_pull(FALSE)); ok(!$pad -> set_blocked(FALSE)); ok(!$pad -> is_blocked()); is($pad -> get_pad_template(), $template); my $source = GStreamer::ElementFactory -> make("fakesrc", "source"); my $sink = GStreamer::ElementFactory -> make("fakesink", "sink"); my $source_pad = $source -> get_pad("src"); my $sink_pad = $sink -> get_pad("sink"); ok(!$source_pad -> link($sink_pad)); ok($source_pad -> is_linked()); ok($sink_pad -> is_linked()); is($source_pad -> get_peer(), $sink_pad); is($sink_pad -> get_peer(), $source_pad); $source_pad -> unlink($sink_pad); is($pad -> get_pad_template_caps(), $caps); is($pad -> get_caps(), $caps); my $structure = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; my $fixed_caps = GStreamer::Caps::Full -> new($structure); ok($pad -> set_caps($fixed_caps)); $pad -> fixate_caps($fixed_caps); ok(defined $pad -> accept_caps($fixed_caps)); is($pad -> peer_get_caps(), undef); ok($pad -> peer_accept_caps($caps)); is($source_pad -> get_allowed_caps(), undef); is($source_pad -> get_negotiated_caps(), undef); my $buffer = GStreamer::Buffer -> new(); is($source_pad -> push($buffer), "not-linked"); ok(!$source_pad -> check_pull_range()); is_deeply([$sink_pad -> pull_range(0, 23)], ["not-linked", undef]); my $event = GStreamer::Event::EOS -> new(); ok(!$pad -> push_event($event)); ok(!$pad -> event_default($event)); $sink_pad -> activate_push(TRUE); ok($sink_pad -> chain($buffer)); is_deeply([$source_pad -> get_range(0, 23)], ["wrong-state", undef]); ok($sink_pad -> send_event($event)); SKIP: { skip 'pad tasks don\'t quite work yet', 3; ok($pad -> start_task(sub { ok($pad -> pause_task()); }, 'bla')); ok($pad -> stop_task()); } is($pad -> get_internal_links(), undef); is($pad -> get_internal_links_default(), undef); is($pad -> get_query_types(), undef); is($pad -> get_query_types_default(), undef); my $query = GStreamer::Query::Position -> new("time"); ok(!$pad -> query($query)); ok(!$pad -> query_default($query)); SKIP: { skip 'new 0.10.11 stuff', 1 unless GStreamer->CHECK_VERSION(0, 10, 11); ok(defined $pad -> is_blocking()); } SKIP: { skip 'new 0.10.15 stuff', 1 unless GStreamer->CHECK_VERSION(0, 10, 15); ok(defined $pad -> peer_query($query)); } SKIP: { skip 'new 0.10.21 stuff', 2 unless GStreamer->CHECK_VERSION(0, 10, 21); is($pad -> iterate_internal_links(), undef); is($pad -> iterate_internal_links_default(), undef); } GStreamer-0.19/t/GstPadTemplate.t000644 001750 000024 00000001034 11664366505 017105 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 5; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $caps = GStreamer::Caps::Empty -> new(); my $template = GStreamer::PadTemplate -> new("urgs", "src", "always", $caps); isa_ok($template, "GStreamer::PadTemplate"); is($template -> get_name_template(), "urgs"); is($template -> get_direction(), "src"); is($template -> get_presence(), "always"); is($template -> get_caps(), $caps); my $pad = GStreamer::Pad -> new("urgs", "src"); $template -> pad_created($pad); GStreamer-0.19/t/GstPipeline.t000644 001750 000024 00000000766 11664366505 016465 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 5; # $Id$ use GStreamer -init; my $pipeline = GStreamer::Pipeline -> new("urgs"); isa_ok($pipeline, "GStreamer::Pipeline"); isa_ok($pipeline -> get_bus(), "GStreamer::Bus"); $pipeline -> set_new_stream_time(23); is($pipeline -> get_last_stream_time(), 23); my $clock = $pipeline -> get_clock(); isa_ok($clock, "GStreamer::Clock"); $pipeline -> set_clock($clock); is($pipeline -> get_clock(), $clock); $pipeline -> auto_clock(); GStreamer-0.19/t/GstPlugin.t000644 001750 000024 00000002157 11664366505 016152 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use ExtUtils::PkgConfig; use File::Spec; use Test::More tests => 13; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $plugin = GStreamer::Plugin::load_by_name("alsa"); SKIP: { skip 'failed to load alsa plugin', 13 unless defined $plugin; isa_ok($plugin, "GStreamer::Plugin"); is($plugin -> get_name(), "alsa"); ok(defined $plugin -> get_description()); ok(defined $plugin -> get_filename()); ok(defined $plugin -> get_version()); ok(defined $plugin -> get_license()); ok(defined $plugin -> get_source()); ok(defined $plugin -> get_package()); ok(defined $plugin -> get_origin()); ok($plugin -> is_loaded()); ok($plugin -> name_filter("alsa")); SKIP: { my $dir = ExtUtils::PkgConfig -> variable("gstreamer-0.10", "pluginsdir"); my $so = File::Spec -> catfile($dir, "libgstalsa.so"); skip "alsa plugin tests", 1 unless (-f $so && -r $so); $plugin = GStreamer::Plugin::load_file($so); isa_ok($plugin, "GStreamer::Plugin"); } $plugin = GStreamer::Plugin::load_by_name("alsa"); isa_ok($plugin, "GStreamer::Plugin"); } GStreamer-0.19/t/GstPluginFeature.t000644 001750 000024 00000001034 11664366505 017457 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 5; # $Id$ use GStreamer -init; my $feature = GStreamer::ElementFactory -> find("alsasink"); SKIP: { skip 'failed to load alsasink', 5 unless defined $feature; isa_ok($feature, "GStreamer::PluginFeature"); isa_ok($feature = $feature -> load(), "GStreamer::PluginFeature"); $feature -> set_rank(23); is($feature -> get_rank(), 23); $feature -> set_name("alsasink"); is($feature -> get_name(), "alsasink"); ok($feature -> check_version(0, 0, 0)); } GStreamer-0.19/t/GstQuery.t000644 001750 000024 00000004260 11664366505 016016 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 22; # $Id$ use GStreamer -init; is(GStreamer::QueryType::register("urgs", "Urgs!"), "urgs"); is(GStreamer::QueryType::get_by_nick("segment"), "segment"); is_deeply([GStreamer::QueryType::get_details("urgs")], ["urgs", "urgs", "Urgs!"]); # is_deeply((GStreamer::QueryType::get_definitions())[-1], ["urgs", "urgs", "Urgs!"]); # --------------------------------------------------------------------------- # my $query = GStreamer::Query::Position -> new("time"); isa_ok($query, "GStreamer::Query::Position"); isa_ok($query, "GStreamer::Query"); isa_ok($query, "GStreamer::MiniObject"); $query -> position("time", 23); is_deeply([$query -> position()], ["time", 23]); # --------------------------------------------------------------------------- # $query = GStreamer::Query::Duration -> new("time"); isa_ok($query, "GStreamer::Query::Duration"); isa_ok($query, "GStreamer::Query"); isa_ok($query, "GStreamer::MiniObject"); $query -> duration("time", 23); is_deeply([$query -> duration()], ["time", 23]); # --------------------------------------------------------------------------- # $query = GStreamer::Query::Convert -> new("time", 23, "buffers"); isa_ok($query, "GStreamer::Query::Convert"); isa_ok($query, "GStreamer::Query"); isa_ok($query, "GStreamer::MiniObject"); $query -> convert("time", 23, "buffers", 42); is_deeply([$query -> convert()], ["time", 23, "buffers", 42]); # --------------------------------------------------------------------------- # $query = GStreamer::Query::Segment -> new("time"); isa_ok($query, "GStreamer::Query::Segment"); isa_ok($query, "GStreamer::Query"); isa_ok($query, "GStreamer::MiniObject"); $query -> segment(1.0, "time", 23, 42); is_deeply([$query -> segment()], [1.0, "time", 23, 42]); # --------------------------------------------------------------------------- # my $structure = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; $query = GStreamer::Query::Application -> new("urgs", $structure); isa_ok($query, "GStreamer::Query"); isa_ok($query, "GStreamer::MiniObject"); is_deeply($query -> get_structure(), $structure); GStreamer-0.19/t/GstRegistry.t000644 001750 000024 00000004112 11737751721 016514 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 21; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $registry = GStreamer::Registry -> get_default(); isa_ok($registry, "GStreamer::Registry"); $registry -> scan_path("~/.gstreamer-0.10"); is_deeply([$registry -> get_path_list()], []); isa_ok(($registry -> get_plugin_list())[0], "GStreamer::Plugin"); sub plugin_filter { my ($plugin, $data) = @_; isa_ok($plugin, "GStreamer::Plugin"); is($data, "bla"); return TRUE; } my @plugins = $registry -> plugin_filter(\&plugin_filter, TRUE, "bla"); is($#plugins, 0); isa_ok($plugins[0], "GStreamer::Plugin"); sub feature_filter { my ($feature, $data) = @_; isa_ok($feature, "GStreamer::PluginFeature"); is($data, "bla"); return TRUE; } my @features = $registry -> feature_filter(\&feature_filter, TRUE, "bla"); is($#features, 0); isa_ok($features[0], "GStreamer::PluginFeature"); isa_ok(($registry -> get_feature_list("GStreamer::ElementFactory"))[0], "GStreamer::PluginFeature"); my $plugin_feature = ($registry -> get_feature_list_by_plugin("alsa"))[0]; SKIP: { skip 'no alsa plugin found', 1 unless defined $plugin_feature; isa_ok($plugin_feature, "GStreamer::PluginFeature"); } SKIP: { my $plugin = $registry -> find_plugin("volume"); skip 'could not find "volume" plugin', 2 unless defined $plugin; isa_ok($plugin, "GStreamer::Plugin"); isa_ok($registry -> find_feature("volume", "GStreamer::ElementFactory"), "GStreamer::PluginFeature"); } is($registry -> lookup("..."), undef); is($registry -> lookup_feature("..."), undef); # These can fail, so just test for definedness. ok(defined $registry -> xml_write_cache("tmp")); ok(defined $registry -> xml_read_cache("tmp")); unlink "tmp"; my $plugin = GStreamer::Plugin::load_by_name("alsa"); SKIP: { skip 'failed to load alsa plugin', 2 unless defined $plugin; ok($registry -> add_plugin($plugin)); my $feature = GStreamer::ElementFactory -> find("alsasink"); ok($registry -> add_feature($feature)); $registry -> remove_feature($feature); $registry -> remove_plugin($plugin); } GStreamer-0.19/t/GstStructure.t000644 001750 000024 00000002432 11664366505 016710 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 9; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $structure_one = { name => "urgs", fields => [ [field_one => "Glib::String" => "urgs"], [field_two => "Glib::Int" => 23] ] }; my $structure_two = { name => "sgru", fields => [ [field_one => "Glib::String" => "sgru"], [field_two => "Glib::Int" => 42] ] }; my $caps = GStreamer::Caps::Full -> new($structure_one); isa_ok($caps, "GStreamer::Caps"); $caps -> append_structure($structure_two); is($caps -> get_size(), 2); is_deeply($caps -> get_structure(0), $structure_one); is_deeply($caps -> get_structure(1), $structure_two); my $string_one = GStreamer::Structure::to_string($structure_one); my $string_two = GStreamer::Structure::to_string($structure_two); # remove trailing semicolon that start to appear sometime in the past $string_one =~ s/;\Z//; $string_two =~ s/;\Z//; is($string_one, "urgs, field_one=(string)urgs, field_two=(int)23"); is($string_two, "sgru, field_one=(string)sgru, field_two=(int)42"); is_deeply(GStreamer::Structure::from_string($string_one), $structure_one); is_deeply(GStreamer::Structure::from_string($string_two), $structure_two); is_deeply((GStreamer::Structure::from_string($string_one))[0], $structure_one); GStreamer-0.19/t/GstSystemClock.t000644 001750 000024 00000000342 11664366505 017146 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 2; # $Id$ use GStreamer -init; my $clock = GStreamer::SystemClock -> obtain(); isa_ok($clock, "GStreamer::SystemClock"); isa_ok($clock, "GStreamer::Clock"); GStreamer-0.19/t/GstTag.t000644 001750 000024 00000000655 11664366505 015430 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 6; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; ok(GStreamer::Tag::exists("artist")); is(GStreamer::Tag::get_type("artist"), "Glib::String"); ok(defined GStreamer::Tag::get_nick("artist")); ok(defined GStreamer::Tag::get_description("artist")); isa_ok(GStreamer::Tag::get_flag("artist"), "GStreamer::TagFlag"); ok(!GStreamer::Tag::is_fixed("artist")); GStreamer-0.19/t/GstTagSetter.t000644 001750 000024 00000001404 11664366505 016610 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $tagger = GStreamer::ElementFactory -> make(vorbisenc => "tagger"); SKIP: { skip "tagger tests -- vorbisenc not found", 3 unless defined $tagger; isa_ok($tagger, "GStreamer::TagSetter"); my $tags = { title => ["Urgs"], artist => [qw(Screw You)] }; $tagger -> merge_tags($tags, "replace"); $tagger -> add_tags("append", title => "Urgs 2", artist => "Screw You"); is_deeply($tagger -> get_tag_list(), { title => ["Urgs", "Urgs 2"], artist => ["Screw", "You", "Screw You"] }); $tagger -> set_tag_merge_mode("replace-all"); is($tagger -> get_tag_merge_mode(), "replace-all"); } GStreamer-0.19/t/GstTypeFindFactory.t000644 001750 000024 00000001072 11737751721 017760 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 2; # $Id$ use GStreamer -init; SKIP: { my $factory = (GStreamer::TypeFindFactory -> get_list())[0]; skip 'could not find a "type find factory"', 2 unless defined $factory; isa_ok($factory, "GStreamer::TypeFindFactory"); # Can't rely on this returning something != NULL my @extensions = $factory -> get_extensions(); # This might be undef, too my $caps = $factory -> get_caps(); skip 'get_caps() returned undef', 1 unless defined $caps; isa_ok($caps, "GStreamer::Caps"); } GStreamer-0.19/t/GstValue.t000644 001750 000024 00000004155 11664366505 015770 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 4; # $Id$ use Glib qw(TRUE FALSE); use GStreamer -init; my $structure = { name => "urgs", fields => [ [fourcc => "GStreamer::Fourcc" => "MJPG"], [int_range => "GStreamer::IntRange" => [23, 42]], [double_range => "GStreamer::DoubleRange" => [23, 42]], [value_list_int => "GStreamer::ValueList" => [[23, "Glib::Int"], [42, "Glib::Int"]]], [value_list_int_range => "GStreamer::ValueList" => [[[23, 42], "GStreamer::IntRange"]]], [value_array_int => "GStreamer::ValueArray" => [[23, "Glib::Int"], [42, "Glib::Int"]]], [value_array_int_range => "GStreamer::ValueArray" => [[[23, 42], "GStreamer::IntRange"]]], [fraction => "GStreamer::Fraction" => [23, 42]], [fraction_range => "GStreamer::FractionRange" => [[23, 42], [42, 23]]], ] }; my $string = GStreamer::Structure::to_string($structure); # remove trailing semicolon that started to appear sometime in the past $string =~ s/;\Z//; my $exptected_string = "urgs, " . "fourcc=(fourcc)MJPG, " . "int_range=(int)[ 23, 42 ], " . "double_range=(double)[ 23, 42 ], " . "value_list_int=(int){ 23, 42 }, " . "value_list_int_range=(int){ [ 23, 42 ] }, " . "value_array_int=(int)< 23, 42 >, " . "value_array_int_range=(int)< [ 23, 42 ] >, " . "fraction=(fraction)23/42, " . "fraction_range=(fraction)[ 23/42, 42/23 ]"; is($string, $exptected_string); is_deeply(GStreamer::Structure::from_string($string), $structure); # The date handling changed slightly, so we test it separately. { # Use UTC to make sure the timestamp means the same everywhere. Hopefully, # this works on most systems. $ENV{TZ} = "UTC"; my $time = 999993600; # 2001-09-09, 00:00 my $structure = { name => "urgs", fields => [ [date => "GStreamer::Date" => $time] ] }; my $string = GStreamer::Structure::to_string($structure); $string =~ s/;\Z//; like($string, qr/date=\(GstDate|date\)2001-09-09/); is_deeply(GStreamer::Structure::from_string($string), $structure); } GStreamer-0.19/lib/GStreamer.pm000644 001750 000024 00000013613 12221735050 016563 0ustar00brianstaff000000 000000 package GStreamer; # $Id$ use 5.008; use strict; use warnings; use Glib; require Exporter; require DynaLoader; our @ISA = qw(Exporter DynaLoader); our @EXPORT_OK = qw( GST_SECOND GST_MSECOND GST_USECOND GST_NSECOND GST_TIME_FORMAT GST_TIME_ARGS GST_RANK_NONE GST_RANK_MARGINAL GST_RANK_SECONDARY GST_RANK_PRIMARY ); # --------------------------------------------------------------------------- # our $VERSION = '0.19'; sub import { my ($self) = @_; my @symbols = (); foreach (@_) { if (/^-?init$/) { $self -> init(); } else { push @symbols, $_; } } GStreamer -> export_to_level(1, @symbols); } sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } GStreamer -> bootstrap($VERSION); # --------------------------------------------------------------------------- # use constant GST_SECOND => 1_000_000 * 1_000; use constant GST_MSECOND => GST_SECOND / 1_000; use constant GST_USECOND => GST_SECOND / 1_000_000; use constant GST_NSECOND => GST_SECOND / 1_000_000_000; use constant GST_TIME_FORMAT => "u:%02u:%02u.%09u"; sub GST_TIME_ARGS { my ($t) = @_; return ( ($t / (GST_SECOND * 60 * 60)), ($t / (GST_SECOND * 60)) % 60, ($t / GST_SECOND) % 60, ($t % GST_SECOND) ); } use constant GST_RANK_NONE => 0; use constant GST_RANK_MARGINAL => 64; use constant GST_RANK_SECONDARY => 128; use constant GST_RANK_PRIMARY => 256; # --------------------------------------------------------------------------- # package GStreamer::Caps; use overload '+' => \&__append, '-' => \&__subtract, '&' => \&__intersect, '|' => \&__union, '<=' => \&__is_subset, '>=' => \&__is_superset, '==' => \&__is_equal, '""' => \&__to_string, fallback => 1; sub __append { my ($a, $b, $swap) = @_; my $tmp = GStreamer::Caps::Empty -> new(); unless ($swap) { $tmp -> append($a); $tmp -> append($b); } else { $tmp -> append($b); $tmp -> append($a); } return $tmp; } sub __subtract { my ($a, $b, $swap) = @_; return $swap ? $b -> subtract($a) : $a -> subtract($b); } sub __intersect { my ($a, $b, $swap) = @_; return $swap ? $b -> intersect($a) : $a -> intersect($b); } sub __union { my ($a, $b, $swap) = @_; return $swap ? $b -> union($a) : $a -> union($b); } sub __is_subset { my ($a, $b, $swap) = @_; return $swap ? $b -> is_subset($a) : $a -> is_subset($b); } sub __is_superset { my ($a, $b, $swap) = @_; return $swap ? $a -> is_subset($b) : $b -> is_subset($a); } sub __is_equal { my ($a, $b, $swap) = @_; return $swap ? $b -> is_equal($a) : $a -> is_equal($b); } sub __to_string { my ($a) = @_; return $a -> to_string(); } # --------------------------------------------------------------------------- # package GStreamer; 1; __END__ =head1 NAME GStreamer - Perl interface to the GStreamer library =head1 SYNOPSIS use GStreamer -init; my $loop = Glib::MainLoop -> new(); # set up my $play = GStreamer::ElementFactory -> make("playbin", "play"); $play -> set(uri => Glib::filename_to_uri $file, "localhost"); $play -> get_bus() -> add_watch(\&my_bus_callback, $loop); $play -> set_state("playing"); # run $loop -> run(); # clean up $play -> set_state("null"); sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } =head1 ABSTRACT GStreamer makes everybody dance like crazy. It provides the means to play, stream, and convert nearly any type of media -- be it audio or video. GStreamer wraps the GStreamer library in a nice and Perlish way, freeing the programmer from any memory management and object casting hassles. =head1 INITIALIZATION =over =item Binit> Initializes GStreamer. Automatically parses I<@ARGV>, stripping any options known to GStreamer. =item Binit_check> Checks if initialization is possible. Returns TRUE if so. =back When importing GStreamer, you can pass the C<-init> option to have Iinit> automatically called for you. If you need to know if initialization is possible without actually doing it, use Iinit_check>. =head1 VERSION CHECKING =over =item BCHECK_VERSION (major, minor, micro)> =over =item * major (integer) =item * minor (integer) =item * micro (integer) =back Returns TRUE if the GStreamer library version GStreamer was compiled against is newer than the one specified by the three arguments. =item B<(major, minor, micro) = GStreamer-EGET_VERSION_INFO> Returns the version information of the GStreamer library GStreamer was compiled against. =item B<(major, minor, micro) = GStreamer-Eversion> Returns the version information of the GStreamer library GStreamer is currently running against. =back =head1 SEE ALSO =over =item L Lists the automatically generated API documentation pages. =item L GStreamer's website has much useful information, including a good tutorial and of course the API reference, which is canonical for GStreamer as well. =item L Just like Gtk2, GStreamer tries to stick closely to the C API, deviating from it only when it makes things easier and/or more Perlish. L gives general rules for how to map from the C API to Perl, most of which also apply to GStreamer. =item L Glib is the foundation this binding is built upon. If you look for information on basic stuff like signals or object properties, this is what you should read. =back =head1 AUTHORS =over =item Torsten Schoenfeld Ekaffeetisch at gmx dot deE =item Brett Kosinski Ebrettk at frodo.dyn.gno dot orgE =back =head1 COPYRIGHT Copyright (C) 2005-2011, 2013 by the gtk2-perl team =cut GStreamer-0.19/examples/manual/000755 001750 000024 00000000000 12221737451 016664 5ustar00brianstaff000000 000000 GStreamer-0.19/examples/player.pl000644 001750 000024 00000002077 11664366505 017256 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer -init; sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "tag") { my $tags = $message -> tag_list; foreach (qw(artist title album track-number)) { if (exists $tags -> { $_ }) { printf " %12s: %s\n", ucfirst GStreamer::Tag::get_nick($_), $tags -> { $_ } -> [0]; } } } elsif ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } foreach my $file (@ARGV) { my $loop = Glib::MainLoop -> new(undef, FALSE); my $player = GStreamer::ElementFactory -> make(playbin => "player"); $player -> set(uri => Glib::filename_to_uri $file, "localhost"); $player -> get_bus() -> add_watch(\&my_bus_callback, $loop); print "Playing: $file\n"; $player -> set_state("playing") or die "Could not start playing"; $loop -> run(); $player -> set_state("null"); } GStreamer-0.19/examples/queue.pl000644 001750 000024 00000003113 11664366505 017076 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer; # This is a Perl port of the queue example found in gstreamer-0.9.6. # This example uses the queue element to create a buffer between 2 elements. # The scheduler automatically uses 2 threads, 1 to feed and another to consume # data from the queue buffer # Event loop to listen to events posted on the GstBus from the pipeline. Exits # on EOS or ERROR events sub event_loop { my ($pipe) = @_; my $bus = $pipe -> get_bus(); while (TRUE) { my $message = $bus -> poll("any", -1); if ($message -> type & "eos") { return; } elsif ($message -> type & "warning" or $message -> type & "error") { die $message -> error; } } } GStreamer -> init(); if ($#ARGV != 0) { printf "usage: %s \n", $0; exit -1; } # create a new pipeline to hold the elements my $pipeline = GStreamer::Pipeline -> new("pipeline"); # create a disk reader my $filesrc = GStreamer::ElementFactory -> make(filesrc => "disk_source"); $filesrc -> set(location => Glib::filename_to_unicode $ARGV[0]); my $decode = GStreamer::ElementFactory -> make(mad => "decode"); my $queue = GStreamer::ElementFactory -> make(queue => "queue"); # and an audio sink my $audiosink = GStreamer::ElementFactory -> make(alsasink => "play_audio"); # add objects to the main pipeline $pipeline -> add($filesrc, $decode, $queue, $audiosink); $filesrc -> link($decode, $queue, $audiosink); # start playing $pipeline -> set_state("playing"); # Listen for EOS event_loop($pipeline); $pipeline -> set_state("null"); GStreamer-0.19/examples/read-metadata.pl000644 001750 000024 00000006700 11722734576 020452 0ustar00brianstaff000000 000000 #!/usr/bin/perl # This is a Perl port of an example found in the gstreamer-0.9.6 tarball. # Original and current copyright: # GStreamer # Copyright (C) 2003 Thomas Vander Stichele # 2003 Benjamin Otte # 2005 Andy Wingo # 2005 Jan Schmidt # # gst-metadata.c: Use GStreamer to display metadata within files. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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 use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer qw(GST_MSECOND); my ($filename, $pipeline, $source); sub message_loop { my ($element) = @_; my $tags = {}; my $done = FALSE; my $bus = $element -> get_bus(); return undef unless defined $bus; return undef unless defined $tags; while (!$done) { my $message = $bus -> poll("any", 0); unless (defined $message) { # All messages read, we're done last; } if ($message -> type & "eos") { # End of stream, no tags found yet -> return undef return undef; } if ($message -> type & "error") { # decodebin complains about not having an element attached to its output. # Sometimes this happens even before the "tag" message, so just continue. next; } elsif ($message -> type & "tag") { my $new_tags = $message -> tag_list(); foreach (keys %$new_tags) { unless (exists $tags -> { $_ }) { $tags -> { $_ } = $new_tags -> { $_ }; } } } } return $tags; } sub make_pipeline { my $decodebin; $pipeline = GStreamer::Pipeline -> new(undef); ($source, $decodebin) = GStreamer::ElementFactory -> make(filesrc => "source", decodebin => "decodebin"); $pipeline -> add($source, $decodebin); $source -> link($decodebin); } sub print_tag { my ($list, $tag) = @_; foreach (@{$list -> { $tag }}) { if (defined $_) { printf " %15s: %s\n", ucfirst $tag, $_; } } } GStreamer -> init(); if ($#ARGV < 0) { print "Please give filenames to read metadata from\n"; exit 1; } make_pipeline(); foreach (@ARGV) { $filename = $_; $source -> set(location => Glib::filename_to_unicode $filename); # Decodebin will only commit to PAUSED if it actually finds a type; # otherwise the state change fails my $sret = $pipeline -> set_state("paused"); if ("async" eq $sret) { ($sret, undef, undef) = $pipeline -> get_state(500 * GST_MSECOND); } if ("success" ne $sret) { printf "%s - Could not read file\n", $filename; next; } my $tags = message_loop($pipeline); unless (defined $tags) { printf "No metadata found for %s\n", Glib::filename_display_name $_; } map { print_tag($tags, $_) } keys %$tags; $pipeline -> set_state("null"); } GStreamer-0.19/examples/tagger.pl000644 001750 000024 00000034546 11664366505 017241 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer -init; use Gtk2 -init; use Gtk2::GladeXML; $/ = undef; my $xml = Gtk2::GladeXML -> new_from_buffer(); $xml -> signal_autoconnect_from_package("main"); sub my_bus_callback { my ($bus, $message, $loop) = @_; my $done = FALSE; if ($message -> type & "tag") { my $tags = $message -> tag_list; foreach (qw(artist title album)) { if (exists $tags -> { $_ }) { $xml -> get_widget("entry_$_") -> set_text($tags -> { $_ } -> [0]); $done = TRUE; } } } elsif ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } $loop -> quit() if $done; # remove message from the queue return TRUE; } sub on_delete_event { Gtk2 -> main_quit(); } sub on_selection_changed { my ($chooser) = @_; my $file = $chooser -> get_filename(); return unless $file; my $pipeline = GStreamer::Pipeline -> new("pipe"); my ($source, $decoder) = GStreamer::ElementFactory -> make(filesrc => "source", decodebin => "decoder"); $pipeline -> add($source, $decoder); $source -> link($decoder); my $loop = Glib::MainLoop -> new(undef, FALSE); $source -> set(location => Glib::filename_to_unicode $file); $pipeline -> get_bus() -> add_watch(\&my_bus_callback, $loop); $pipeline -> set_state("playing") or die "Could not start playing"; $loop -> run(); $pipeline -> set_state("null"); } sub on_save_clicked { my $chooser = $xml -> get_widget("chooser"); warn "Saving doesn't work yet"; return; my $file = $chooser -> get_filename(); my $pipeline = GStreamer::Pipeline -> new("pipeline"); my ($source, $tagger, $sink) = GStreamer::ElementFactory -> make(filesrc => "src", id3mux => "tagger", filesink => "sink"); my $backup = $file . ".bak"; rename $file, $backup; $source -> set(location => Glib::filename_to_unicode $backup); $sink -> set(location => Glib::filename_to_unicode $file); $tagger -> set_tag_merge_mode("keep"); foreach my $tag (qw(artist title album)) { my $value = $xml -> get_widget("entry_$tag") -> get_text(); $tagger -> add_tags("replace", $tag => $value); } $source -> link($tagger, $sink) or die "Could not link"; $pipeline -> add($source, $tagger, $sink); $pipeline -> set_state("playing") or die "Could not start playing"; while ($pipeline -> iterate()) { } $pipeline -> set_state("null"); } Gtk2 -> main(); __DATA__ True Tag Writer GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True 5 True False 0 True Select a File GTK_FILE_CHOOSER_ACTION_OPEN True False -1 0 False True True 5 True True True 3 2 False 0 0 True Artist: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 1 0 1 fill True Title: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 1 1 2 fill True Album: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 1 2 3 fill True True True True 0 True * False 1 2 0 1 True True True True 0 True * False 1 2 1 2 True True True True 0 True * False 1 2 2 3 0 True True True 5 True True True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-save 4 0.5 0.5 0 0 0 False False True Save True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 True True 0 False False GStreamer-0.19/examples/manual/bin.pl000644 001750 000024 00000000643 11664366505 020004 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # create my $pipeline = GStreamer::Pipeline -> new("my_pipeline"); my $bin = GStreamer::Pipeline -> new("my_bin"); my ($source, $sink) = GStreamer::ElementFactory -> make(fakesrc => "source", fakesink => "sink"); # set up pipeline $bin -> add($source, $sink); $pipeline -> add($bin); $source -> link($sink); GStreamer-0.19/examples/manual/bus.pl000644 001750 000024 00000001302 11664366505 020016 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer; sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } # init GStreamer -> init(); # create pipeline, add handler my $pipeline = GStreamer::Pipeline -> new("my_pipeline"); my $loop = Glib::MainLoop -> new(undef, FALSE); $pipeline -> get_bus() -> add_watch(\&my_bus_callback, $loop); # in the mainloop, all messages posted to the bus by the pipeline # will automatically be sent to our callback. $loop -> run(); GStreamer-0.19/examples/manual/decodebin.pl000644 001750 000024 00000003446 11664366505 021154 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE filename_to_unicode); use GStreamer; # $Id$ sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } my ($pipeline, $audio); sub cb_newpad { my ($decodebin, $pad, $last, $data) = @_; my $audiopad = $audio -> get_pad("sink"); # only link audio; only link once return if ($audiopad -> is_linked()); # check media type my $caps = $pad -> get_caps(); my $str = $caps -> get_structure(0); return if (index($str -> { name }, "audio") == -1); # link'n'play $pad -> link($audiopad); } GStreamer -> init(); my $loop = Glib::MainLoop -> new(undef, FALSE); # make sure we have input unless ($#ARGV == 0) { print "Usage: $0 \n"; exit -1; } # setup $pipeline = GStreamer::Pipeline -> new("pipeline"); $pipeline -> get_bus() -> add_watch(\&my_bus_callback, $loop); $audio = GStreamer::Bin -> new("audiobin"); my ($src, $dec, $conv, $sink) = GStreamer::ElementFactory -> make(filesrc => "source", decodebin => "decoder", audioconvert => "aconv", alsasink => "sink"); my $audiopad = $conv -> get_pad("sink"); $src -> set(location => filename_to_unicode $ARGV[0]); $dec -> signal_connect(new_decoded_pad => \&cb_newpad); $audio -> add($conv, $sink); $conv -> link($sink); $pipeline -> add($src, $dec); $src -> link($dec); $audio -> add_pad(GStreamer::GhostPad -> new("sink", $audiopad)); $pipeline -> add($audio); # run $pipeline -> set_state("playing"); $loop -> run(); # cleanup $pipeline -> set_state("null"); GStreamer-0.19/examples/manual/dynamic.pl000644 001750 000024 00000013363 11664366505 020663 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE filename_to_unicode); use GStreamer qw(-init GST_RANK_MARGINAL); # $Id$ my ($pipeline, @factories); # This function is called by the registry loader. Its return value # (TRUE or FALSE) decides whether the given feature will be included # in the list that we're generating further down. sub cb_feature_filter { my ($feature, $data) = @_; # we only care about element factories return FALSE unless ($feature -> isa("GStreamer::ElementFactory")); # only parsers, demuxers and decoders my $klass = $feature -> get_klass(); return FALSE if (index($klass, "Demux") == -1 && index($klass, "Decoder") == -1 && index($klass, "Parse") == -1); # only select elements with autoplugging rank my $rank = $feature -> get_rank(); return FALSE if ($rank < GST_RANK_MARGINAL); return TRUE; } # This function is called to sort features by rank. sub cb_compare_ranks { return $b -> get_rank() - $a -> get_rank(); } sub init_factories { # first filter out the interesting element factories @factories = GStreamer::RegistryPool -> feature_filter( \&cb_feature_filter, FALSE); # sort them according to their ranks @factories = sort cb_compare_ranks @factories; } my ($converter, $scale, $audiosink); sub cb_newpad { my ($element, $pad, $data) = @_; try_to_plug($pad, $pad -> get_caps()); } sub close_link { my ($srcpad, $sinkelement, $padname, @templlist) = @_; my $has_dynamic_pads = FALSE; printf "Plugging pad %s:%s to newly created %s:%s\n", $srcpad -> get_parent() -> get_name(), $srcpad -> get_name(), $sinkelement -> get_name(), $padname; # add the element to the pipeline and set correct state $sinkelement -> set_state("paused"); $pipeline -> add($sinkelement); $srcpad -> link($sinkelement -> get_pad($padname)); $pipeline -> sync_children_state(); # if we have static source pads, link those. If we have dynamic # source pads, listen for new-pad signals on the element foreach my $templ (@templlist) { my $direction = $templ -> get_direction(); my $presence = $templ -> get_presence(); # only sourcepads, no request pads next if ($direction ne "src" || $presence eq "request"); if ($presence eq "always") { my $pad = $sinkelement -> get_pad($templ -> get_name_template()); my $caps = $pad -> get_caps(); # link try_to_plug($pad, $caps); } elsif ($presence eq "sometimes") { $has_dynamic_pads = TRUE; } } # listen for newly created pads if this element supports that if ($has_dynamic_pads) { $sinkelement -> signal_connect(new_pad => \&cb_newpad); } } sub try_to_plug { my ($pad, $caps) = @_; my $parent = $pad -> get_parent(); # don't plug if we're already plugged if ($audiosink -> get_pad("sink") -> is_linked()) { printf "Omitting link for pad %s:%s because we're already linked\n", $parent -> get_name(), $pad -> get_name(); return; } # as said above, we only try to plug audio... Omit video my $mime = $caps -> get_structure(0) -> { name }; if (index($mime, "video") > -1) { printf "Omitting link for pad %s:%s because mimetype %s is non-audio\n", $parent -> get_name(), $pad -> get_name(), $mime; return; } # can it link to the audiopad? my $audiocaps = $audiosink -> get_pad("sink") -> get_caps(); my $res = $caps -> intersect($audiocaps); if ($res && !$res -> is_empty()) { print "Found pad to link to audiosink - plugging is now done\n"; close_link($pad, $converter, "sink", ()); close_link($converter -> get_pad("src"), $scale, "sink", ()); close_link($scale -> get_pad("src"), $audiosink, "sink", ()); return; } # try to plug from our list foreach my $factory (@factories) { foreach my $templ ($factory -> get_pad_templates()) { # find the sink template - need an always pad next if ($templ -> get_direction() ne "sink" || $templ -> get_presence() ne "always"); # can it link? my $res = $caps -> intersect($templ -> get_caps()); if ($res && !$res -> is_empty()) { # close link and return my $element = $factory -> create(undef); close_link($pad, $element, $templ -> get_name_template(), $factory -> get_pad_templates()); return; } # we only check one sink template per factory, so move on to the # next factory now last; } } # if we get here, no item was found printf "No compatible pad found to decode %s on %s:%s\n", $mime, $parent -> get_name(), $pad -> get_name(); } sub cb_typefound { my ($typefind, $probability, $caps, $data) = @_; printf "Detected media type %s\n", $caps -> to_string(); # actually plug now try_to_plug($typefind -> get_pad("src"), $caps); } sub cb_error { my ($pipeline, $source, $error, $debug, $data) = @_; printf "Error: %s\n", $error -> message(); } # init ourselves init_factories(); # args unless ($#ARGV == 0) { print "Usage: $0 \n"; exit -1; } # pipeline $pipeline = GStreamer::parse_launch( sprintf qq(filesrc location="%s" ! typefind name=tf), filename_to_unicode $ARGV[0]); $pipeline -> signal_connect(error => \&cb_error); my $typefind = $pipeline -> get_by_name("tf"); $typefind -> signal_connect(have_type => \&cb_typefound); ($converter, $scale, $audiosink) = GStreamer::ElementFactory -> make(audioconvert => "audio-converter", audioscale => "audio-scale", alsasink => "audiosink"); $audiosink -> set_state("paused"); $pipeline -> set_state("playing"); # run while ($pipeline -> iterate()) { } # exit $pipeline -> set_state("null"); GStreamer-0.19/examples/manual/elementcreate.pl000644 001750 000024 00000000614 11664366505 022047 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # create element, method #2 my $factory = GStreamer::ElementFactory -> find("fakesrc"); unless ($factory) { print "Failed to find factory of type 'fakesrc'\n"; exit -1; } my $element = $factory -> create("source"); unless ($element) { print "Failed to create element, even though its factory exists!\n"; exit -1; } GStreamer-0.19/examples/manual/elementfactory.pl000644 001750 000024 00000000733 11664366505 022255 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # get factory my $factory = GStreamer::ElementFactory -> find("audiotestsrc"); unless ($factory) { print "You don't have the 'audiotestsrc' element installed, go get it!\n"; exit -1; } # display information printf "The '%s' element is a member of the category %s.\n" . "Description: %s\n", $factory -> get_name(), $factory -> get_klass(), $factory -> get_description(); GStreamer-0.19/examples/manual/elementget.pl000644 001750 000024 00000000334 11664366505 021362 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ my $element = GStreamer::ElementFactory -> make("fakesrc", "source"); printf "The name of the element is '%s'.\n", $element -> get("name"); GStreamer-0.19/examples/manual/elementlink.pl000644 001750 000024 00000000516 11664366505 021542 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # create elements my ($source, $filter, $sink) = GStreamer::ElementFactory -> make(fakesrc => "source", identity => "filter", fakesink => "sink"); # link $source -> link($filter, $sink); GStreamer-0.19/examples/manual/elementmake.pl000644 001750 000024 00000000370 11664366505 021520 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # create element my $element = GStreamer::ElementFactory -> make("fakesrc", "source"); unless ($element) { print "Failed to create element of type 'fakesrc'\n"; exit -1; } GStreamer-0.19/examples/manual/fakesrc.pl000644 001750 000024 00000003131 11664366505 020645 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE); use GStreamer; # $Id$ sub cb_handoff { my ($fakesrc, $buffer, $pad, $user_data) = @_; my $white = FALSE if (0); # this makes the image black/white $buffer -> set_data($white ? 0xff x $buffer -> size() : 0x0 x $buffer -> size()); $white = !$white; } GStreamer -> init(); my $loop = Glib::MainLoop -> new(undef, FALSE); # setup pipeline my $pipeline = GStreamer::Pipeline -> new("pipeline"); my ($fakesrc, $flt, $conv, $videosink) = GStreamer::ElementFactory -> make(fakesrc => "source", capsfilter => "flt", ffmpegcolorspace => "conv", ximagesink => "videosink"); # setup $flt -> set(caps => GStreamer::Caps::Simple -> new( "video/x-raw-rgb", width => "Glib::Int" => 384, height => "Glib::Int" => 288, framerate => "Glib::Double" => 1.0, bpp => "Glib::Int" => 16, depth => "Glib::Int" => 16, endianness => "Glib::Int" => 1234)); $pipeline -> add($fakesrc, $flt, $conv, $videosink); $fakesrc -> link($flt, $conv, $videosink); # setup fake source $fakesrc -> set(signal_handoffs => TRUE, sizemax => 384 * 288 * 2, sizetype => "fixed"); $fakesrc -> signal_connect(handoff => \&cb_handoff); # play $pipeline -> set_state("playing"); $loop -> run(); # clean up $pipeline -> set_state("null"); GStreamer-0.19/examples/manual/ghostpad.pl000644 001750 000024 00000000523 11664366505 021042 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ # create element, add to bin, add ghostpad my $sink = GStreamer::ElementFactory -> make("fakesink", "sink"); my $bin = GStreamer::Bin -> new("mybin"); $bin -> add($sink); my $pad = $sink -> get_pad("sink"); $bin -> add_pad(GStreamer::GhostPad -> new("sink", $pad)); GStreamer-0.19/examples/manual/helloworld.pl000644 001750 000024 00000004151 11664366505 021405 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE filename_to_unicode); use GStreamer; # $Id$ # Global objects are usually a bad thing. For the purpose of this # example, we will use them, however. my ($pipeline, $source, $parser, $decoder, $conv, $sink); sub bus_call { my ($bus, $message, $loop) = @_; if ($message -> type & "eos") { print "End of stream\n"; $loop -> quit(); } elsif ($message -> type & "error") { warn $message -> error; $loop -> quit(); } # remove message from the queue return TRUE; } sub new_pad { my ($element, $pad, $data) = @_; # We can now link this pad with the audio decoder. print "Dynamic pad created, linking parser/decoder\n"; $pad -> link($decoder -> get_pad("sink")); } GStreamer -> init(); my $loop = Glib::MainLoop -> new(undef, FALSE); # check input arguments if ($#ARGV != 0) { print "Usage: $0 \n"; exit -1; } # create elements $pipeline = GStreamer::Pipeline -> new("audio-player"); ($source, $parser, $decoder, $conv, $sink) = GStreamer::ElementFactory -> make(filesrc => "file-source", oggdemux => "ogg-parser", vorbisdec => "vorbis-decoder", audioconvert => "audio-converter", alsasink => "alsa-output"); # set filename property on the file source. Also add a message handler. $source -> set(location => filename_to_unicode $ARGV[0]); $pipeline -> get_bus() -> add_watch(\&bus_call, $loop); # put all elements in a bin $pipeline -> add($source, $parser, $decoder, $conv, $sink); # link together - note that we cannot link the parser and # decoder yet, becuse the parser uses dynamic pads. For that, # we set a pad-added signal handler. $source -> link($parser); $decoder -> link($conv, $sink); $parser -> signal_connect(pad_added => \&new_pad); # Now set to playing and iterate. print "Setting to PLAYING\n"; $pipeline -> set_state("playing"); print "Running\n"; $loop -> run(); # clean up nicely print "Returned, stopping playback\n"; $pipeline -> set_state("null"); GStreamer-0.19/examples/manual/init.pl000644 001750 000024 00000000333 11664366505 020173 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use GStreamer -init; # $Id$ my ($major, $minor, $micro) = GStreamer -> version(); printf "This program is linked against GStreamer %d.%d.%d\n", $major, $minor, $micro; GStreamer-0.19/examples/manual/pad.pl000644 001750 000024 00000001676 11664366505 020007 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(filename_to_unicode TRUE FALSE); use GStreamer -init; # $Id$ sub cb_new_pad { my ($element, $pad, $data) = @_; printf "A new pad %s was created\n", $pad -> get_name(); # here, you would setup a new pad link for the newly created pad } # create elements my $pipeline = GStreamer::Pipeline -> new("my_pipeline"); my ($source, $demux) = GStreamer::ElementFactory -> make(filesrc => "source", oggdemux => "demuxer"); $source -> set("location", filename_to_unicode $ARGV[0]); # you would normally check that the elements were created properly # put together a pipeline $pipeline -> add($source, $demux); $source -> link_pads("src", $demux, "sink"); # listen for newly created pads $demux -> signal_connect(pad_added => \&cb_new_pad); # start the pipeline $pipeline -> set_state("playing"); my $loop = Glib::MainLoop -> new(undef, FALSE); $loop -> run(); GStreamer-0.19/examples/manual/playbin.pl000644 001750 000024 00000001467 11664366505 020677 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE filename_to_unicode); use GStreamer; # $Id$ sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } GStreamer -> init(); my $loop = Glib::MainLoop -> new(undef, FALSE); # make sure we have a URI unless ($#ARGV == 0) { print "Usage: $0 \n"; exit -1; } # set up my $play = GStreamer::ElementFactory -> make("playbin", "play"); $play -> set(uri => filename_to_unicode $ARGV[0]); $play -> get_bus() -> add_watch(\&my_bus_callback, $loop); $play -> set_state("playing"); # now run $loop -> run(); # also clean up $play -> set_state("null"); GStreamer-0.19/examples/manual/query.pl000644 001750 000024 00000003471 11664366505 020403 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(filename_to_unicode TRUE FALSE); use GStreamer qw(GST_SECOND GST_TIME_FORMAT GST_TIME_ARGS); # $Id$ # Turn off perl's output buffering. $|++; sub my_bus_message_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } } sub cb_print_position { my ($pipeline) = @_; my $pos_query = GStreamer::Query::Position -> new("time"); my $dur_query = GStreamer::Query::Duration -> new("time"); if ($pipeline -> query($pos_query) && $pipeline -> query($dur_query)) { printf "Time: %" . GST_TIME_FORMAT . " / %" . GST_TIME_FORMAT . "\r", GST_TIME_ARGS(($pos_query -> position)[1]), GST_TIME_ARGS(($dur_query -> duration)[1]); } # call me again return TRUE; } GStreamer -> init(); # args if ($#ARGV != 0) { print "Usage: $0 \n"; exit -1; } my $loop = Glib::MainLoop -> new(undef, FALSE); my $file = filename_to_unicode $ARGV[0]; # build pipeline, the easy way my $pipeline; eval { $pipeline = GStreamer::parse_launch( "filesrc location=\"$file\" ! " . "oggdemux ! " . "vorbisdec ! " . "audioconvert ! " . "audioresample ! " . "alsasink"); }; if ($@) { warn "Cannot build pipeline: ", $@; exit -1; } my $bus = $pipeline -> get_bus(); $bus -> add_signal_watch(); $bus -> signal_connect(message => \&my_bus_message_callback, $loop); # play my $ret = $pipeline -> set_state("playing"); if ($ret eq "failure") { die "Failed to set pipeline to PLAYING.\n"; } # run pipeline Glib::Timeout -> add(200, \&cb_print_position, $pipeline); $loop -> run(); # clean up $pipeline -> set_state("null"); GStreamer-0.19/examples/manual/typefind.pl000644 001750 000024 00000003235 11664366505 021056 0ustar00brianstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Glib qw(TRUE FALSE filename_to_unicode); use GStreamer; # $Id$ sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return TRUE; } sub idle_exit_loop { my ($loop) = @_; $loop -> quit(); # once return FALSE; } sub cb_typefound { my ($typefind, $probability, $caps, $loop) = @_; my $type = $caps -> to_string(); print "Media type $type found, probability $probability%\n"; # since we connect to a signal in the pipeline thread context, we need # to set an idle handler to exit the main loop in the mainloop context. # Normally, your app should not need to worry about such things. Glib::Idle -> add(\&idle_exit_loop, $loop); } GStreamer -> init(); my $loop = Glib::MainLoop -> new(undef, FALSE); # check args unless ($#ARGV == 0) { print "Usage: $0 \n"; exit -1; } # create a new pipeline to hold the elements my $pipeline = GStreamer::Pipeline -> new("pipe"); $pipeline -> get_bus() -> add_watch(\&my_bus_callback, $loop); # create file source and typefind element my ($filesrc, $typefind) = GStreamer::ElementFactory -> make(filesrc => "source", typefind => "typefinder"); $filesrc -> set(location => filename_to_unicode $ARGV[0]); $typefind -> signal_connect(have_type => \&cb_typefound, $loop); # setup $pipeline -> add($filesrc, $typefind); $filesrc -> link($typefind); $pipeline -> set_state("playing"); $loop -> run(); # unset $pipeline -> set_state("null");