pbutils: don't depend on libgstvideo just to parse some caps

Let's extract those ints and fractions ourselves and not depend
on libgstvideo.
This commit is contained in:
Tim-Philipp Müller 2011-08-27 14:57:41 +01:00
parent 517153e85a
commit 67a12c9c72
3 changed files with 11 additions and 17 deletions

View file

@ -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)

View file

@ -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)

View file

@ -44,7 +44,6 @@
#include "config.h"
#endif
#include <gst/video/video.h>
#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,