diff options
author | David Schleef <ds@schleef.org> | 2003-12-22 01:47:09 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2003-12-22 01:47:09 +0000 |
commit | b144bc6c58979f49a6e8e04a04a65f771247297a (patch) | |
tree | 648bc437ca5562bc7c67224ad71ef90dfacc12d1 /gst-libs/gst/video/video.c | |
parent | 2309d726b7b0c37dbd9c57c653e2053ec6258ac8 (diff) | |
download | gst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.tar.gz gst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.tar.bz2 gst-plugins-bad-b144bc6c58979f49a6e8e04a04a65f771247297a.zip |
Merge CAPS branch
Original commit message from CVS:
Merge CAPS branch
Diffstat (limited to 'gst-libs/gst/video/video.c')
-rw-r--r-- | gst-libs/gst/video/video.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 706acc3b..6d804a4d 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -26,11 +26,12 @@ /* This is simply a convenience function, nothing more or less */ -gfloat +gdouble gst_video_frame_rate (GstPad *pad) { - gfloat fps = 0.; + gdouble fps = 0.; GstCaps *caps; + GstStructure *structure; /* get pad caps */ caps = GST_PAD_CAPS (pad); @@ -41,16 +42,14 @@ gst_video_frame_rate (GstPad *pad) return 0.; } - if (!gst_caps_has_property_typed (caps, "framerate", - GST_PROPS_FLOAT_TYPE)) { + structure = gst_caps_get_structure (caps, 0); + if (!gst_structure_get_double (structure, "framerate", &fps)){ g_warning ("gstvideo: failed to get framerate property of pad %s:%s", GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return 0.; } - gst_caps_get_float (caps, "framerate", &fps); - GST_DEBUG ("Framerate request on pad %s:%s: %f", GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME(pad), fps); @@ -64,8 +63,12 @@ gst_video_get_size (GstPad *pad, gint *height) { GstCaps *caps; + GstStructure *structure; + gboolean ret; g_return_val_if_fail (pad != NULL, FALSE); + g_return_val_if_fail (width != NULL, FALSE); + g_return_val_if_fail (height != NULL, FALSE); caps = GST_PAD_CAPS (pad); @@ -76,21 +79,17 @@ gst_video_get_size (GstPad *pad, return FALSE; } - if (!gst_caps_has_property_typed (caps, "width", - GST_PROPS_INT_TYPE) || - !gst_caps_has_property_typed (caps, "height", - GST_PROPS_FLOAT_TYPE)) { + structure = gst_caps_get_structure (caps, 0); + ret = gst_structure_get_int (structure, "width", width); + ret &= gst_structure_get_int (structure, "height", height); + + if (!ret) { g_warning ("gstvideo: failed to get size properties on pad %s:%s", GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME(pad)); return FALSE; } - if (width) - gst_caps_get_int (caps, "width", width); - if (height) - gst_caps_get_int (caps, "height", height); - GST_DEBUG ("size request on pad %s:%s: %dx%d", GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad), |