mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
videotestsrc: Add support for generating video/x-raw-gray with bpp=depth=8
This commit is contained in:
parent
77bc4ff763
commit
dea48dc885
1 changed files with 25 additions and 3 deletions
|
@ -423,6 +423,9 @@ struct fourcc_list_struct fourcc_list[] = {
|
||||||
/* Y800 grayscale */
|
/* Y800 grayscale */
|
||||||
{VTS_YUV, "Y800", "Y800", 8, paint_setup_Y800, paint_hline_Y800},
|
{VTS_YUV, "Y800", "Y800", 8, paint_setup_Y800, paint_hline_Y800},
|
||||||
|
|
||||||
|
/* Not exactly YUV but it's the same as above */
|
||||||
|
{VTS_YUV, "GRAY8", "GRAY8", 8, paint_setup_Y800, paint_hline_Y800},
|
||||||
|
|
||||||
{VTS_RGB, "RGB ", "xRGB8888", 32, paint_setup_xRGB8888, paint_hline_str4, 24,
|
{VTS_RGB, "RGB ", "xRGB8888", 32, paint_setup_xRGB8888, paint_hline_str4, 24,
|
||||||
0x00ff0000, 0x0000ff00, 0x000000ff},
|
0x00ff0000, 0x0000ff00, 0x000000ff},
|
||||||
{VTS_RGB, "RGB ", "xBGR8888", 32, paint_setup_xBGR8888, paint_hline_str4, 24,
|
{VTS_RGB, "RGB ", "xBGR8888", 32, paint_setup_xBGR8888, paint_hline_str4, 24,
|
||||||
|
@ -463,7 +466,21 @@ paintinfo_find_by_structure (const GstStructure * structure)
|
||||||
|
|
||||||
g_return_val_if_fail (structure, NULL);
|
g_return_val_if_fail (structure, NULL);
|
||||||
|
|
||||||
if (strcmp (media_type, "video/x-raw-yuv") == 0) {
|
if (strcmp (media_type, "video/x-raw-gray") == 0) {
|
||||||
|
gint bpp, depth;
|
||||||
|
|
||||||
|
ret = gst_structure_get_int (structure, "bpp", &bpp) &&
|
||||||
|
gst_structure_get_int (structure, "depth", &depth);
|
||||||
|
if (!ret || bpp != 8 || depth != 8)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < n_fourccs; i++) {
|
||||||
|
if (fourcc_list[i].type == VTS_YUV
|
||||||
|
&& strcmp (fourcc_list[i].fourcc, "GRAY8") == 0) {
|
||||||
|
return fourcc_list + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (strcmp (media_type, "video/x-raw-yuv") == 0) {
|
||||||
char *s;
|
char *s;
|
||||||
int fourcc;
|
int fourcc;
|
||||||
guint32 format;
|
guint32 format;
|
||||||
|
@ -600,8 +617,13 @@ paint_get_structure (struct fourcc_list_struct * format)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VTS_YUV:
|
case VTS_YUV:
|
||||||
structure = gst_structure_new ("video/x-raw-yuv",
|
if (strcmp (format->fourcc, "GRAY8") == 0) {
|
||||||
"format", GST_TYPE_FOURCC, fourcc, NULL);
|
structure = gst_structure_new ("video/x-raw-gray",
|
||||||
|
"bpp", G_TYPE_INT, 8, "depth", G_TYPE_INT, 8, NULL);
|
||||||
|
} else {
|
||||||
|
structure = gst_structure_new ("video/x-raw-yuv",
|
||||||
|
"format", GST_TYPE_FOURCC, fourcc, NULL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VTS_BAYER:
|
case VTS_BAYER:
|
||||||
structure = gst_structure_new ("video/x-raw-bayer", NULL);
|
structure = gst_structure_new ("video/x-raw-bayer", NULL);
|
||||||
|
|
Loading…
Reference in a new issue