4 # A package for manipulating MPEG video
6 # Copyright (C) 2004 David J. Goehrig
15 my $class = ref($proto) || $proto;
18 verify (%options, qw/ -from / ) if $SDL::DEBUG;
21 if ( $options{-from} ) {
22 die "SDL::MPEG::new -from requires a SDL::Video object\n"
23 unless $options{-from}->isa('SDL::Video');
25 $self = \SDL::SMPEGGetInfo(${$options{-from}});
27 $self = \SDL::NewSMPEGInfo();
34 SDL::FreeSMPEGInfo(${$_[0]});
38 SDL::SMPEGInfoHasAudio(${$_[0]});
42 SDL::SMPEGInfoHasVideo(${$_[0]});
46 SDL::SMPEGInfoWidth(${$_[0]});
50 SDL::SMPEGInfoHeight(${$_[0]});
54 SDL::SMPEGInfoTotalSize(${$_[0]});
58 SDL::SMPEGInfoCurrentOffset(${$_[0]});
62 SDL::SMPEGInfoCurrentFrame(${$_[0]});
66 SDL::SMPEGInfoCurrentFPS(${$_[0]});
70 SDL::SMPEGInfoCurrentTime(${$_[0]});
74 SDL::SMPEGInfoTotalTime(${$_[0]});
86 SDL::MPEG - a SDL perl extension
90 $info = new SDL::MPEG -from => $mpeg;
94 C<SDL::MPEG> provides an interface to quering the status
103 C<SDL::MPEG::has_audio> returns true if it has audio track
107 C<SDL::MPEG::has_video> returns true if it has a video track
111 C<SDL::MPEG::width> returns the width of the video in pixels
115 C<SDL::MPEG::height> returns the height of the video in pixels
119 C<SDL::MPEG::size> returns the total size of the clip in bytes
123 C<SDL::MPEG::offset> returns the offset into the clip in bytes
127 C<SDL::MPEG::frame> returns the offset into the clip in fames
131 C<SDL::MPEG::fps> returns the play rate in frames per second
135 C<SDL::MPEG::time> returns the current play time in seconds
139 C<SDL::MPEG::length> returns the total play time in seconds
149 perl(1) SDL::Video(3)