source: gs3-extensions/pharos-videois/trunk/perllib/plugins/PharosVideoPlugin.pm@ 21333

Last change on this file since 21333 was 21333, checked in by davidb, 13 years ago

New extension for Greenstone 3 that combines Video capabilities (Greenstone 2 extension) with Pharos Image Similarity (Greenstone 3 extension)

File size: 2.7 KB
Line 
1###########################################################################
2#
3# PharosVideoPlugin - an VideoPlugin that can also do pharos related tasks.
4#
5# A component of the Greenstone digital library software
6# from the New Zealand Digital Library Project at the
7# University of Waikato, New Zealand.
8#
9# Copyright (C) 2008 New Zealand Digital Library Project
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26package PharosVideoPlugin;
27
28use VideoPlugin;
29use PharosImageIndexer;
30
31use strict;
32no strict 'refs'; # allow filehandles to be variables and viceversa
33
34use gsprintf 'gsprintf';
35
36BEGIN {
37 @PharosVideoPlugin::ISA = ('VideoPlugin', 'PharosImageIndexer');
38}
39
40my $arguments = [
41 ];
42
43my $options = { 'name' => "PharosVideoPlugin",
44 'desc' => "{PharosVideoPlugin.desc}",
45 'abstract' => "no",
46 'inherits' => "yes",
47 'args' => $arguments };
48
49sub new {
50 my ($class) = shift (@_);
51 my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
52 push(@$pluginlist, $class);
53
54 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
55 push(@{$hashArgOptLists->{"OptList"}},$options);
56
57 new PharosImageIndexer($pluginlist, $inputargs, $hashArgOptLists);
58 my $self = new VideoPlugin($pluginlist, $inputargs, $hashArgOptLists);
59
60
61 return bless $self, $class;
62
63}
64
65# needs to be called after BasePlugin init, so that outhandle is set up.
66sub init {
67 my $self = shift(@_);
68 my ($verbosity, $outhandle, $failhandle) = @_;
69
70 $self->SUPER::init(@_);
71 $self->PharosImageIndexer::init();
72
73}
74
75sub removeold {
76 my $self = shift (@_);
77 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
78
79 $self->SUPER::removeold(@_);
80 $self->PharosImageIndexer::removeold(@_);
81
82}
83
84sub post_process_doc_obj {
85 my $self = shift (@_);
86 # options??
87 my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
88 $self->pharos_index_image(&util::filename_cat($base_dir, $file), $doc_obj);
89}
90
91
92
931;
Note: See TracBrowser for help on using the repository browser.