From 26bf14c9fd5eaefefcd1d4ffa7d65b793e1aabdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2013 14:53:24 +0100 Subject: [PATCH] openni2src: Check color format --- ext/openni2/gstopenni2src.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/openni2/gstopenni2src.cpp b/ext/openni2/gstopenni2src.cpp index 1ae50583cf..b436e42c4d 100644 --- a/ext/openni2/gstopenni2src.cpp +++ b/ext/openni2/gstopenni2src.cpp @@ -327,15 +327,15 @@ gst_openni2_src_get_caps (GstBaseSrc * src, GstCaps * filter) : gst_caps_ref (ni2src->gst_caps); } // If we are here, we need to compose the caps and return them. - if (ni2src->colorpixfmt != openni::PIXEL_FORMAT_RGB888) - return gst_caps_new_empty (); /* Uh oh, not RGB :? Not supported. */ if (ni2src->depth.isValid () && ni2src->color.isValid () && - ni2src->sourcetype == SOURCETYPE_BOTH) { + ni2src->sourcetype == SOURCETYPE_BOTH + && ni2src->colorpixfmt == openni::PIXEL_FORMAT_RGB888) { format = GST_VIDEO_FORMAT_RGBA; } else if (ni2src->depth.isValid () && ni2src->sourcetype == SOURCETYPE_DEPTH) { format = GST_VIDEO_FORMAT_GRAY16_LE; - } else if (ni2src->color.isValid () && ni2src->sourcetype == SOURCETYPE_COLOR) { + } else if (ni2src->color.isValid () && ni2src->sourcetype == SOURCETYPE_COLOR + && ni2src->colorpixfmt == openni::PIXEL_FORMAT_RGB888) { format = GST_VIDEO_FORMAT_RGB; } else { return gst_caps_new_empty (); @@ -452,7 +452,8 @@ gst_openni2src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query) if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) { GST_DEBUG_OBJECT (pool, "activate Video Meta"); - gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); + gst_buffer_pool_config_add_option (config, + GST_BUFFER_POOL_OPTION_VIDEO_META); } gst_buffer_pool_set_config (pool, config);