PROP_DECIMATE
};
-GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src);
#ifdef HAVE_XVIDEO
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
gst_v4l2src_color_balance_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_ORIENTATION,
- gst_v4l2src_video_orientation_interface_init);
- G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
- gst_v4l2src_property_probe_interface_init));
+ gst_v4l2src_video_orientation_interface_init));
static void gst_v4l2src_dispose (GObject * object);
static void gst_v4l2src_finalize (GstV4l2Src * v4l2src);
static gboolean gst_v4l2src_decide_allocation (GstBaseSrc * src,
GstQuery * query);
static GstFlowReturn gst_v4l2src_fill (GstPushSrc * src, GstBuffer * out);
-static void gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps);
+static GstCaps *gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps);
static gboolean gst_v4l2src_negotiate (GstBaseSrc * basesrc);
static void gst_v4l2src_set_property (GObject * object, guint prop_id,
}
/* this function is a bit of a last resort */
-static void
+static GstCaps *
gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps)
{
GstStructure *structure;
GST_DEBUG_OBJECT (basesrc, "fixating caps %" GST_PTR_FORMAT, caps);
+ caps = gst_caps_make_writable (caps);
+
for (i = 0; i < gst_caps_get_size (caps); ++i) {
structure = gst_caps_get_structure (caps, i);
GST_DEBUG_OBJECT (basesrc, "fixated caps %" GST_PTR_FORMAT, caps);
- GST_BASE_SRC_CLASS (parent_class)->fixate (basesrc, caps);
+ caps = GST_BASE_SRC_CLASS (parent_class)->fixate (basesrc, caps);
+
+ return caps;
}
}
}
gst_caps_unref (thiscaps);
- gst_caps_unref (peercaps);
} else {
/* no peer or peer have ANY caps, work with our own caps then */
caps = thiscaps;
}
+ if (peercaps)
+ gst_caps_unref (peercaps);
if (caps) {
- caps = gst_caps_make_writable (caps);
- gst_caps_truncate (caps);
+ caps = gst_caps_truncate (caps);
/* now fixate */
if (!gst_caps_is_empty (caps)) {
- gst_v4l2src_fixate (basesrc, caps);
+ caps = gst_v4l2src_fixate (basesrc, caps);
GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps);
LOG_CAPS (basesrc, caps);
GstV4l2Src *src;
GstV4l2Object *obj;
GstBufferPool *pool;
- guint size, min, max, prefix, alignment;
+ guint size, min, max;
+ gboolean update;
src = GST_V4L2SRC (bsrc);
obj = src->v4l2object;
- gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
- &alignment, &pool);
+ if (gst_query_get_n_allocation_pools (query) > 0) {
+ gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
+ update = TRUE;
+ } else {
+ pool = NULL;
+ min = max = 0;
+ size = 0;
+ update = FALSE;
+ }
- GST_DEBUG_OBJECT (src, "allocation: size:%u min:%u max:%u prefix:%u "
- "align:%u pool:%" GST_PTR_FORMAT, size, min, max, prefix, alignment,
- pool);
+ GST_DEBUG_OBJECT (src, "allocation: size:%u min:%u max:%u pool:%"
+ GST_PTR_FORMAT, size, min, max, pool);
if (min != 0) {
/* if there is a min-buffers suggestion, use it. We add 1 because we need 1
const GstCaps *caps;
config = gst_buffer_pool_get_config (pool);
- gst_buffer_pool_config_get (config, &caps, NULL, NULL, NULL, NULL, NULL);
- gst_buffer_pool_config_set (config, caps, size, min, max, prefix,
- alignment);
+ gst_buffer_pool_config_get (config, &caps, NULL, NULL, NULL, NULL, NULL,
+ NULL);
+ gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 0);
/* if downstream supports video metadata, add this to the pool config */
- if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API))
+ if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE))
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_META);
gst_buffer_pool_set_config (pool, config);
}
- gst_query_set_allocation_params (query, size, min, max, prefix,
- alignment, pool);
+ if (update)
+ gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
+ else
+ gst_query_add_allocation_pool (query, pool, size, min, max);
return TRUE;
}