5 # Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
7 # ------------------------------------------------------------------------------
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 # ------------------------------------------------------------------------------
25 # Please feel free to send questions, suggestions or improvements to:
40 my $class = ref($proto) || $proto;
43 verify (%options, qw/ -from / ) if $SDL::DEBUG;
46 if ( $options{-from} ) {
47 croak "SDL::MPEG::new -from requires a SDL::Video object\n"
48 unless $options{-from}->isa('SDL::Video');
50 $self = \SDL::SMPEGGetInfo(${$options{-from}});
52 $self = \SDL::NewSMPEGInfo();
59 SDL::FreeSMPEGInfo(${$_[0]});
63 SDL::SMPEGInfoHasAudio(${$_[0]});
67 SDL::SMPEGInfoHasVideo(${$_[0]});
71 SDL::SMPEGInfoWidth(${$_[0]});
75 SDL::SMPEGInfoHeight(${$_[0]});
79 SDL::SMPEGInfoTotalSize(${$_[0]});
83 SDL::SMPEGInfoCurrentOffset(${$_[0]});
87 SDL::SMPEGInfoCurrentFrame(${$_[0]});
91 SDL::SMPEGInfoCurrentFPS(${$_[0]});
95 SDL::SMPEGInfoCurrentTime(${$_[0]});
99 SDL::SMPEGInfoTotalTime(${$_[0]});
111 SDL::MPEG - a SDL perl extension
115 $info = new SDL::MPEG -from => $mpeg;
119 C<SDL::MPEG> provides an interface to quering the status
128 C<SDL::MPEG::has_audio> returns true if it has audio track
132 C<SDL::MPEG::has_video> returns true if it has a video track
136 C<SDL::MPEG::width> returns the width of the video in pixels
140 C<SDL::MPEG::height> returns the height of the video in pixels
144 C<SDL::MPEG::size> returns the total size of the clip in bytes
148 C<SDL::MPEG::offset> returns the offset into the clip in bytes
152 C<SDL::MPEG::frame> returns the offset into the clip in fames
156 C<SDL::MPEG::fps> returns the play rate in frames per second
160 C<SDL::MPEG::time> returns the current play time in seconds
164 C<SDL::MPEG::length> returns the total play time in seconds
174 perl(1) SDL::Video(3)