#endif
/* get caps info */
-#define MMPLAYER_GST_GET_CAPS_INFO(x_pad, x_caps, x_str, x_name, x_ret) \
+#define MMPLAYER_GST_GET_CAPS_INFO(x_caps, x_str, x_name, x_ret) \
do { \
- x_caps = gst_pad_get_current_caps(x_pad); \
- if (!x_caps) \
- x_caps = gst_pad_query_caps(x_pad, NULL); \
- if (x_caps) { \
- x_str = gst_caps_get_structure(x_caps, 0); \
- if (x_str) { \
- x_name = gst_structure_get_name(x_str); \
- } \
+ x_ret = TRUE; \
+ if (!(x_caps)) { \
+ LOGE("input caps is NULL"); \
+ x_ret = FALSE; \
+ break; \
} \
- if (!x_caps || !x_str || !x_name) { \
+ x_str = gst_caps_get_structure(x_caps, 0); \
+ if (x_str) \
+ x_name = gst_structure_get_name(x_str); \
+ if (!(x_str) || !(x_name)) { \
LOGE("failed to get caps info"); \
x_ret = FALSE; \
} \
} while (0)
+#define MMPLAYER_GST_GET_CAPS_INFO_FROM_PAD(x_pad, x_caps, x_str, x_name, x_ret) \
+ do { \
+ x_caps = gst_pad_get_current_caps(x_pad); \
+ if (!(x_caps)) \
+ x_caps = gst_pad_query_caps(x_pad, NULL); \
+ MMPLAYER_GST_GET_CAPS_INFO(x_caps, x_str, x_name, x_ret); \
+ } while (0)
+
/*=======================================================================================
| GLOBAL FUNCTION PROTOTYPES |
========================================================================================*/