From 67a12c9c7298717901efce0bcfa6abbe84f97cb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 27 Aug 2011 14:57:41 +0100 Subject: [PATCH] pbutils: don't depend on libgstvideo just to parse some caps Let's extract those ints and fractions ourselves and not depend on libgstvideo. --- gst-libs/gst/Makefile.am | 4 +--- gst-libs/gst/pbutils/Makefile.am | 7 +------ gst-libs/gst/pbutils/gstdiscoverer.c | 17 +++++++++-------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am index 05a4e87..6f261b3 100644 --- a/gst-libs/gst/Makefile.am +++ b/gst-libs/gst/Makefile.am @@ -29,10 +29,8 @@ riff: tag audio rtsp: sdp -pbutils: video - INDEPENDENT_SUBDIRS = \ - interfaces tag fft floatcast netbuffer rtp sdp video app + interfaces tag fft floatcast netbuffer pbutils rtp sdp video app .PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS) diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am index fab6523..1ed49ab 100644 --- a/gst-libs/gst/pbutils/Makefile.am +++ b/gst-libs/gst/pbutils/Makefile.am @@ -45,9 +45,7 @@ noinst_HEADERS = \ pbutils-private.h EXTRA_DIST = pbutils-marshal.list -libgstpbutils_@GST_MAJORMINOR@_la_LIBADD = \ - $(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_MAJORMINOR@.la \ - $(GST_LIBS) +libgstpbutils_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) libgstpbutils_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) libgstpbutils_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) @@ -83,7 +81,6 @@ GstPbutils-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_MAJ $(gir_cincludes) \ -I$(top_srcdir)/gst-libs \ -I$(top_builddir)/gst-libs \ - --add-include-path=$(srcdir)/../video \ --add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \ --library=libgstpbutils-@GST_MAJORMINOR@.la \ --library-path=`$(PKG_CONFIG) --variable=libdir gstreamer-@GST_MAJORMINOR@` \ @@ -91,7 +88,6 @@ GstPbutils-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_MAJ --include=Gst-@GST_MAJORMINOR@ \ --libtool="$(top_builddir)/libtool" \ --pkg gstreamer-@GST_MAJORMINOR@ \ - --pkg gstreamer-video-@GST_MAJORMINOR@ \ --pkg-export gstreamer-pbutils-@GST_MAJORMINOR@ \ --add-init-section="gst_init(NULL,NULL);" \ --output $@ \ @@ -111,7 +107,6 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ $(INTROSPECTION_COMPILER) \ --includedir=$(srcdir) \ - --includedir=$(srcdir)/../video \ --includedir=$(builddir) \ --includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 21e4f52..bd5ad95 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -44,7 +44,6 @@ #include "config.h" #endif -#include #include "pbutils.h" #include "pbutils-marshal.h" #include "pbutils-private.h" @@ -615,7 +614,6 @@ collect_information (GstDiscoverer * dc, const GstStructure * st, const gchar *name; int tmp, tmp2; guint utmp; - gboolean btmp; if (!st || !gst_structure_id_has_field (st, _CAPS_QUARK)) { GST_WARNING ("Couldn't find caps !"); @@ -680,7 +678,6 @@ collect_information (GstDiscoverer * dc, const GstStructure * st, } else if (g_str_has_prefix (name, "video/") || g_str_has_prefix (name, "image/")) { GstDiscovererVideoInfo *info; - GstVideoFormat format; if (parent) info = (GstDiscovererVideoInfo *) parent; @@ -690,7 +687,8 @@ collect_information (GstDiscoverer * dc, const GstStructure * st, info->parent.caps = caps; } - if (gst_video_format_parse_caps (caps, &format, &tmp, &tmp2)) { + if (gst_structure_get_int (caps_st, "width", &tmp) && + gst_structure_get_int (caps_st, "height", &tmp2)) { info->width = (guint) tmp; info->height = (guint) tmp2; } @@ -698,18 +696,21 @@ collect_information (GstDiscoverer * dc, const GstStructure * st, if (gst_structure_get_int (caps_st, "depth", &tmp)) info->depth = (guint) tmp; - if (gst_video_parse_caps_pixel_aspect_ratio (caps, &tmp, &tmp2)) { + if (gst_structure_get_fraction (caps_st, "pixel-aspect-ratio", &tmp, &tmp2)) { info->par_num = tmp; info->par_denom = tmp2; + } else { + info->par_num = 1; + info->par_denom = 1; } - if (gst_video_parse_caps_framerate (caps, &tmp, &tmp2)) { + if (gst_structure_get_fraction (caps_st, "framerate", &tmp, &tmp2)) { info->framerate_num = tmp; info->framerate_denom = tmp2; } - if (gst_video_format_parse_caps_interlaced (caps, &btmp)) - info->interlaced = btmp; + if (!gst_structure_get_boolean (caps_st, "interlaced", &info->interlaced)) + info->interlaced = FALSE; if (gst_structure_id_has_field (st, _TAGS_QUARK)) { gst_structure_id_get (st, _TAGS_QUARK, -- 2.7.4