#ifndef LIBFFMPEG_FILLPLUGINS_H
#define LIBFFMPEG_FILLPLUGINS_H

#include <infotypes.h>
#include <fourcc.h>

static void libffmpeg_add_divx(std::vector<CodecInfo>& ci)
{
    static const char divx_about[] =
	"FFMPEG GPL version of popular MPEG-4 video codec. "
	"Advanced compression technologies allow it to "
	"compress 640x480x25 video with a perfect "
	"quality into 100-150 kbytes/s ( 3-4 times "
	"less than MPEG-2 ), by the cost of increased "
	"requirements for playback.<br>";

    static const int div3_codecs[] = { fccDIV3, fccdiv3, fccDIV4, fccdiv4,
    				       fccDIV5, fccdiv5, fccDIV6, fccdiv6,
                                       fccMP41, fccMP43, 
    				       fccAP41, fccap41, fccAP42, fccap42,
				       0 };

#if 0
    std::vector<AttributeInfo> vs;
    std::vector<AttributeInfo> ds;
    vs.push_back("BitRate");
    vs.push_back("Crispness");
    vs.push_back("KeyFrames");
    ds.push_back(AttributeInfo("Quality", "Quality/CPU balance ( 0 fastest )", AttributeInfo::Integer, 0, 4));

    std::vector<AttributeInfo> ds1;
    ds1.push_back(AttributeInfo("Quality", "Quality/CPU balance ( 0 fastest )", AttributeInfo::Integer, 0, 4));
    ds1.push_back(AttributeInfo("Saturation", "Saturation", AttributeInfo::Integer, 0, 100));
    ds1.push_back(AttributeInfo("Hue", "Hue", AttributeInfo::Integer, 0, 100));
    ds1.push_back(AttributeInfo("Brightness", "Brightness", AttributeInfo::Integer, 0, 100));
    ds1.push_back(AttributeInfo("Contrast", "Contrast", AttributeInfo::Integer, 0, 100));
#endif

    // for encoding
    ci.push_back(CodecInfo(div3_codecs, "FFMPEG DivX ;-)", "",
			   divx_about, CodecInfo::Plugin, CodecInfo::Video,
			   CodecInfo::Decode // for now
			  ));
}

static void libffmpeg_add_opendivx(std::vector<CodecInfo>& ci)
{
    static const char opendix_about[] = "FFMPEG OpenDivX MPEG-4";
    static const int opendix_codecs[] = { fccDIVX, fccdivx, fccDIV1, fccdiv1, fccMP4S, fccmp4s, 0x4, 0 };
    ci.push_back(CodecInfo(opendix_codecs, "FFMPEG DIVX", "",
			   opendix_about, CodecInfo::Plugin,
			   CodecInfo::Video,
			   CodecInfo::Decode // for now
			  ));
}

static void libffmpeg_add_mjpeg(std::vector<CodecInfo>& ci)
{
    static const int mjpg_codecs[] = { fccMJPG, fccmjpg, 0 };
    ci.push_back(CodecInfo(mjpg_codecs, "FFMPEG Motion JPEG", "",
			   "", CodecInfo::Plugin, CodecInfo::Video,
			   CodecInfo::Decode));
}

static void libffmpeg_add_ac3dec(std::vector<CodecInfo>& ci)
{
    static const int ac3_codecs[]={ 0x2000, 0 };
    ci.push_back(CodecInfo(ac3_codecs, "FFMPEG AC3", "",
			   "", CodecInfo::Plugin,
			   CodecInfo::Audio, CodecInfo::Decode));
}

static void libffmpeg_FillPlugins(std::vector<CodecInfo>& ci)
{
    libffmpeg_add_divx(ci);
    libffmpeg_add_opendivx(ci);
    libffmpeg_add_mjpeg(ci);

    libffmpeg_add_ac3dec(ci); // not using FFMpeg interface!
}

#endif //LIBFFMPEG_FILLPLUGINS_H
