mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 02:02:26 +00:00
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:
parent
517153e85a
commit
67a12c9c72
3 changed files with 11 additions and 17 deletions
|
@ -29,10 +29,8 @@ riff: tag audio
|
||||||
|
|
||||||
rtsp: sdp
|
rtsp: sdp
|
||||||
|
|
||||||
pbutils: video
|
|
||||||
|
|
||||||
INDEPENDENT_SUBDIRS = \
|
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)
|
.PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS)
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,7 @@ noinst_HEADERS = \
|
||||||
pbutils-private.h
|
pbutils-private.h
|
||||||
EXTRA_DIST = pbutils-marshal.list
|
EXTRA_DIST = pbutils-marshal.list
|
||||||
|
|
||||||
libgstpbutils_@GST_MAJORMINOR@_la_LIBADD = \
|
libgstpbutils_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS)
|
||||||
$(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_MAJORMINOR@.la \
|
|
||||||
$(GST_LIBS)
|
|
||||||
libgstpbutils_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
|
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)
|
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) \
|
$(gir_cincludes) \
|
||||||
-I$(top_srcdir)/gst-libs \
|
-I$(top_srcdir)/gst-libs \
|
||||||
-I$(top_builddir)/gst-libs \
|
-I$(top_builddir)/gst-libs \
|
||||||
--add-include-path=$(srcdir)/../video \
|
|
||||||
--add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \
|
--add-include-path=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \
|
||||||
--library=libgstpbutils-@GST_MAJORMINOR@.la \
|
--library=libgstpbutils-@GST_MAJORMINOR@.la \
|
||||||
--library-path=`$(PKG_CONFIG) --variable=libdir gstreamer-@GST_MAJORMINOR@` \
|
--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@ \
|
--include=Gst-@GST_MAJORMINOR@ \
|
||||||
--libtool="$(top_builddir)/libtool" \
|
--libtool="$(top_builddir)/libtool" \
|
||||||
--pkg gstreamer-@GST_MAJORMINOR@ \
|
--pkg gstreamer-@GST_MAJORMINOR@ \
|
||||||
--pkg gstreamer-video-@GST_MAJORMINOR@ \
|
|
||||||
--pkg-export gstreamer-pbutils-@GST_MAJORMINOR@ \
|
--pkg-export gstreamer-pbutils-@GST_MAJORMINOR@ \
|
||||||
--add-init-section="gst_init(NULL,NULL);" \
|
--add-init-section="gst_init(NULL,NULL);" \
|
||||||
--output $@ \
|
--output $@ \
|
||||||
|
@ -111,7 +107,6 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
|
||||||
$(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \
|
$(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \
|
||||||
$(INTROSPECTION_COMPILER) \
|
$(INTROSPECTION_COMPILER) \
|
||||||
--includedir=$(srcdir) \
|
--includedir=$(srcdir) \
|
||||||
--includedir=$(srcdir)/../video \
|
|
||||||
--includedir=$(builddir) \
|
--includedir=$(builddir) \
|
||||||
--includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \
|
--includedir=`$(PKG_CONFIG) --variable=girdir gstreamer-@GST_MAJORMINOR@` \
|
||||||
$(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
|
$(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gst/video/video.h>
|
|
||||||
#include "pbutils.h"
|
#include "pbutils.h"
|
||||||
#include "pbutils-marshal.h"
|
#include "pbutils-marshal.h"
|
||||||
#include "pbutils-private.h"
|
#include "pbutils-private.h"
|
||||||
|
@ -615,7 +614,6 @@ collect_information (GstDiscoverer * dc, const GstStructure * st,
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
int tmp, tmp2;
|
int tmp, tmp2;
|
||||||
guint utmp;
|
guint utmp;
|
||||||
gboolean btmp;
|
|
||||||
|
|
||||||
if (!st || !gst_structure_id_has_field (st, _CAPS_QUARK)) {
|
if (!st || !gst_structure_id_has_field (st, _CAPS_QUARK)) {
|
||||||
GST_WARNING ("Couldn't find caps !");
|
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/") ||
|
} else if (g_str_has_prefix (name, "video/") ||
|
||||||
g_str_has_prefix (name, "image/")) {
|
g_str_has_prefix (name, "image/")) {
|
||||||
GstDiscovererVideoInfo *info;
|
GstDiscovererVideoInfo *info;
|
||||||
GstVideoFormat format;
|
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
info = (GstDiscovererVideoInfo *) parent;
|
info = (GstDiscovererVideoInfo *) parent;
|
||||||
|
@ -690,7 +687,8 @@ collect_information (GstDiscoverer * dc, const GstStructure * st,
|
||||||
info->parent.caps = caps;
|
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->width = (guint) tmp;
|
||||||
info->height = (guint) tmp2;
|
info->height = (guint) tmp2;
|
||||||
}
|
}
|
||||||
|
@ -698,18 +696,21 @@ collect_information (GstDiscoverer * dc, const GstStructure * st,
|
||||||
if (gst_structure_get_int (caps_st, "depth", &tmp))
|
if (gst_structure_get_int (caps_st, "depth", &tmp))
|
||||||
info->depth = (guint) 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_num = tmp;
|
||||||
info->par_denom = tmp2;
|
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_num = tmp;
|
||||||
info->framerate_denom = tmp2;
|
info->framerate_denom = tmp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_video_format_parse_caps_interlaced (caps, &btmp))
|
if (!gst_structure_get_boolean (caps_st, "interlaced", &info->interlaced))
|
||||||
info->interlaced = btmp;
|
info->interlaced = FALSE;
|
||||||
|
|
||||||
if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
|
if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
|
||||||
gst_structure_id_get (st, _TAGS_QUARK,
|
gst_structure_id_get (st, _TAGS_QUARK,
|
||||||
|
|
Loading…
Reference in a new issue