hornetseye-ffmpeg 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -7
- data/ext/frame.cc +19 -9
- data/ext/frame.hh +3 -1
- data/lib/hornetseye-ffmpeg/avinput.rb +1 -1
- data/lib/hornetseye-ffmpeg/avoutput.rb +1 -1
- data/lib/hornetseye_ffmpeg_ext.rb +1 -1
- metadata +7 -7
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rake/packagetask'
|
|
6
6
|
require 'rbconfig'
|
7
7
|
|
8
8
|
PKG_NAME = 'hornetseye-ffmpeg'
|
9
|
-
PKG_VERSION = '0.3.
|
9
|
+
PKG_VERSION = '0.3.1'
|
10
10
|
CXX = ENV[ 'CXX' ] || 'g++'
|
11
11
|
STRIP = ENV[ 'STRIP' ] || 'strip'
|
12
12
|
RB_FILES = FileList[ 'lib/**/*.rb' ]
|
@@ -19,7 +19,7 @@ PKG_FILES = [ 'Rakefile', 'README.md', 'COPYING', '.document' ] +
|
|
19
19
|
RB_FILES + CC_FILES + HH_FILES + TS_FILES + TC_FILES
|
20
20
|
BIN_FILES = [ 'README.md', 'COPYING', '.document', SO_FILE ] +
|
21
21
|
RB_FILES + TS_FILES + TC_FILES
|
22
|
-
SUMMARY = %q{Read video frames using libffmpeg}
|
22
|
+
SUMMARY = %q{Read/write video frames using libffmpeg}
|
23
23
|
DESCRIPTION = %q{This Ruby extension defines the class Hornetseye::AVInput for reading frames from video files.}
|
24
24
|
AUTHOR = %q{Jan Wedekind}
|
25
25
|
EMAIL = %q{jan@wedesoft.de}
|
@@ -113,8 +113,8 @@ begin
|
|
113
113
|
s.extra_rdoc_files = []
|
114
114
|
s.rdoc_options = %w{--no-private}
|
115
115
|
s.add_dependency %<malloc>, [ '~> 1.1' ]
|
116
|
-
s.add_dependency %<multiarray>, [ '~> 0.
|
117
|
-
s.add_dependency %<hornetseye-frame>, [ '~> 0.
|
116
|
+
s.add_dependency %<multiarray>, [ '~> 0.6' ]
|
117
|
+
s.add_dependency %<hornetseye-frame>, [ '~> 0.2' ]
|
118
118
|
s.add_development_dependency %q{rake}
|
119
119
|
end
|
120
120
|
GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
|
@@ -136,8 +136,8 @@ begin
|
|
136
136
|
s.extra_rdoc_files = []
|
137
137
|
s.rdoc_options = %w{--no-private}
|
138
138
|
s.add_dependency %<malloc>, [ '~> 1.1' ]
|
139
|
-
s.add_dependency %<multiarray>, [ '~> 0.
|
140
|
-
s.add_dependency %<hornetseye-frame>, [ '~> 0.
|
139
|
+
s.add_dependency %<multiarray>, [ '~> 0.6' ]
|
140
|
+
s.add_dependency %<hornetseye-frame>, [ '~> 0.2' ]
|
141
141
|
end
|
142
142
|
GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
|
143
143
|
desc "Build the gem file #{GEM_SOURCE}"
|
@@ -173,7 +173,7 @@ file 'ext/avinput.o' => [ 'ext/avinput.cc', 'ext/avinput.hh', 'ext/error.hh',
|
|
173
173
|
file 'ext/avoutput.o' => [ 'ext/avoutput.cc', 'ext/avoutput.hh', 'ext/error.hh',
|
174
174
|
'ext/frame.hh' ]
|
175
175
|
file 'ext/frame.o' => [ 'ext/frame.cc', 'ext/frame.hh' ]
|
176
|
-
file 'ext/init.o' => [ 'ext/init.cc', 'ext/avinput.hh' ]
|
176
|
+
file 'ext/init.o' => [ 'ext/init.cc', 'ext/avinput.hh', 'ext/avoutput.hh' ]
|
177
177
|
|
178
178
|
CLEAN.include 'ext/*.o'
|
179
179
|
CLOBBER.include SO_FILE, 'doc', '.yardoc'
|
data/ext/frame.cc
CHANGED
@@ -17,21 +17,31 @@
|
|
17
17
|
|
18
18
|
using namespace std;
|
19
19
|
|
20
|
-
Frame::Frame( const
|
20
|
+
Frame::Frame( const string &typecode, int width, int height, char *data ):
|
21
21
|
m_frame( Qnil )
|
22
22
|
{
|
23
23
|
VALUE mModule = rb_define_module( "Hornetseye" );
|
24
24
|
VALUE cMalloc = rb_define_class_under( mModule, "Malloc", rb_cObject );
|
25
25
|
VALUE cFrame = rb_define_class_under( mModule, "Frame", rb_cObject );
|
26
|
-
VALUE rbSize = rb_funcall( cFrame, rb_intern( "
|
27
|
-
rb_const_get( mModule, rb_intern( typecode ) ),
|
26
|
+
VALUE rbSize = rb_funcall( cFrame, rb_intern( "storage_size" ), 3,
|
27
|
+
rb_const_get( mModule, rb_intern( typecode.c_str() ) ),
|
28
28
|
INT2NUM( width ), INT2NUM( height ) );
|
29
|
-
VALUE rbMemory
|
30
|
-
|
29
|
+
VALUE rbMemory;
|
30
|
+
if ( data != NULL ) {
|
31
|
+
rbMemory = Data_Wrap_Struct( cMalloc, 0, 0, (void *)data );
|
32
|
+
rb_ivar_set( rbMemory, rb_intern( "@size" ), rbSize );
|
33
|
+
} else
|
34
|
+
rbMemory = rb_funcall( cMalloc, rb_intern( "new" ), 1, rbSize );
|
31
35
|
m_frame = rb_funcall( cFrame, rb_intern( "import" ), 4,
|
32
|
-
rb_const_get( mModule, rb_intern( typecode ) ),
|
33
|
-
INT2NUM( width ), INT2NUM( height ),
|
34
|
-
|
36
|
+
rb_const_get( mModule, rb_intern( typecode.c_str() ) ),
|
37
|
+
INT2NUM( width ), INT2NUM( height ), rbMemory );
|
38
|
+
}
|
39
|
+
|
40
|
+
string Frame::typecode(void)
|
41
|
+
{
|
42
|
+
VALUE rbString = rb_funcall( rb_funcall( m_frame, rb_intern( "typecode" ), 0 ),
|
43
|
+
rb_intern( "to_s" ), 0 );
|
44
|
+
return StringValuePtr( rbString );
|
35
45
|
}
|
36
46
|
|
37
47
|
int Frame::width(void)
|
@@ -46,7 +56,7 @@ int Frame::height(void)
|
|
46
56
|
|
47
57
|
char *Frame::data(void)
|
48
58
|
{
|
49
|
-
VALUE rbMemory =
|
59
|
+
VALUE rbMemory = rb_funcall( m_frame, rb_intern( "memory" ), 0 );
|
50
60
|
char *ptr;
|
51
61
|
Data_Get_Struct( rbMemory, char, ptr );
|
52
62
|
return ptr;
|
data/ext/frame.hh
CHANGED
@@ -18,13 +18,15 @@
|
|
18
18
|
|
19
19
|
#include <boost/smart_ptr.hpp>
|
20
20
|
#include <ruby.h>
|
21
|
+
#include <string>
|
21
22
|
|
22
23
|
class Frame
|
23
24
|
{
|
24
25
|
public:
|
25
|
-
Frame( const
|
26
|
+
Frame( const std::string &typecode, int width, int height, char *data = NULL );
|
26
27
|
Frame( VALUE rbFrame ): m_frame( rbFrame ) {}
|
27
28
|
virtual ~Frame(void) {}
|
29
|
+
std::string typecode(void);
|
28
30
|
int width(void);
|
29
31
|
int height(void);
|
30
32
|
char *data(void);
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jan Wedekind
|
@@ -41,8 +41,8 @@ dependencies:
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
segments:
|
43
43
|
- 0
|
44
|
-
-
|
45
|
-
version: "0.
|
44
|
+
- 6
|
45
|
+
version: "0.6"
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
48
|
- !ruby/object:Gem::Dependency
|
@@ -55,8 +55,8 @@ dependencies:
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
segments:
|
57
57
|
- 0
|
58
|
-
-
|
59
|
-
version: "0.
|
58
|
+
- 2
|
59
|
+
version: "0.2"
|
60
60
|
type: :runtime
|
61
61
|
version_requirements: *id003
|
62
62
|
- !ruby/object:Gem::Dependency
|
@@ -128,6 +128,6 @@ rubyforge_project: hornetseye
|
|
128
128
|
rubygems_version: 1.3.7
|
129
129
|
signing_key:
|
130
130
|
specification_version: 3
|
131
|
-
summary: Read video frames using libffmpeg
|
131
|
+
summary: Read/write video frames using libffmpeg
|
132
132
|
test_files: []
|
133
133
|
|