hornetseye-ffmpeg 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/loaders/makefile'
7
7
  require 'rbconfig'
8
8
 
9
9
  PKG_NAME = 'hornetseye-ffmpeg'
10
- PKG_VERSION = '0.9.1'
10
+ PKG_VERSION = '0.10.0'
11
11
  CFG = RbConfig::CONFIG
12
12
  CXX = ENV[ 'CXX' ] || 'g++'
13
13
  RB_FILES = FileList[ 'lib/**/*.rb' ]
@@ -208,8 +208,8 @@ begin
208
208
  s.extra_rdoc_files = []
209
209
  s.rdoc_options = %w{--no-private}
210
210
  s.add_dependency %<malloc>, [ '~> 1.2' ]
211
- s.add_dependency %<multiarray>, [ '~> 0.20' ]
212
- s.add_dependency %<hornetseye-frame>, [ '~> 0.8' ]
211
+ s.add_dependency %<multiarray>, [ '~> 0.23' ]
212
+ s.add_dependency %<hornetseye-frame>, [ '~> 0.11' ]
213
213
  s.add_development_dependency %q{rake}
214
214
  end
215
215
  GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
@@ -231,8 +231,8 @@ begin
231
231
  s.extra_rdoc_files = []
232
232
  s.rdoc_options = %w{--no-private}
233
233
  s.add_dependency %<malloc>, [ '~> 1.2' ]
234
- s.add_dependency %<multiarray>, [ '~> 0.20' ]
235
- s.add_dependency %<hornetseye-frame>, [ '~> 0.8' ]
234
+ s.add_dependency %<multiarray>, [ '~> 0.23' ]
235
+ s.add_dependency %<hornetseye-frame>, [ '~> 0.11' ]
236
236
  end
237
237
  GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
238
238
  desc "Build the gem file #{GEM_SOURCE}"
data/ext/init.cc CHANGED
@@ -30,8 +30,8 @@ extern "C" {
30
30
 
31
31
  void Init_hornetseye_ffmpeg(void)
32
32
  {
33
- rb_require( "rational" );
34
- rb_require( "hornetseye_frame" );
33
+ rb_eval_string( "require 'rational'" );
34
+ rb_eval_string( "require 'hornetseye_frame'" );
35
35
  VALUE rbHornetseye = rb_define_module( "Hornetseye" );
36
36
  avcodec_register_all();
37
37
  av_register_all();
@@ -58,12 +58,12 @@ module Hornetseye
58
58
  def enqueue_frame
59
59
  frame = read_av
60
60
  if frame.is_a? Frame_
61
- @video.enq [ frame, video_pts ]
61
+ @video.enq [frame, video_pts]
62
62
  @frame = frame
63
63
  else
64
64
  n = channels
65
- target = Hornetseye::MultiArray SINT, n, frame.size / ( 2 * n )
66
- @audio.enq [ target.new( frame.memory ), audio_pts ]
65
+ samples = MultiArray.import(SINT, frame.memory, n, frame.size / (2 * n))
66
+ @audio.enq [samples, audio_pts]
67
67
  end
68
68
  end
69
69
 
@@ -39,7 +39,7 @@ module Hornetseye
39
39
  audio_codec || CODEC_ID_NONE
40
40
  if have_audio
41
41
  retval.instance_eval do
42
- @audio_buffer = Hornetseye::MultiArray( SINT, channels, frame_size ).new
42
+ @audio_buffer = MultiArray.new SINT, channels, frame_size
43
43
  @audio_samples = 0
44
44
  end
45
45
  end
@@ -70,18 +70,18 @@ module Hornetseye
70
70
  raise "Audio frame must have #{channels} channels " +
71
71
  "(but had #{frame.shape.first})"
72
72
  end
73
- frame_type = Hornetseye::Sequence UBYTE, frame_size * 2 * channels
73
+ size = frame_size * 2 * channels
74
74
  remaining = frame
75
75
  while @audio_samples + remaining.shape.last >= frame_size
76
76
  if @audio_samples > 0
77
77
  @audio_buffer[ @audio_samples ... frame_size ] =
78
78
  remaining[ 0 ... frame_size - @audio_samples ]
79
- orig_write_audio frame_type.new( @audio_buffer.memory )
79
+ orig_write_audio Sequence.import(UBYTE, @audio_buffer.memory, size)
80
80
  remaining = remaining[ 0 ... channels,
81
81
  frame_size - @audio_samples ... remaining.shape.last ]
82
82
  @audio_samples = 0
83
83
  else
84
- orig_write_audio frame_type.new( remaining.memory )
84
+ orig_write_audio Sequence.import(UBYTE, remaining.memory, size)
85
85
  remaining = remaining[ 0 ... channels, frame_size ... remaining.shape.last ]
86
86
  end
87
87
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 9
8
- - 1
9
- version: 0.9.1
7
+ - 10
8
+ - 0
9
+ version: 0.10.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan Wedekind
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-12 00:00:00 +00:00
17
+ date: 2011-06-29 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -41,8 +41,8 @@ dependencies:
41
41
  - !ruby/object:Gem::Version
42
42
  segments:
43
43
  - 0
44
- - 20
45
- version: "0.20"
44
+ - 23
45
+ version: "0.23"
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
- - 8
59
- version: "0.8"
58
+ - 11
59
+ version: "0.11"
60
60
  type: :runtime
61
61
  version_requirements: *id003
62
62
  - !ruby/object:Gem::Dependency