{
const GstStructure *structure;
const char *media_type = NULL;
- MMPixelFormatType type = 0;
+ MMPixelFormatType type = MM_PIXEL_FORMAT_INVALID;
unsigned int fourcc = 0;
GstVideoInfo media_info;
} else if (!strcmp(media_type, "video/x-raw-yuv")) {
_mmstreamrec_dbg_log("It is yuv.");
gst_video_info_init(&media_info);
- gst_video_info_from_caps(&media_info, caps);
- fourcc = gst_video_format_to_fourcc(GST_VIDEO_INFO_FORMAT(&media_info));
- type = _mmstreamrecorder_get_pixtype(fourcc);
+ if (gst_video_info_from_caps(&media_info, caps)) {
+ fourcc = gst_video_format_to_fourcc(GST_VIDEO_INFO_FORMAT(&media_info));
+ type = _mmstreamrecorder_get_pixtype(fourcc);
+ } else {
+ _mmstreamrec_dbg_err("Getting media_info is failed");
+ }
} else if (!strcmp(media_type, "video/x-raw-rgb")) {
_mmstreamrec_dbg_log("It is rgb.");
type = MM_PIXEL_FORMAT_RGB888;
_mmstreamrec_dbg_log("Type [%d]", type);
+error:
gst_caps_unref(caps);
caps = NULL;