//---------- Codec::Codec(SquashCodec * squashCodec) { ofxSquash::initialize(); this->name = squash_codec_get_name(squashCodec); this->valid = squash_codec_init(squashCodec) == SQUASH_OK; this->squashCodec = squashCodec; }
/** * @brief Get a codec from a plugin by name. * * @param plugin The plugin. * @param codec The codec name. * @return The codec, or *NULL* if it could not be found. */ SquashCodec* squash_plugin_get_codec (SquashPlugin* plugin, const char* codec) { SquashCodec key = { 0, }; SquashCodec* codec_real; assert (plugin != NULL); assert (codec != NULL); key.name = (char*) codec; codec_real = SQUASH_TREE_FIND (&(plugin->codecs), _SquashCodec, tree, &key); return (squash_codec_init (codec_real) == SQUASH_OK) ? codec_real : NULL; }