ffmpeg-ruby 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new("ffmpeg-ruby", "0.1.2") do |p|
5
+ Echoe.new("ffmpeg-ruby", "0.1.3") do |p|
6
6
  p.description = "FFMpeg Ruby Bridge. Call FFMpeg/LibAVCodec/LibAVFormat directly"
7
7
  p.url = "http://github.com/hackerdude/ffmpeg-ruby"
8
8
  p.author = "David Martinez"
@@ -39,6 +39,27 @@ VALUE AVCodecContext_codec_id(VALUE self)
39
39
  return result;
40
40
  }
41
41
 
42
+ VALUE AVCodecContext_fourcc_tag(VALUE self)
43
+ {
44
+ AVCodecContext *enc;
45
+ char buf1[128];
46
+
47
+ Data_Get_Struct(self, AVCodecContext, enc);
48
+ // TODO
49
+ if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
50
+ && isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){
51
+ snprintf(buf1, sizeof(buf1), "%c%c%c%c",
52
+ enc->codec_tag & 0xff,
53
+ (enc->codec_tag >> 8) & 0xff,
54
+ (enc->codec_tag >> 16) & 0xff,
55
+ (enc->codec_tag >> 24) & 0xff);
56
+ } else {
57
+ snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);
58
+ }
59
+ VALUE result = rb_str_new2(buf1);
60
+ return result;
61
+ }
62
+
42
63
  VALUE AVCodecContext_width(VALUE self)
43
64
  {
44
65
  AVCodecContext *ptr;
@@ -166,8 +187,8 @@ VALUE supported_audio_codecs()
166
187
  return result;
167
188
  }
168
189
  /*
169
- * Similar to avcodec_string but only
170
- * gets the name using thse same logic
190
+ * Similar to avcodec_string on ffmpeg, but only
191
+ * gets the name using thse same logic. Uses the AVI tags
171
192
  */
172
193
  VALUE avcodec_canonical_name(AVCodecContext *enc)
173
194
  {
@@ -182,18 +203,17 @@ VALUE avcodec_canonical_name(AVCodecContext *enc)
182
203
  /* fake mpeg2 transport stream codec (currently not
183
204
  * registered) */
184
205
  codec_name = "mpeg2ts";
185
- } else if (enc->codec_name[0] != '\0') {
186
- codec_name = enc->codec_name;
206
+ // } else if (enc->codec_name[0] != '\0') {
207
+ // codec_name = enc->codec_name;
187
208
  } else {
188
209
  /* output avi tags */
189
210
  if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
190
211
  && isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){
191
- snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X",
212
+ snprintf(buf1, sizeof(buf1), "%c%c%c%c",
192
213
  enc->codec_tag & 0xff,
193
214
  (enc->codec_tag >> 8) & 0xff,
194
215
  (enc->codec_tag >> 16) & 0xff,
195
- (enc->codec_tag >> 24) & 0xff,
196
- enc->codec_tag);
216
+ (enc->codec_tag >> 24) & 0xff);
197
217
  } else {
198
218
  snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);
199
219
  }
@@ -218,6 +238,7 @@ void Init_ffmpeg_ruby_avcodec(VALUE module)
218
238
  rb_define_method(cFFMpegAVCodecContext, "long_name", AVCodecContext_codec_long_name, 0);
219
239
  rb_define_method(cFFMpegAVCodecContext, "name", AVCodecContext_codec_name, 0);
220
240
  rb_define_method(cFFMpegAVCodecContext, "codec_type", AVCodecContext_codec_type, 0);
241
+ rb_define_method(cFFMpegAVCodecContext, "fourcc_tag", AVCodecContext_fourcc_tag, 0);
221
242
  rb_define_method(cFFMpegAVCodecContext, "codec_id", AVCodecContext_codec_id, 0);
222
243
  rb_define_method(cFFMpegAVCodecContext, "width", AVCodecContext_width, 0);
223
244
  rb_define_method(cFFMpegAVCodecContext, "height", AVCodecContext_height, 0);
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ffmpeg-ruby}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["David Martinez"]
9
- s.date = %q{2010-02-16}
9
+ s.date = %q{2010-02-17}
10
10
  s.description = %q{FFMpeg Ruby Bridge. Call FFMpeg/LibAVCodec/LibAVFormat directly}
11
11
  s.email = %q{}
12
12
  s.extensions = ["ext/ffmpeg_ruby/extconf.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffmpeg-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Martinez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-16 00:00:00 -08:00
12
+ date: 2010-02-17 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15