DISCO_UNLOCK (dc);
}
-static gboolean
-_event_probe (GstPad * pad, GstEvent * event, PrivateStream * ps)
+static GstProbeReturn
+_event_probe (GstPad * pad, GstProbeType type, GstEvent * event,
+ PrivateStream * ps)
{
if (GST_EVENT_TYPE (event) == GST_EVENT_TAG) {
GstTagList *tl = NULL, *tmp;
DISCO_UNLOCK (ps->dc);
}
- return TRUE;
+ return GST_PROBE_OK;
}
static void
g_object_set (ps->sink, "silent", TRUE, NULL);
g_object_set (ps->queue, "max-size-buffers", 1, "silent", TRUE, NULL);
- caps = gst_pad_get_caps_reffed (pad);
+ caps = gst_pad_get_caps (pad, NULL);
if (gst_caps_can_intersect (caps, subs_caps)) {
/* Subtitle streams are sparse and don't provide any information - don't
gst_object_unref (sinkpad);
/* Add an event probe */
- gst_pad_add_event_probe (pad, G_CALLBACK (_event_probe), ps);
+ gst_pad_add_probe (pad, GST_PROBE_TYPE_EVENT,
+ (GstPadProbeCallback) _event_probe, ps, NULL);
DISCO_LOCK (dc);
dc->priv->streams = g_list_append (dc->priv->streams, ps);
if (!caps) {
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
GST_DEBUG_PAD_NAME (ps->pad));
- caps = gst_pad_get_caps (ps->pad);
+ caps = gst_pad_get_caps (ps->pad, NULL);
}
if (caps) {
GST_DEBUG ("Got caps %" GST_PTR_FORMAT, caps);
GstCaps *caps;
GstStructure *caps_st, *tags_st;
const gchar *name;
- int tmp, tmp2;
+ int tmp;
guint utmp;
- gboolean btmp;
if (!st || !gst_structure_id_has_field (st, _CAPS_QUARK)) {
GST_WARNING ("Couldn't find caps !");
return parent;
else
return (GstDiscovererStreamInfo *)
- gst_mini_object_new (GST_TYPE_DISCOVERER_STREAM_INFO);
+ g_object_new (GST_TYPE_DISCOVERER_STREAM_INFO, NULL);
}
gst_structure_id_get (st, _CAPS_QUARK, GST_TYPE_CAPS, &caps, NULL);
info = (GstDiscovererAudioInfo *) parent;
else {
info = (GstDiscovererAudioInfo *)
- gst_mini_object_new (GST_TYPE_DISCOVERER_AUDIO_INFO);
+ g_object_new (GST_TYPE_DISCOVERER_AUDIO_INFO, NULL);
info->parent.caps = caps;
}
} else if (g_str_has_prefix (name, "video/") ||
g_str_has_prefix (name, "image/")) {
GstDiscovererVideoInfo *info;
- GstVideoFormat format;
+ GstVideoInfo vinfo;
if (parent)
info = (GstDiscovererVideoInfo *) parent;
else {
info = (GstDiscovererVideoInfo *)
- gst_mini_object_new (GST_TYPE_DISCOVERER_VIDEO_INFO);
+ g_object_new (GST_TYPE_DISCOVERER_VIDEO_INFO, NULL);
info->parent.caps = caps;
}
- if (gst_video_format_parse_caps (caps, &format, &tmp, &tmp2)) {
- info->width = (guint) tmp;
- info->height = (guint) tmp2;
- }
+ if (gst_video_info_from_caps (&vinfo, caps)) {
+ info->width = (guint) vinfo.width;
+ info->height = (guint) vinfo.height;
- if (gst_structure_get_int (caps_st, "depth", &tmp))
- info->depth = (guint) tmp;
+ info->depth = (guint) 0;
- if (gst_video_parse_caps_pixel_aspect_ratio (caps, &tmp, &tmp2)) {
- info->par_num = tmp;
- info->par_denom = tmp2;
- }
+ info->par_num = vinfo.par_n;
+ info->par_denom = vinfo.par_d;
- if (gst_video_parse_caps_framerate (caps, &tmp, &tmp2)) {
- info->framerate_num = tmp;
- info->framerate_denom = tmp2;
- }
+ info->framerate_num = vinfo.fps_n;
+ info->framerate_denom = vinfo.fps_d;
- if (gst_video_format_parse_caps_interlaced (caps, &btmp))
- info->interlaced = btmp;
+ info->interlaced = (vinfo.flags & GST_VIDEO_FLAG_INTERLACED) != 0;
+ }
if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
gst_structure_id_get (st, _TAGS_QUARK,
info = parent;
else {
info = (GstDiscovererStreamInfo *)
- gst_mini_object_new (GST_TYPE_DISCOVERER_STREAM_INFO);
+ g_object_new (GST_TYPE_DISCOVERER_STREAM_INFO, NULL);
info->caps = caps;
}
GST_DEBUG ("next is a list of %d entries", len);
cont = (GstDiscovererContainerInfo *)
- gst_mini_object_new (GST_TYPE_DISCOVERER_CONTAINER_INFO);
+ g_object_new (GST_TYPE_DISCOVERER_CONTAINER_INFO, NULL);
cont->parent.caps = caps;
res = (GstDiscovererStreamInfo *) cont;
gst_caps_get_structure (dc->priv->current_info->stream_info->caps, 0);
if (g_str_has_prefix (gst_structure_get_name (st), "image/"))
- ((GstDiscovererVideoInfo *) dc->priv->current_info->
- stream_info)->is_image = TRUE;
+ ((GstDiscovererVideoInfo *) dc->priv->current_info->stream_info)->
+ is_image = TRUE;
}
}
case GST_MESSAGE_ELEMENT:
{
- GQuark sttype = gst_structure_get_name_id (msg->structure);
+ GQuark sttype;
+ const GstStructure *structure;
+
+ structure = gst_message_get_structure (msg);
+ sttype = gst_structure_get_name_id (structure);
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
- "structure %" GST_PTR_FORMAT, msg->structure);
+ "structure %" GST_PTR_FORMAT, structure);
if (sttype == _MISSING_PLUGIN_QUARK) {
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
"Setting result to MISSING_PLUGINS");
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
- dc->priv->current_info->misc = gst_structure_copy (msg->structure);
+ dc->priv->current_info->misc = gst_structure_copy (structure);
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
- dc->priv->current_topology = gst_structure_copy (msg->structure);
+ dc->priv->current_topology = gst_structure_copy (structure);
}
}
break;
/* Pop URI off the pending URI list */
dc->priv->current_info =
- (GstDiscovererInfo *) gst_mini_object_new (GST_TYPE_DISCOVERER_INFO);
+ (GstDiscovererInfo *) g_object_new (GST_TYPE_DISCOVERER_INFO, NULL);
dc->priv->current_info->uri = (gchar *) dc->priv->pending_uris->data;
dc->priv->pending_uris =
g_list_delete_link (dc->priv->pending_uris, dc->priv->pending_uris);