2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * Library <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
27 /* This is simply a convenience function, nothing more or less */
30 gst_video_frame_rate (GstPad *pad)
36 caps = GST_PAD_CAPS (pad);
38 g_warning ("gstvideo: failed to get caps of pad %s:%s",
39 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
44 if (!gst_caps_has_property_typed (caps, "framerate",
45 GST_PROPS_FLOAT_TYPE)) {
46 g_warning ("gstvideo: failed to get framerate property of pad %s:%s",
47 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
52 gst_caps_get_float (caps, "framerate", &fps);
54 GST_DEBUG ("Framerate request on pad %s:%s: %f",
55 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
56 GST_PAD_NAME(pad), fps);
62 gst_video_get_size (GstPad *pad,
68 g_return_val_if_fail (pad != NULL, FALSE);
70 caps = GST_PAD_CAPS (pad);
73 g_warning ("gstvideo: failed to get caps of pad %s:%s",
74 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
79 if (!gst_caps_has_property_typed (caps, "width",
80 GST_PROPS_INT_TYPE) ||
81 !gst_caps_has_property_typed (caps, "height",
82 GST_PROPS_FLOAT_TYPE)) {
83 g_warning ("gstvideo: failed to get size properties on pad %s:%s",
84 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
90 gst_caps_get_int (caps, "width", width);
92 gst_caps_get_int (caps, "height", height);
94 GST_DEBUG ("size request on pad %s:%s: %dx%d",
95 GST_ELEMENT_NAME (gst_pad_get_parent (pad)),
98 height ? *height : -1);
104 plugin_init (GstPlugin *plugin)
113 "Convenience routines for video plugins",