static GstCaps * theora_enc_getcaps (GstVideoEncoder * encoder, GstCaps * filter) { GstCaps *caps, *ret; char *supported_formats, *caps_string; supported_formats = theora_enc_get_supported_formats (); if (!supported_formats) { GST_WARNING ("no supported formats found. Encoder disabled?"); return gst_caps_new_empty (); } caps_string = g_strdup_printf ("video/x-raw, " "format = (string) { %s }, " "framerate = (fraction) [1/MAX, MAX], " "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]", supported_formats); caps = gst_caps_from_string (caps_string); g_free (caps_string); g_free (supported_formats); GST_DEBUG ("Supported caps: %" GST_PTR_FORMAT, caps); ret = gst_video_encoder_proxy_getcaps (encoder, caps, filter); gst_caps_unref (caps); return ret; }
static GstCaps * theora_enc_sink_getcaps (GstPad * pad) { GstCaps *caps; char *supported_formats, *caps_string; supported_formats = theora_enc_get_supported_formats (); if (!supported_formats) { GST_WARNING ("no supported formats found. Encoder disabled?"); return gst_caps_new_empty (); } caps_string = g_strdup_printf ("video/x-raw-yuv, " "format = (fourcc) { %s }, " "framerate = (fraction) [1/MAX, MAX], " "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]", supported_formats); caps = gst_caps_from_string (caps_string); g_free (caps_string); g_free (supported_formats); GST_DEBUG ("Supported caps: %" GST_PTR_FORMAT, caps); return caps; }