如何从 GstCaps 获取 video/x-raw

How to get video/x-raw from GstCaps

我试图支持所有相机驱动程序,但我需要将音频和视频驱动程序分开。所以我需要得到 video/x-raw、image/jpeg 来自 GstCaps 元素,但我在互联网上找不到任何如何从 GstCaps 获取 video/x-raw 的信息。

我知道如何从 GstCaps
获取高度和宽度 gst_structure_get_int(s, "height", &height);
gst_structure_get_int(s, "width", &width);


但是我不知道如何得到
"video/x-raw",
"image/jpeg",
"application/x-rtp"

它的作用是什么?

使用gst_structure_get_name (const GstStructure *structure);

const gchar *media_type = gst_structure_get_name (s);
g_print("media_type is: %s\n", media_type);