hornetseye-ffmpeg 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -49
- data/ext/avinput.cc +1 -0
- data/ext/avoutput.cc +2 -8
- metadata +4 -4
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 = '1.1.
|
10
|
+
PKG_VERSION = '1.1.3'
|
11
11
|
CFG = RbConfig::CONFIG
|
12
12
|
CXX = ENV[ 'CXX' ] || 'g++'
|
13
13
|
RB_FILES = FileList[ 'lib/**/*.rb' ]
|
@@ -116,54 +116,6 @@ file 'ext/config.h' do |t|
|
|
116
116
|
else
|
117
117
|
raise 'Cannot find avformat.h header file'
|
118
118
|
end
|
119
|
-
have_libavformat_alloc_context = check_program do |c|
|
120
|
-
c.puts <<EOS
|
121
|
-
extern "C" {
|
122
|
-
#include <#{have_libavformat_incdir ? 'libavformat' : 'ffmpeg'}/avformat.h>
|
123
|
-
}
|
124
|
-
int main(void) { avformat_alloc_context(); return 0; }
|
125
|
-
EOS
|
126
|
-
end
|
127
|
-
if have_libavformat_alloc_context
|
128
|
-
s << "#define HAVE_LIBAVFORMAT_ALLOC_CONTEXT 1\n"
|
129
|
-
else
|
130
|
-
have_alloc_format_context = check_program do |c|
|
131
|
-
c.puts <<EOS
|
132
|
-
extern "C" {
|
133
|
-
#include <#{have_libavformat_incdir ? 'libavformat' : 'ffmpeg'}/avformat.h>
|
134
|
-
}
|
135
|
-
int main(void) { av_alloc_format_context(); return 0; }
|
136
|
-
EOS
|
137
|
-
end
|
138
|
-
unless have_alloc_format_context
|
139
|
-
raise 'Cannot find constructor for AVFormatContext'
|
140
|
-
end
|
141
|
-
s << "#undef HAVE_LIBAVFORMAT_ALLOC_CONTEXT\n"
|
142
|
-
end
|
143
|
-
have_byteio_ptr = check_program do |c|
|
144
|
-
c.puts <<EOS
|
145
|
-
extern "C" {
|
146
|
-
#include <#{have_libavformat_incdir ? 'libavformat' : 'ffmpeg'}/avformat.h>
|
147
|
-
}
|
148
|
-
int main(void) { AVFormatContext *c; url_fclose( c->pb ); return 0; }
|
149
|
-
EOS
|
150
|
-
end
|
151
|
-
if have_byteio_ptr
|
152
|
-
s << "#define HAVE_BYTEIO_PTR 1\n"
|
153
|
-
else
|
154
|
-
have_byteio_inst = check_program do |c|
|
155
|
-
c.puts <<EOS
|
156
|
-
extern "C" {
|
157
|
-
#include <#{have_libavformat_incdir ? 'libavformat' : 'ffmpeg'}/avformat.h>
|
158
|
-
}
|
159
|
-
int main(void) { AVFormatContext *c; url_fclose( &c->pb ); return 0; }
|
160
|
-
EOS
|
161
|
-
end
|
162
|
-
unless have_byteio_inst
|
163
|
-
raise 'Cannot find ByteIOContext member variable'
|
164
|
-
end
|
165
|
-
s << "#undef HAVE_BYTEIO_PTR\n"
|
166
|
-
end
|
167
119
|
File.open( t.name, 'w' ) { |f| f.puts s }
|
168
120
|
end
|
169
121
|
|
data/ext/avinput.cc
CHANGED
@@ -35,6 +35,7 @@ AVInput::AVInput( const string &mrl, bool audio ) throw (Error):
|
|
35
35
|
m_swsContext(NULL), m_vFrame(NULL), m_aFrame(NULL)
|
36
36
|
{
|
37
37
|
try {
|
38
|
+
av_register_all();
|
38
39
|
int err = avformat_open_input(&m_ic, mrl.c_str(), NULL, NULL);
|
39
40
|
ERRORMACRO( err >= 0, Error, , "Error opening file \"" << mrl << "\": "
|
40
41
|
<< strerror( errno ) );
|
data/ext/avoutput.cc
CHANGED
@@ -45,15 +45,13 @@ AVOutput::AVOutput( const string &mrl, int videoBitRate, int width, int height,
|
|
45
45
|
{
|
46
46
|
try {
|
47
47
|
AVOutputFormat *format;
|
48
|
+
av_register_all();
|
48
49
|
format = av_guess_format( NULL, mrl.c_str(), NULL );
|
49
50
|
if ( format == NULL ) format = av_guess_format( "mpeg", NULL, NULL );
|
50
51
|
ERRORMACRO( format != NULL, Error, ,
|
51
52
|
"Could not find suitable output format for \"" << mrl << "\"" );
|
52
|
-
#ifdef HAVE_LIBAVFORMAT_ALLOC_CONTEXT
|
53
53
|
m_oc = avformat_alloc_context();
|
54
|
-
|
55
|
-
m_oc = av_alloc_format_context();
|
56
|
-
#endif
|
54
|
+
// m_oc = av_alloc_format_context();
|
57
55
|
ERRORMACRO( m_oc != NULL, Error, , "Failure allocating format context" );
|
58
56
|
m_oc->oformat = format;
|
59
57
|
snprintf( m_oc->filename, sizeof( m_oc->filename ), "%s", mrl.c_str() );
|
@@ -193,11 +191,7 @@ void AVOutput::close(void)
|
|
193
191
|
m_audioStream = NULL;
|
194
192
|
m_videoStream = NULL;
|
195
193
|
if ( m_fileOpen ) {
|
196
|
-
#ifdef HAVE_BYTEIO_PTR
|
197
194
|
url_fclose( m_oc->pb );
|
198
|
-
#else
|
199
|
-
url_fclose( &m_oc->pb );
|
200
|
-
#endif
|
201
195
|
m_fileOpen = false;
|
202
196
|
};
|
203
197
|
av_free( m_oc );
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hornetseye-ffmpeg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 3
|
10
|
+
version: 1.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jan Wedekind
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-04-
|
18
|
+
date: 2013-04-27 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: malloc
|