+ if(strcmp(__format->colorspace,"YUV") == 0) {
+ if(strcmp(__format->format_label,"I420") == 0) {
+ _a='I'; _b='4', _c='2', _d='0';
+ }else if(strcmp(__format->format_label,"Y42B") == 0) {
+ _a='Y'; _b='4', _c='2', _d='B';
+ }else if(strcmp(__format->format_label,"Y444") == 0) {
+ _a='Y'; _b='4', _c='4', _d='4';
+ }else if(strcmp(__format->format_label,"YV12") == 0) {
+ _a='Y'; _b='V', _c='1', _d='2'; //GStreamer-CRITICAL **: gst_mini_object_ref: assertion `mini_object != NULL' failed
+ }else if(strcmp(__format->format_label,"NV12") == 0) {
+ _a='N'; _b='V', _c='1', _d='2';
+ }else if(strcmp(__format->format_label,"UYVY") == 0) {
+ _a='U'; _b='Y', _c='V', _d='Y';
+ }else if(strcmp(__format->format_label,"YUYV") == 0) {
+ _a='Y'; _b='U', _c='Y', _d='2';
+ }
+
+ __format->caps = gst_caps_new_simple ("video/x-raw-yuv",
+ "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC (_a, _b, _c, _d), //'I', '4', '2', '0'),
+ "framerate", GST_TYPE_FRACTION, 25, 1,
+ "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
+ "width", G_TYPE_INT, __format->width,
+ "height", G_TYPE_INT, __format->height,
+ "framerate", GST_TYPE_FRACTION, 1, 1,
+ NULL);
+ }
+
+ else if(strcmp(__format->colorspace,"RGB") ==0 || strcmp(__format->colorspace,"BGRX") ==0) {
+ if(strcmp(__format->format_label,"RGB888") == 0) {
+ _bpp=24; _depth=24; _red_mask=16711680; _green_mask=65280; _blue_mask=255; _endianness=4321;
+ }else if(strcmp(__format->format_label,"BGR888") == 0) {
+ _bpp=24; _depth=24; _red_mask=255; _green_mask=65280; _blue_mask=16711680; _endianness=4321;
+ }else if(strcmp(__format->format_label,"RGB565") == 0) {
+ _bpp=16; _depth=16; _red_mask=63488; _green_mask=2016; _blue_mask=31; _endianness=1234;
+ }else if( (strcmp(__format->format_label, "BGRX") == 0)) {
+ _bpp=32; _depth=24; _red_mask=65280; _green_mask=16711680; _blue_mask=-16777216; _endianness=4321;
+ }
+ __format->caps = gst_caps_new_simple ("video/x-raw-rgb",
+ "bpp", G_TYPE_INT, _bpp,
+ "depth", G_TYPE_INT, _depth,
+ "red_mask", G_TYPE_INT, _red_mask,
+ "green_mask", G_TYPE_INT, _green_mask,
+ "blue_mask", G_TYPE_INT, _blue_mask,
+ "width", G_TYPE_INT, __format->width,
+ "height", G_TYPE_INT, __format->height,
+ "endianness", G_TYPE_INT, _endianness,
+ "framerate", GST_TYPE_FRACTION, 1, 1, NULL);