gst/ffmpegcolorspace/gstffmpegcodecmap.c: Fix for gcc-2.95 (fixes #158221).

Original commit message from CVS:
reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
Fix for gcc-2.95 (fixes #158221).
This commit is contained in:
Ronald S. Bultje 2004-11-14 10:35:37 +00:00
parent dc52a0ead1
commit b4628eebaf
2 changed files with 196 additions and 146 deletions

View file

@ -1,3 +1,10 @@
2004-11-14 Koop Mast <kwm@rainbow-runner.nl>
reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
Fix for gcc-2.95 (fixes #158221).
2004-11-13 Ronald S. Bultje <rbultje@ronald.bitfreak.net> 2004-11-13 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_add_element): * gst/playback/gstplaybasebin.c: (gst_play_base_bin_add_element):

View file

@ -555,172 +555,215 @@ typedef struct PixFmtInfo
/* this table gives more information about formats */ /* this table gives more information about formats */
static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* YUV formats */ /*[PIX_FMT_YUV420P] = */ {
[PIX_FMT_YUV420P] = { /*.name = */ "yuv420p",
.name = "yuv420p", /*.nb_channels = */ 3,
.nb_channels = 3, /*.color_type = */ FF_COLOR_YUV,
.color_type = FF_COLOR_YUV, /*.pixel_type = */ FF_PIXEL_PLANAR,
.pixel_type = FF_PIXEL_PLANAR, /*.is_alpha = */ 0,
.depth = 8, /*.x_chroma_shift = */ 1,
.x_chroma_shift = 1,.y_chroma_shift = 1, /*.y_chroma_shift = */ 1,
/*.depth = */ 8
}, },
[PIX_FMT_YUV422P] = { /*[PIX_FMT_YUV422] = */ {
.name = "yuv422p", /*.name = */ "yuv422",
.nb_channels = 3, /*.nb_channels = */ 1,
.color_type = FF_COLOR_YUV, /*.color_type = */ FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PACKED,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 1,.y_chroma_shift = 0, /*.x_chroma_shift = */ 1,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_YUV444P] = { /*[PIX_FMT_RGB24] = */ {
.name = "yuv444p", /*.name = */ "rgb24",
.nb_channels = 3, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV, /*.color_type = */ FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PACKED,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_YUV422] = { /*[PIX_FMT_BGR24] = */ {
.name = "yuv422", /*.name = */ "bgr24",
.nb_channels = 1, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV, /*.color_type = */ FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PACKED,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 1,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_YUV410P] = { /*[PIX_FMT_YUV422P] = */ {
.name = "yuv410p", /*.name = */ "yuv422p",
.nb_channels = 3, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV, /*.color_type = */ FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.depth = */ 8,
.x_chroma_shift = 2,.y_chroma_shift = 2, /*.x_chroma_shift = */ 1,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_YUV411P] = { /*[PIX_FMT_YUV444P] = */ {
.name = "yuv411p", /*.name = */ "yuv444p",
.nb_channels = 3, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV, /*.color_type = */ FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 2,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_YUV422] = { /*[PIX_FMT_RGBA32] = */ {
.name = "ayuv4444", /*.name = */ "rgba32",
.nb_channels = 1, /*.nb_channels = */ 4,
.is_alpha = 1, /*.color_type = */ FF_COLOR_RGB,
.color_type = FF_COLOR_YUV, /*.pixel_type = */ FF_PIXEL_PACKED,
.pixel_type = FF_PIXEL_PACKED, /*.is_alpha = */ 1,
.depth = 8, /*.x_chroma_shift = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
/*[PIX_FMT_RGB32] = */ {
/* JPEG YUV */ /*.name = */ "rgb32",
[PIX_FMT_YUVJ420P] = { /*.nb_channels = */ 4,
.name = "yuvj420p", /*.color_type = */ FF_COLOR_RGB,
.nb_channels = 3, /*.pixel_type = */ FF_PIXEL_PACKED,
.color_type = FF_COLOR_YUV_JPEG, /*.is_alpha = */ 0,
.pixel_type = FF_PIXEL_PLANAR, /*.x_chroma_shift = */ 0,
.depth = 8, /*.y_chroma_shift = */ 0,
.x_chroma_shift = 1,.y_chroma_shift = 1, /*.depth = */ 8
}, },
[PIX_FMT_YUVJ422P] = { /*[PIX_FMT_YUV410P] = */ {
.name = "yuvj422p", /*.name = */ "yuv410p",
.nb_channels = 3, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV_JPEG, /*.color_type = */ FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 1,.y_chroma_shift = 0, /*.x_chroma_shift = */ 2,
/*.y_chroma_shift = */ 2,
/*.depth = */ 8
}, },
[PIX_FMT_YUVJ444P] = { /*[PIX_FMT_YUV411P] = */ {
.name = "yuvj444p", /*.name = */ "yuv411p",
.nb_channels = 3, /*.nb_channels = */ 3,
.color_type = FF_COLOR_YUV_JPEG, /*.color_type = */ FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 2,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
/*[PIX_FMT_RGB565] = */ {
/* RGB formats */ /*.name = */ "rgb565",
[PIX_FMT_RGB24] = { /*.nb_channels = */ 3,
.name = "rgb24", /*.color_type = */ FF_COLOR_RGB,
.nb_channels = 3, /*.pixel_type = */ FF_PIXEL_PACKED,
.color_type = FF_COLOR_RGB, /*.is_alpha = */ 0,
.pixel_type = FF_PIXEL_PACKED, /*.x_chroma_shift = */ 0,
.depth = 8, /*.y_chroma_shift = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.depth = */ 5
}, },
[PIX_FMT_BGR24] = { /*[PIX_FMT_RGB555] = */ {
.name = "bgr24", /*.name = */ "rgb555",
.nb_channels = 3, /*.nb_channels = */ 4,
.color_type = FF_COLOR_RGB, /*.color_type = */ FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PACKED,
.depth = 8, /*.is_alpha = */ 1,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 5
}, },
[PIX_FMT_RGB32] = { /*[PIX_FMT_GRAY8] = */ {
.name = "rgb32", /*.name = */ "gray",
.nb_channels = 4, /*.nb_channels = */ 1,
.color_type = FF_COLOR_RGB, /*.color_type = */ FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_RGBA32] = { /*[PIX_FMT_MONOWHITE] = */ {
.name = "rgba32", /*.name = */ "monow",
.nb_channels = 4,.is_alpha = 1, /*.nb_channels = */ 1,
.color_type = FF_COLOR_RGB, /*.color_type = */ FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 8, /*.is_alpha = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 1
}, },
[PIX_FMT_RGB565] = { /*[PIX_FMT_MONOBLACK] = */ {
.name = "rgb565", /*.name = */ "monob",
.nb_channels = 3, /*.nb_channels = */ 1,
.color_type = FF_COLOR_RGB, /*.color_type = */ FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 5, /*.is_alpha = */ 0,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 1
}, },
[PIX_FMT_RGB555] = { /*[PIX_FMT_PAL8] = */ {
.name = "rgb555", /*.name = */ "pal8",
.nb_channels = 4,.is_alpha = 1, /*.nb_channels = */ 4,
.color_type = FF_COLOR_RGB, /*.color_type = */ FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, /*.pixel_type = */ FF_PIXEL_PALETTE,
.depth = 5, /*.is_alpha = */ 1,
.x_chroma_shift = 0,.y_chroma_shift = 0, /*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
/*[PIX_FMT_YUVJ420P] = */ {
/* gray / mono formats */ /*.name = */ "yuvj420p",
[PIX_FMT_GRAY8] = { /*.nb_channels = */ 3,
.name = "gray", /*.color_type = */ FF_COLOR_YUV_JPEG,
.nb_channels = 1, /*.pixel_type = */ FF_PIXEL_PLANAR,
.color_type = FF_COLOR_GRAY, /*.is_alpha = */ 0,
.pixel_type = FF_PIXEL_PLANAR, /*.x_chroma_shift = */ 1,
.depth = 8, /*.y_chroma_shift = */ 1,
/*.depth = */ 8
}, },
[PIX_FMT_MONOWHITE] = { /*[PIX_FMT_YUVJ422P] = */ {
.name = "monow", /*.name = */ "yuvj422p",
.nb_channels = 1, /*.nb_channels = */ 3,
.color_type = FF_COLOR_GRAY, /*.color_type = */ FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 1, /*.is_alpha = */ 0,
/*.x_chroma_shift = */ 1,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
[PIX_FMT_MONOBLACK] = { /*[PIX_FMT_YUVJ444P] = */ {
.name = "monob", /*.name = */ "yuvj444p",
.nb_channels = 1, /*.nb_channels = */ 3,
.color_type = FF_COLOR_GRAY, /*.color_type = */ FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, /*.pixel_type = */ FF_PIXEL_PLANAR,
.depth = 1, /*.is_alpha = */ 0,
/*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}, },
/*[PIX_FMT_XVMC_MPEG2_MC] = */ {
/* paletted formats */ /*.name = */ NULL
[PIX_FMT_PAL8] = {
.name = "pal8",
.nb_channels = 4,.is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PALETTE,
.depth = 8,
}, },
/*[PIX_FMT_UYVY422] = */ {
/*.name = */ NULL
},
/*[PIX_FMT_UYVY411] = */ {
/*.name = */ NULL
},
/*[PIX_FMT_AYUV] = */ {
/*.name = */ "ayuv4444",
/*.nb_channels = */ 1,
/*.color_type = */ FF_COLOR_YUV,
/*.pixel_type = */ FF_PIXEL_PACKED,
/*.is_alpha = */ 1,
/*.x_chroma_shift = */ 0,
/*.y_chroma_shift = */ 0,
/*.depth = */ 8
}
}; };
#define GEN_MASK(x) ((1<<(x))-1) #define GEN_MASK(x) ((1<<(x))-1)