From 2295142d248c8bdedd72903abbef76a3895020c8 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 21 Aug 2011 11:11:08 +0200 Subject: gst-plugins-base: add patch to fix building Signed-off-by: Michael Olbrich --- ...-added-RGB666-Support-to-ffmpegcolorspace.patch | 296 +++++++++++++++++++++ .../0002-fix-building-test-program.patch | 24 ++ .../add-RGB666-Support-to-ffmpegcolorspace.patch | 296 --------------------- .../add-rgb666-support-to-videotestsrc.patch | 82 ------ patches/gst-plugins-base-0.10.35/autogen.sh | 1 + patches/gst-plugins-base-0.10.35/series | 6 +- 6 files changed, 326 insertions(+), 379 deletions(-) create mode 100644 patches/gst-plugins-base-0.10.35/0001-added-RGB666-Support-to-ffmpegcolorspace.patch create mode 100644 patches/gst-plugins-base-0.10.35/0002-fix-building-test-program.patch delete mode 100644 patches/gst-plugins-base-0.10.35/add-RGB666-Support-to-ffmpegcolorspace.patch delete mode 100644 patches/gst-plugins-base-0.10.35/add-rgb666-support-to-videotestsrc.patch create mode 120000 patches/gst-plugins-base-0.10.35/autogen.sh diff --git a/patches/gst-plugins-base-0.10.35/0001-added-RGB666-Support-to-ffmpegcolorspace.patch b/patches/gst-plugins-base-0.10.35/0001-added-RGB666-Support-to-ffmpegcolorspace.patch new file mode 100644 index 000000000..7931db767 --- /dev/null +++ b/patches/gst-plugins-base-0.10.35/0001-added-RGB666-Support-to-ffmpegcolorspace.patch @@ -0,0 +1,296 @@ +From: Luotao Fu +Date: Thu, 11 Dec 2008 17:02:52 +0100 +Subject: [PATCH] added RGB666 Support to ffmpegcolorspace + +This one adds RGB666 Support to ffmpegcolorspace +Still very hacky, need to be enhanced before submitting to mainline + +Signed-off-by: Luotao Fu +--- + gst/ffmpegcolorspace/avcodec.h | 1 + + gst/ffmpegcolorspace/gstffmpegcodecmap.c | 26 ++++++++++- + gst/ffmpegcolorspace/imgconvert.c | 71 ++++++++++++++++++++++++++++-- + 3 files changed, 91 insertions(+), 7 deletions(-) + +diff --git a/gst/ffmpegcolorspace/avcodec.h b/gst/ffmpegcolorspace/avcodec.h +index 57f551c..3d06101 100644 +--- a/gst/ffmpegcolorspace/avcodec.h ++++ b/gst/ffmpegcolorspace/avcodec.h +@@ -94,6 +94,7 @@ enum PixelFormat { + + PIX_FMT_AYUV4444, ///< Packed pixel, A0 Y0 Cb Cr + PIX_FMT_YUVA420P, ///< Planar YUV 4:4:2:0 (1 Cr & Cb sample per 2x2 Y & A samples) (A420) ++ PIX_FMT_RGB666, + PIX_FMT_NB + }; + +diff --git a/gst/ffmpegcolorspace/gstffmpegcodecmap.c b/gst/ffmpegcolorspace/gstffmpegcodecmap.c +index 318a90e..2015a48 100644 +--- a/gst/ffmpegcolorspace/gstffmpegcodecmap.c ++++ b/gst/ffmpegcolorspace/gstffmpegcodecmap.c +@@ -228,6 +228,14 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context) + b_mask = 0xff000000; + #endif + break; ++ case PIX_FMT_RGB666: ++ bpp = 32; ++ depth = 18; ++ endianness = G_BIG_ENDIAN; ++ r_mask = 0x0003f000; ++ g_mask = 0x00000fc0; ++ b_mask = 0x0000003f; ++ break; + case PIX_FMT_BGR32: + bpp = 32; + depth = 24; +@@ -684,7 +692,6 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + } + } else if (gst_structure_has_name (structure, "video/x-raw-rgb")) { + gint bpp = 0, rmask = 0, endianness = 0, amask = 0, depth = 0; +- + if (gst_structure_get_int (structure, "bpp", &bpp) && + gst_structure_get_int (structure, "endianness", &endianness)) { + if (gst_structure_get_int (structure, "red_mask", &rmask)) { +@@ -696,6 +703,8 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + context->pix_fmt = PIX_FMT_BGRA32; + else if (rmask == 0x00ff0000) + context->pix_fmt = PIX_FMT_RGBA32; ++ else if (rmask == 0x0003f000) ++ context->pix_fmt = PIX_FMT_RGB666; + else if (rmask == 0xff000000) + context->pix_fmt = PIX_FMT_ARGB32; + else // if (r_mask = 0x000000ff) +@@ -705,6 +714,11 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + context->pix_fmt = PIX_FMT_BGRA32; + else if (rmask == 0x0000ff00) + context->pix_fmt = PIX_FMT_RGBA32; ++ /* XXX: Hack here, gstreamer seems not to treat endianess in a ++ * consistent way between plugins. Since we only have RGB666 for ++ * now, We have to hack it around here */ ++ else if (rmask == 0x0003f000) ++ context->pix_fmt = PIX_FMT_RGB666; + else if (rmask == 0x000000ff) + context->pix_fmt = PIX_FMT_ARGB32; + else // if (rmask == 0xff000000) +@@ -716,7 +730,9 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + context->pix_fmt = PIX_FMT_RGB32; + else if (rmask == 0x0000ff00) + context->pix_fmt = PIX_FMT_BGR32; +- else if (rmask == 0xff000000) ++ else if (rmask == 0x0003f000) ++ context->pix_fmt = PIX_FMT_RGB666; ++ else if (rmask == 0xff000000) + context->pix_fmt = PIX_FMT_xRGB32; + else // if (rmask == 0x000000ff) + context->pix_fmt = PIX_FMT_BGRx32; +@@ -725,7 +741,10 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + context->pix_fmt = PIX_FMT_RGB32; + else if (rmask == 0x00ff0000) + context->pix_fmt = PIX_FMT_BGR32; +- else if (rmask == 0x000000ff) ++ /* XXX: Hack here, see XXX section above for more details */ ++ else if (rmask == 0x0003f000) ++ context->pix_fmt = PIX_FMT_RGB666; ++ else if (rmask == 0x000000ff) + context->pix_fmt = PIX_FMT_xRGB32; + else // if (rmask == 0xff000000) + context->pix_fmt = PIX_FMT_BGRx32; +@@ -922,6 +941,7 @@ gst_ffmpegcsp_avpicture_fill (AVPicture * picture, + picture->linesize[0] = stride; + return size; + case PIX_FMT_AYUV4444: ++ case PIX_FMT_RGB666: + case PIX_FMT_RGB32: + case PIX_FMT_RGBA32: + case PIX_FMT_ARGB32: +diff --git a/gst/ffmpegcolorspace/imgconvert.c b/gst/ffmpegcolorspace/imgconvert.c +index cb145bb..d7be2bf 100644 +--- a/gst/ffmpegcolorspace/imgconvert.c ++++ b/gst/ffmpegcolorspace/imgconvert.c +@@ -488,7 +488,18 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { + /* .x_chroma_shift = */ 1, + /* .y_chroma_shift = */ 1, + /* .depth = */ 8, +- } ++ }, ++ /* [PIX_FMT_RGB666] = */ { ++ /* .format = */ PIX_FMT_RGB666, ++ /* .name = */ "rgb666", ++ /* .nb_channels = */ 4, ++ /* .color_type = */ FF_COLOR_RGB, ++ /* .pixel_type = */ FF_PIXEL_PLANAR, ++ /* .is_alpha = */ 0, ++ /* .x_chroma_shift = */ 0, ++ /* .y_chroma_shift = */ 0, ++ /* .depth = */ 6, ++ } + }; + + /* returns NULL if not found */ +@@ -497,7 +508,6 @@ PixFmtInfo * + get_pix_fmt_info (enum PixelFormat format) + { + int i; +- + for (i = 0; i < sizeof (pix_fmt_info) / sizeof (pix_fmt_info[0]); i++) { + if (pix_fmt_info[i].format == format) { + return pix_fmt_info + i; +@@ -673,6 +683,8 @@ avg_bits_per_pixel (int pix_fmt) + case PIX_FMT_RGB555: + bits = 16; + break; ++ case PIX_FMT_RGB666: ++ bits = 8 * pf->nb_channels; + case PIX_FMT_UYVY411: + bits = 12; + break; +@@ -682,7 +694,9 @@ avg_bits_per_pixel (int pix_fmt) + } + break; + case FF_PIXEL_PLANAR: +- if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) { ++ if(pix_fmt == PIX_FMT_RGB666) { ++ bits = 8 * pf->nb_channels; ++ } else if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) { + bits = pf->depth * pf->nb_channels; + } else { + bits = pf->depth + ((2 * pf->depth) >> +@@ -740,7 +754,6 @@ avcodec_find_best_pix_fmt (int pix_fmt_mask, int src_pix_fmt, + ~FF_LOSS_DEPTH, + 0, + }; +- + /* try with successive loss */ + i = 0; + for (;;) { +@@ -2371,6 +2384,37 @@ bitcopy_n (unsigned int a, int n) + + #include "imgconvert_template.h" + ++/* rgb666 handling */ ++ ++#define RGB_NAME rgb666 ++#define FMT_RGB666 ++ ++#define RGB_IN(r, g, b, s)\ ++{\ ++ unsigned int v = ((const uint32_t *)(s))[0];\ ++ r = (v >> 12) & 0x3f;\ ++ g = (v >> 6) & 0x3f;\ ++ b = v & 0x3f;\ ++} ++ ++#define RGBA_IN(r, g, b, a, s)\ ++{\ ++ unsigned int v = ((const uint32_t *)(s))[0];\ ++ a = 0xff;\ ++ r = (v >> 12) & 0x3f;\ ++ g = (v >> 6) & 0x3f;\ ++ b = v & 0x3f;\ ++} ++ ++#define RGBA_OUT(d, r, g, b, a)\ ++{\ ++ ((uint32_t *)(d))[0] = ((r >> 2) << 12) | ((g >> 2) << 6) | (b >> 2);\ ++} ++ ++#define BPP 4 ++ ++#include "imgconvert_template.h" ++ + /* xrgb32 handling */ + + #define RGB_NAME xrgb32 +@@ -3102,6 +3146,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_YUV420P, PIX_FMT_RGB565, yuv420p_to_rgb565}, + {PIX_FMT_YUV420P, PIX_FMT_BGR24, yuv420p_to_bgr24}, + {PIX_FMT_YUV420P, PIX_FMT_RGB24, yuv420p_to_rgb24}, ++ {PIX_FMT_YUV420P, PIX_FMT_RGB666, yuv420p_to_rgb666}, + {PIX_FMT_YUV420P, PIX_FMT_RGB32, yuv420p_to_rgb32}, + {PIX_FMT_YUV420P, PIX_FMT_BGR32, yuv420p_to_bgr32}, + {PIX_FMT_YUV420P, PIX_FMT_xRGB32, yuv420p_to_xrgb32}, +@@ -3115,6 +3160,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_NV12, PIX_FMT_RGB565, nv12_to_rgb565}, + {PIX_FMT_NV12, PIX_FMT_BGR24, nv12_to_bgr24}, + {PIX_FMT_NV12, PIX_FMT_RGB24, nv12_to_rgb24}, ++ {PIX_FMT_NV12, PIX_FMT_RGB666, nv12_to_rgb666}, + {PIX_FMT_NV12, PIX_FMT_RGB32, nv12_to_rgb32}, + {PIX_FMT_NV12, PIX_FMT_BGR32, nv12_to_bgr32}, + {PIX_FMT_NV12, PIX_FMT_xRGB32, nv12_to_xrgb32}, +@@ -3130,6 +3176,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_NV21, PIX_FMT_RGB565, nv21_to_rgb565}, + {PIX_FMT_NV21, PIX_FMT_BGR24, nv21_to_bgr24}, + {PIX_FMT_NV21, PIX_FMT_RGB24, nv21_to_rgb24}, ++ {PIX_FMT_NV21, PIX_FMT_RGB666, nv21_to_rgb666}, + {PIX_FMT_NV21, PIX_FMT_RGB32, nv21_to_rgb32}, + {PIX_FMT_NV21, PIX_FMT_BGR32, nv21_to_bgr32}, + {PIX_FMT_NV21, PIX_FMT_xRGB32, nv21_to_xrgb32}, +@@ -3151,6 +3198,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_YUVJ420P, PIX_FMT_RGB565, yuvj420p_to_rgb565}, + {PIX_FMT_YUVJ420P, PIX_FMT_BGR24, yuvj420p_to_bgr24}, + {PIX_FMT_YUVJ420P, PIX_FMT_RGB24, yuvj420p_to_rgb24}, ++ {PIX_FMT_YUVJ420P, PIX_FMT_RGB666, yuvj420p_to_rgb666}, + {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_rgb32}, + {PIX_FMT_YUVJ420P, PIX_FMT_BGR32, yuvj420p_to_bgr32}, + {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_xrgb32}, +@@ -3216,6 +3264,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_RGB24, PIX_FMT_NV21, rgb24_to_nv21}, + {PIX_FMT_RGB24, PIX_FMT_RGB565, rgb24_to_rgb565}, + {PIX_FMT_RGB24, PIX_FMT_RGB555, rgb24_to_rgb555}, ++ {PIX_FMT_RGB24, PIX_FMT_RGB666, rgb24_to_rgb666}, + {PIX_FMT_RGB24, PIX_FMT_RGB32, rgb24_to_rgb32}, + {PIX_FMT_RGB24, PIX_FMT_BGR32, rgb24_to_bgr32}, + {PIX_FMT_RGB24, PIX_FMT_xRGB32, rgb24_to_xrgb32}, +@@ -3239,6 +3288,7 @@ static ConvertEntry convert_table[] = { + + {PIX_FMT_RGB32, PIX_FMT_RGB24, rgb32_to_rgb24}, + {PIX_FMT_RGB32, PIX_FMT_RGB555, rgba32_to_rgb555}, ++ {PIX_FMT_RGB32, PIX_FMT_RGB666, rgba32_to_rgb666}, + {PIX_FMT_RGB32, PIX_FMT_PAL8, rgb32_to_pal8}, + {PIX_FMT_RGB32, PIX_FMT_YUV420P, rgb32_to_yuv420p}, + {PIX_FMT_RGB32, PIX_FMT_YUVA420P, rgb32_to_yuva420p}, +@@ -3269,6 +3319,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_RGBA32, PIX_FMT_BGRx32, rgba32_to_bgrx32}, + {PIX_FMT_RGBA32, PIX_FMT_ABGR32, rgba32_to_abgr32}, + {PIX_FMT_RGBA32, PIX_FMT_RGB24, rgba32_to_rgb24}, ++ {PIX_FMT_RGBA32, PIX_FMT_RGB666, rgba32_to_rgb666}, + {PIX_FMT_RGBA32, PIX_FMT_RGB555, rgba32_to_rgb555}, + {PIX_FMT_RGBA32, PIX_FMT_PAL8, rgba32_to_pal8}, + {PIX_FMT_RGBA32, PIX_FMT_YUV420P, rgba32_to_yuv420p}, +@@ -3408,10 +3459,18 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_Y16, PIX_FMT_ABGR32, y16_to_abgr32}, + {PIX_FMT_Y16, PIX_FMT_Y800, y16_to_y800}, + ++ {PIX_FMT_RGB666, PIX_FMT_GRAY8, rgb666_to_gray}, ++ {PIX_FMT_RGB666, PIX_FMT_NV12, rgb666_to_nv12}, ++ {PIX_FMT_RGB666, PIX_FMT_NV21, rgb666_to_nv21}, ++ {PIX_FMT_RGB666, PIX_FMT_YUV420P, rgb666_to_yuv420p}, ++ {PIX_FMT_RGB666, PIX_FMT_RGBA32, rgb666_to_rgba32}, ++ {PIX_FMT_RGB666, PIX_FMT_RGB24, rgb666_to_rgb24}, ++ + {PIX_FMT_GRAY8, PIX_FMT_RGB555, gray_to_rgb555}, + {PIX_FMT_GRAY8, PIX_FMT_RGB565, gray_to_rgb565}, + {PIX_FMT_GRAY8, PIX_FMT_RGB24, gray_to_rgb24}, + {PIX_FMT_GRAY8, PIX_FMT_BGR24, gray_to_bgr24}, ++ {PIX_FMT_GRAY8, PIX_FMT_RGB666, gray_to_rgb666}, + {PIX_FMT_GRAY8, PIX_FMT_RGB32, gray_to_rgb32}, + {PIX_FMT_GRAY8, PIX_FMT_BGR32, gray_to_bgr32}, + {PIX_FMT_GRAY8, PIX_FMT_xRGB32, gray_to_xrgb32}, +@@ -3463,6 +3522,7 @@ static ConvertEntry convert_table[] = { + {PIX_FMT_PAL8, PIX_FMT_RGB565, pal8_to_rgb565}, + {PIX_FMT_PAL8, PIX_FMT_BGR24, pal8_to_bgr24}, + {PIX_FMT_PAL8, PIX_FMT_RGB24, pal8_to_rgb24}, ++ {PIX_FMT_PAL8, PIX_FMT_RGB666, pal8_to_rgb666}, + {PIX_FMT_PAL8, PIX_FMT_RGB32, pal8_to_rgb32}, + {PIX_FMT_PAL8, PIX_FMT_BGR32, pal8_to_bgr32}, + {PIX_FMT_PAL8, PIX_FMT_xRGB32, pal8_to_xrgb32}, +@@ -3858,6 +3918,9 @@ img_get_alpha_info (const AVPicture * src, int pix_fmt, int width, int height) + case PIX_FMT_ABGR32: + ret = get_alpha_info_abgr32 (src, width, height); + break; ++ case PIX_FMT_RGB666: ++ ret = get_alpha_info_rgb666 (src, width, height); ++ break; + case PIX_FMT_RGB555: + ret = get_alpha_info_rgb555 (src, width, height); + break; diff --git a/patches/gst-plugins-base-0.10.35/0002-fix-building-test-program.patch b/patches/gst-plugins-base-0.10.35/0002-fix-building-test-program.patch new file mode 100644 index 000000000..0d42cd821 --- /dev/null +++ b/patches/gst-plugins-base-0.10.35/0002-fix-building-test-program.patch @@ -0,0 +1,24 @@ +From: Michael Olbrich +Date: Sun, 21 Aug 2011 11:06:40 +0200 +Subject: [PATCH] fix building test program + +Based on upstream changes. + +Signed-off-by: Michael Olbrich +--- + gst-libs/gst/audio/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am +index c7e1dcc..9b63fe1 100644 +--- a/gst-libs/gst/audio/Makefile.am ++++ b/gst-libs/gst/audio/Makefile.am +@@ -53,7 +53,7 @@ libgstaudio_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) + noinst_PROGRAMS = testchannels + testchannels_SOURCES = testchannels.c + testchannels_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +-testchannels_LDADD = $(builddir)/libgstaudio-$(GST_MAJORMINOR).la $(GST_LIBS) ++testchannels_LDADD = $(GST_LIBS) + + include $(top_srcdir)/common/gst-glib-gen.mak + diff --git a/patches/gst-plugins-base-0.10.35/add-RGB666-Support-to-ffmpegcolorspace.patch b/patches/gst-plugins-base-0.10.35/add-RGB666-Support-to-ffmpegcolorspace.patch deleted file mode 100644 index 7e3bd7132..000000000 --- a/patches/gst-plugins-base-0.10.35/add-RGB666-Support-to-ffmpegcolorspace.patch +++ /dev/null @@ -1,296 +0,0 @@ -From: Luotao Fu -Date: Thu, 11 Dec 2008 17:02:52 +0100 -Subject: [PATCH] added RGB666 Support to ffmpegcolorspace - -This one adds RGB666 Support to ffmpegcolorspace -Still very hacky, need to be enhanced before submitting to mainline - -Signed-off-by: Luotao Fu ---- - gst/ffmpegcolorspace/avcodec.h | 1 - gst/ffmpegcolorspace/gstffmpegcodecmap.c | 26 ++++++++++- - gst/ffmpegcolorspace/imgconvert.c | 71 +++++++++++++++++++++++++++++-- - 3 files changed, 91 insertions(+), 7 deletions(-) - -Index: gst/ffmpegcolorspace/avcodec.h -=================================================================== ---- gst/ffmpegcolorspace/avcodec.h.orig -+++ gst/ffmpegcolorspace/avcodec.h -@@ -94,6 +94,7 @@ enum PixelFormat { - - PIX_FMT_AYUV4444, ///< Packed pixel, A0 Y0 Cb Cr - PIX_FMT_YUVA420P, ///< Planar YUV 4:4:2:0 (1 Cr & Cb sample per 2x2 Y & A samples) (A420) -+ PIX_FMT_RGB666, - PIX_FMT_NB - }; - -Index: gst/ffmpegcolorspace/imgconvert.c -=================================================================== ---- gst/ffmpegcolorspace/imgconvert.c.orig -+++ gst/ffmpegcolorspace/imgconvert.c -@@ -488,7 +488,18 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_N - /* .x_chroma_shift = */ 1, - /* .y_chroma_shift = */ 1, - /* .depth = */ 8, -- } -+ }, -+ /* [PIX_FMT_RGB666] = */ { -+ /* .format = */ PIX_FMT_RGB666, -+ /* .name = */ "rgb666", -+ /* .nb_channels = */ 4, -+ /* .color_type = */ FF_COLOR_RGB, -+ /* .pixel_type = */ FF_PIXEL_PLANAR, -+ /* .is_alpha = */ 0, -+ /* .x_chroma_shift = */ 0, -+ /* .y_chroma_shift = */ 0, -+ /* .depth = */ 6, -+ } - }; - - /* returns NULL if not found */ -@@ -497,7 +508,6 @@ PixFmtInfo * - get_pix_fmt_info (enum PixelFormat format) - { - int i; -- - for (i = 0; i < sizeof (pix_fmt_info) / sizeof (pix_fmt_info[0]); i++) { - if (pix_fmt_info[i].format == format) { - return pix_fmt_info + i; -@@ -673,6 +683,8 @@ avg_bits_per_pixel (int pix_fmt) - case PIX_FMT_RGB555: - bits = 16; - break; -+ case PIX_FMT_RGB666: -+ bits = 8 * pf->nb_channels; - case PIX_FMT_UYVY411: - bits = 12; - break; -@@ -682,7 +694,9 @@ avg_bits_per_pixel (int pix_fmt) - } - break; - case FF_PIXEL_PLANAR: -- if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) { -+ if(pix_fmt == PIX_FMT_RGB666) { -+ bits = 8 * pf->nb_channels; -+ } else if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) { - bits = pf->depth * pf->nb_channels; - } else { - bits = pf->depth + ((2 * pf->depth) >> -@@ -740,7 +754,6 @@ avcodec_find_best_pix_fmt (int pix_fmt_m - ~FF_LOSS_DEPTH, - 0, - }; -- - /* try with successive loss */ - i = 0; - for (;;) { -@@ -2371,6 +2384,37 @@ bitcopy_n (unsigned int a, int n) - - #include "imgconvert_template.h" - -+/* rgb666 handling */ -+ -+#define RGB_NAME rgb666 -+#define FMT_RGB666 -+ -+#define RGB_IN(r, g, b, s)\ -+{\ -+ unsigned int v = ((const uint32_t *)(s))[0];\ -+ r = (v >> 12) & 0x3f;\ -+ g = (v >> 6) & 0x3f;\ -+ b = v & 0x3f;\ -+} -+ -+#define RGBA_IN(r, g, b, a, s)\ -+{\ -+ unsigned int v = ((const uint32_t *)(s))[0];\ -+ a = 0xff;\ -+ r = (v >> 12) & 0x3f;\ -+ g = (v >> 6) & 0x3f;\ -+ b = v & 0x3f;\ -+} -+ -+#define RGBA_OUT(d, r, g, b, a)\ -+{\ -+ ((uint32_t *)(d))[0] = ((r >> 2) << 12) | ((g >> 2) << 6) | (b >> 2);\ -+} -+ -+#define BPP 4 -+ -+#include "imgconvert_template.h" -+ - /* xrgb32 handling */ - - #define RGB_NAME xrgb32 -@@ -3102,6 +3146,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_YUV420P, PIX_FMT_RGB565, yuv420p_to_rgb565}, - {PIX_FMT_YUV420P, PIX_FMT_BGR24, yuv420p_to_bgr24}, - {PIX_FMT_YUV420P, PIX_FMT_RGB24, yuv420p_to_rgb24}, -+ {PIX_FMT_YUV420P, PIX_FMT_RGB666, yuv420p_to_rgb666}, - {PIX_FMT_YUV420P, PIX_FMT_RGB32, yuv420p_to_rgb32}, - {PIX_FMT_YUV420P, PIX_FMT_BGR32, yuv420p_to_bgr32}, - {PIX_FMT_YUV420P, PIX_FMT_xRGB32, yuv420p_to_xrgb32}, -@@ -3115,6 +3160,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_NV12, PIX_FMT_RGB565, nv12_to_rgb565}, - {PIX_FMT_NV12, PIX_FMT_BGR24, nv12_to_bgr24}, - {PIX_FMT_NV12, PIX_FMT_RGB24, nv12_to_rgb24}, -+ {PIX_FMT_NV12, PIX_FMT_RGB666, nv12_to_rgb666}, - {PIX_FMT_NV12, PIX_FMT_RGB32, nv12_to_rgb32}, - {PIX_FMT_NV12, PIX_FMT_BGR32, nv12_to_bgr32}, - {PIX_FMT_NV12, PIX_FMT_xRGB32, nv12_to_xrgb32}, -@@ -3130,6 +3176,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_NV21, PIX_FMT_RGB565, nv21_to_rgb565}, - {PIX_FMT_NV21, PIX_FMT_BGR24, nv21_to_bgr24}, - {PIX_FMT_NV21, PIX_FMT_RGB24, nv21_to_rgb24}, -+ {PIX_FMT_NV21, PIX_FMT_RGB666, nv21_to_rgb666}, - {PIX_FMT_NV21, PIX_FMT_RGB32, nv21_to_rgb32}, - {PIX_FMT_NV21, PIX_FMT_BGR32, nv21_to_bgr32}, - {PIX_FMT_NV21, PIX_FMT_xRGB32, nv21_to_xrgb32}, -@@ -3151,6 +3198,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_YUVJ420P, PIX_FMT_RGB565, yuvj420p_to_rgb565}, - {PIX_FMT_YUVJ420P, PIX_FMT_BGR24, yuvj420p_to_bgr24}, - {PIX_FMT_YUVJ420P, PIX_FMT_RGB24, yuvj420p_to_rgb24}, -+ {PIX_FMT_YUVJ420P, PIX_FMT_RGB666, yuvj420p_to_rgb666}, - {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_rgb32}, - {PIX_FMT_YUVJ420P, PIX_FMT_BGR32, yuvj420p_to_bgr32}, - {PIX_FMT_YUVJ420P, PIX_FMT_RGB32, yuvj420p_to_xrgb32}, -@@ -3216,6 +3264,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_RGB24, PIX_FMT_NV21, rgb24_to_nv21}, - {PIX_FMT_RGB24, PIX_FMT_RGB565, rgb24_to_rgb565}, - {PIX_FMT_RGB24, PIX_FMT_RGB555, rgb24_to_rgb555}, -+ {PIX_FMT_RGB24, PIX_FMT_RGB666, rgb24_to_rgb666}, - {PIX_FMT_RGB24, PIX_FMT_RGB32, rgb24_to_rgb32}, - {PIX_FMT_RGB24, PIX_FMT_BGR32, rgb24_to_bgr32}, - {PIX_FMT_RGB24, PIX_FMT_xRGB32, rgb24_to_xrgb32}, -@@ -3239,6 +3288,7 @@ static ConvertEntry convert_table[] = { - - {PIX_FMT_RGB32, PIX_FMT_RGB24, rgb32_to_rgb24}, - {PIX_FMT_RGB32, PIX_FMT_RGB555, rgba32_to_rgb555}, -+ {PIX_FMT_RGB32, PIX_FMT_RGB666, rgba32_to_rgb666}, - {PIX_FMT_RGB32, PIX_FMT_PAL8, rgb32_to_pal8}, - {PIX_FMT_RGB32, PIX_FMT_YUV420P, rgb32_to_yuv420p}, - {PIX_FMT_RGB32, PIX_FMT_YUVA420P, rgb32_to_yuva420p}, -@@ -3269,6 +3319,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_RGBA32, PIX_FMT_BGRx32, rgba32_to_bgrx32}, - {PIX_FMT_RGBA32, PIX_FMT_ABGR32, rgba32_to_abgr32}, - {PIX_FMT_RGBA32, PIX_FMT_RGB24, rgba32_to_rgb24}, -+ {PIX_FMT_RGBA32, PIX_FMT_RGB666, rgba32_to_rgb666}, - {PIX_FMT_RGBA32, PIX_FMT_RGB555, rgba32_to_rgb555}, - {PIX_FMT_RGBA32, PIX_FMT_PAL8, rgba32_to_pal8}, - {PIX_FMT_RGBA32, PIX_FMT_YUV420P, rgba32_to_yuv420p}, -@@ -3408,10 +3459,18 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_Y16, PIX_FMT_ABGR32, y16_to_abgr32}, - {PIX_FMT_Y16, PIX_FMT_Y800, y16_to_y800}, - -+ {PIX_FMT_RGB666, PIX_FMT_GRAY8, rgb666_to_gray}, -+ {PIX_FMT_RGB666, PIX_FMT_NV12, rgb666_to_nv12}, -+ {PIX_FMT_RGB666, PIX_FMT_NV21, rgb666_to_nv21}, -+ {PIX_FMT_RGB666, PIX_FMT_YUV420P, rgb666_to_yuv420p}, -+ {PIX_FMT_RGB666, PIX_FMT_RGBA32, rgb666_to_rgba32}, -+ {PIX_FMT_RGB666, PIX_FMT_RGB24, rgb666_to_rgb24}, -+ - {PIX_FMT_GRAY8, PIX_FMT_RGB555, gray_to_rgb555}, - {PIX_FMT_GRAY8, PIX_FMT_RGB565, gray_to_rgb565}, - {PIX_FMT_GRAY8, PIX_FMT_RGB24, gray_to_rgb24}, - {PIX_FMT_GRAY8, PIX_FMT_BGR24, gray_to_bgr24}, -+ {PIX_FMT_GRAY8, PIX_FMT_RGB666, gray_to_rgb666}, - {PIX_FMT_GRAY8, PIX_FMT_RGB32, gray_to_rgb32}, - {PIX_FMT_GRAY8, PIX_FMT_BGR32, gray_to_bgr32}, - {PIX_FMT_GRAY8, PIX_FMT_xRGB32, gray_to_xrgb32}, -@@ -3463,6 +3522,7 @@ static ConvertEntry convert_table[] = { - {PIX_FMT_PAL8, PIX_FMT_RGB565, pal8_to_rgb565}, - {PIX_FMT_PAL8, PIX_FMT_BGR24, pal8_to_bgr24}, - {PIX_FMT_PAL8, PIX_FMT_RGB24, pal8_to_rgb24}, -+ {PIX_FMT_PAL8, PIX_FMT_RGB666, pal8_to_rgb666}, - {PIX_FMT_PAL8, PIX_FMT_RGB32, pal8_to_rgb32}, - {PIX_FMT_PAL8, PIX_FMT_BGR32, pal8_to_bgr32}, - {PIX_FMT_PAL8, PIX_FMT_xRGB32, pal8_to_xrgb32}, -@@ -3858,6 +3918,9 @@ img_get_alpha_info (const AVPicture * sr - case PIX_FMT_ABGR32: - ret = get_alpha_info_abgr32 (src, width, height); - break; -+ case PIX_FMT_RGB666: -+ ret = get_alpha_info_rgb666 (src, width, height); -+ break; - case PIX_FMT_RGB555: - ret = get_alpha_info_rgb555 (src, width, height); - break; -Index: gst/ffmpegcolorspace/gstffmpegcodecmap.c -=================================================================== ---- gst/ffmpegcolorspace/gstffmpegcodecmap.c.orig -+++ gst/ffmpegcolorspace/gstffmpegcodecmap.c -@@ -228,6 +228,14 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFor - b_mask = 0xff000000; - #endif - break; -+ case PIX_FMT_RGB666: -+ bpp = 32; -+ depth = 18; -+ endianness = G_BIG_ENDIAN; -+ r_mask = 0x0003f000; -+ g_mask = 0x00000fc0; -+ b_mask = 0x0000003f; -+ break; - case PIX_FMT_BGR32: - bpp = 32; - depth = 24; -@@ -684,7 +692,6 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps - } - } else if (gst_structure_has_name (structure, "video/x-raw-rgb")) { - gint bpp = 0, rmask = 0, endianness = 0, amask = 0, depth = 0; -- - if (gst_structure_get_int (structure, "bpp", &bpp) && - gst_structure_get_int (structure, "endianness", &endianness)) { - if (gst_structure_get_int (structure, "red_mask", &rmask)) { -@@ -696,6 +703,8 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps - context->pix_fmt = PIX_FMT_BGRA32; - else if (rmask == 0x00ff0000) - context->pix_fmt = PIX_FMT_RGBA32; -+ else if (rmask == 0x0003f000) -+ context->pix_fmt = PIX_FMT_RGB666; - else if (rmask == 0xff000000) - context->pix_fmt = PIX_FMT_ARGB32; - else // if (r_mask = 0x000000ff) -@@ -705,6 +714,11 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps - context->pix_fmt = PIX_FMT_BGRA32; - else if (rmask == 0x0000ff00) - context->pix_fmt = PIX_FMT_RGBA32; -+ /* XXX: Hack here, gstreamer seems not to treat endianess in a -+ * consistent way between plugins. Since we only have RGB666 for -+ * now, We have to hack it around here */ -+ else if (rmask == 0x0003f000) -+ context->pix_fmt = PIX_FMT_RGB666; - else if (rmask == 0x000000ff) - context->pix_fmt = PIX_FMT_ARGB32; - else // if (rmask == 0xff000000) -@@ -716,7 +730,9 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps - context->pix_fmt = PIX_FMT_RGB32; - else if (rmask == 0x0000ff00) - context->pix_fmt = PIX_FMT_BGR32; -- else if (rmask == 0xff000000) -+ else if (rmask == 0x0003f000) -+ context->pix_fmt = PIX_FMT_RGB666; -+ else if (rmask == 0xff000000) - context->pix_fmt = PIX_FMT_xRGB32; - else // if (rmask == 0x000000ff) - context->pix_fmt = PIX_FMT_BGRx32; -@@ -725,7 +741,10 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps - context->pix_fmt = PIX_FMT_RGB32; - else if (rmask == 0x00ff0000) - context->pix_fmt = PIX_FMT_BGR32; -- else if (rmask == 0x000000ff) -+ /* XXX: Hack here, see XXX section above for more details */ -+ else if (rmask == 0x0003f000) -+ context->pix_fmt = PIX_FMT_RGB666; -+ else if (rmask == 0x000000ff) - context->pix_fmt = PIX_FMT_xRGB32; - else // if (rmask == 0xff000000) - context->pix_fmt = PIX_FMT_BGRx32; -@@ -922,6 +941,7 @@ gst_ffmpegcsp_avpicture_fill (AVPicture - picture->linesize[0] = stride; - return size; - case PIX_FMT_AYUV4444: -+ case PIX_FMT_RGB666: - case PIX_FMT_RGB32: - case PIX_FMT_RGBA32: - case PIX_FMT_ARGB32: diff --git a/patches/gst-plugins-base-0.10.35/add-rgb666-support-to-videotestsrc.patch b/patches/gst-plugins-base-0.10.35/add-rgb666-support-to-videotestsrc.patch deleted file mode 100644 index 74fd685c3..000000000 --- a/patches/gst-plugins-base-0.10.35/add-rgb666-support-to-videotestsrc.patch +++ /dev/null @@ -1,82 +0,0 @@ -From b03b40150cb7755d3bcdb1a42883a5543779e1dc Mon Sep 17 00:00:00 2001 -From: Luotao Fu -Date: Thu, 11 Dec 2008 15:17:36 +0100 -Subject: [PATCH] add rgb666 support - - This one adds RGB666 support to videotestsrc. - -Signed-off-by: Luotao Fu ---- - gst/videotestsrc/videotestsrc.c | 28 ++++++++++++++++++++++++++++ - 1 files changed, 28 insertions(+), 0 deletions(-) - -diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c -index b9f29fb..e6fb9e5 100644 ---- gst/videotestsrc/videotestsrc.c -+++ gst/videotestsrc/videotestsrc.c -@@ -329,6 +329,7 @@ static void paint_setup_xRGB8888 (paintinfo * p, unsigned char *dest); - static void paint_setup_xBGR8888 (paintinfo * p, unsigned char *dest); - static void paint_setup_RGBx8888 (paintinfo * p, unsigned char *dest); - static void paint_setup_BGRx8888 (paintinfo * p, unsigned char *dest); -+static void paint_setup_RGB666 (paintinfo * p, unsigned char *dest); - static void paint_setup_RGB888 (paintinfo * p, unsigned char *dest); - static void paint_setup_BGR888 (paintinfo * p, unsigned char *dest); - static void paint_setup_RGB565 (paintinfo * p, unsigned char *dest); -@@ -351,6 +352,7 @@ static void paint_hline_IMC1 (paintinfo * p, int x, int y, int w); - static void paint_hline_YUV9 (paintinfo * p, int x, int y, int w); - static void paint_hline_str4 (paintinfo * p, int x, int y, int w); - static void paint_hline_str3 (paintinfo * p, int x, int y, int w); -+static void paint_hline_RGB666 (paintinfo * p, int x, int y, int w); - static void paint_hline_RGB565 (paintinfo * p, int x, int y, int w); - static void paint_hline_xRGB1555 (paintinfo * p, int x, int y, int w); - -@@ -432,6 +434,8 @@ struct fourcc_list_struct fourcc_list[] = { - 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff}, - {VTS_RGB, "RGB ", "BGRA8888", 32, paint_setup_BGRA8888, paint_hline_str4, 32, - 0x0000ff00, 0x00ff0000, 0xff000000, 0x000000ff}, -+ {VTS_RGB, "RGB ", "RGB666", 32, paint_setup_RGB666, paint_hline_RGB666, 18, -+ 0x0003f000, 0x00000fc0, 0x0000003f}, - {VTS_RGB, "RGB ", "RGB888", 24, paint_setup_RGB888, paint_hline_str3, 24, - 0x00ff0000, 0x0000ff00, 0x000000ff}, - {VTS_RGB, "RGB ", "BGR888", 24, paint_setup_BGR888, paint_hline_str3, 24, -@@ -1700,6 +1704,16 @@ paint_setup_BGRx8888 (paintinfo * p, unsigned char *dest) - } - - static void -+paint_setup_RGB666 (paintinfo * p, unsigned char *dest) -+{ -+ p->yp = dest + 0; -+ p->up = dest + 1; -+ p->vp = dest + 2; -+ p->ystride = p->width * 4; -+ p->endptr = p->dest + p->ystride * p->height; -+} -+ -+static void - paint_setup_RGB888 (paintinfo * p, unsigned char *dest) - { - p->yp = dest + 0; -@@ -1735,6 +1749,20 @@ paint_hline_str4 (paintinfo * p, int x, int y, int w) - } - - static void -+paint_hline_RGB666 (paintinfo * p, int x, int y, int w) -+{ -+ int offset = y * p->ystride; -+ guint8 a, b, c; -+ a = (p->color->R & 0xC0) >> 6; -+ b = ((p->color->R & 0xf0) << 2) | ((p->color->G & 0xf0) >> 4); -+ c = ((p->color->G & 0x0c) << 4) | (p->color->B >> 2); -+ -+ oil_splat_u8 (p->yp + offset + x * 4, 4, &c, w); -+ oil_splat_u8 (p->up + offset + x * 4, 4, &b, w); -+ oil_splat_u8 (p->vp + offset + x * 4, 4, &a, w); -+} -+ -+static void - paint_hline_str3 (paintinfo * p, int x, int y, int w) - { - int offset = y * p->ystride; --- -1.5.6.5 - diff --git a/patches/gst-plugins-base-0.10.35/autogen.sh b/patches/gst-plugins-base-0.10.35/autogen.sh new file mode 120000 index 000000000..9f8a4cb7d --- /dev/null +++ b/patches/gst-plugins-base-0.10.35/autogen.sh @@ -0,0 +1 @@ +../autogen.sh \ No newline at end of file diff --git a/patches/gst-plugins-base-0.10.35/series b/patches/gst-plugins-base-0.10.35/series index 97aff6e5b..9b0c490c7 100644 --- a/patches/gst-plugins-base-0.10.35/series +++ b/patches/gst-plugins-base-0.10.35/series @@ -1 +1,5 @@ -add-RGB666-Support-to-ffmpegcolorspace.patch -p0 +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-added-RGB666-Support-to-ffmpegcolorspace.patch +0002-fix-building-test-program.patch +# bd27eb09bf57e88fc89c29faa6867395 - git-ptx-patches magic -- cgit v1.2.3