/**
* gst_video_convert_frame:
* @buf: a #GstBuffer
+ * @from_caps: the #GstCaps to convert from
* @to_caps: the #GstCaps to convert to
* @timeout: the maximum amount of time allowed for the processing.
* @error: pointer to a #GError. Can be %NULL.
*
*/
GstBuffer *
-gst_video_convert_frame (GstBuffer * buf, const GstCaps * to_caps,
- GstClockTime timeout, GError ** error)
+gst_video_convert_frame (GstBuffer * buf, GstCaps * from_caps,
+ const GstCaps * to_caps, GstClockTime timeout, GError ** err)
{
GstMessage *msg;
GstBuffer *result = NULL;
GError *err = NULL;
GstBus *bus;
- GstCaps *from_caps, *to_caps_copy = NULL;
+ GstCaps *to_caps_copy = NULL;
GstFlowReturn ret;
GstElement *pipeline, *src, *sink;
guint i, n;
g_return_val_if_fail (buf != NULL, NULL);
g_return_val_if_fail (to_caps != NULL, NULL);
- g_return_val_if_fail (GST_BUFFER_CAPS (buf) != NULL, NULL);
-
- from_caps = GST_BUFFER_CAPS (buf);
+ g_return_val_if_fail (from_caps != NULL, NULL);
to_caps_copy = gst_caps_new_empty ();
n = gst_caps_get_size (to_caps);
/* feed buffer in appsrc */
GST_DEBUG ("feeding buffer %p, size %u, caps %" GST_PTR_FORMAT,
- buf, GST_BUFFER_SIZE (buf), from_caps);
+ buf, gst_buffer_get_size (buf), from_caps);
g_signal_emit_by_name (src, "push-buffer", buf, &ret);
/* now see what happens. We either got an error somewhere or the pipeline
*
*/
void
-gst_video_convert_frame_async (GstBuffer * buf, const GstCaps * to_caps,
- GstClockTime timeout, GstVideoConvertFrameCallback callback,
- gpointer user_data, GDestroyNotify destroy_notify)
+gst_video_convert_frame_async (GstBuffer * buf, GstCaps * from_caps,
+ const GstCaps * to_caps, GstClockTime timeout,
+ GstVideoConvertFrameCallback callback, gpointer user_data,
+ GDestroyNotify destroy_notify)
{
GMainContext *context = NULL;
GError *error = NULL;
GstBus *bus;
- GstCaps *from_caps, *to_caps_copy = NULL;
+ GstCaps *to_caps_copy = NULL;
GstElement *pipeline, *src, *sink;
guint i, n;
GSource *source;
g_return_if_fail (buf != NULL);
g_return_if_fail (to_caps != NULL);
- g_return_if_fail (GST_BUFFER_CAPS (buf) != NULL);
+ g_return_if_fail (from_caps != NULL);
g_return_if_fail (callback != NULL);
context = g_main_context_get_thread_default ();
if (!context)
context = g_main_context_default ();
- from_caps = GST_BUFFER_CAPS (buf);
-
to_caps_copy = gst_caps_new_empty ();
n = gst_caps_get_size (to_caps);
for (i = 0; i < n; i++) {