This is an automated email from the git hooks/post-receive script. sunweaver pushed a commit to branch master in repository libgstreamer1-perl.
commit d57c52b330a36d251a50f4ced4418f73e049a138 Author: Mike Gabriel <mike.gabr...@das-netzwerkteam.de> Date: Fri Apr 21 13:41:58 2017 +0000 Import original source of GStreamer1 0.003 --- CHANGELOG | 16 ++++ MANIFEST | 14 ++++ META.json | 45 +++++++++++ Makefile.PL | 60 ++++++++++++++ dist.ini | 32 ++++++++ examples/hello.pl | 24 ++++++ examples/rpi_pic.pl | 80 ++++++++++++++++++ examples/symdump.pl | 10 +++ lib/GStreamer1.pm | 184 ++++++++++++++++++++++++++++++++++++++++++ lib/GStreamer1/Caps/Simple.pm | 52 ++++++++++++ t/001_load.t | 27 +++++++ t/002_pod.t | 2 + t/010_caps_simple.t | 38 +++++++++ 13 files changed, 584 insertions(+) diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..d4c9749 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,16 @@ +Revision history for perl module CHANGELOG + +0.003 2014-11-27 + +- Specify libgstreamer >= 1.0.0 as a requirement +- Add repository URL +- Build META.json + +0.002 2014-11-22 + +- Don't include sintel trailer in dist +- Cleanup POD typos + +0.001 2014-11-21 + +- Initial release diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..f78ff70 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,14 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.019. +CHANGELOG +MANIFEST +META.json +Makefile.PL +dist.ini +examples/hello.pl +examples/rpi_pic.pl +examples/symdump.pl +lib/GStreamer1.pm +lib/GStreamer1/Caps/Simple.pm +t/001_load.t +t/002_pod.t +t/010_caps_simple.t diff --git a/META.json b/META.json new file mode 100644 index 0000000..3ae27de --- /dev/null +++ b/META.json @@ -0,0 +1,45 @@ +{ + "abstract" : "Bindings for GStreamer 1.0, the open source multimedia framework", + "author" : [ + "Timm Murray <tmur...@wumpus-cave.net>" + ], + "dynamic_config" : 0, + "generated_by" : "Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.140640", + "license" : [ + "bsd" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "GStreamer1", + "prereqs" : { + "configure" : { + "requires" : { + "Devel::CheckLib" : "0.9", + "ExtUtils::MakeMaker" : "6.30" + } + }, + "runtime" : { + "requires" : { + "Glib::Object::Introspection" : "0.009" + } + }, + "test" : { + "requires" : { + "Test::Pod" : "0" + } + } + }, + "release_status" : "stable", + "resources" : { + "homepage" : "http://www.wumpus-cave.net", + "repository" : { + "type" : "git", + "url" : "https://github.com/frezik/GStreamer1.git", + "web" : "https://github.com/frezik/GStreamer1" + } + }, + "version" : "0.003" +} + diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..1f1694a --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,60 @@ + +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.019. +use strict; +use warnings; + +# inserted by Dist::Zilla::Plugin::CheckLib 0.006 +use Devel::CheckLib; +check_lib_or_exit( + lib => 'gstreamer-1.0', +); + + + +use ExtUtils::MakeMaker 6.30; + + + +my %WriteMakefileArgs = ( + "ABSTRACT" => "Bindings for GStreamer 1.0, the open source multimedia framework", + "AUTHOR" => "Timm Murray <tmurray\@wumpus-cave.net>", + "CONFIGURE_REQUIRES" => { + "Devel::CheckLib" => "0.9", + "ExtUtils::MakeMaker" => "6.30" + }, + "DISTNAME" => "GStreamer1", + "EXE_FILES" => [], + "LICENSE" => "bsd", + "NAME" => "GStreamer1", + "PREREQ_PM" => { + "Glib::Object::Introspection" => "0.009" + }, + "TEST_REQUIRES" => { + "Test::Pod" => 0 + }, + "VERSION" => "0.003", + "test" => { + "TESTS" => "t/*.t" + } +); + + +my %FallbackPrereqs = ( + "Glib::Object::Introspection" => "0.009", + "Test::Pod" => 0 +); + + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + delete $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{BUILD_REQUIRES}; + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; +} + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; + +WriteMakefile(%WriteMakefileArgs); + + + diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..1641ebf --- /dev/null +++ b/dist.ini @@ -0,0 +1,32 @@ +name = GStreamer1 +author = Timm Murray <tmur...@wumpus-cave.net> +license = BSD +copyright_holder = Timm Murray + +version = 0.003 +[PkgVersion] + +[GatherDir] +[Manifest] +[MakeMaker] + +[CheckLib] +lib = gstreamer-1.0 + +[Prereqs] +Glib::Object::Introspection = 0.009 + +[Prereqs / TestRequires] +Test::Pod = 0 + +[MetaResources] +homepage = http://www.wumpus-cave.net +repository.web = https://github.com/frezik/GStreamer1 +repository.url = https://github.com/frezik/GStreamer1.git +repository.type = git + +[MetaJSON] + +[TestRelease] +[ConfirmRelease] +[UploadToCPAN] diff --git a/examples/hello.pl b/examples/hello.pl new file mode 100644 index 0000000..1482343 --- /dev/null +++ b/examples/hello.pl @@ -0,0 +1,24 @@ +#!perl +use v5.12; +use warnings; +use GStreamer1; + +# This is based on the GStreamer Hello, World! tutorial at: +# +# http://docs.gstreamer.com/pages/viewpage.action?pageId=327735 +# +# You can download 'sintel_trailer-480p.webm' from there +# + +my $URI = shift || die "Need URI to play\n"; + +GStreamer1::init([ $0, @ARGV ]); +my $pipeline = GStreamer1::parse_launch( "playbin uri=$URI" ); + +$pipeline->set_state( "playing" ); + +my $bus = $pipeline->get_bus; +my $msg = $bus->timed_pop_filtered( GStreamer1::CLOCK_TIME_NONE, + [ 'error', 'eos' ]); + +$pipeline->set_state( "null" ); diff --git a/examples/rpi_pic.pl b/examples/rpi_pic.pl new file mode 100644 index 0000000..31f7c26 --- /dev/null +++ b/examples/rpi_pic.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl +use v5.12; +use warnings; +use GStreamer1; +use Glib qw( TRUE FALSE ); + +# Get a jpeg image from the Raspberry Pi camera. This requires the rpicamsrc +# gst plugin, which you can download and compile from: +# +# https://github.com/thaytan/gst-rpicamsrc +# +# Duplicates this command line: +# +# gst-launch-1.0 rpicamsrc ! h264parse ! 'video/x-h264,width=800,height=600' \ +# ! avdec_h264 ! jpegenc quality=50 ! filesink location=output.jpg +# +# Except that we use an appsink to get the jpeg and then save it. +# + +my $OUT_FILE = shift || die "Need file to save to\n"; + + +sub dump_to_file +{ + my ($output_file, $jpeg_data) = @_; + my @jpeg_bytes = @$jpeg_data; + say "Got jpeg, saving " . scalar(@jpeg_bytes) . " bytes . . . "; + + open( my $fh, '>', $output_file ) or die "Can't open '$output_file': $!\n"; + binmode $fh; + print $fh pack( 'C*', @jpeg_bytes ); + close $fh; + + say "Saved jpeg to $output_file (size: " . (-s $output_file) . ")"; + return 1; +} + + +GStreamer1::init([ $0, @ARGV ]); +my $loop = Glib::MainLoop->new( undef, FALSE ); +my $pipeline = GStreamer1::Pipeline->new( 'pipeline' ); + +my $rpi = GStreamer1::ElementFactory::make( rpicamsrc => 'and_who' ); +my $h264parse = GStreamer1::ElementFactory::make( h264parse => 'are_you' ); +my $capsfilter = GStreamer1::ElementFactory::make( + capsfilter => 'the_proud_lord_said' ); +my $avdec_h264 = GStreamer1::ElementFactory::make( + avdec_h264 => 'that_i_should_bow_so_low' ); +my $jpegenc = GStreamer1::ElementFactory::make( jpegenc => 'only_a_cat' ); +my $appsink = GStreamer1::ElementFactory::make( + appsink => 'of_a_different_coat' ); + +my $caps = GStreamer1::Caps::Simple->new( 'video/x-h264', + width => 'Glib::Int' => 800, + height => 'Glib::Int' => 600, +); +$capsfilter->set( caps => $caps ); + +$appsink->set( 'max-buffers' => 20 ); +$appsink->set( 'emit-signals' => TRUE ); +$appsink->set( 'sync' => FALSE ); + + +my @link = ( $rpi, $h264parse, $capsfilter, $avdec_h264, $jpegenc, $appsink ); +$pipeline->add( $_ ) for @link; +foreach my $i (0 .. $#link) { + last if ! exists $link[$i+1]; + my $this = $link[$i]; + my $next = $link[$i+1]; + $this->link( $next ); +} + +$pipeline->set_state( "playing" ); +my $jpeg_sample = $appsink->pull_sample; +$pipeline->set_state( "null" ); + +my $jpeg_buf = $jpeg_sample->get_buffer; +my $size = $jpeg_buf->get_size; +my $buf = $jpeg_buf->extract_dup( 0, $size, undef, $size ); +dump_to_file( $OUT_FILE, $buf ); diff --git a/examples/symdump.pl b/examples/symdump.pl new file mode 100644 index 0000000..764fb12 --- /dev/null +++ b/examples/symdump.pl @@ -0,0 +1,10 @@ +#!perl +use v5.12; +use warnings; +use GStreamer1; +use Devel::Symdump; + +# Dump out everything under the GStreamer1:: namespace recursively + +my $dump = Devel::Symdump->rnew( 'GStreamer1' ); +say $_ for sort $dump->functions; diff --git a/lib/GStreamer1.pm b/lib/GStreamer1.pm new file mode 100644 index 0000000..a531c66 --- /dev/null +++ b/lib/GStreamer1.pm @@ -0,0 +1,184 @@ +# Copyright (c) 2014 Timm Murray +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +package GStreamer1; +$GStreamer1::VERSION = '0.003'; +use v5.12; +use warnings; +use Glib::Object::Introspection; + +# ABSTRACT: Bindings for GStreamer 1.0, the open source multimedia framework + +BEGIN { + foreach my $name ('', ( + #'Allocators', + 'App', + #'Audio', + 'Base', + #'Check', + 'Controller', + #'Fft', + #'InsertBin', + #'Mpegts', + #'Net', + #'Pbutils', + #'Riff', + #'Rtp', + #'Rtsp', + #'Sdp', + #'Tag', + #'Video', + )) { + my $basename = 'Gst' . $name; + my $pkg = $name + ? 'GStreamer1::' . $name + : 'GStreamer1'; + Glib::Object::Introspection->setup( + basename => $basename, + version => '1.0', + package => $pkg, + ); + } +} + +use GStreamer1::Caps::Simple; + +1; +__END__ + + +=encoding utf8 + +=head1 NAME + + GStreamer1 - Bindings for GStreamer 1.0, the open source multimedia framework + +=head1 SYNOPSIS + + use GStreamer1; + + GStreamer1::init([ $0, @ARGV ]); + my $pipeline = GStreamer1::parse_launch( "playbin uri=$URI" ); + + $pipeline->set_state( "playing" ); + + my $bus = $pipeline->get_bus; + my $msg = $bus->timed_pop_filtered( GStreamer1::CLOCK_TIME_NONE, + [ 'error', 'eos' ]); + + $pipeline->set_state( "null" ); + +=head1 DESCRIPTION + +GStreamer1 implements a framework that allows for processing and encoding of +multimedia sources in a manner similar to a shell pipeline. + +Because it's introspection-based, most of the classes follow directly from the +C API. Therefore, most of the documentation is by example rather than +a full breakdown of the class structure. + +=head1 PORTING FROM GStreamer + +If you're porting from the original GStreamer module, here are some things +to keep in mind. + +=head2 ElementFactory + +The original GStreamer had a version of C<< ElementFactory->make() >> which +could be called with a list of gst plugins and associated names. GStreamer1 +may add a similar method in the future. For now, the bindings directly follow +from the C interface, so they take only one at a time. + +Example: + + my $rpi = GStreamer1::ElementFactory::make( rpicamsrc => 'and_who' ); + my $h264parse = GStreamer1::ElementFactory::make( h264parse => 'are_you' ); + my $capsfilter = GStreamer1::ElementFactory::make( + capsfilter => 'the_proud_lord_said' ); + my $avdec_h264 = GStreamer1::ElementFactory::make( + avdec_h264 => 'that_i_should_bow_so_low' ); + my $jpegenc = GStreamer1::ElementFactory::make( jpegenc => 'only_a_cat' ); + my $fakesink = GStreamer1::ElementFactory::make( + fakesink => 'of_a_different_coat' ); + +=head2 Adding/linking + +The original GStreamer added methods for C<< Pipeline->add() >> and +C<< Element->link() >> that could take lists of objects. GStreamer1 may add +similar methods in the future. For now, the bindings directly follow from the +C interface, so they take only one object at a time. + +Example: + + my @link = ( $rpi, $h264parse, $capsfilter, $avdec_h264, $jpegenc, $fakesink ); + $pipeline->add( $_ ) for @link; + foreach my $i (0 .. $#link) { + last if ! exists $link[$i+1]; + my $this = $link[$i]; + my $next = $link[$i+1]; + $this->link( $next ); + } + +=head1 EXAMPLES + +See the C<examples/> directory in the distribution. + +=head1 SEE ALSO + +L<GStreamer> - Perl bindings to the old 0.10 version of GStreamer + +L<http://gstreamer.freedesktop.org/> + +=head1 SPECIAL THANKS + +To Torsten Schönfeld for pointing me in the right direction on creating +this module. + +=head1 LICENSE + +Copyright (c) 2014 Timm Murray +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + +=cut diff --git a/lib/GStreamer1/Caps/Simple.pm b/lib/GStreamer1/Caps/Simple.pm new file mode 100644 index 0000000..074e1d5 --- /dev/null +++ b/lib/GStreamer1/Caps/Simple.pm @@ -0,0 +1,52 @@ +# Copyright (c) 2014 Timm Murray +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +package GStreamer1::Caps::Simple; +$GStreamer1::Caps::Simple::VERSION = '0.003'; +use v5.12; +use warnings; + + +sub new +{ + my ($class, $media_type, @args) = @_; + my $self = GStreamer1::Caps->new_empty_simple( $media_type ); + + while( scalar(@args) >= 3 ) { + my $name = shift @args; + my $type = shift @args; + my $value = shift @args; + + my $glib_type_value = Glib::Object::Introspection::GValueWrapper->new( + $type => $value, + ); + $self->set_value( $name => $glib_type_value ); + } + + return $self; +} + + +1; +__END__ + diff --git a/t/001_load.t b/t/001_load.t new file mode 100644 index 0000000..9fb0c3f --- /dev/null +++ b/t/001_load.t @@ -0,0 +1,27 @@ +# Copyright (c) 2014 Timm Murray +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +use Test::More tests => 2; +use v5.12; +use_ok( 'GStreamer1' ); +use_ok( 'GStreamer1::Caps::Simple' ); diff --git a/t/002_pod.t b/t/002_pod.t new file mode 100644 index 0000000..6829ff0 --- /dev/null +++ b/t/002_pod.t @@ -0,0 +1,2 @@ +use Test::Pod; +all_pod_files_ok( all_pod_files( 'lib' ) ); diff --git a/t/010_caps_simple.t b/t/010_caps_simple.t new file mode 100644 index 0000000..e349637 --- /dev/null +++ b/t/010_caps_simple.t @@ -0,0 +1,38 @@ +# Copyright (c) 2014 Timm Murray +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +use Test::More tests => 3; +use v5.14; +use GStreamer1; # This should load GStreamer1::Caps::Simple on its own +GStreamer1::init([ $0, @ARGV ]); + + +my $caps = GStreamer1::Caps::Simple->new( 'video/x-h264', + width => 'Glib::Int' => 800, + height => 'Glib::Int' => 600, +); +isa_ok( $caps => 'GStreamer1::Caps' ); + +my $struct = $caps->get_structure( 0 ); +cmp_ok( $struct->get_value( 'width' ), '==', 800, "Width set" ); +cmp_ok( $struct->get_value( 'height' ), '==', 600, "Height set" ); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libgstreamer1-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits