| 1 | package Video::Info::Quicktime; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 0 | ▶ | use Video::OpenQuicktime; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 5 | use base qw(Video::Info); | ||
| 6 | |||
| 7 | our $VERSION = '0.02'; | ||
| 8 | use constant DEBUG => 0; | ||
| 9 | |||
| 10 | sub init { | ||
| 11 | my $self = shift; | ||
| 12 | my %raw = @_; | ||
| 13 | my %param; | ||
| 14 | foreach(keys %raw){/^-?(.+)/;$param{$1} = $raw{$_}}; | ||
| 15 | |||
| 16 | warn Video::OpenQuicktime->new( ); | ||
| 17 | $self->oqt( Video::OpenQuicktime->new( file=>$param{file} ) ); | ||
| 18 | $self->init_attributes(%param); | ||
| 19 | return $self; | ||
| 20 | } | ||
| 21 | |||
| 22 | sub oqt { | ||
| 23 | my $self = shift; | ||
| 24 | my $arg = shift; | ||
| 25 | $self->{oqt} = $arg if defined $arg; | ||
| 26 | return $self->{oqt}; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub probe { | ||
| 30 | return 1; | ||
| 31 | } | ||
| 32 | |||
| 33 | sub achans { return shift->oqt->get_audio_channels } | ||
| 34 | sub acodec { return shift->oqt->get_audio_compressor } | ||
| 35 | sub acodecraw { warn 'not implemented! ask the author to add reverse-lookups for GUIDs in Magic.pm'; return -1 } | ||
| 36 | sub arate { return shift->oqt->get_audio_samplerate } | ||
| 37 | sub astreams { return shift->oqt->get_audio_track_count } | ||
| 38 | sub afrequency { warn "not implemented!"; return -1 } | ||
| 39 | sub vcodec { return shift->oqt->get_video_compressor } | ||
| 40 | sub vframes { return shift->oqt->get_video_length } | ||
| 41 | sub vrate { warn "not implemented!"; return -1 } | ||
| 42 | sub vstreams { return shift->oqt->get_video_track_count } | ||
| 43 | sub fps { return shift->oqt->get_video_framerate } | ||
| 44 | sub width { return shift->oqt->get_video_width } | ||
| 45 | sub height { return shift->oqt->get_video_height } | ||
| 46 | sub type { warn 'not implemented! ask the author to implement stream_reference()'; return -1 } | ||
| 47 | sub duration { return shift->oqt->length } | ||
| 48 | sub title { warn 'not implemented!'; return -1 } | ||
| 49 | sub copyright { warn 'not implemented!'; return -1 } | ||
| 50 | |||
| 51 | 1; | ||
| 52 | |||
| 53 | __END__ | ||