4 # A package for manipulating MPEG video
6 # Copyright (C) 2004 David J. Goehrig
17 my $class = ref($proto) || $proto;
20 verify (%options, qw/ -from / ) if $SDL::DEBUG;
23 if ( $options{-from} ) {
24 croak "SDL::MPEG::new -from requires a SDL::Video object\n"
25 unless $options{-from}->isa('SDL::Video');
27 $self = \SDL::SMPEGGetInfo(${$options{-from}});
29 $self = \SDL::NewSMPEGInfo();
36 SDL::FreeSMPEGInfo(${$_[0]});
40 SDL::SMPEGInfoHasAudio(${$_[0]});
44 SDL::SMPEGInfoHasVideo(${$_[0]});
48 SDL::SMPEGInfoWidth(${$_[0]});
52 SDL::SMPEGInfoHeight(${$_[0]});
56 SDL::SMPEGInfoTotalSize(${$_[0]});
60 SDL::SMPEGInfoCurrentOffset(${$_[0]});
64 SDL::SMPEGInfoCurrentFrame(${$_[0]});
68 SDL::SMPEGInfoCurrentFPS(${$_[0]});
72 SDL::SMPEGInfoCurrentTime(${$_[0]});
76 SDL::SMPEGInfoTotalTime(${$_[0]});
88 SDL::MPEG - a SDL perl extension
92 $info = new SDL::MPEG -from => $mpeg;
96 C<SDL::MPEG> provides an interface to quering the status
105 C<SDL::MPEG::has_audio> returns true if it has audio track
109 C<SDL::MPEG::has_video> returns true if it has a video track
113 C<SDL::MPEG::width> returns the width of the video in pixels
117 C<SDL::MPEG::height> returns the height of the video in pixels
121 C<SDL::MPEG::size> returns the total size of the clip in bytes
125 C<SDL::MPEG::offset> returns the offset into the clip in bytes
129 C<SDL::MPEG::frame> returns the offset into the clip in fames
133 C<SDL::MPEG::fps> returns the play rate in frames per second
137 C<SDL::MPEG::time> returns the current play time in seconds
141 C<SDL::MPEG::length> returns the total play time in seconds
151 perl(1) SDL::Video(3)