Skip to content

Commit

Permalink
Import of CAVAC/Video-FFmpeg-0.48 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Video-FFmpeg
gitpan-cpan-version:      0.48
gitpan-cpan-path:         CAVAC/Video-FFmpeg-0.48.tar.gz
gitpan-cpan-author:       CAVAC
gitpan-cpan-maturity:     released
  • Loading branch information
Rene Schickbauer authored and Gitpan committed Oct 23, 2014
1 parent 8d20549 commit af4a3d1
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 66 deletions.
8 changes: 8 additions & 0 deletions Changes
Expand Up @@ -15,3 +15,11 @@ Revision history for Perl extension Video::FFmpeg.
- Fixed Mac OS X Compilation issue. Thanks Mischa Spiegelmock.
- Fixed META.yml desription.
- Lowered required version of libavformat to compile on Debian Lenny.

0.48 Sun Apr 29 19:00:00 2012
- Fixed some critical bugs, see https://rt.cpan.org/Public/Bug/Display.html?id=73132
- Makefile.PL does not find -lavformat (fixed)
- Compile errors in FFmpeg.xs
- Some Perl code still uses Switch.pm (deprecated) (fixed)
- Two Tests had floating point problems (fixed)
- Uploaded UNAUTHORIZED version
16 changes: 8 additions & 8 deletions FFmpeg.xs
Expand Up @@ -4,7 +4,7 @@

#include "ppport.h"

#include <avformat.h>
#include <libavformat/avformat.h>
#include <pthread.h>
pthread_mutex_t AVFormatCtxMP;

Expand Down Expand Up @@ -88,7 +88,7 @@ nb_streams(Video_FFmpeg_AVFormat *self)
Video_FFmpeg_AVStream_Video *
get_video_stream(Video_FFmpeg_AVFormat *self, int id)
CODE:
if(CODEC_TYPE_VIDEO == self->streams[id]->codec->codec_type)
if(AVMEDIA_TYPE_VIDEO == self->streams[id]->codec->codec_type)
RETVAL = self->streams[id];
else
RETVAL = NULL;
Expand All @@ -97,7 +97,7 @@ get_video_stream(Video_FFmpeg_AVFormat *self, int id)
Video_FFmpeg_AVStream_Audio *
get_audio_stream(Video_FFmpeg_AVFormat *self, int id)
CODE:
if(CODEC_TYPE_AUDIO == self->streams[id]->codec->codec_type)
if(AVMEDIA_TYPE_AUDIO == self->streams[id]->codec->codec_type)
RETVAL = self->streams[id];
else
RETVAL = NULL;
Expand Down Expand Up @@ -175,19 +175,19 @@ char *
codec_type(Video_FFmpeg_AVStream *st);
CODE:
switch(st->codec->codec_type){
case CODEC_TYPE_VIDEO:
case AVMEDIA_TYPE_VIDEO:
RETVAL = "video";
break;
case CODEC_TYPE_AUDIO:
case AVMEDIA_TYPE_AUDIO:
RETVAL = "audio";
break;
case CODEC_TYPE_SUBTITLE:
case AVMEDIA_TYPE_SUBTITLE:
RETVAL = "subtitle";
break;
case CODEC_TYPE_DATA:
case AVMEDIA_TYPE_DATA:
RETVAL = "data";
break;
case CODEC_TYPE_ATTACHMENT:
case AVMEDIA_TYPE_ATTACHMENT:
RETVAL = "attachment";
break;
default:
Expand Down
18 changes: 10 additions & 8 deletions MANIFEST
@@ -1,17 +1,19 @@
Changes
FFmpeg.xs
lib/Video/FFmpeg.pm
lib/Video/FFmpeg/AVFormat.pm
lib/Video/FFmpeg/AVStream.pm
lib/Video/FFmpeg/AVStream/Audio.pm
lib/Video/FFmpeg/AVStream/Subtitle.pm
lib/Video/FFmpeg/AVStream/Video.pm
Makefile.PL
MANIFEST
MANIFEST This list of files
MANIFEST.SKIP
META.yml
ppport.h
README
t/Video-FFmpeg.t
test
test.mp4
typemap
t/Video-FFmpeg.t
lib/Video/FFmpeg.pm
lib/Video/FFmpeg/AVFormat.pm
lib/Video/FFmpeg/AVStream/Subtitle.pm
lib/Video/FFmpeg/AVStream/Audio.pm
lib/Video/FFmpeg/AVStream/Video.pm
lib/Video/FFmpeg/AVStream.pm
META.json Module JSON meta-data (added by MakeMaker)
59 changes: 59 additions & 0 deletions MANIFEST.SKIP
@@ -0,0 +1,59 @@
# Avoid version control files.
\bRCS\b
\bCVS\b
\bSCCS\b
,v$
\B\.svn\b
\B\.hg\b
\B\.hgtags\b
\B\.git\b
\B\.gitignore\b
\b_darcs\b
\B\.cvsignore$

# Avoid VMS specific MakeMaker generated files
\bDescrip.MMS$
\bDESCRIP.MMS$
\bdescrip.mms$

# Avoid Makemaker generated and utility files.
\bMANIFEST\.bak
\bMakefile$
\bblib/
\bMakeMaker-\d
\bpm_to_blib\.ts$
\bpm_to_blib$
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
\bMYMETA\.json
\bMYMETA\.yml


# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$

# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
\.tmp$
server/tmp.*\.html$
\.#
\.rej$
\.pyc$
\.lock$

# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._

# Avoid Devel::Cover files.
\bcover_db\b
39 changes: 39 additions & 0 deletions META.json
@@ -0,0 +1,39 @@
{
"abstract" : "Retrieve video properties using libavformat such as: height width codec fps",
"author" : [
"Rene Schickbauer <rene.schickbauer@magnapowertrain.com>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120351",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "Video-FFmpeg",
"no_index" : {
"directory" : [
"t",
"inc"
]
},
"prereqs" : {
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {}
}
},
"release_status" : "stable",
"version" : "0.48"
}
43 changes: 21 additions & 22 deletions META.yml
@@ -1,22 +1,21 @@
--- #YAML:1.0
name: Video-FFmpeg
abstract: Extract Video information using libavformat
version: 0.47
author:
- Max Vohra <max@seattlenetworks.com>
license: perl
distribution_type: module
requires:
ExtUtils::MakeMaker: 0
ExtUtils::PkgConfig: 0
recommends:
Pod::Text: 0
YAML: 0.35
build_requires:
Test::More: 0
urls:
license: http://dev.perl.org/licenses/
meta-spec:
version: 1.3
url: http://module-build.sourceforge.net/META-spec-v1.3.html
generated_by: Max Vohra using vim
---
abstract: 'Retrieve video properties using libavformat such as: height width codec fps'
author:
- 'Rene Schickbauer <rene.schickbauer@magnapowertrain.com>'
build_requires:
ExtUtils::MakeMaker: 0
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120351'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Video-FFmpeg
no_index:
directory:
- t
- inc
requires: {}
version: 0.48
6 changes: 3 additions & 3 deletions Makefile.PL
Expand Up @@ -5,7 +5,7 @@ use ExtUtils::PkgConfig;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

my $lavf_lib = ExtUtils::PkgConfig->libs("libavformat");
my $lavf_lib = "-L/usr/lib " . ExtUtils::PkgConfig->libs("libavformat");
my $lavf_inc = ExtUtils::PkgConfig->cflags("libavformat");
die("Installed libavformat version is too low. I require 52.7 or greater") unless (
ExtUtils::PkgConfig->atleast_version("libavformat", "52.7.0"));
Expand All @@ -14,9 +14,9 @@ WriteMakefile(
NAME => 'Video::FFmpeg',
VERSION_FROM => 'lib/Video/FFmpeg.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
($] >= 5.010 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/Video/FFmpeg.pm', # retrieve abstract from module
AUTHOR => 'Max Vohra <max@seattlenetworks.com>') : ()),
AUTHOR => 'Rene Schickbauer <rene.schickbauer@magnapowertrain.com>') : ()),
LIBS => [$lavf_lib], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I. '.$lavf_inc, # e.g., '-I. -I/usr/include/other'
Expand Down
8 changes: 7 additions & 1 deletion README
@@ -1,6 +1,12 @@
Video-FFmpeg version 0.47
Video-FFmpeg version 0.48
========================

** This UNAUTHORIZED VERSION was done by Rene Schickbauer
** to fix some bugs that completly broke this module
**
** See https://rt.cpan.org/Public/Bug/Display.html?id=73132
** for more information

The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
Expand Down
18 changes: 12 additions & 6 deletions lib/Video/FFmpeg.pm
Expand Up @@ -12,7 +12,7 @@ use Video::FFmpeg::AVStream::Subtitle;

our @ISA = ('Video::FFmpeg::AVFormat');

our $VERSION = '0.47';
our $VERSION = '0.48';

sub new {
my $class = shift;
Expand All @@ -35,8 +35,8 @@ Video::FFmpeg - Retrieve video properties using libavformat such as: height widt
=head1 SYNOPSIS
use 5.010;
use Video::FFmpeg;
use Switch;
my $info = Video::FFmpeg::AVFormat->new($ARGV[0]);
Expand All @@ -56,16 +56,16 @@ Video::FFmpeg - Retrieve video properties using libavformat such as: height widt
print "\ttype: ",$stream->codec_type,"\n";
print "\tcodec: ",$stream->codec,"\n";
print "\tlanguage: ",$stream->lang,"\n";
switch($stream->codec_type){
case "video" {
given($stream->codec_type){
when("video") {
print "\tfps: ",$stream->fps,"\n";
print "\tDAR: ",$stream->display_aspect,"\n";
}
case "audio" {
when("audio") {
print "\tsample rate: ",$stream->sample_rate,"hz\n";
print "\taudio language: ",$stream->lang,"\n";
}
case "subtitle" {
when("subtitle") {
print "\tsub codec: ",$stream->codec,"\n";
print "\tsub language: ",$stream->lang,"\n";
}
Expand Down Expand Up @@ -197,6 +197,12 @@ None by default.
Max Vohra, E<lt>max@seattlenetworks.comE<gt> L<html://www.seattlenetworks.com/>
This unauthorized version by Rene Schickbauer E<lt>rene.schickbauer@magnapowertrain.comE<gt>
=head UNAUTHORIZED VERSION
This unauthorized version fixes some critical bugs, see file "Changes" for details
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2009 by Max Vohra
Expand Down

0 comments on commit af4a3d1

Please sign in to comment.