input/decoder: Support generic decoder.