Module: FFruby
- Defined in:
- ext/ffruby/ffruby.c,
ext/ffruby/ffrubyfile.c,
ext/ffruby/ffrubystream.c
Defined Under Namespace
Classes: AudioStream, File, Stream, VideoStream
Class Method Summary collapse
-
.codecs(klass) ⇒ Object
Returns an array of the codecs supported by FFmpeg.
-
.formats(klass) ⇒ Object
Returns an array of the input and output formats supported by FFmpeg.
Class Method Details
.codecs(klass) ⇒ Object
Returns an array of the codecs supported by FFmpeg. This method will hopefully be expanded to return more than just names in the future.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'ext/ffruby/ffruby.c', line 57
static VALUE ffruby_codecs(VALUE self, VALUE klass)
{
AVCodec *codec;
VALUE array = rb_ary_new();
#ifdef HAVE_AV_CODEC_NEXT
for (codec = av_codec_next(NULL); codec; codec = av_codec_next(codec))
#else
for (codec = first_avcodec; codec; codec = codec->next)
#endif
rb_ary_push(array, rb_str_new2(codec->name));
return rb_funcall(rb_funcall(array, rb_intern("uniq"), 0), rb_intern("sort"), 0);
}
|
.formats(klass) ⇒ Object
Returns an array of the input and output formats supported by FFmpeg. This method will hopefully be expanded to return more than just names in the future.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'ext/ffruby/ffruby.c', line 31
static VALUE ffruby_formats(VALUE self, VALUE klass)
{
AVInputFormat *ifmt;
AVOutputFormat *ofmt;
VALUE array = rb_ary_new();
#ifdef HAVE_AV_IFORMAT_NEXT
for (ifmt = av_iformat_next(NULL); ifmt; ifmt = av_iformat_next(ifmt))
#else
for (ifmt = first_iformat; ifmt; ifmt = ifmt->next)
#endif
rb_ary_push(array, rb_str_new2(ifmt->name));
#ifdef HAVE_AV_OFORMAT_NEXT
for (ofmt = av_oformat_next(NULL); ofmt; ofmt = av_oformat_next(ofmt))
#else
for (ofmt = first_oformat; ofmt; ofmt = ofmt->next)
#endif
rb_ary_push(array, rb_str_new2(ofmt->name));
return rb_funcall(rb_funcall(array, rb_intern("uniq"), 0), rb_intern("sort"), 0);
}
|