Changeset 21599 for gs2-extensions


Ignore:
Timestamp:
2010-01-25T13:57:54+13:00 (14 years ago)
Author:
davidb
Message:

Section level support added in

Location:
gs2-extensions/video/trunk/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video/trunk/perllib/plugins/MultimediaPlugin.pm

    r20345 r21599  
    208208   
    209209    $self->add_OID($doc_obj);
     210
     211    $self->post_process_doc_obj($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli);
    210212
    211213    return (1,$doc_obj);
  • gs2-extensions/video/trunk/perllib/plugins/VideoConverter.pm

    r21335 r21599  
    793793    my ($self) = shift(@_);
    794794
    795     my ($doc_obj,$section,$timeline) = @_;
     795    my ($doc_obj,$topsection,$timeline) = @_;
    796796
    797797    my $output_dir = $self->{'cached_dir'};
    798798   
    799799    my $count = 1;
     800
     801    my $endchild = $doc_obj->get_end_child($topsection);
    800802
    801803    foreach my $t (sort { $timeline->{$a}->{'keyframeindex'} <=> $timeline->{$b}->{'keyframeindex'} } keys %$timeline)
     
    804806    my $timestamp = $timeline->{$t}->{'timestamp'};
    805807
     808    # create next sub-section to video "document"
     809    $endchild = $doc_obj->insert_section($endchild);
     810    $doc_obj->add_utf8_metadata($endchild,"Title","Timestamp $timestamp");
     811    $doc_obj->add_utf8_metadata($endchild,"FrameNum",$t);
     812
    806813    my $kframe_filename = &util::filename_cat($output_dir,$kframe_file);
    807     $doc_obj->associate_file($kframe_filename,"keyframe$count.jpg","image/jpeg",
    808                  $section);
    809     $doc_obj->add_utf8_metadata($section,"KeyframeTimestamp",$timestamp);
    810     $doc_obj->add_utf8_metadata($section,"KeyframeFrameNum",$t);
     814    $doc_obj->associate_file($kframe_filename,"keyframe$count.jpg",
     815                 "image/jpeg",
     816                 $endchild);
     817
     818    $doc_obj->add_utf8_metadata($endchild,"assockeyframe","keyframe$count.jpg");
     819
     820    $doc_obj->add_utf8_metadata($topsection,"KeyframeTimestamp",$timestamp);
     821    $doc_obj->add_utf8_metadata($topsection,"KeyframeFrameNum",$t);
     822
     823
    811824
    812825    $count++;
    813826    }
    814827
    815     #### $doc_obj->add_utf8_metadata($section,"NumKeyframes",scalar(@{$self->{'keyframe_fnames'}}));
    816 
    817     $doc_obj->add_utf8_metadata($section,"NumKeyframes",scalar(keys %$timeline));
     828    #### $doc_obj->add_utf8_metadata($topsection,"NumKeyframes",scalar(@{$self->{'keyframe_fnames'}}));
     829
     830    $doc_obj->add_utf8_metadata($topsection,"NumKeyframes",scalar(keys %$timeline));
    818831
    819832
    820833    # *****
    821     # $doc_obj->add_metadata ($section, "thumblist", $self->{'flowplayer_thumblist'});
     834    # $doc_obj->add_metadata ($topsection, "thumblist", $self->{'flowplayer_thumblist'});
    822835}
    823836
Note: See TracChangeset for help on using the changeset viewer.