Method: FFruby.codecs
- Defined in:
- ext/ffruby/ffruby.c
.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); } |