diff options
Diffstat (limited to 'gst/debugutils')
-rw-r--r-- | gst/debugutils/Makefile.am | 55 | ||||
-rwxr-xr-x | gst/debugutils/Makefile.in | 1046 | ||||
-rw-r--r-- | gst/debugutils/breakmydata.c | 293 | ||||
-rw-r--r-- | gst/debugutils/cpureport.c | 149 | ||||
-rw-r--r-- | gst/debugutils/cpureport.h | 58 | ||||
-rw-r--r-- | gst/debugutils/gstcapsdebug.h | 55 | ||||
-rwxr-xr-x | gst/debugutils/gstcapssetter.c | 331 | ||||
-rw-r--r-- | gst/debugutils/gstcapssetter.h | 63 | ||||
-rw-r--r-- | gst/debugutils/gstdebug.c | 76 | ||||
-rw-r--r-- | gst/debugutils/gstnavigationtest.c | 277 | ||||
-rw-r--r-- | gst/debugutils/gstnavigationtest.h | 65 | ||||
-rwxr-xr-x | gst/debugutils/gstnavseek.c | 390 | ||||
-rw-r--r-- | gst/debugutils/gstnavseek.h | 60 | ||||
-rw-r--r-- | gst/debugutils/gstpushfilesrc.c | 203 | ||||
-rw-r--r-- | gst/debugutils/gstpushfilesrc.h | 56 | ||||
-rw-r--r-- | gst/debugutils/gsttaginject.c | 205 | ||||
-rw-r--r-- | gst/debugutils/gsttaginject.h | 66 | ||||
-rw-r--r-- | gst/debugutils/progressreport.c | 516 | ||||
-rw-r--r-- | gst/debugutils/progressreport.h | 67 | ||||
-rw-r--r-- | gst/debugutils/rndbuffersize.c | 580 | ||||
-rw-r--r-- | gst/debugutils/testplugin.c | 305 | ||||
-rwxr-xr-x | gst/debugutils/tests.c | 269 | ||||
-rw-r--r-- | gst/debugutils/tests.h | 43 |
23 files changed, 5228 insertions, 0 deletions
diff --git a/gst/debugutils/Makefile.am b/gst/debugutils/Makefile.am new file mode 100644 index 0000000..1a953d4 --- /dev/null +++ b/gst/debugutils/Makefile.am @@ -0,0 +1,55 @@ + +plugin_LTLIBRARIES = libgstdebug.la libgstnavigationtest.la + +noinst_HEADERS = \ + cpureport.h \ + gstcapsdebug.h \ + gstcapssetter.h \ + gstnavigationtest.h \ + gstnavseek.h \ + gstpushfilesrc.h \ + gsttaginject.h \ + progressreport.h \ + tests.h + +libgstnavigationtest_la_SOURCES = gstnavigationtest.c +libgstnavigationtest_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \ + $(GST_PLUGINS_BASE_CFLAGS) +libgstnavigationtest_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \ + $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_API_VERSION@ $(LIBM) +libgstnavigationtest_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstnavigationtest_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +libgstdebug_la_SOURCES = \ + gstdebug.c \ + breakmydata.c \ + gstcapssetter.c \ + gstnavseek.c \ + gstpushfilesrc.c \ + gsttaginject.c \ + rndbuffersize.c \ + progressreport.c \ + tests.c \ + cpureport.c \ + testplugin.c + +# gstcapsdebug.c + +libgstdebug_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) +libgstdebug_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) +libgstdebug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstdebug_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer \ + -:PROJECT libgstdebug -:SHARED libgstdebug \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstdebug_la_SOURCES) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdebug_la_CFLAGS) \ + -:LDFLAGS $(libgstdebug_la_LDFLAGS) \ + $(libgstdebug_la_LIBADD) \ + -ldl \ + -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ + LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ + > $@ diff --git a/gst/debugutils/Makefile.in b/gst/debugutils/Makefile.in new file mode 100755 index 0000000..8271893 --- /dev/null +++ b/gst/debugutils/Makefile.in @@ -0,0 +1,1046 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = gst/debugutils +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(noinst_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \ + $(top_srcdir)/common/m4/as-auto-alt.m4 \ + $(top_srcdir)/common/m4/as-compiler-flag.m4 \ + $(top_srcdir)/common/m4/as-gcc-inline-assembly.m4 \ + $(top_srcdir)/common/m4/as-libtool.m4 \ + $(top_srcdir)/common/m4/as-version.m4 \ + $(top_srcdir)/common/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/common/m4/gst-arch.m4 \ + $(top_srcdir)/common/m4/gst-args.m4 \ + $(top_srcdir)/common/m4/gst-check.m4 \ + $(top_srcdir)/common/m4/gst-default.m4 \ + $(top_srcdir)/common/m4/gst-dowhile.m4 \ + $(top_srcdir)/common/m4/gst-error.m4 \ + $(top_srcdir)/common/m4/gst-feature.m4 \ + $(top_srcdir)/common/m4/gst-gettext.m4 \ + $(top_srcdir)/common/m4/gst-glib2.m4 \ + $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \ + $(top_srcdir)/common/m4/gst-platform.m4 \ + $(top_srcdir)/common/m4/gst-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.m4 \ + $(top_srcdir)/common/m4/gst-x11.m4 \ + $(top_srcdir)/common/m4/gst.m4 \ + $(top_srcdir)/common/m4/gtk-doc.m4 \ + $(top_srcdir)/common/m4/orc.m4 $(top_srcdir)/common/m4/pkg.m4 \ + $(top_srcdir)/m4/aalib.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-fionread.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(plugindir)" +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgstdebug_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstdebug_la_OBJECTS = libgstdebug_la-gstdebug.lo \ + libgstdebug_la-breakmydata.lo libgstdebug_la-gstcapssetter.lo \ + libgstdebug_la-gstnavseek.lo libgstdebug_la-gstpushfilesrc.lo \ + libgstdebug_la-gsttaginject.lo libgstdebug_la-rndbuffersize.lo \ + libgstdebug_la-progressreport.lo libgstdebug_la-tests.lo \ + libgstdebug_la-cpureport.lo libgstdebug_la-testplugin.lo +libgstdebug_la_OBJECTS = $(am_libgstdebug_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libgstdebug_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstdebug_la_CFLAGS) $(CFLAGS) \ + $(libgstdebug_la_LDFLAGS) $(LDFLAGS) -o $@ +libgstnavigationtest_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstnavigationtest_la_OBJECTS = \ + libgstnavigationtest_la-gstnavigationtest.lo +libgstnavigationtest_la_OBJECTS = \ + $(am_libgstnavigationtest_la_OBJECTS) +libgstnavigationtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstnavigationtest_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(libgstnavigationtest_la_CFLAGS) \ + $(CFLAGS) $(libgstnavigationtest_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libgstdebug_la_SOURCES) $(libgstnavigationtest_la_SOURCES) +DIST_SOURCES = $(libgstdebug_la_SOURCES) \ + $(libgstnavigationtest_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +AALIB_CFLAGS = @AALIB_CFLAGS@ +AALIB_CONFIG = @AALIB_CONFIG@ +AALIB_LIBS = @AALIB_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ2_LIBS = @BZ2_LIBS@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@ +DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@ +DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@ +DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@ +DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@ +DIRECTSOUND_CFLAGS = @DIRECTSOUND_CFLAGS@ +DIRECTSOUND_LDFLAGS = @DIRECTSOUND_LDFLAGS@ +DIRECTSOUND_LIBS = @DIRECTSOUND_LIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DV1394_CFLAGS = @DV1394_CFLAGS@ +DV1394_LIBS = @DV1394_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +ERROR_OBJCFLAGS = @ERROR_OBJCFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +FLAC_CFLAGS = @FLAC_CFLAGS@ +FLAC_LIBS = @FLAC_LIBS@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LDFLAGS = @GIO_LDFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_PREFIX = @GLIB_PREFIX@ +GLIB_REQ = @GLIB_REQ@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@ +GSTPB_PREFIX = @GSTPB_PREFIX@ +GST_AGE = @GST_AGE@ +GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@ +GST_API_VERSION = @GST_API_VERSION@ +GST_BASE_CFLAGS = @GST_BASE_CFLAGS@ +GST_BASE_LIBS = @GST_BASE_LIBS@ +GST_CFLAGS = @GST_CFLAGS@ +GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@ +GST_CHECK_LIBS = @GST_CHECK_LIBS@ +GST_CONTROLLER_CFLAGS = @GST_CONTROLLER_CFLAGS@ +GST_CONTROLLER_LIBS = @GST_CONTROLLER_LIBS@ +GST_CURRENT = @GST_CURRENT@ +GST_CXXFLAGS = @GST_CXXFLAGS@ +GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@ +GST_LIBS = @GST_LIBS@ +GST_LIBVERSION = @GST_LIBVERSION@ +GST_LICENSE = @GST_LICENSE@ +GST_LT_LDFLAGS = @GST_LT_LDFLAGS@ +GST_NET_CFLAGS = @GST_NET_CFLAGS@ +GST_NET_LIBS = @GST_NET_LIBS@ +GST_OBJCFLAGS = @GST_OBJCFLAGS@ +GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +GST_OPTION_OBJCFLAGS = @GST_OPTION_OBJCFLAGS@ +GST_PACKAGE_NAME = @GST_PACKAGE_NAME@ +GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@ +GST_PLUGINS_ALL = @GST_PLUGINS_ALL@ +GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@ +GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@ +GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@ +GST_PLUGINS_DIR = @GST_PLUGINS_DIR@ +GST_PLUGINS_NONPORTED = @GST_PLUGINS_NONPORTED@ +GST_PLUGINS_SELECTED = @GST_PLUGINS_SELECTED@ +GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +GST_PLUGIN_LIBTOOLFLAGS = @GST_PLUGIN_LIBTOOLFLAGS@ +GST_PREFIX = @GST_PREFIX@ +GST_REVISION = @GST_REVISION@ +GST_TOOLS_DIR = @GST_TOOLS_DIR@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_X11_CFLAGS = @GTK_X11_CFLAGS@ +GTK_X11_LIBS = @GTK_X11_LIBS@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HAVE_AVC1394 = @HAVE_AVC1394@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DIRECTSOUND = @HAVE_DIRECTSOUND@ +HAVE_ROM1394 = @HAVE_ROM1394@ +HAVE_SPEEX = @HAVE_SPEEX@ +HAVE_X = @HAVE_X@ +HAVE_XSHM = @HAVE_XSHM@ +HAVE_ZLIB = @HAVE_ZLIB@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +JACK_0_120_1_CFLAGS = @JACK_0_120_1_CFLAGS@ +JACK_0_120_1_LIBS = @JACK_0_120_1_LIBS@ +JACK_1_9_7_CFLAGS = @JACK_1_9_7_CFLAGS@ +JACK_1_9_7_LIBS = @JACK_1_9_7_LIBS@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LIBS = @JACK_LIBS@ +JPEG_LIBS = @JPEG_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCACA_CFLAGS = @LIBCACA_CFLAGS@ +LIBCACA_LIBS = @LIBCACA_LIBS@ +LIBDV_CFLAGS = @LIBDV_CFLAGS@ +LIBDV_LIBS = @LIBDV_LIBS@ +LIBICONV = @LIBICONV@ +LIBIEC61883_CFLAGS = @LIBIEC61883_CFLAGS@ +LIBIEC61883_LIBS = @LIBIEC61883_LIBS@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CFLAGS = @LIBPNG_CFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBRT = @LIBRT@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@ +LIBV4L2_LIBS = @LIBV4L2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORCC = @ORCC@ +ORCC_FLAGS = @ORCC_FLAGS@ +ORC_CFLAGS = @ORC_CFLAGS@ +ORC_LIBS = @ORC_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@ +PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINDIR = @PLUGINDIR@ +POSUB = @POSUB@ +PROFILE_CFLAGS = @PROFILE_CFLAGS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RAW1394_CFLAGS = @RAW1394_CFLAGS@ +RAW1394_LIBS = @RAW1394_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHOUT2_CFLAGS = @SHOUT2_CFLAGS@ +SHOUT2_LIBS = @SHOUT2_LIBS@ +SOUP_CFLAGS = @SOUP_CFLAGS@ +SOUP_LIBS = @SOUP_LIBS@ +SPEEX_CFLAGS = @SPEEX_CFLAGS@ +SPEEX_LIBS = @SPEEX_LIBS@ +STRIP = @STRIP@ +TAGLIB_CFLAGS = @TAGLIB_CFLAGS@ +TAGLIB_CXXFLAGS = @TAGLIB_CXXFLAGS@ +TAGLIB_LIBS = @TAGLIB_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +VPX_130_CFLAGS = @VPX_130_CFLAGS@ +VPX_130_LIBS = @VPX_130_LIBS@ +VPX_CFLAGS = @VPX_CFLAGS@ +VPX_LIBS = @VPX_LIBS@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WARNING_OBJCFLAGS = @WARNING_OBJCFLAGS@ +WAVPACK_CFLAGS = @WAVPACK_CFLAGS@ +WAVPACK_LIBS = @WAVPACK_LIBS@ +XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ +XDAMAGE_LIBS = @XDAMAGE_LIBS@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +XSHM_LIBS = @XSHM_LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +plugin_LTLIBRARIES = libgstdebug.la libgstnavigationtest.la +noinst_HEADERS = \ + cpureport.h \ + gstcapsdebug.h \ + gstcapssetter.h \ + gstnavigationtest.h \ + gstnavseek.h \ + gstpushfilesrc.h \ + gsttaginject.h \ + progressreport.h \ + tests.h + +libgstnavigationtest_la_SOURCES = gstnavigationtest.c +libgstnavigationtest_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \ + $(GST_PLUGINS_BASE_CFLAGS) + +libgstnavigationtest_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \ + $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_API_VERSION@ $(LIBM) + +libgstnavigationtest_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstnavigationtest_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +libgstdebug_la_SOURCES = \ + gstdebug.c \ + breakmydata.c \ + gstcapssetter.c \ + gstnavseek.c \ + gstpushfilesrc.c \ + gsttaginject.c \ + rndbuffersize.c \ + progressreport.c \ + tests.c \ + cpureport.c \ + testplugin.c + + +# gstcapsdebug.c +libgstdebug_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) +libgstdebug_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) +libgstdebug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstdebug_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gst/debugutils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu gst/debugutils/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libgstdebug.la: $(libgstdebug_la_OBJECTS) $(libgstdebug_la_DEPENDENCIES) $(EXTRA_libgstdebug_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstdebug_la_LINK) -rpath $(plugindir) $(libgstdebug_la_OBJECTS) $(libgstdebug_la_LIBADD) $(LIBS) + +libgstnavigationtest.la: $(libgstnavigationtest_la_OBJECTS) $(libgstnavigationtest_la_DEPENDENCIES) $(EXTRA_libgstnavigationtest_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstnavigationtest_la_LINK) -rpath $(plugindir) $(libgstnavigationtest_la_OBJECTS) $(libgstnavigationtest_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-breakmydata.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-cpureport.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-gstcapssetter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-gstdebug.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-gstnavseek.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-gstpushfilesrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-gsttaginject.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-progressreport.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-rndbuffersize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-testplugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdebug_la-tests.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstnavigationtest_la-gstnavigationtest.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libgstdebug_la-gstdebug.lo: gstdebug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-gstdebug.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-gstdebug.Tpo -c -o libgstdebug_la-gstdebug.lo `test -f 'gstdebug.c' || echo '$(srcdir)/'`gstdebug.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-gstdebug.Tpo $(DEPDIR)/libgstdebug_la-gstdebug.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstdebug.c' object='libgstdebug_la-gstdebug.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-gstdebug.lo `test -f 'gstdebug.c' || echo '$(srcdir)/'`gstdebug.c + +libgstdebug_la-breakmydata.lo: breakmydata.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-breakmydata.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-breakmydata.Tpo -c -o libgstdebug_la-breakmydata.lo `test -f 'breakmydata.c' || echo '$(srcdir)/'`breakmydata.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-breakmydata.Tpo $(DEPDIR)/libgstdebug_la-breakmydata.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='breakmydata.c' object='libgstdebug_la-breakmydata.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-breakmydata.lo `test -f 'breakmydata.c' || echo '$(srcdir)/'`breakmydata.c + +libgstdebug_la-gstcapssetter.lo: gstcapssetter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-gstcapssetter.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-gstcapssetter.Tpo -c -o libgstdebug_la-gstcapssetter.lo `test -f 'gstcapssetter.c' || echo '$(srcdir)/'`gstcapssetter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-gstcapssetter.Tpo $(DEPDIR)/libgstdebug_la-gstcapssetter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstcapssetter.c' object='libgstdebug_la-gstcapssetter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-gstcapssetter.lo `test -f 'gstcapssetter.c' || echo '$(srcdir)/'`gstcapssetter.c + +libgstdebug_la-gstnavseek.lo: gstnavseek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-gstnavseek.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-gstnavseek.Tpo -c -o libgstdebug_la-gstnavseek.lo `test -f 'gstnavseek.c' || echo '$(srcdir)/'`gstnavseek.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-gstnavseek.Tpo $(DEPDIR)/libgstdebug_la-gstnavseek.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstnavseek.c' object='libgstdebug_la-gstnavseek.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-gstnavseek.lo `test -f 'gstnavseek.c' || echo '$(srcdir)/'`gstnavseek.c + +libgstdebug_la-gstpushfilesrc.lo: gstpushfilesrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-gstpushfilesrc.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-gstpushfilesrc.Tpo -c -o libgstdebug_la-gstpushfilesrc.lo `test -f 'gstpushfilesrc.c' || echo '$(srcdir)/'`gstpushfilesrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-gstpushfilesrc.Tpo $(DEPDIR)/libgstdebug_la-gstpushfilesrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstpushfilesrc.c' object='libgstdebug_la-gstpushfilesrc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-gstpushfilesrc.lo `test -f 'gstpushfilesrc.c' || echo '$(srcdir)/'`gstpushfilesrc.c + +libgstdebug_la-gsttaginject.lo: gsttaginject.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-gsttaginject.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-gsttaginject.Tpo -c -o libgstdebug_la-gsttaginject.lo `test -f 'gsttaginject.c' || echo '$(srcdir)/'`gsttaginject.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-gsttaginject.Tpo $(DEPDIR)/libgstdebug_la-gsttaginject.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsttaginject.c' object='libgstdebug_la-gsttaginject.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-gsttaginject.lo `test -f 'gsttaginject.c' || echo '$(srcdir)/'`gsttaginject.c + +libgstdebug_la-rndbuffersize.lo: rndbuffersize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-rndbuffersize.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-rndbuffersize.Tpo -c -o libgstdebug_la-rndbuffersize.lo `test -f 'rndbuffersize.c' || echo '$(srcdir)/'`rndbuffersize.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-rndbuffersize.Tpo $(DEPDIR)/libgstdebug_la-rndbuffersize.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rndbuffersize.c' object='libgstdebug_la-rndbuffersize.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-rndbuffersize.lo `test -f 'rndbuffersize.c' || echo '$(srcdir)/'`rndbuffersize.c + +libgstdebug_la-progressreport.lo: progressreport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-progressreport.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-progressreport.Tpo -c -o libgstdebug_la-progressreport.lo `test -f 'progressreport.c' || echo '$(srcdir)/'`progressreport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-progressreport.Tpo $(DEPDIR)/libgstdebug_la-progressreport.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progressreport.c' object='libgstdebug_la-progressreport.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-progressreport.lo `test -f 'progressreport.c' || echo '$(srcdir)/'`progressreport.c + +libgstdebug_la-tests.lo: tests.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-tests.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-tests.Tpo -c -o libgstdebug_la-tests.lo `test -f 'tests.c' || echo '$(srcdir)/'`tests.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-tests.Tpo $(DEPDIR)/libgstdebug_la-tests.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests.c' object='libgstdebug_la-tests.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-tests.lo `test -f 'tests.c' || echo '$(srcdir)/'`tests.c + +libgstdebug_la-cpureport.lo: cpureport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-cpureport.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-cpureport.Tpo -c -o libgstdebug_la-cpureport.lo `test -f 'cpureport.c' || echo '$(srcdir)/'`cpureport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-cpureport.Tpo $(DEPDIR)/libgstdebug_la-cpureport.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cpureport.c' object='libgstdebug_la-cpureport.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-cpureport.lo `test -f 'cpureport.c' || echo '$(srcdir)/'`cpureport.c + +libgstdebug_la-testplugin.lo: testplugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -MT libgstdebug_la-testplugin.lo -MD -MP -MF $(DEPDIR)/libgstdebug_la-testplugin.Tpo -c -o libgstdebug_la-testplugin.lo `test -f 'testplugin.c' || echo '$(srcdir)/'`testplugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdebug_la-testplugin.Tpo $(DEPDIR)/libgstdebug_la-testplugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testplugin.c' object='libgstdebug_la-testplugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdebug_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdebug_la_CFLAGS) $(CFLAGS) -c -o libgstdebug_la-testplugin.lo `test -f 'testplugin.c' || echo '$(srcdir)/'`testplugin.c + +libgstnavigationtest_la-gstnavigationtest.lo: gstnavigationtest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstnavigationtest_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstnavigationtest_la_CFLAGS) $(CFLAGS) -MT libgstnavigationtest_la-gstnavigationtest.lo -MD -MP -MF $(DEPDIR)/libgstnavigationtest_la-gstnavigationtest.Tpo -c -o libgstnavigationtest_la-gstnavigationtest.lo `test -f 'gstnavigationtest.c' || echo '$(srcdir)/'`gstnavigationtest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstnavigationtest_la-gstnavigationtest.Tpo $(DEPDIR)/libgstnavigationtest_la-gstnavigationtest.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstnavigationtest.c' object='libgstnavigationtest_la-gstnavigationtest.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstnavigationtest_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstnavigationtest_la_CFLAGS) $(CFLAGS) -c -o libgstnavigationtest_la-gstnavigationtest.lo `test -f 'gstnavigationtest.c' || echo '$(srcdir)/'`gstnavigationtest.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(plugindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pluginLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pluginLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pluginLTLIBRARIES + + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer \ + -:PROJECT libgstdebug -:SHARED libgstdebug \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstdebug_la_SOURCES) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdebug_la_CFLAGS) \ + -:LDFLAGS $(libgstdebug_la_LDFLAGS) \ + $(libgstdebug_la_LIBADD) \ + -ldl \ + -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ + LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ + > $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gst/debugutils/breakmydata.c b/gst/debugutils/breakmydata.c new file mode 100644 index 0000000..c7306b1 --- /dev/null +++ b/gst/debugutils/breakmydata.c @@ -0,0 +1,293 @@ +/* GStreamer + * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:element-breakmydata + * + * This element modifies the contents of the buffer it is passed randomly + * according to the parameters set. + * It otherwise acts as an identity. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <gst/gst.h> +#include <gst/base/gstbasetransform.h> + +GST_DEBUG_CATEGORY_STATIC (gst_break_my_data_debug); +#define GST_CAT_DEFAULT gst_break_my_data_debug + +#define GST_TYPE_BREAK_MY_DATA \ + (gst_break_my_data_get_type()) +#define GST_BREAK_MY_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BREAK_MY_DATA,GstBreakMyData)) +#define GST_BREAK_MY_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BREAK_MY_DATA,GstBreakMyDataClass)) +#define GST_IS_BREAK_MY_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BREAK_MY_DATA)) +#define GST_IS_BREAK_MY_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BREAK_MY_DATA)) + +GType gst_break_my_data_get_type (void); + +enum +{ + ARG_0, + ARG_SEED, + ARG_SET_TO, + ARG_SKIP, + ARG_PROBABILITY +}; + +typedef struct _GstBreakMyData GstBreakMyData; +typedef struct _GstBreakMyDataClass GstBreakMyDataClass; + +struct _GstBreakMyData +{ + GstBaseTransform basetransform; + + GRand *rand; + guint skipped; + + guint32 seed; + gint set; + guint skip; + gdouble probability; +}; + +struct _GstBreakMyDataClass +{ + GstBaseTransformClass parent_class; +}; + +static void gst_break_my_data_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec); +static void gst_break_my_data_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec); + +static GstFlowReturn gst_break_my_data_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); +static gboolean gst_break_my_data_stop (GstBaseTransform * trans); +static gboolean gst_break_my_data_start (GstBaseTransform * trans); + +GstStaticPadTemplate bmd_src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GstStaticPadTemplate bmd_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +#define gst_break_my_data_parent_class parent_class +G_DEFINE_TYPE (GstBreakMyData, gst_break_my_data, GST_TYPE_BASE_TRANSFORM); + + +static void +gst_break_my_data_class_init (GstBreakMyDataClass * klass) +{ + GstBaseTransformClass *gstbasetrans_class; + GstElementClass *gstelement_class; + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + gstelement_class = GST_ELEMENT_CLASS (klass); + gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass); + + GST_DEBUG_CATEGORY_INIT (gst_break_my_data_debug, "breakmydata", 0, + "debugging category for breakmydata element"); + + gobject_class->set_property = gst_break_my_data_set_property; + gobject_class->get_property = gst_break_my_data_get_property; + + g_object_class_install_property (gobject_class, ARG_SEED, + g_param_spec_uint ("seed", "seed", + "seed for randomness (initialized when going from READY to PAUSED)", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_SET_TO, + g_param_spec_int ("set-to", "set-to", + "set changed bytes to this value (-1 means random value", + -1, G_MAXUINT8, -1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_SKIP, + g_param_spec_uint ("skip", "skip", + "amount of bytes skipped at the beginning of stream", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_PROBABILITY, + g_param_spec_double ("probability", "probability", + "probability for each byte in the buffer to be changed", 0.0, 1.0, + 0.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&bmd_sink_template)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&bmd_src_template)); + + gst_element_class_set_static_metadata (gstelement_class, "Break my data", + "Testing", + "randomly change data in the stream", "Benjamin Otte <otte@gnome>"); + + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_break_my_data_transform_ip); + gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_break_my_data_start); + gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_break_my_data_stop); +} + +static void +gst_break_my_data_init (GstBreakMyData * bmd) +{ + gst_base_transform_set_in_place (GST_BASE_TRANSFORM (bmd), TRUE); +} + +static void +gst_break_my_data_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstBreakMyData *bmd = GST_BREAK_MY_DATA (object); + + GST_OBJECT_LOCK (bmd); + + switch (prop_id) { + case ARG_SEED: + bmd->seed = g_value_get_uint (value); + break; + case ARG_SET_TO: + bmd->set = g_value_get_int (value); + break; + case ARG_SKIP: + bmd->skip = g_value_get_uint (value); + break; + case ARG_PROBABILITY: + bmd->probability = g_value_get_double (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + + GST_OBJECT_UNLOCK (bmd); +} + +static void +gst_break_my_data_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstBreakMyData *bmd = GST_BREAK_MY_DATA (object); + + GST_OBJECT_LOCK (bmd); + + switch (prop_id) { + case ARG_SEED: + g_value_set_uint (value, bmd->seed); + break; + case ARG_SET_TO: + g_value_set_int (value, bmd->set); + break; + case ARG_SKIP: + g_value_set_uint (value, bmd->skip); + break; + case ARG_PROBABILITY: + g_value_set_double (value, bmd->probability); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + + GST_OBJECT_UNLOCK (bmd); +} + +static GstFlowReturn +gst_break_my_data_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans); + GstMapInfo map; + gsize i; + + g_return_val_if_fail (gst_buffer_is_writable (buf), GST_FLOW_ERROR); + + GST_OBJECT_LOCK (bmd); + + if (bmd->skipped < bmd->skip) { + i = bmd->skip - bmd->skipped; + } else { + i = 0; + } + + gst_buffer_map (buf, &map, GST_MAP_READWRITE); + + GST_LOG_OBJECT (bmd, + "got buffer %p (size %" G_GSIZE_FORMAT ", timestamp %" G_GUINT64_FORMAT + ", offset %" G_GUINT64_FORMAT "", buf, map.size, + GST_BUFFER_TIMESTAMP (buf), GST_BUFFER_OFFSET (buf)); + + for (; i < map.size; i++) { + if (g_rand_double_range (bmd->rand, 0, 1.0) <= bmd->probability) { + guint8 new; + + if (bmd->set < 0) { + new = g_rand_int_range (bmd->rand, 0, 256); + } else { + new = bmd->set; + } + GST_INFO_OBJECT (bmd, + "changing byte %" G_GSIZE_FORMAT " from 0x%02X to 0x%02X", i, + (guint) GST_READ_UINT8 (map.data + i), (guint) ((guint8) new)); + map.data[i] = new; + } + } + /* don't overflow */ + bmd->skipped += MIN (G_MAXUINT - bmd->skipped, map.size); + + gst_buffer_unmap (buf, &map); + + GST_OBJECT_UNLOCK (bmd); + + return GST_FLOW_OK; +} + +static gboolean +gst_break_my_data_start (GstBaseTransform * trans) +{ + GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans); + + GST_OBJECT_LOCK (bmd); + bmd->rand = g_rand_new_with_seed (bmd->seed); + bmd->skipped = 0; + GST_OBJECT_UNLOCK (bmd); + + return TRUE; +} + +static gboolean +gst_break_my_data_stop (GstBaseTransform * trans) +{ + GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans); + + GST_OBJECT_LOCK (bmd); + g_rand_free (bmd->rand); + bmd->rand = NULL; + GST_OBJECT_UNLOCK (bmd); + + return TRUE; +} diff --git a/gst/debugutils/cpureport.c b/gst/debugutils/cpureport.c new file mode 100644 index 0000000..85cc294 --- /dev/null +++ b/gst/debugutils/cpureport.c @@ -0,0 +1,149 @@ +/* GStreamer Cpu Report Element + * Copyright (C) <2010> Zaheer Abbas Merali <zaheerabbas merali org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gst/gst.h> +#include <string.h> +#include <math.h> +#include <time.h> + +#include "cpureport.h" + + +enum +{ + ARG_0, +}; + +GstStaticPadTemplate cpu_report_src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GstStaticPadTemplate cpu_report_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static GstFlowReturn gst_cpu_report_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); + +static gboolean gst_cpu_report_start (GstBaseTransform * trans); +static gboolean gst_cpu_report_stop (GstBaseTransform * trans); + +#define gst_cpu_report_parent_class parent_class +G_DEFINE_TYPE (GstCpuReport, gst_cpu_report, GST_TYPE_BASE_TRANSFORM); + +static void +gst_cpu_report_finalize (GObject * obj) +{ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + +static void +gst_cpu_report_class_init (GstCpuReportClass * g_class) +{ + GstBaseTransformClass *gstbasetrans_class; + GstElementClass *element_class; + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (g_class); + element_class = GST_ELEMENT_CLASS (g_class); + gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (g_class); + + gobject_class->finalize = gst_cpu_report_finalize; + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&cpu_report_sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&cpu_report_src_template)); + + gst_element_class_set_static_metadata (element_class, "CPU report", + "Testing", + "Post cpu usage information every buffer", + "Zaheer Abbas Merali <zaheerabbas at merali dot org>"); + + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_cpu_report_transform_ip); + gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_cpu_report_start); + gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_cpu_report_stop); +} + +static void +gst_cpu_report_init (GstCpuReport * report) +{ + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (report), TRUE); + +} + +static GstFlowReturn +gst_cpu_report_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstCpuReport *filter; + GTimeVal cur_time; + clock_t cur_cpu_time; + GstMessage *msg; + GstStructure *s; + gint64 time_taken; + + + g_get_current_time (&cur_time); + cur_cpu_time = clock (); + + filter = GST_CPU_REPORT (trans); + + + time_taken = GST_TIMEVAL_TO_TIME (cur_time) - + GST_TIMEVAL_TO_TIME (filter->last_time); + + s = gst_structure_new ("cpu-report", "cpu-time", G_TYPE_DOUBLE, + ((gdouble) (cur_cpu_time - filter->last_cpu_time)), + "actual-time", G_TYPE_INT64, time_taken, "buffer-time", G_TYPE_INT64, + GST_BUFFER_TIMESTAMP (buf), NULL); + msg = gst_message_new_element (GST_OBJECT_CAST (filter), s); + gst_element_post_message (GST_ELEMENT_CAST (filter), msg); + filter->last_time = cur_time; + filter->last_cpu_time = cur_cpu_time; + + + return GST_FLOW_OK; +} + +static gboolean +gst_cpu_report_start (GstBaseTransform * trans) +{ + GstCpuReport *filter; + + filter = GST_CPU_REPORT (trans); + + g_get_current_time (&filter->last_time); + filter->start_time = filter->last_time; + filter->last_cpu_time = clock (); + return TRUE; +} + +static gboolean +gst_cpu_report_stop (GstBaseTransform * trans) +{ + /* anything we should be doing here? */ + return TRUE; +} diff --git a/gst/debugutils/cpureport.h b/gst/debugutils/cpureport.h new file mode 100644 index 0000000..3505559 --- /dev/null +++ b/gst/debugutils/cpureport.h @@ -0,0 +1,58 @@ +/* GStreamer CPU Report Element + * Copyright (C) <2010> Zaheer Abbas Merali <zaheerabbas merali org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_CPU_REPORT_H__ +#define __GST_CPU_REPORT_H__ + +#include <time.h> + +#include <gst/base/gstbasetransform.h> + +G_BEGIN_DECLS +#define GST_TYPE_CPU_REPORT \ + (gst_cpu_report_get_type()) +#define GST_CPU_REPORT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CPU_REPORT,GstCpuReport)) +#define GST_CPU_REPORT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CPU_REPORT,GstCpuReportClass)) +#define GST_IS_CPU_REPORT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CPU_REPORT)) +#define GST_IS_CPU_REPORT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CPU_REPORT)) +typedef struct _GstCpuReport GstCpuReport; +typedef struct _GstCpuReportClass GstCpuReportClass; + +struct _GstCpuReport +{ + GstBaseTransform basetransform; + + GTimeVal start_time; + GTimeVal last_time; + clock_t last_cpu_time; +}; + +struct _GstCpuReportClass +{ + GstBaseTransformClass parent_class; +}; + +GType gst_cpu_report_get_type (void); + +G_END_DECLS +#endif /* __GST_CPU_REPORT_H__ */ diff --git a/gst/debugutils/gstcapsdebug.h b/gst/debugutils/gstcapsdebug.h new file mode 100644 index 0000000..9d0930d --- /dev/null +++ b/gst/debugutils/gstcapsdebug.h @@ -0,0 +1,55 @@ +/* GStreamer + * Copyright (C) 2010 FIXME <fixme@example.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _GST_CAPS_DEBUG_H_ +#define _GST_CAPS_DEBUG_H_ + +#include <gst/gst.h> +#include <gst/gst.h> + +G_BEGIN_DECLS + +#define GST_TYPE_CAPS_DEBUG (gst_caps_debug_get_type()) +#define GST_CAPS_DEBUG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CAPS_DEBUG,GstCapsDebug)) +#define GST_CAPS_DEBUG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CAPS_DEBUG,GstCapsDebugClass)) +#define GST_IS_CAPS_DEBUG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CAPS_DEBUG)) +#define GST_IS_CAPS_DEBUG_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CAPS_DEBUG)) + +typedef struct _GstCapsDebug GstCapsDebug; +typedef struct _GstCapsDebugClass GstCapsDebugClass; + +struct _GstCapsDebug +{ + GstElement base_capsdebug; + + GstPad *srcpad; + GstPad *sinkpad; + +}; + +struct _GstCapsDebugClass +{ + GstElementClass base_capsdebug_class; +}; + +GType gst_caps_debug_get_type (void); + +G_END_DECLS + +#endif diff --git a/gst/debugutils/gstcapssetter.c b/gst/debugutils/gstcapssetter.c new file mode 100755 index 0000000..187adb7 --- /dev/null +++ b/gst/debugutils/gstcapssetter.c @@ -0,0 +1,331 @@ +/* GStreamer Element + * Copyright (C) 2006-2009 Mark Nauwelaerts <mnauw@users.sourceforge.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1307, USA. + */ + +/** + * SECTION:element-capssetter + * + * Sets or merges caps on a stream's buffers. That is, a buffer's caps are + * updated using (fields of) #GstCapsSetter:caps. Note that this may contain + * multiple structures (though not likely recommended), but each of these must + * be fixed (or will otherwise be rejected). + * + * If #GstCapsSetter:join is %TRUE, then the incoming caps' mime-type is + * compared to the mime-type(s) of provided caps and only matching structure(s) + * are considered for updating. + * + * If #GstCapsSetter:replace is %TRUE, then any caps update is preceded by + * clearing existing fields, making provided fields (as a whole) replace + * incoming ones. Otherwise, no clearing is performed, in which case provided + * fields are added/merged onto incoming caps + * + * Although this element might mainly serve as debug helper, + * it can also practically be used to correct a faulty pixel-aspect-ratio, + * or to modify a yuv fourcc value to effectively swap chroma components or such + * alike. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstcapssetter.h" + +#include <string.h> + + +GST_DEBUG_CATEGORY_STATIC (caps_setter_debug); +#define GST_CAT_DEFAULT caps_setter_debug + + +/* signals and args */ +enum +{ + /* FILL ME */ + LAST_SIGNAL +}; + +enum +{ + PROP_0, + PROP_CAPS, + PROP_JOIN, + PROP_REPLACE + /* FILL ME */ +}; + +#define DEFAULT_JOIN TRUE +#define DEFAULT_REPLACE FALSE + +static GstStaticPadTemplate gst_caps_setter_src_template = +GST_STATIC_PAD_TEMPLATE (GST_BASE_TRANSFORM_SRC_NAME, + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static GstStaticPadTemplate gst_caps_setter_sink_template = +GST_STATIC_PAD_TEMPLATE (GST_BASE_TRANSFORM_SINK_NAME, + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + + +static gboolean gst_caps_setter_transform_size (GstBaseTransform * trans, + GstPadDirection direction, GstCaps * caps, gsize size, + GstCaps * othercaps, gsize * othersize); +static GstCaps *gst_caps_setter_transform_caps (GstBaseTransform * trans, + GstPadDirection direction, GstCaps * caps, GstCaps * cfilter); +static GstFlowReturn gst_caps_setter_transform_ip (GstBaseTransform * btrans, + GstBuffer * in); + +static void gst_caps_setter_finalize (GObject * object); + +static void gst_caps_setter_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_caps_setter_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +#define gst_caps_setter_parent_class parent_class +G_DEFINE_TYPE (GstCapsSetter, gst_caps_setter, GST_TYPE_BASE_TRANSFORM); + +static void +gst_caps_setter_class_init (GstCapsSetterClass * g_class) +{ + GObjectClass *gobject_class = (GObjectClass *) g_class; + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class; + + GST_DEBUG_CATEGORY_INIT (caps_setter_debug, "capssetter", 0, "capssetter"); + + gobject_class->set_property = gst_caps_setter_set_property; + gobject_class->get_property = gst_caps_setter_get_property; + + gobject_class->finalize = gst_caps_setter_finalize; + + g_object_class_install_property (gobject_class, PROP_CAPS, + g_param_spec_boxed ("caps", "Merge caps", + "Merge these caps (thereby overwriting) in the stream", + GST_TYPE_CAPS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_JOIN, + g_param_spec_boolean ("join", "Join", + "Match incoming caps' mime-type to mime-type of provided caps", + DEFAULT_JOIN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_REPLACE, + g_param_spec_boolean ("replace", "Replace", + "Drop fields of incoming caps", DEFAULT_REPLACE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_set_static_metadata (element_class, "CapsSetter", + "Generic", + "Set/merge caps on stream", + "Mark Nauwelaerts <mnauw@users.sourceforge.net>"); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_caps_setter_sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_caps_setter_src_template)); + + trans_class->transform_size = + GST_DEBUG_FUNCPTR (gst_caps_setter_transform_size); + trans_class->transform_caps = + GST_DEBUG_FUNCPTR (gst_caps_setter_transform_caps); + /* dummy seems needed */ + trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_caps_setter_transform_ip); +} + +static void +gst_caps_setter_init (GstCapsSetter * filter) +{ + filter->caps = gst_caps_new_any (); + filter->join = DEFAULT_JOIN; + filter->replace = DEFAULT_REPLACE; +} + +static void +gst_caps_setter_finalize (GObject * object) +{ + GstCapsSetter *filter = GST_CAPS_SETTER (object); + + gst_caps_replace (&filter->caps, NULL); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static gboolean +gst_caps_setter_transform_size (GstBaseTransform * trans, + GstPadDirection direction, GstCaps * caps, gsize size, + GstCaps * othercaps, gsize * othersize) +{ + *othersize = size; + + return TRUE; +} + +static GstCaps * +gst_caps_setter_transform_caps (GstBaseTransform * trans, + GstPadDirection direction, GstCaps * caps, GstCaps * cfilter) +{ + GstCapsSetter *filter = GST_CAPS_SETTER (trans); + GstCaps *ret = NULL, *filter_caps = NULL; + GstStructure *structure, *merge; + const gchar *name; + gint i, j, k; + + GST_DEBUG_OBJECT (trans, + "receiving caps: %" GST_PTR_FORMAT ", with filter: %" GST_PTR_FORMAT, + caps, cfilter); + + /* pass filter caps upstream, or any if no filter */ + if (direction != GST_PAD_SINK) { + if (!cfilter || gst_caps_is_empty (cfilter)) { + return gst_caps_ref (GST_CAPS_ANY); + } else { + return gst_caps_ref (cfilter); + } + } + + ret = gst_caps_copy (caps); + + GST_OBJECT_LOCK (filter); + filter_caps = gst_caps_ref (filter->caps); + GST_OBJECT_UNLOCK (filter); + + for (k = 0; k < gst_caps_get_size (ret); k++) { + structure = gst_caps_get_structure (ret, k); + name = gst_structure_get_name (structure); + + for (i = 0; i < gst_caps_get_size (filter_caps); ++i) { + merge = gst_caps_get_structure (filter_caps, i); + if (gst_structure_has_name (merge, name) || !filter->join) { + + if (!filter->join) + gst_structure_set_name (structure, gst_structure_get_name (merge)); + + if (filter->replace) + gst_structure_remove_all_fields (structure); + + for (j = 0; j < gst_structure_n_fields (merge); ++j) { + const gchar *fname; + + fname = gst_structure_nth_field_name (merge, j); + gst_structure_set_value (structure, fname, + gst_structure_get_value (merge, fname)); + } + } + } + } + + GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret); + + gst_caps_unref (filter_caps); + + return ret; +} + +static GstFlowReturn +gst_caps_setter_transform_ip (GstBaseTransform * btrans, GstBuffer * in) +{ + return GST_FLOW_OK; +} + +static gboolean +gst_caps_is_fixed_foreach (GQuark field_id, const GValue * value, + gpointer unused) +{ + return gst_value_is_fixed (value); +} + +static void +gst_caps_setter_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstCapsSetter *filter = GST_CAPS_SETTER (object); + + switch (prop_id) { + case PROP_CAPS:{ + GstCaps *new_caps; + const GstCaps *new_caps_val = gst_value_get_caps (value); + gint i; + + if (new_caps_val == NULL) { + new_caps = gst_caps_new_any (); + } else { + new_caps = gst_caps_copy (new_caps_val); + } + + for (i = 0; new_caps && (i < gst_caps_get_size (new_caps)); ++i) { + GstStructure *s; + + s = gst_caps_get_structure (new_caps, i); + if (!gst_structure_foreach (s, gst_caps_is_fixed_foreach, NULL)) { + GST_ERROR_OBJECT (filter, "rejected unfixed caps: %" GST_PTR_FORMAT, + new_caps); + gst_caps_unref (new_caps); + new_caps = NULL; + break; + } + } + + if (new_caps) { + GST_OBJECT_LOCK (filter); + gst_caps_replace (&filter->caps, new_caps); + /* drop extra ref */ + gst_caps_unref (new_caps); + GST_OBJECT_UNLOCK (filter); + + GST_DEBUG_OBJECT (filter, "set new caps %" GST_PTR_FORMAT, new_caps); + } + + /* try to activate these new caps next time around */ + gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM (filter)); + break; + } + case PROP_JOIN: + filter->join = g_value_get_boolean (value); + break; + case PROP_REPLACE: + filter->replace = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_caps_setter_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstCapsSetter *filter = GST_CAPS_SETTER (object); + + switch (prop_id) { + case PROP_CAPS: + gst_value_set_caps (value, filter->caps); + break; + case PROP_JOIN: + g_value_set_boolean (value, filter->join); + break; + case PROP_REPLACE: + g_value_set_boolean (value, filter->replace); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} diff --git a/gst/debugutils/gstcapssetter.h b/gst/debugutils/gstcapssetter.h new file mode 100644 index 0000000..246bf19 --- /dev/null +++ b/gst/debugutils/gstcapssetter.h @@ -0,0 +1,63 @@ +/* GStreamer Element + * Copyright (C) 2006-2009 Mark Nauwelaerts <mnauw@users.sourceforge.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1307, USA. + */ + + +#ifndef __GST_CAPS_SETTER_H__ +#define __GST_CAPS_SETTER_H__ + +#include <gst/base/gstbasetransform.h> + +G_BEGIN_DECLS + +#define GST_TYPE_CAPS_SETTER \ + (gst_caps_setter_get_type()) +#define GST_CAPS_SETTER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CAPS_SETTER,GstCapsSetter)) +#define GST_CAPS_SETTER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CAPS_SETTER,GstCapsSetterClass)) +#define GST_IS_CAPS_SETTER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CAPS_SETTER)) +#define GST_IS_CAPS_SETTER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CAPS_SETTER)) + +GType gst_caps_setter_get_type (void); + +typedef struct _GstCapsSetter GstCapsSetter; +typedef struct _GstCapsSetterClass GstCapsSetterClass; + +struct _GstCapsSetter +{ + GstBaseTransform parent; + + /* < private > */ + /* properties */ + GstCaps *caps; + gboolean join; + gboolean replace; +}; + + +struct _GstCapsSetterClass +{ + GstBaseTransformClass parent_class; +}; + +G_END_DECLS + +#endif /* __GST_CAPS_SETTER_H__ */ diff --git a/gst/debugutils/gstdebug.c b/gst/debugutils/gstdebug.c new file mode 100644 index 0000000..a56aa9f --- /dev/null +++ b/gst/debugutils/gstdebug.c @@ -0,0 +1,76 @@ +/* GStreamer + * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <gst/gst.h> + +GType gst_break_my_data_get_type (void); +//GType gst_caps_debug_get_type (void); +GType gst_caps_setter_get_type (void); +GType gst_rnd_buffer_size_get_type (void); +GType gst_navseek_get_type (void); +GType gst_progress_report_get_type (void); +GType gst_tag_inject_get_type (void); +GType gst_test_get_type (void); +GType gst_push_file_src_get_type (void); +/* +GType gst_gst_negotiation_get_type (void); +*/ +GType gst_cpu_report_get_type (void); + +static gboolean +plugin_init (GstPlugin * plugin) +{ + if (!gst_element_register (plugin, "breakmydata", GST_RANK_NONE, + gst_break_my_data_get_type ()) + || !gst_element_register (plugin, "capssetter", GST_RANK_NONE, + gst_caps_setter_get_type ()) + || !gst_element_register (plugin, "rndbuffersize", GST_RANK_NONE, + gst_rnd_buffer_size_get_type ()) + || !gst_element_register (plugin, "navseek", GST_RANK_NONE, + gst_navseek_get_type ()) + || !gst_element_register (plugin, "pushfilesrc", GST_RANK_NONE, + gst_push_file_src_get_type ()) || +/* !gst_element_register (plugin, "negotiation", GST_RANK_NONE, gst_gst_negotiation_get_type ()) || */ + !gst_element_register (plugin, "progressreport", GST_RANK_NONE, + gst_progress_report_get_type ()) + || !gst_element_register (plugin, "taginject", GST_RANK_NONE, + gst_tag_inject_get_type ()) + || !gst_element_register (plugin, "testsink", GST_RANK_NONE, + gst_test_get_type ()) +#if 0 + || !gst_element_register (plugin, "capsdebug", GST_RANK_NONE, + gst_caps_debug_get_type ()) +#endif + || !gst_element_register (plugin, "cpureport", GST_RANK_NONE, + gst_cpu_report_get_type ())) + + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + debug, + "elements for testing and debugging", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/gst/debugutils/gstnavigationtest.c b/gst/debugutils/gstnavigationtest.c new file mode 100644 index 0000000..de98900 --- /dev/null +++ b/gst/debugutils/gstnavigationtest.c @@ -0,0 +1,277 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * Copyright (C) <2003> David Schleef <ds@schleef.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstnavigationtest.h" +#include <string.h> +#include <math.h> + +#include <gst/video/video.h> + +#ifdef _MSC_VER +#define rint(x) (floor((x)+0.5)) +#endif + +GST_DEBUG_CATEGORY_STATIC (navigationtest_debug); +#define GST_CAT_DEFAULT navigationtest_debug + +static GstStaticPadTemplate gst_navigationtest_src_template = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420")) + ); + +static GstStaticPadTemplate gst_navigationtest_sink_template = +GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420")) + ); + +#define gst_navigationtest_parent_class parent_class +G_DEFINE_TYPE (GstNavigationtest, gst_navigationtest, GST_TYPE_VIDEO_FILTER); + +static gboolean +gst_navigationtest_src_event (GstBaseTransform * trans, GstEvent * event) +{ + GstVideoInfo *info; + GstNavigationtest *navtest; + const gchar *type; + + navtest = GST_NAVIGATIONTEST (trans); + + info = &GST_VIDEO_FILTER (trans)->in_info; + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_NAVIGATION: + { + const GstStructure *s = gst_event_get_structure (event); + gint fps_n, fps_d; + + fps_n = GST_VIDEO_INFO_FPS_N (info); + fps_d = GST_VIDEO_INFO_FPS_D (info); + + type = gst_structure_get_string (s, "event"); + if (g_str_equal (type, "mouse-move")) { + gst_structure_get_double (s, "pointer_x", &navtest->x); + gst_structure_get_double (s, "pointer_y", &navtest->y); + } else if (g_str_equal (type, "mouse-button-press")) { + ButtonClick *click = g_new (ButtonClick, 1); + + gst_structure_get_double (s, "pointer_x", &click->x); + gst_structure_get_double (s, "pointer_y", &click->y); + click->images_left = (fps_n + fps_d - 1) / fps_d; + /* green */ + click->cy = 150; + click->cu = 46; + click->cv = 21; + navtest->clicks = g_slist_prepend (navtest->clicks, click); + } else if (g_str_equal (type, "mouse-button-release")) { + ButtonClick *click = g_new (ButtonClick, 1); + + gst_structure_get_double (s, "pointer_x", &click->x); + gst_structure_get_double (s, "pointer_y", &click->y); + click->images_left = (fps_n + fps_d - 1) / fps_d; + /* red */ + click->cy = 76; + click->cu = 85; + click->cv = 255; + navtest->clicks = g_slist_prepend (navtest->clicks, click); + } + break; + } + default: + break; + } + return GST_BASE_TRANSFORM_CLASS (parent_class)->src_event (trans, event); +} + +/* Useful macros */ +#define GST_VIDEO_I420_Y_ROWSTRIDE(width) (GST_ROUND_UP_4(width)) +#define GST_VIDEO_I420_U_ROWSTRIDE(width) (GST_ROUND_UP_8(width)/2) +#define GST_VIDEO_I420_V_ROWSTRIDE(width) ((GST_ROUND_UP_8(GST_VIDEO_I420_Y_ROWSTRIDE(width)))/2) + +#define GST_VIDEO_I420_Y_OFFSET(w,h) (0) +#define GST_VIDEO_I420_U_OFFSET(w,h) (GST_VIDEO_I420_Y_OFFSET(w,h)+(GST_VIDEO_I420_Y_ROWSTRIDE(w)*GST_ROUND_UP_2(h))) +#define GST_VIDEO_I420_V_OFFSET(w,h) (GST_VIDEO_I420_U_OFFSET(w,h)+(GST_VIDEO_I420_U_ROWSTRIDE(w)*GST_ROUND_UP_2(h)/2)) + +#define GST_VIDEO_I420_SIZE(w,h) (GST_VIDEO_I420_V_OFFSET(w,h)+(GST_VIDEO_I420_V_ROWSTRIDE(w)*GST_ROUND_UP_2(h)/2)) + +static void +draw_box_planar411 (GstVideoFrame * frame, int x, int y, + guint8 colory, guint8 coloru, guint8 colorv) +{ + gint width, height; + int x1, x2, y1, y2; + guint8 *d; + gint stride; + + width = GST_VIDEO_FRAME_WIDTH (frame); + height = GST_VIDEO_FRAME_HEIGHT (frame); + + if (x < 0 || y < 0 || x >= width || y >= height) + return; + + x1 = MAX (x - 5, 0); + x2 = MIN (x + 5, width); + y1 = MAX (y - 5, 0); + y2 = MIN (y + 5, height); + + d = GST_VIDEO_FRAME_PLANE_DATA (frame, 0); + stride = GST_VIDEO_FRAME_PLANE_STRIDE (frame, 0); + + for (y = y1; y < y2; y++) { + for (x = x1; x < x2; x++) { + d[y * stride + x] = colory; + } + } + + d = GST_VIDEO_FRAME_PLANE_DATA (frame, 1); + stride = GST_VIDEO_FRAME_PLANE_STRIDE (frame, 1); + + x1 /= 2; + x2 /= 2; + y1 /= 2; + y2 /= 2; + for (y = y1; y < y2; y++) { + for (x = x1; x < x2; x++) { + d[y * stride + x] = coloru; + } + } + + d = GST_VIDEO_FRAME_PLANE_DATA (frame, 2); + stride = GST_VIDEO_FRAME_PLANE_STRIDE (frame, 2); + + for (y = y1; y < y2; y++) { + for (x = x1; x < x2; x++) { + d[y * stride + x] = colorv; + } + } +} + +static GstFlowReturn +gst_navigationtest_transform_frame (GstVideoFilter * filter, + GstVideoFrame * in_frame, GstVideoFrame * out_frame) +{ + GstNavigationtest *navtest = GST_NAVIGATIONTEST (filter); + GSList *walk; + + gst_video_frame_copy (out_frame, in_frame); + + walk = navtest->clicks; + while (walk) { + ButtonClick *click = walk->data; + + walk = g_slist_next (walk); + draw_box_planar411 (out_frame, + rint (click->x), rint (click->y), click->cy, click->cu, click->cv); + if (--click->images_left < 1) { + navtest->clicks = g_slist_remove (navtest->clicks, click); + g_free (click); + } + } + draw_box_planar411 (out_frame, + rint (navtest->x), rint (navtest->y), 0, 128, 128); + + return GST_FLOW_OK; +} + +static GstStateChangeReturn +gst_navigationtest_change_state (GstElement * element, + GstStateChange transition) +{ + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; + GstNavigationtest *navtest = GST_NAVIGATIONTEST (element); + + if (GST_ELEMENT_CLASS (parent_class)->change_state) + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + /* downwards state changes */ + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: + { + g_slist_foreach (navtest->clicks, (GFunc) g_free, NULL); + g_slist_free (navtest->clicks); + navtest->clicks = NULL; + break; + } + default: + break; + } + + return ret; +} + +static void +gst_navigationtest_class_init (GstNavigationtestClass * klass) +{ + GstElementClass *element_class; + GstBaseTransformClass *trans_class; + GstVideoFilterClass *vfilter_class; + + element_class = (GstElementClass *) klass; + trans_class = (GstBaseTransformClass *) klass; + vfilter_class = (GstVideoFilterClass *) klass; + + element_class->change_state = + GST_DEBUG_FUNCPTR (gst_navigationtest_change_state); + + gst_element_class_set_static_metadata (element_class, "Video navigation test", + "Filter/Effect/Video", + "Handle navigation events showing a black square following mouse pointer", + "David Schleef <ds@schleef.org>"); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_navigationtest_sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_navigationtest_src_template)); + + trans_class->src_event = GST_DEBUG_FUNCPTR (gst_navigationtest_src_event); + + vfilter_class->transform_frame = + GST_DEBUG_FUNCPTR (gst_navigationtest_transform_frame); +} + +static void +gst_navigationtest_init (GstNavigationtest * navtest) +{ + navtest->x = -1; + navtest->y = -1; +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (navigationtest_debug, "navigationtest", 0, + "navigationtest"); + + return gst_element_register (plugin, "navigationtest", GST_RANK_NONE, + GST_TYPE_NAVIGATIONTEST); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + navigationtest, + "Template for a video filter", + plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/gst/debugutils/gstnavigationtest.h b/gst/debugutils/gstnavigationtest.h new file mode 100644 index 0000000..f1cf458 --- /dev/null +++ b/gst/debugutils/gstnavigationtest.h @@ -0,0 +1,65 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NAVIGATIONTEST_H__ +#define __GST_NAVIGATIONTEST_H__ + +#include <gst/video/video.h> +#include <gst/video/gstvideofilter.h> + +G_BEGIN_DECLS +#define GST_TYPE_NAVIGATIONTEST \ + (gst_navigationtest_get_type()) +#define GST_NAVIGATIONTEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NAVIGATIONTEST,GstNavigationtest)) +#define GST_NAVIGATIONTEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NAVIGATIONTEST,GstNavigationtestClass)) +#define GST_IS_NAVIGATIONTEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NAVIGATIONTEST)) +#define GST_IS_NAVIGATIONTEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NAVIGATIONTEST)) +typedef struct _GstNavigationtest GstNavigationtest; +typedef struct _GstNavigationtestClass GstNavigationtestClass; + +typedef struct +{ + gdouble x; + gdouble y; + gint images_left; + guint8 cy, cu, cv; +} ButtonClick; + +struct _GstNavigationtest +{ + GstVideoFilter videofilter; + + gdouble x, y; + GSList *clicks; +}; + +struct _GstNavigationtestClass +{ + GstVideoFilterClass parent_class; +}; + +GType gst_navigationtest_get_type (void); + +G_END_DECLS +#endif /* __GST_NAVIGATIONTEST_H__ */ diff --git a/gst/debugutils/gstnavseek.c b/gst/debugutils/gstnavseek.c new file mode 100755 index 0000000..b6fae2e --- /dev/null +++ b/gst/debugutils/gstnavseek.c @@ -0,0 +1,390 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * Copyright (C) <2003> David Schleef <ds@schleef.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* + * This file was (probably) generated from gstnavseek.c, + * gstnavseek.c,v 1.7 2003/11/08 02:48:59 dschleef Exp + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstnavseek.h" +#include <string.h> +#include <math.h> + +enum +{ + ARG_0, + ARG_SEEKOFFSET +}; + +GstStaticPadTemplate navseek_src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GstStaticPadTemplate navseek_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static gboolean gst_navseek_sink_event (GstBaseTransform * trans, + GstEvent * event); +static GstFlowReturn gst_navseek_transform_ip (GstBaseTransform * basetrans, + GstBuffer * buf); +static gboolean gst_navseek_src_event (GstBaseTransform * trans, + GstEvent * event); +static gboolean gst_navseek_stop (GstBaseTransform * trans); +static gboolean gst_navseek_start (GstBaseTransform * trans); + +static void gst_navseek_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_navseek_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +GType gst_navseek_get_type (void); +#define gst_navseek_parent_class parent_class +G_DEFINE_TYPE (GstNavSeek, gst_navseek, GST_TYPE_BASE_TRANSFORM); + +static void +gst_navseek_class_init (GstNavSeekClass * klass) +{ + GstBaseTransformClass *gstbasetrans_class; + GstElementClass *element_class; + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (klass); + element_class = GST_ELEMENT_CLASS (klass); + gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass); + + gobject_class->set_property = gst_navseek_set_property; + gobject_class->get_property = gst_navseek_get_property; + + g_object_class_install_property (gobject_class, + ARG_SEEKOFFSET, g_param_spec_double ("seek-offset", "Seek Offset", + "Time in seconds to seek by", 0.0, G_MAXDOUBLE, 5.0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&navseek_sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&navseek_src_template)); + + gst_element_class_set_static_metadata (element_class, + "Seek based on left-right arrows", "Filter/Video", + "Seek based on navigation keys left-right", + "Jan Schmidt <thaytan@mad.scientist.com>"); + + gstbasetrans_class->src_event = GST_DEBUG_FUNCPTR (gst_navseek_src_event); + gstbasetrans_class->sink_event = GST_DEBUG_FUNCPTR (gst_navseek_sink_event); + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_navseek_transform_ip); + gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_navseek_start); + gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_navseek_stop); +} + +static void +gst_navseek_init (GstNavSeek * navseek) +{ + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (navseek), TRUE); + + navseek->seek_offset = 5.0; + navseek->loop = FALSE; + navseek->grab_seg_start = FALSE; + navseek->grab_seg_end = FALSE; + navseek->segment_start = GST_CLOCK_TIME_NONE; + navseek->segment_end = GST_CLOCK_TIME_NONE; +} + +static void +gst_navseek_seek (GstNavSeek * navseek, gint64 offset) +{ + gboolean ret; + GstPad *peer_pad; + gint64 peer_value; + + /* Query for the current time then attempt to set to time + offset */ + peer_pad = gst_pad_get_peer (GST_BASE_TRANSFORM (navseek)->sinkpad); + ret = gst_pad_query_position (peer_pad, GST_FORMAT_TIME, &peer_value); + + if (ret) { + GstEvent *event; + + peer_value += offset; + if (peer_value < 0) + peer_value = 0; + + event = gst_event_new_seek (1.0, GST_FORMAT_TIME, + GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH, + GST_SEEK_TYPE_SET, peer_value, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); + + gst_pad_send_event (peer_pad, event); + } + + gst_object_unref (peer_pad); +} + +static void +gst_navseek_change_playback_rate (GstNavSeek * navseek, gdouble rate) +{ + gboolean ret; + GstPad *peer_pad; + gint64 current_position; + + peer_pad = gst_pad_get_peer (GST_BASE_TRANSFORM (navseek)->sinkpad); + ret = gst_pad_query_position (peer_pad, GST_FORMAT_TIME, ¤t_position); + + if (ret) { + GstEvent *event; + gint64 start; + gint64 stop; + + if (rate > 0.0) { + start = current_position; + stop = -1; + } else { + /* negative rate: we play from stop to start */ + start = 0; + stop = current_position; + } + + event = gst_event_new_seek (rate, GST_FORMAT_TIME, + GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP, + GST_SEEK_TYPE_SET, start, GST_SEEK_TYPE_SET, stop); + + gst_pad_send_event (peer_pad, event); + } + gst_object_unref (peer_pad); +} + +static void +gst_navseek_segseek (GstNavSeek * navseek) +{ + GstEvent *event; + GstPad *peer_pad; + + if ((navseek->segment_start == GST_CLOCK_TIME_NONE) || + (navseek->segment_end == GST_CLOCK_TIME_NONE) || + (!GST_PAD_IS_LINKED (GST_BASE_TRANSFORM (navseek)->sinkpad))) { + return; + } + + if (navseek->loop) { + event = + gst_event_new_seek (1.0, GST_FORMAT_TIME, + GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_SEGMENT, + GST_SEEK_TYPE_SET, navseek->segment_start, GST_SEEK_TYPE_SET, + navseek->segment_end); + } else { + event = + gst_event_new_seek (1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_ACCURATE, + GST_SEEK_TYPE_SET, navseek->segment_start, GST_SEEK_TYPE_SET, + navseek->segment_end); + } + + peer_pad = gst_pad_get_peer (GST_BASE_TRANSFORM (navseek)->sinkpad); + gst_pad_send_event (peer_pad, event); + gst_object_unref (peer_pad); +} + +static void +gst_navseek_toggle_play_pause (GstNavSeek * navseek) +{ + GstStateChangeReturn sret; + GstState current, pending, state; + + sret = gst_element_get_state (GST_ELEMENT (navseek), ¤t, &pending, 0); + if (sret == GST_STATE_CHANGE_FAILURE) + return; + + state = (pending != GST_STATE_VOID_PENDING) ? pending : current; + + gst_element_post_message (GST_ELEMENT (navseek), + gst_message_new_request_state (GST_OBJECT (navseek), + (state == GST_STATE_PLAYING) ? GST_STATE_PAUSED : GST_STATE_PLAYING)); +} + +static gboolean +gst_navseek_src_event (GstBaseTransform * trans, GstEvent * event) +{ + GstNavSeek *navseek; + gboolean ret = TRUE; + + navseek = GST_NAVSEEK (trans); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_NAVIGATION: + { + /* Check for a keyup and convert left/right to a seek event */ + const GstStructure *structure; + const gchar *event_type; + + structure = gst_event_get_structure (event); + g_return_val_if_fail (structure != NULL, FALSE); + + event_type = gst_structure_get_string (structure, "event"); + g_return_val_if_fail (event_type != NULL, FALSE); + + if (strcmp (event_type, "key-press") == 0) { + const gchar *key; + + key = gst_structure_get_string (structure, "key"); + g_return_val_if_fail (key != NULL, FALSE); + + if (strcmp (key, "Left") == 0) { + /* Seek backward by 5 secs */ + gst_navseek_seek (navseek, -1.0 * navseek->seek_offset * GST_SECOND); + } else if (strcmp (key, "Right") == 0) { + /* Seek forward */ + gst_navseek_seek (navseek, navseek->seek_offset * GST_SECOND); + } else if (strcmp (key, "s") == 0) { + /* Grab the next frame as the start frame of a segment */ + navseek->grab_seg_start = TRUE; + } else if (strcmp (key, "e") == 0) { + /* Grab the next frame as the end frame of a segment */ + navseek->grab_seg_end = TRUE; + } else if (strcmp (key, "l") == 0) { + /* Toggle the loop flag. If we have both start and end segment times send a seek */ + navseek->loop = !navseek->loop; + gst_navseek_segseek (navseek); + } else if (strcmp (key, "f") == 0) { + /* fast forward */ + gst_navseek_change_playback_rate (navseek, 2.0); + } else if (strcmp (key, "r") == 0) { + /* rewind */ + gst_navseek_change_playback_rate (navseek, -2.0); + } else if (strcmp (key, "n") == 0) { + /* normal speed */ + gst_navseek_change_playback_rate (navseek, 1.0); + } else if (strcmp (key, "space") == 0) { + gst_navseek_toggle_play_pause (navseek); + } + } else { + break; + } + gst_event_unref (event); + event = NULL; + break; + } + default: + break; + } + + if (event) + ret = GST_BASE_TRANSFORM_CLASS (parent_class)->src_event (trans, event); + + return ret; +} + +static void +gst_navseek_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstNavSeek *navseek = GST_NAVSEEK (object); + + switch (prop_id) { + case ARG_SEEKOFFSET: + GST_OBJECT_LOCK (navseek); + navseek->seek_offset = g_value_get_double (value); + GST_OBJECT_UNLOCK (navseek); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_navseek_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstNavSeek *navseek = GST_NAVSEEK (object); + + switch (prop_id) { + case ARG_SEEKOFFSET: + GST_OBJECT_LOCK (navseek); + g_value_set_double (value, navseek->seek_offset); + GST_OBJECT_UNLOCK (navseek); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +gst_navseek_sink_event (GstBaseTransform * trans, GstEvent * event) +{ + GstNavSeek *navseek = GST_NAVSEEK (trans); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_EOS: + GST_OBJECT_LOCK (navseek); + if (navseek->loop) + gst_navseek_segseek (navseek); + GST_OBJECT_UNLOCK (navseek); + break; + default: + break; + } + return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event); +} + +static GstFlowReturn +gst_navseek_transform_ip (GstBaseTransform * basetrans, GstBuffer * buf) +{ + GstNavSeek *navseek = GST_NAVSEEK (basetrans); + + GST_OBJECT_LOCK (navseek); + + if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) { + if (navseek->grab_seg_start) { + navseek->segment_start = GST_BUFFER_TIMESTAMP (buf); + navseek->segment_end = GST_CLOCK_TIME_NONE; + navseek->grab_seg_start = FALSE; + } + + if (navseek->grab_seg_end) { + navseek->segment_end = GST_BUFFER_TIMESTAMP (buf); + navseek->grab_seg_end = FALSE; + gst_navseek_segseek (navseek); + } + } + + GST_OBJECT_UNLOCK (navseek); + + return GST_FLOW_OK; +} + +static gboolean +gst_navseek_start (GstBaseTransform * trans) +{ + /* anything we should be doing here? */ + return TRUE; +} + +static gboolean +gst_navseek_stop (GstBaseTransform * trans) +{ + /* anything we should be doing here? */ + return TRUE; +} diff --git a/gst/debugutils/gstnavseek.h b/gst/debugutils/gstnavseek.h new file mode 100644 index 0000000..1b9c924 --- /dev/null +++ b/gst/debugutils/gstnavseek.h @@ -0,0 +1,60 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_NAVSEEK_H__ +#define __GST_NAVSEEK_H__ + + +#include <gst/gst.h> +#include <gst/base/gstbasetransform.h> + +G_BEGIN_DECLS +#define GST_TYPE_NAVSEEK \ + (gst_navseek_get_type()) +#define GST_NAVSEEK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NAVSEEK,GstNavSeek)) +#define GST_NAVSEEK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NAVSEEK,GstNavSeekClass)) +#define GST_IS_NAVSEEK(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NAVSEEK)) +#define GST_IS_NAVSEEK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NAVSEEK)) +typedef struct _GstNavSeek GstNavSeek; +typedef struct _GstNavSeekClass GstNavSeekClass; + +struct _GstNavSeek +{ + GstBaseTransform basetransform; + + gdouble seek_offset; + gboolean loop; + gboolean grab_seg_start; + gboolean grab_seg_end; + GstClockTime segment_start; + GstClockTime segment_end; +}; + +struct _GstNavSeekClass +{ + GstBaseTransformClass parent_class; +}; + +G_END_DECLS +#endif /* __GST_NAVSEEK_H__ */ diff --git a/gst/debugutils/gstpushfilesrc.c b/gst/debugutils/gstpushfilesrc.c new file mode 100644 index 0000000..435d185 --- /dev/null +++ b/gst/debugutils/gstpushfilesrc.c @@ -0,0 +1,203 @@ +/* GStreamer Push File Source + * Copyright (C) <2007> Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/** + * SECTION:element-pushfilesrc + * @see_also: filesrc + * + * This element is only useful for debugging purposes. It implements an URI + * protocol handler for the 'pushfile' protocol and behaves like a file source + * element that cannot be activated in pull-mode. This makes it very easy to + * debug demuxers or decoders that can operate both pull and push-based in + * connection with the playbin element (which creates a source based on the + * URI passed). + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch-1.0 -m playbin uri=pushfile:///home/you/some/file.ogg + * ]| This plays back the given file using playbin, with the demuxer operating + * push-based. + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstpushfilesrc.h" + +#include <gst/gst.h> + +GST_DEBUG_CATEGORY_STATIC (pushfilesrc_debug); +#define GST_CAT_DEFAULT pushfilesrc_debug + +static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static void gst_push_file_src_uri_handler_init (gpointer g_iface, + gpointer iface_data); + +#define gst_push_file_src_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstPushFileSrc, gst_push_file_src, GST_TYPE_BIN, + G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, + gst_push_file_src_uri_handler_init)); + +static void +gst_push_file_src_dispose (GObject * obj) +{ + GstPushFileSrc *src = GST_PUSH_FILE_SRC (obj); + + if (src->srcpad) { + gst_element_remove_pad (GST_ELEMENT (src), src->srcpad); + src->srcpad = NULL; + } + if (src->filesrc) { + gst_bin_remove (GST_BIN (src), src->filesrc); + src->filesrc = NULL; + } + + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + +static void +gst_push_file_src_class_init (GstPushFileSrcClass * g_class) +{ + GObjectClass *gobject_class; + GstElementClass *element_class; + + gobject_class = G_OBJECT_CLASS (g_class); + element_class = GST_ELEMENT_CLASS (g_class); + + GST_DEBUG_CATEGORY_INIT (pushfilesrc_debug, "pushfilesrc", 0, + "pushfilesrc element"); + + gobject_class->dispose = gst_push_file_src_dispose; + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&srctemplate)); + + gst_element_class_set_static_metadata (element_class, "Push File Source", + "Testing", + "Implements pushfile:// URI-handler for push-based file access", + "Tim-Philipp Müller <tim centricular net>"); +} + +static gboolean +gst_push_file_src_ghostpad_query (GstPad * pad, GstObject * parent, + GstQuery * query) +{ + gboolean res; + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_SCHEDULING: + gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEEKABLE, 1, -1, 0); + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); + res = TRUE; + break; + default: + res = gst_pad_query_default (pad, parent, query); + break; + } + return res; +} + +static void +gst_push_file_src_init (GstPushFileSrc * src) +{ + src->filesrc = gst_element_factory_make ("filesrc", "real-filesrc"); + if (src->filesrc) { + GstPad *pad; + + gst_bin_add (GST_BIN (src), src->filesrc); + pad = gst_element_get_static_pad (src->filesrc, "src"); + g_assert (pad != NULL); + src->srcpad = gst_ghost_pad_new ("src", pad); + /* FIXME^H^HCORE: try pushfile:///foo/bar.ext ! typefind ! fakesink without + * this and watch core bugginess (some pad stays in flushing state) */ + gst_pad_set_query_function (src->srcpad, + GST_DEBUG_FUNCPTR (gst_push_file_src_ghostpad_query)); + gst_element_add_pad (GST_ELEMENT (src), src->srcpad); + gst_object_unref (pad); + } +} + +/*** GSTURIHANDLER INTERFACE *************************************************/ + +static GstURIType +gst_push_file_src_uri_get_type (GType type) +{ + return GST_URI_SRC; +} + +static const gchar *const * +gst_push_file_src_uri_get_protocols (GType type) +{ + static const gchar *protocols[] = { "pushfile", NULL }; + + return protocols; +} + +static gchar * +gst_push_file_src_uri_get_uri (GstURIHandler * handler) +{ + GstPushFileSrc *src = GST_PUSH_FILE_SRC (handler); + gchar *fileuri, *pushfileuri; + + if (src->filesrc == NULL) + return NULL; + + fileuri = gst_uri_handler_get_uri (GST_URI_HANDLER (src->filesrc));; + if (fileuri == NULL) + return NULL; + pushfileuri = g_strconcat ("push", fileuri, NULL); + g_free (fileuri); + + return pushfileuri; +} + +static gboolean +gst_push_file_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, + GError ** error) +{ + GstPushFileSrc *src = GST_PUSH_FILE_SRC (handler); + + if (src->filesrc == NULL) { + g_set_error_literal (error, GST_URI_ERROR, GST_URI_ERROR_BAD_STATE, + "Could not create file source element"); + return FALSE; + } + + /* skip 'push' bit */ + return gst_uri_handler_set_uri (GST_URI_HANDLER (src->filesrc), uri + 4, + error); +} + +static void +gst_push_file_src_uri_handler_init (gpointer g_iface, gpointer iface_data) +{ + GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface; + + iface->get_type = gst_push_file_src_uri_get_type; + iface->get_protocols = gst_push_file_src_uri_get_protocols; + iface->get_uri = gst_push_file_src_uri_get_uri; + iface->set_uri = gst_push_file_src_uri_set_uri; +} diff --git a/gst/debugutils/gstpushfilesrc.h b/gst/debugutils/gstpushfilesrc.h new file mode 100644 index 0000000..6013cc8 --- /dev/null +++ b/gst/debugutils/gstpushfilesrc.h @@ -0,0 +1,56 @@ +/* GStreamer Push File Source + * Copyright (C) <2007> Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_PUSH_FILE_SRC_H__ +#define __GST_PUSH_FILE_SRC_H__ + +#include <gst/gstbin.h> + +G_BEGIN_DECLS +#define GST_TYPE_PUSH_FILE_SRC \ + (gst_push_file_src_get_type()) +#define GST_PUSH_FILE_SRC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSH_FILE_SRC,GstPushFileSrc)) +#define GST_PUSH_FILE_SRC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSH_FILE_SRC,GstPushFileSrcClass)) +#define GST_IS_PUSH_FILE_SRC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSH_FILE_SRC)) +#define GST_IS_PUSH_FILE_SRC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSH_FILE_SRC)) +typedef struct _GstPushFileSrc GstPushFileSrc; +typedef struct _GstPushFileSrcClass GstPushFileSrcClass; + +struct _GstPushFileSrc +{ + GstBin parent; + + /*< private > */ + GstElement *filesrc; + GstPad *srcpad; +}; + +struct _GstPushFileSrcClass +{ + GstBinClass parent_class; +}; + +GType gst_push_file_src_get_type (void); + +G_END_DECLS +#endif /* __GST_PUSH_FILE_SRC_H__ */ diff --git a/gst/debugutils/gsttaginject.c b/gst/debugutils/gsttaginject.c new file mode 100644 index 0000000..b9b2727 --- /dev/null +++ b/gst/debugutils/gsttaginject.c @@ -0,0 +1,205 @@ +/* GStreamer + * Copyright (C) 2008 Stefan Kost <ensonic@users.sf.net> + * + * gsttaginject.c: + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:element-taginject + * + * Element that injects new metadata tags, but passes incomming data through + * unmodified. + * + * <refsect2> + * <title>Example launch lines</title> + * |[ + * gst-launch-1.0 audiotestsrc num-buffers=100 ! taginject tags="title=testsrc,artist=gstreamer" ! vorbisenc ! oggmux ! filesink location=test.ogg + * ]| set title and artist + * |[ + * gst-launch-1.0 audiotestsrc num-buffers=100 ! taginject tags="keywords=\{\"testone\",\"audio\"\},title=\"audio testtone\"" ! vorbisenc ! oggmux ! filesink location=test.ogg + * ]| set keywords and title demonstrating quoting of special chars and handling lists + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdlib.h> + +#include "gsttaginject.h" + +static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GST_DEBUG_CATEGORY_STATIC (gst_tag_inject_debug); +#define GST_CAT_DEFAULT gst_tag_inject_debug + +enum +{ + PROP_TAGS = 1 +}; + + +#define gst_tag_inject_parent_class parent_class +G_DEFINE_TYPE (GstTagInject, gst_tag_inject, GST_TYPE_BASE_TRANSFORM); + +static void gst_tag_inject_finalize (GObject * object); +static void gst_tag_inject_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_tag_inject_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); +static gboolean gst_tag_inject_start (GstBaseTransform * trans); + + +static void +gst_tag_inject_finalize (GObject * object) +{ + GstTagInject *self = GST_TAG_INJECT (object); + + if (self->tags) { + gst_tag_list_unref (self->tags); + self->tags = NULL; + } + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gst_tag_inject_class_init (GstTagInjectClass * klass) +{ + GObjectClass *gobject_class; + GstElementClass *gstelement_class; + GstBaseTransformClass *gstbasetrans_class; + + gobject_class = G_OBJECT_CLASS (klass); + gstelement_class = GST_ELEMENT_CLASS (klass); + gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass); + + GST_DEBUG_CATEGORY_INIT (gst_tag_inject_debug, "taginject", 0, + "tag inject element"); + + gobject_class->set_property = gst_tag_inject_set_property; + gobject_class->get_property = gst_tag_inject_get_property; + + g_object_class_install_property (gobject_class, PROP_TAGS, + g_param_spec_string ("tags", "taglist", + "List of tags to inject into the target file", + NULL, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); + + gobject_class->finalize = gst_tag_inject_finalize; + + gst_element_class_set_static_metadata (gstelement_class, + "TagInject", + "Generic", "inject metadata tags", "Stefan Kost <ensonic@users.sf.net>"); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&srctemplate)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sinktemplate)); + + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip); + + gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_tag_inject_start); +} + +static void +gst_tag_inject_init (GstTagInject * self) +{ + GstBaseTransform *trans = GST_BASE_TRANSFORM (self); + + gst_base_transform_set_gap_aware (trans, TRUE); + + self->tags = NULL; +} + +static GstFlowReturn +gst_tag_inject_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstTagInject *self = GST_TAG_INJECT (trans); + + if (G_UNLIKELY (!self->tags_sent)) { + self->tags_sent = TRUE; + /* send tags */ + if (self->tags && !gst_tag_list_is_empty (self->tags)) { + GST_DEBUG ("tag event :%" GST_PTR_FORMAT, self->tags); + gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans), + gst_event_new_tag (gst_tag_list_ref (self->tags))); + } + } + + return GST_FLOW_OK; +} + +static void +gst_tag_inject_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstTagInject *self = GST_TAG_INJECT (object); + + switch (prop_id) { + case PROP_TAGS:{ + gchar *structure = + g_strdup_printf ("taglist,%s", g_value_get_string (value)); + if (!(self->tags = gst_tag_list_new_from_string (structure))) { + GST_WARNING ("unparsable taglist = '%s'", structure); + } + + /* make sure that tags will be send */ + self->tags_sent = FALSE; + g_free (structure); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_tag_inject_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + /*GstTagInject *self = GST_TAG_INJECT (object); */ + + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +gst_tag_inject_start (GstBaseTransform * trans) +{ + GstTagInject *self = GST_TAG_INJECT (trans); + + /* we need to sent tags _transform_ip() once */ + self->tags_sent = FALSE; + + return TRUE; +} diff --git a/gst/debugutils/gsttaginject.h b/gst/debugutils/gsttaginject.h new file mode 100644 index 0000000..a545927 --- /dev/null +++ b/gst/debugutils/gsttaginject.h @@ -0,0 +1,66 @@ +/* GStreamer + * Copyright (C) 2008 Stefan Kost <ensonic@users.sf.net> + * + * gsttaginject.h: + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __GST_TAG_INJECT_H__ +#define __GST_TAG_INJECT_H__ + + +#include <gst/gst.h> +#include <gst/base/gstbasetransform.h> + +G_BEGIN_DECLS +#define GST_TYPE_TAG_INJECT \ + (gst_tag_inject_get_type()) +#define GST_TAG_INJECT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TAG_INJECT,GstTagInject)) +#define GST_TAG_INJECT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TAG_INJECT,GstTagInjectClass)) +#define GST_IS_TAG_INJECT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TAG_INJECT)) +#define GST_IS_TAG_INJECT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TAG_INJECT)) +typedef struct _GstTagInject GstTagInject; +typedef struct _GstTagInjectClass GstTagInjectClass; + +/** + * GstTagInject: + * + * Opaque #GstTagInject data structure + */ +struct _GstTagInject +{ + GstBaseTransform element; + + /*< private > */ + GstTagList *tags; + gboolean tags_sent; +}; + +struct _GstTagInjectClass +{ + GstBaseTransformClass parent_class; +}; + +GType gst_tag_inject_get_type (void); + +G_END_DECLS +#endif /* __GST_TAG_INJECT_H__ */ diff --git a/gst/debugutils/progressreport.c b/gst/debugutils/progressreport.c new file mode 100644 index 0000000..859e4b9 --- /dev/null +++ b/gst/debugutils/progressreport.c @@ -0,0 +1,516 @@ +/* GStreamer Progress Report Element + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * Copyright (C) <2003> David Schleef <ds@schleef.org> + * Copyright (C) <2004> Jan Schmidt <thaytan@mad.scientist.com> + * Copyright (C) <2006> Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/** + * SECTION:element-progressreport + * + * The progressreport element can be put into a pipeline to report progress, + * which is done by doing upstream duration and position queries in regular + * (real-time) intervals. Both the interval and the prefered query format + * can be specified via the #GstProgressReport:update-freq and the + * #GstProgressReport:format property. + * + * Element messages containing a "progress" structure are posted on the bus + * whenever progress has been queried (since gst-plugins-good 0.10.6 only). + * + * Since the element was originally designed for debugging purposes, it will + * by default also print information about the current progress to the + * terminal. This can be prevented by setting the #GstProgressReport:silent + * property to %TRUE. + * + * This element is most useful in transcoding pipelines or other situations + * where just querying the pipeline might not lead to the wanted result. For + * progress in TIME format, the element is best placed in a 'raw stream' + * section of the pipeline (or after any demuxers/decoders/parsers). + * + * Three more things should be pointed out: firstly, the element will only + * query progress when data flow happens. If data flow is stalled for some + * reason, no progress messages will be posted. Secondly, there are other + * elements (like qtdemux, for example) that may also post "progress" element + * messages on the bus. Applications should check the source of any element + * messages they receive, if needed. Finally, applications should not take + * action on receiving notification of progress being 100%, they should only + * take action when they receive an EOS message (since the progress reported + * is in reference to an internal point of a pipeline and not the pipeline as + * a whole). + * + * <refsect2> + * <title>Example launch line</title> + * |[ + * gst-launch-1.0 -m filesrc location=foo.ogg ! decodebin ! progressreport update-freq=1 ! audioconvert ! audioresample ! autoaudiosink + * ]| This shows a progress query where a duration is available. + * |[ + * gst-launch-1.0 -m audiotestsrc ! progressreport update-freq=1 ! audioconvert ! autoaudiosink + * ]| This shows a progress query where no duration is available. + * </refsect2> + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gst/gst.h> +#include <string.h> +#include <math.h> +#include <time.h> + +#include "progressreport.h" + + +enum +{ + ARG_0, + ARG_UPDATE_FREQ, + ARG_SILENT, + ARG_DO_QUERY, + ARG_FORMAT +}; + +GstStaticPadTemplate progress_report_src_template = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GstStaticPadTemplate progress_report_sink_template = +GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +#define DEFAULT_UPDATE_FREQ 5 +#define DEFAULT_SILENT FALSE +#define DEFAULT_DO_QUERY TRUE +#define DEFAULT_FORMAT "auto" + +static void gst_progress_report_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_progress_report_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static gboolean gst_progress_report_sink_event (GstBaseTransform * trans, + GstEvent * event); +static GstFlowReturn gst_progress_report_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); + +static gboolean gst_progress_report_start (GstBaseTransform * trans); +static gboolean gst_progress_report_stop (GstBaseTransform * trans); + +#define gst_progress_report_parent_class parent_class +G_DEFINE_TYPE (GstProgressReport, gst_progress_report, GST_TYPE_BASE_TRANSFORM); + +static void +gst_progress_report_finalize (GObject * obj) +{ + GstProgressReport *filter = GST_PROGRESS_REPORT (obj); + + g_free (filter->format); + filter->format = NULL; + + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + +static void +gst_progress_report_class_init (GstProgressReportClass * g_class) +{ + GstBaseTransformClass *gstbasetrans_class; + GstElementClass *element_class; + GObjectClass *gobject_class; + + gobject_class = G_OBJECT_CLASS (g_class); + element_class = GST_ELEMENT_CLASS (g_class); + gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (g_class); + + gobject_class->finalize = gst_progress_report_finalize; + gobject_class->set_property = gst_progress_report_set_property; + gobject_class->get_property = gst_progress_report_get_property; + + g_object_class_install_property (gobject_class, + ARG_UPDATE_FREQ, g_param_spec_int ("update-freq", "Update Frequency", + "Number of seconds between reports when data is flowing", 1, G_MAXINT, + DEFAULT_UPDATE_FREQ, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + ARG_SILENT, g_param_spec_boolean ("silent", + "Do not print output to stdout", "Do not print output to stdout", + DEFAULT_SILENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + ARG_DO_QUERY, g_param_spec_boolean ("do-query", + "Use a query instead of buffer metadata to determine stream position", + "Use a query instead of buffer metadata to determine stream position", + DEFAULT_DO_QUERY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, + ARG_FORMAT, g_param_spec_string ("format", "format", + "Format to use for the querying", DEFAULT_FORMAT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&progress_report_sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&progress_report_src_template)); + + gst_element_class_set_static_metadata (element_class, "Progress report", + "Testing", + "Periodically query and report on processing progress", + "Jan Schmidt <thaytan@mad.scientist.com>"); + + gstbasetrans_class->sink_event = + GST_DEBUG_FUNCPTR (gst_progress_report_sink_event); + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_progress_report_transform_ip); + gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_progress_report_start); + gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_progress_report_stop); +} + +static void +gst_progress_report_init (GstProgressReport * report) +{ + gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (report), TRUE); + + report->update_freq = DEFAULT_UPDATE_FREQ; + report->silent = DEFAULT_SILENT; + report->do_query = DEFAULT_DO_QUERY; + report->format = g_strdup (DEFAULT_FORMAT); +} + +static void +gst_progress_report_post_progress (GstProgressReport * filter, + GstFormat format, gint64 current, gint64 total) +{ + GstStructure *s = NULL; + + if (current >= 0 && total > 0) { + gdouble perc; + + perc = gst_util_guint64_to_gdouble (current) * 100.0 / + gst_util_guint64_to_gdouble (total); + perc = CLAMP (perc, 0.0, 100.0); + + /* we provide a "percent" field of integer type to stay compatible + * with qtdemux, but add a second "percent-double" field for those who + * want more precision and are too lazy to calculate it themselves */ + s = gst_structure_new ("progress", "percent", G_TYPE_INT, (gint) perc, + "percent-double", G_TYPE_DOUBLE, perc, "current", G_TYPE_INT64, current, + "total", G_TYPE_INT64, total, NULL); + } else if (current >= 0) { + s = gst_structure_new ("progress", "current", G_TYPE_INT64, current, NULL); + } + + if (s) { + GST_LOG_OBJECT (filter, "posting progress message: %" GST_PTR_FORMAT, s); + gst_structure_set (s, "format", GST_TYPE_FORMAT, format, NULL); + /* can't post it right here because we're holding the object lock */ + filter->pending_msg = gst_message_new_element (GST_OBJECT_CAST (filter), s); + } +} + +static gboolean +gst_progress_report_do_query (GstProgressReport * filter, GstFormat format, + gint hh, gint mm, gint ss, GstBuffer * buf) +{ + const gchar *format_name = NULL; + GstPad *sink_pad; + gint64 cur, total; + + sink_pad = GST_BASE_TRANSFORM (filter)->sinkpad; + + GST_LOG_OBJECT (filter, "querying using format %d (%s)", format, + gst_format_get_name (format)); + + if (filter->do_query || !buf) { + GST_LOG_OBJECT (filter, "using upstream query"); + if (!gst_pad_peer_query_position (sink_pad, format, &cur) || + !gst_pad_peer_query_duration (sink_pad, format, &total)) { + return FALSE; + } + } else { + GstBaseTransform *base = GST_BASE_TRANSFORM (filter); + + GST_LOG_OBJECT (filter, "using buffer metadata"); + if (format == GST_FORMAT_TIME && base->segment.format == GST_FORMAT_TIME) { + cur = gst_segment_to_stream_time (&base->segment, format, + GST_BUFFER_TIMESTAMP (buf)); + total = base->segment.duration; + } else { + return FALSE; + } + } + + switch (format) { + case GST_FORMAT_BYTES: + format_name = "bytes"; + break; + case GST_FORMAT_BUFFERS: + format_name = "buffers"; + break; + case GST_FORMAT_PERCENT: + format_name = "percent"; + break; + case GST_FORMAT_TIME: + format_name = "seconds"; + cur /= GST_SECOND; + total /= GST_SECOND; + break; + case GST_FORMAT_DEFAULT:{ + GstCaps *caps; + + format_name = "bogounits"; + caps = gst_pad_get_current_caps (GST_BASE_TRANSFORM (filter)->sinkpad); + if (caps) { + if (gst_caps_is_fixed (caps) && !gst_caps_is_any (caps)) { + GstStructure *s = gst_caps_get_structure (caps, 0); + const gchar *mime_type = gst_structure_get_name (s); + + if (g_str_has_prefix (mime_type, "video/") || + g_str_has_prefix (mime_type, "image/")) { + format_name = "frames"; + } else if (g_str_has_prefix (mime_type, "audio/")) { + format_name = "samples"; + } + } + gst_caps_unref (caps); + } + break; + } + default:{ + const GstFormatDefinition *details; + + details = gst_format_get_details (format); + if (details) { + format_name = details->nick; + } else { + format_name = "unknown"; + } + break; + } + } + + if (!filter->silent) { + if (total > 0) { + g_print ("%s (%02d:%02d:%02d): %" G_GINT64_FORMAT " / %" + G_GINT64_FORMAT " %s (%4.1f %%)\n", GST_OBJECT_NAME (filter), hh, + mm, ss, cur, total, format_name, (gdouble) cur / total * 100.0); + } else { + g_print ("%s (%02d:%02d:%02d): %" G_GINT64_FORMAT " %s\n", + GST_OBJECT_NAME (filter), hh, mm, ss, cur, format_name); + } + } + + gst_progress_report_post_progress (filter, format, cur, total); + return TRUE; +} + +static void +gst_progress_report_report (GstProgressReport * filter, GTimeVal cur_time, + GstBuffer * buf) +{ + GstFormat try_formats[] = { GST_FORMAT_TIME, GST_FORMAT_BYTES, + GST_FORMAT_PERCENT, GST_FORMAT_BUFFERS, + GST_FORMAT_DEFAULT + }; + GstMessage *msg; + GstFormat format = GST_FORMAT_UNDEFINED; + gboolean done = FALSE; + glong run_time; + gint hh, mm, ss; + + run_time = cur_time.tv_sec - filter->start_time.tv_sec; + + hh = (run_time / 3600) % 100; + mm = (run_time / 60) % 60; + ss = (run_time % 60); + + GST_OBJECT_LOCK (filter); + + if (filter->format != NULL && strcmp (filter->format, "auto") != 0) { + format = gst_format_get_by_nick (filter->format); + } + + if (format != GST_FORMAT_UNDEFINED) { + done = gst_progress_report_do_query (filter, format, hh, mm, ss, buf); + } else { + gint i; + + for (i = 0; i < G_N_ELEMENTS (try_formats); ++i) { + done = gst_progress_report_do_query (filter, try_formats[i], hh, mm, ss, + buf); + if (done) + break; + } + } + + if (!done && !filter->silent) { + g_print ("%s (%2d:%2d:%2d): Could not query position and/or duration\n", + GST_OBJECT_NAME (filter), hh, mm, ss); + } + + msg = filter->pending_msg; + filter->pending_msg = NULL; + GST_OBJECT_UNLOCK (filter); + + if (msg) { + gst_element_post_message (GST_ELEMENT_CAST (filter), msg); + } +} + +static gboolean +gst_progress_report_sink_event (GstBaseTransform * trans, GstEvent * event) +{ + GstProgressReport *filter; + + filter = GST_PROGRESS_REPORT (trans); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_EOS: + { + GTimeVal cur_time; + + g_get_current_time (&cur_time); + gst_progress_report_report (filter, cur_time, NULL); + break; + } + default: + break; + } + return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event); +} + +static GstFlowReturn +gst_progress_report_transform_ip (GstBaseTransform * trans, GstBuffer * buf) +{ + GstProgressReport *filter; + gboolean need_update; + GTimeVal cur_time; + + g_get_current_time (&cur_time); + + filter = GST_PROGRESS_REPORT (trans); + + /* Check if update_freq seconds have passed since the last update */ + GST_OBJECT_LOCK (filter); + need_update = + ((cur_time.tv_sec - filter->last_report.tv_sec) >= filter->update_freq); + GST_OBJECT_UNLOCK (filter); + + if (need_update) { + gst_progress_report_report (filter, cur_time, buf); + GST_OBJECT_LOCK (filter); + filter->last_report = cur_time; + GST_OBJECT_UNLOCK (filter); + } + + return GST_FLOW_OK; +} + +static gboolean +gst_progress_report_start (GstBaseTransform * trans) +{ + GstProgressReport *filter; + + filter = GST_PROGRESS_REPORT (trans); + + g_get_current_time (&filter->last_report); + filter->start_time = filter->last_report; + + return TRUE; +} + +static gboolean +gst_progress_report_stop (GstBaseTransform * trans) +{ + /* anything we should be doing here? */ + return TRUE; +} + +static void +gst_progress_report_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstProgressReport *filter; + + filter = GST_PROGRESS_REPORT (object); + + switch (prop_id) { + case ARG_UPDATE_FREQ: + GST_OBJECT_LOCK (filter); + filter->update_freq = g_value_get_int (value); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_SILENT: + GST_OBJECT_LOCK (filter); + filter->silent = g_value_get_boolean (value); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_DO_QUERY: + GST_OBJECT_LOCK (filter); + filter->do_query = g_value_get_boolean (value); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_FORMAT: + GST_OBJECT_LOCK (filter); + g_free (filter->format); + filter->format = g_value_dup_string (value); + if (filter->format == NULL) + filter->format = g_strdup ("auto"); + GST_OBJECT_UNLOCK (filter); + break; + default: + break; + } +} + +static void +gst_progress_report_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstProgressReport *filter; + + filter = GST_PROGRESS_REPORT (object); + + switch (prop_id) { + case ARG_UPDATE_FREQ: + GST_OBJECT_LOCK (filter); + g_value_set_int (value, filter->update_freq); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_SILENT: + GST_OBJECT_LOCK (filter); + g_value_set_boolean (value, filter->silent); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_DO_QUERY: + GST_OBJECT_LOCK (filter); + g_value_set_boolean (value, filter->do_query); + GST_OBJECT_UNLOCK (filter); + break; + case ARG_FORMAT: + GST_OBJECT_LOCK (filter); + g_value_set_string (value, filter->format); + GST_OBJECT_UNLOCK (filter); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} diff --git a/gst/debugutils/progressreport.h b/gst/debugutils/progressreport.h new file mode 100644 index 0000000..c46ac09 --- /dev/null +++ b/gst/debugutils/progressreport.h @@ -0,0 +1,67 @@ +/* GStreamer Progress Report Element + * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> + * Copyright (C) <2003> David Schleef <ds@schleef.org> + * Copyright (C) <2004> Jan Schmidt <thaytan@mad.scientist.com> + * Copyright (C) <2006> Tim-Philipp Müller <tim centricular net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_PROGRESS_REPORT_H__ +#define __GST_PROGRESS_REPORT_H__ + +#include <gst/base/gstbasetransform.h> + +G_BEGIN_DECLS +#define GST_TYPE_PROGRESS_REPORT \ + (gst_progress_report_get_type()) +#define GST_PROGRESS_REPORT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PROGRESS_REPORT,GstProgressReport)) +#define GST_PROGRESS_REPORT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PROGRESS_REPORT,GstProgressReportClass)) +#define GST_IS_PROGRESS_REPORT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PROGRESS_REPORT)) +#define GST_IS_PROGRESS_REPORT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PROGRESS_REPORT)) +typedef struct _GstProgressReport GstProgressReport; +typedef struct _GstProgressReportClass GstProgressReportClass; + +struct _GstProgressReport +{ + GstBaseTransform basetransform; + + GstMessage *pending_msg; + + gint update_freq; + gboolean silent; + gboolean do_query; + GTimeVal start_time; + GTimeVal last_report; + + /* Format used for querying. Using a string here because the + * format might not be registered yet when the property is set */ + gchar *format; +}; + +struct _GstProgressReportClass +{ + GstBaseTransformClass parent_class; +}; + +GType gst_progress_report_get_type (void); + +G_END_DECLS +#endif /* __GST_PROGRESS_REPORT_H__ */ diff --git a/gst/debugutils/rndbuffersize.c b/gst/debugutils/rndbuffersize.c new file mode 100644 index 0000000..009f833 --- /dev/null +++ b/gst/debugutils/rndbuffersize.c @@ -0,0 +1,580 @@ +/* GStreamer + * Copyright (C) 2007 Nokia Corporation (contact <stefan.kost@nokia.com>) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +/** + * SECTION:element-rndbuffersize + * + * This element pulls buffers with random sizes from the source. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gst/gst.h> +#include <gst/base/gstadapter.h> + +GST_DEBUG_CATEGORY_STATIC (gst_rnd_buffer_size_debug); +#define GST_CAT_DEFAULT gst_rnd_buffer_size_debug + +#define GST_TYPE_RND_BUFFER_SIZE (gst_rnd_buffer_size_get_type()) +#define GST_RND_BUFFER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RND_BUFFER_SIZE,GstRndBufferSize)) +#define GST_RND_BUFFER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RND_BUFFER_SIZE,GstRndBufferSizeClass)) +#define GST_IS_RND_BUFFER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RND_BUFFER_SIZE)) +#define GST_IS_RND_BUFFER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RND_BUFFER_SIZE)) + +typedef struct _GstRndBufferSize GstRndBufferSize; +typedef struct _GstRndBufferSizeClass GstRndBufferSizeClass; + +struct _GstRndBufferSize +{ + GstElement parent; + + /*< private > */ + GRand *rand; + guint seed; + gint min, max; + + GstPad *sinkpad, *srcpad; + guint64 offset; + + gboolean need_newsegment; + + GstAdapter *adapter; +}; + +struct _GstRndBufferSizeClass +{ + GstElementClass parent_class; +}; + +enum +{ + ARG_SEED = 1, + ARG_MINIMUM, + ARG_MAXIMUM +}; + +#define DEFAULT_SEED 0 +#define DEFAULT_MIN 1 +#define DEFAULT_MAX (8*1024) + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +static void gst_rnd_buffer_size_finalize (GObject * object); +static void gst_rnd_buffer_size_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_rnd_buffer_size_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static gboolean gst_rnd_buffer_size_activate (GstPad * pad, GstObject * parent); +static gboolean gst_rnd_buffer_size_activate_mode (GstPad * pad, + GstObject * parent, GstPadMode mode, gboolean active); +static void gst_rnd_buffer_size_loop (GstRndBufferSize * self); +static GstStateChangeReturn gst_rnd_buffer_size_change_state (GstElement * + element, GstStateChange transition); +static gboolean gst_rnd_buffer_size_src_event (GstPad * pad, + GstObject * parent, GstEvent * event); +static gboolean gst_rnd_buffer_size_sink_event (GstPad * pad, + GstObject * parent, GstEvent * event); +static GstFlowReturn gst_rnd_buffer_size_chain (GstPad * pad, + GstObject * parent, GstBuffer * buffer); + +GType gst_rnd_buffer_size_get_type (void); +#define gst_rnd_buffer_size_parent_class parent_class +G_DEFINE_TYPE (GstRndBufferSize, gst_rnd_buffer_size, GST_TYPE_ELEMENT); + +static void +gst_rnd_buffer_size_class_init (GstRndBufferSizeClass * klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + + GST_DEBUG_CATEGORY_INIT (gst_rnd_buffer_size_debug, "rndbuffersize", 0, + "rndbuffersize element"); + + gobject_class->set_property = gst_rnd_buffer_size_set_property; + gobject_class->get_property = gst_rnd_buffer_size_get_property; + gobject_class->finalize = gst_rnd_buffer_size_finalize; + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_template)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_template)); + + gst_element_class_set_static_metadata (gstelement_class, "Random buffer size", + "Testing", "pull random sized buffers", + "Stefan Kost <stefan.kost@nokia.com>"); + + gstelement_class->change_state = + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_change_state); + + g_object_class_install_property (gobject_class, ARG_SEED, + g_param_spec_uint ("seed", "random number seed", + "seed for randomness (initialized when going from READY to PAUSED)", + 0, G_MAXUINT32, DEFAULT_SEED, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_MINIMUM, + g_param_spec_int ("min", "mininum", "mininum buffer size", + 0, G_MAXINT32, DEFAULT_MIN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_MAXIMUM, + g_param_spec_int ("max", "maximum", "maximum buffer size", + 1, G_MAXINT32, DEFAULT_MAX, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); +} + +static void +gst_rnd_buffer_size_init (GstRndBufferSize * self) +{ + self->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink"); + gst_pad_set_activate_function (self->sinkpad, + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_activate)); + gst_pad_set_activatemode_function (self->sinkpad, + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_activate_mode)); + gst_pad_set_event_function (self->sinkpad, + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_sink_event)); + gst_pad_set_chain_function (self->sinkpad, + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_chain)); + GST_OBJECT_FLAG_SET (self->sinkpad, GST_PAD_FLAG_PROXY_CAPS); + GST_OBJECT_FLAG_SET (self->sinkpad, GST_PAD_FLAG_PROXY_ALLOCATION); + GST_OBJECT_FLAG_SET (self->sinkpad, GST_PAD_FLAG_PROXY_SCHEDULING); + gst_element_add_pad (GST_ELEMENT (self), self->sinkpad); + + self->srcpad = gst_pad_new_from_static_template (&src_template, "src"); + gst_pad_set_event_function (self->srcpad, + GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_src_event)); + GST_OBJECT_FLAG_SET (self->srcpad, GST_PAD_FLAG_PROXY_CAPS); + GST_OBJECT_FLAG_SET (self->srcpad, GST_PAD_FLAG_PROXY_ALLOCATION); + GST_OBJECT_FLAG_SET (self->srcpad, GST_PAD_FLAG_PROXY_SCHEDULING); + gst_element_add_pad (GST_ELEMENT (self), self->srcpad); +} + + +static void +gst_rnd_buffer_size_finalize (GObject * object) +{ + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (object); + + if (self->rand) { + g_rand_free (self->rand); + self->rand = NULL; + } + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + + +static void +gst_rnd_buffer_size_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (object); + + switch (prop_id) { + case ARG_SEED: + self->seed = g_value_get_uint (value); + break; + case ARG_MINIMUM: + self->min = g_value_get_int (value); + break; + case ARG_MAXIMUM: + self->max = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +gst_rnd_buffer_size_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (object); + + switch (prop_id) { + case ARG_SEED: + g_value_set_uint (value, self->seed); + break; + case ARG_MINIMUM: + g_value_set_int (value, self->min); + break; + case ARG_MAXIMUM: + g_value_set_int (value, self->max); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static gboolean +gst_rnd_buffer_size_activate (GstPad * pad, GstObject * parent) +{ + GstQuery *query; + gboolean pull_mode; + + query = gst_query_new_scheduling (); + + if (gst_pad_peer_query (pad, query)) + pull_mode = gst_query_has_scheduling_mode_with_flags (query, + GST_PAD_MODE_PULL, GST_SCHEDULING_FLAG_SEEKABLE); + else + pull_mode = FALSE; + + gst_query_unref (query); + + if (pull_mode) { + GST_DEBUG_OBJECT (pad, "activating pull"); + return gst_pad_activate_mode (pad, GST_PAD_MODE_PULL, TRUE); + } else { + GST_DEBUG_OBJECT (pad, "activating push"); + return gst_pad_activate_mode (pad, GST_PAD_MODE_PUSH, TRUE); + } +} + + +static gboolean +gst_rnd_buffer_size_activate_mode (GstPad * pad, GstObject * parent, + GstPadMode mode, gboolean active) +{ + gboolean res; + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (parent); + + switch (mode) { + case GST_PAD_MODE_PULL: + if (active) { + GST_INFO_OBJECT (self, "starting pull"); + res = + gst_pad_start_task (pad, (GstTaskFunction) gst_rnd_buffer_size_loop, + self, NULL); + self->need_newsegment = TRUE; + } else { + GST_INFO_OBJECT (self, "stopping pull"); + res = gst_pad_stop_task (pad); + } + break; + case GST_PAD_MODE_PUSH: + GST_INFO_OBJECT (self, "%sactivating in push mode", (active) ? "" : "de"); + res = TRUE; + break; + default: + res = FALSE; + break; + } + return res; +} + +static gboolean +gst_rnd_buffer_size_src_event (GstPad * pad, GstObject * parent, + GstEvent * event) +{ + GstRndBufferSize *self; + GstSeekType start_type; + GstSeekFlags flags; + GstFormat format; + gint64 start; + + if (GST_EVENT_TYPE (event) != GST_EVENT_SEEK) { + return gst_pad_event_default (pad, parent, event); + } + + self = GST_RND_BUFFER_SIZE (parent); + gst_event_parse_seek (event, NULL, &format, &flags, &start_type, &start, + NULL, NULL); + + if (format != GST_FORMAT_BYTES) { + GST_WARNING_OBJECT (pad, "only BYTE format supported"); + return FALSE; + } + if (start_type != GST_SEEK_TYPE_SET) { + GST_WARNING_OBJECT (pad, "only SEEK_TYPE_SET supported"); + return FALSE; + } + + if ((flags & GST_SEEK_FLAG_FLUSH)) { + gst_pad_push_event (self->srcpad, gst_event_new_flush_start ()); + gst_pad_push_event (self->sinkpad, gst_event_new_flush_start ()); + } else { + gst_pad_pause_task (self->sinkpad); + } + + GST_PAD_STREAM_LOCK (self->sinkpad); + + if ((flags & GST_SEEK_FLAG_FLUSH)) { + gst_pad_push_event (self->srcpad, gst_event_new_flush_stop (TRUE)); + gst_pad_push_event (self->sinkpad, gst_event_new_flush_stop (TRUE)); + } + + GST_INFO_OBJECT (pad, "seeking to offset %" G_GINT64_FORMAT, start); + + self->offset = start; + self->need_newsegment = TRUE; + + gst_pad_start_task (self->sinkpad, (GstTaskFunction) gst_rnd_buffer_size_loop, + self, NULL); + + GST_PAD_STREAM_UNLOCK (self->sinkpad); + return TRUE; +} + +static GstFlowReturn +gst_rnd_buffer_size_drain_adapter (GstRndBufferSize * self, gboolean eos) +{ + GstFlowReturn flow; + GstBuffer *buf; + guint num_bytes, avail; + + flow = GST_FLOW_OK; + + if (G_UNLIKELY (self->min > self->max)) + goto bogus_minmax; + + do { + if (self->min != self->max) { + num_bytes = g_rand_int_range (self->rand, self->min, self->max); + } else { + num_bytes = self->min; + } + + GST_LOG_OBJECT (self, "pulling %u bytes out of adapter", num_bytes); + + buf = gst_adapter_take_buffer (self->adapter, num_bytes); + + if (buf == NULL) { + if (!eos) { + GST_LOG_OBJECT (self, "not enough bytes in adapter"); + break; + } + + avail = gst_adapter_available (self->adapter); + + if (avail == 0) + break; + + if (avail < self->min) { + GST_WARNING_OBJECT (self, "discarding %u bytes at end (min=%u)", + avail, self->min); + gst_adapter_clear (self->adapter); + break; + } + buf = gst_adapter_take_buffer (self->adapter, avail); + g_assert (buf != NULL); + } + + flow = gst_pad_push (self->srcpad, buf); + } + while (flow == GST_FLOW_OK); + + return flow; + +/* ERRORS */ +bogus_minmax: + { + GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, + ("The minimum buffer size is smaller than the maximum buffer size."), + ("buffer sizes: max=%d, min=%d", self->min, self->max)); + return GST_FLOW_ERROR; + } +} + +static gboolean +gst_rnd_buffer_size_sink_event (GstPad * pad, GstObject * parent, + GstEvent * event) +{ + GstRndBufferSize *rnd = GST_RND_BUFFER_SIZE (parent); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_EOS: + gst_rnd_buffer_size_drain_adapter (rnd, TRUE); + break; + case GST_EVENT_FLUSH_STOP: + if (rnd->adapter != NULL) + gst_adapter_clear (rnd->adapter); + break; + default: + break; + } + + return gst_pad_event_default (pad, parent, event); +} + +static GstFlowReturn +gst_rnd_buffer_size_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) +{ + GstRndBufferSize *rnd = GST_RND_BUFFER_SIZE (parent); + GstFlowReturn flow; + + if (rnd->adapter == NULL) + rnd->adapter = gst_adapter_new (); + + gst_adapter_push (rnd->adapter, buf); + + flow = gst_rnd_buffer_size_drain_adapter (rnd, FALSE); + + if (flow != GST_FLOW_OK) + GST_INFO_OBJECT (rnd, "flow: %s", gst_flow_get_name (flow)); + + return flow; +} + +static void +gst_rnd_buffer_size_loop (GstRndBufferSize * self) +{ + GstBuffer *buf = NULL; + GstFlowReturn ret; + guint num_bytes, size; + + if (G_UNLIKELY (self->min > self->max)) + goto bogus_minmax; + + if (G_UNLIKELY (self->min != self->max)) { + num_bytes = g_rand_int_range (self->rand, self->min, self->max); + } else { + num_bytes = self->min; + } + + GST_LOG_OBJECT (self, "pulling %u bytes at offset %" G_GUINT64_FORMAT, + num_bytes, self->offset); + + ret = gst_pad_pull_range (self->sinkpad, self->offset, num_bytes, &buf); + + if (ret != GST_FLOW_OK) + goto pull_failed; + + size = gst_buffer_get_size (buf); + + if (size < num_bytes) { + GST_WARNING_OBJECT (self, "short buffer: %u bytes", size); + } + + if (self->need_newsegment) { + GstSegment segment; + + gst_segment_init (&segment, GST_FORMAT_BYTES); + segment.start = self->offset; + gst_pad_push_event (self->srcpad, gst_event_new_segment (&segment)); + self->need_newsegment = FALSE; + } + + self->offset += size; + + ret = gst_pad_push (self->srcpad, buf); + + if (ret != GST_FLOW_OK) + goto push_failed; + + return; + +pause_task: + { + GST_DEBUG_OBJECT (self, "pausing task"); + gst_pad_pause_task (self->sinkpad); + return; + } + +pull_failed: + { + if (ret == GST_FLOW_EOS) { + GST_DEBUG_OBJECT (self, "eos"); + gst_pad_push_event (self->srcpad, gst_event_new_eos ()); + } else { + GST_WARNING_OBJECT (self, "pull_range flow: %s", gst_flow_get_name (ret)); + } + goto pause_task; + } + +push_failed: + { + GST_DEBUG_OBJECT (self, "push flow: %s", gst_flow_get_name (ret)); + if (ret == GST_FLOW_EOS) { + GST_DEBUG_OBJECT (self, "eos"); + gst_pad_push_event (self->srcpad, gst_event_new_eos ()); + } else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) { + GST_ELEMENT_ERROR (self, STREAM, FAILED, + ("Internal data stream error."), + ("streaming stopped, reason: %s", gst_flow_get_name (ret))); + } + goto pause_task; + } + +bogus_minmax: + { + GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, + ("The minimum buffer size is smaller than the maximum buffer size."), + ("buffer sizes: max=%d, min=%d", self->min, self->max)); + goto pause_task; + } +} + +static GstStateChangeReturn +gst_rnd_buffer_size_change_state (GstElement * element, + GstStateChange transition) +{ + GstRndBufferSize *self = GST_RND_BUFFER_SIZE (element); + GstStateChangeReturn ret; + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + break; + case GST_STATE_CHANGE_READY_TO_PAUSED: + self->offset = 0; + if (!self->rand) { + self->rand = g_rand_new_with_seed (self->seed); + } + break; + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + break; + default: + break; + } + + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + break; + case GST_STATE_CHANGE_PAUSED_TO_READY: + if (self->rand) { + g_rand_free (self->rand); + self->rand = NULL; + } + break; + case GST_STATE_CHANGE_READY_TO_NULL: + if (self->adapter) { + g_object_unref (self->adapter); + self->adapter = NULL; + } + break; + default: + break; + } + + return ret; +} diff --git a/gst/debugutils/testplugin.c b/gst/debugutils/testplugin.c new file mode 100644 index 0000000..7d104cd --- /dev/null +++ b/gst/debugutils/testplugin.c @@ -0,0 +1,305 @@ +/* GStreamer + * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <gst/gst.h> +#include <gst/base/gstbasesink.h> +#include "tests.h" + +GST_DEBUG_CATEGORY_STATIC (gst_test_debug); +#define GST_CAT_DEFAULT gst_test_debug + +/* This plugin does all the tests registered in the tests.h file + */ + +#define GST_TYPE_TEST \ + (gst_test_get_type()) +#define GST_TEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TEST,GstTest)) +#define GST_TEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TEST,GstTestClass)) +#define GST_TEST_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_TEST,GstTestClass)) +#define GST_IS_TEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TEST)) +#define GST_IS_TEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TEST)) + +typedef struct _GstTest GstTest; +typedef struct _GstTestClass GstTestClass; + +struct _GstTest +{ + GstBaseSink basesink; + + gpointer tests[TESTS_COUNT]; + GValue values[TESTS_COUNT]; +}; + +struct _GstTestClass +{ + GstBaseSinkClass parent_class; + + gchar *param_names[2 * TESTS_COUNT]; +}; + +static void gst_test_finalize (GstTest * test); + +static gboolean gst_test_start (GstBaseSink * trans); +static gboolean gst_test_stop (GstBaseSink * trans); +static gboolean gst_test_sink_event (GstBaseSink * basesink, GstEvent * event); +static GstFlowReturn gst_test_render_buffer (GstBaseSink * basesink, + GstBuffer * buf); + +static void gst_test_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_test_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS_ANY); + +GType gst_test_get_type (void); +#define gst_test_parent_class parent_class +G_DEFINE_TYPE (GstTest, gst_test, GST_TYPE_BASE_SINK); + + +static void +gst_test_class_init (GstTestClass * klass) +{ + GstBaseSinkClass *basesink_class = GST_BASE_SINK_CLASS (klass); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + guint i; + + GST_DEBUG_CATEGORY_INIT (gst_test_debug, "testsink", 0, + "debugging category for testsink element"); + + object_class->set_property = gst_test_set_property; + object_class->get_property = gst_test_get_property; + + object_class->finalize = (GObjectFinalizeFunc) gst_test_finalize; + + for (i = 0; i < TESTS_COUNT; i++) { + GParamSpec *spec; + + spec = tests[i].get_spec (&tests[i], FALSE); + klass->param_names[2 * i] = g_strdup (g_param_spec_get_name (spec)); + g_object_class_install_property (object_class, 2 * i + 1, spec); + spec = tests[i].get_spec (&tests[i], TRUE); + klass->param_names[2 * i + 1] = g_strdup (g_param_spec_get_name (spec)); + g_object_class_install_property (object_class, 2 * i + 2, spec); + } + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sinktemplate)); + + gst_element_class_set_static_metadata (gstelement_class, "Test plugin", + "Testing", "perform a number of tests", "Benjamin Otte <otte@gnome>"); + + basesink_class->render = GST_DEBUG_FUNCPTR (gst_test_render_buffer); + basesink_class->event = GST_DEBUG_FUNCPTR (gst_test_sink_event); + basesink_class->start = GST_DEBUG_FUNCPTR (gst_test_start); + basesink_class->stop = GST_DEBUG_FUNCPTR (gst_test_stop); +} + +static void +gst_test_init (GstTest * test) +{ + GstTestClass *klass; + guint i; + + klass = GST_TEST_GET_CLASS (test); + for (i = 0; i < TESTS_COUNT; i++) { + GParamSpec *spec = g_object_class_find_property (G_OBJECT_CLASS (klass), + klass->param_names[2 * i + 1]); + + g_value_init (&test->values[i], G_PARAM_SPEC_VALUE_TYPE (spec)); + } +} + +static void +gst_test_finalize (GstTest * test) +{ + guint i; + + for (i = 0; i < TESTS_COUNT; i++) { + g_value_unset (&test->values[i]); + } + + G_OBJECT_CLASS (parent_class)->finalize ((GObject *) test); +} + +static void +tests_unset (GstTest * test) +{ + guint i; + + for (i = 0; i < TESTS_COUNT; i++) { + if (test->tests[i]) { + tests[i].free (test->tests[i]); + test->tests[i] = NULL; + } + } +} + +static void +tests_set (GstTest * test) +{ + guint i; + + for (i = 0; i < TESTS_COUNT; i++) { + g_assert (test->tests[i] == NULL); + test->tests[i] = tests[i].new (&tests[i]); + } +} + +static gboolean +gst_test_sink_event (GstBaseSink * basesink, GstEvent * event) +{ + GstTestClass *klass = GST_TEST_GET_CLASS (basesink); + GstTest *test = GST_TEST (basesink); + + switch (GST_EVENT_TYPE (event)) { +/* + case GST_EVENT_NEWSEGMENT: + if (GST_EVENT_DISCONT_NEW_MEDIA (event)) { + tests_unset (test); + tests_set (test); + } + break; +*/ + case GST_EVENT_EOS:{ + gint i; + + g_object_freeze_notify (G_OBJECT (test)); + for (i = 0; i < TESTS_COUNT; i++) { + if (test->tests[i]) { + if (!tests[i].finish (test->tests[i], &test->values[i])) { + GValue v = { 0, }; + gchar *real, *expected; + + expected = gst_value_serialize (&test->values[i]); + g_value_init (&v, G_VALUE_TYPE (&test->values[i])); + g_object_get_property (G_OBJECT (test), klass->param_names[2 * i], + &v); + real = gst_value_serialize (&v); + g_value_unset (&v); + GST_ELEMENT_ERROR (test, STREAM, FORMAT, (NULL), + ("test %s returned value \"%s\" and not expected value \"%s\"", + klass->param_names[2 * i], real, expected)); + g_free (real); + g_free (expected); + } + g_object_notify (G_OBJECT (test), klass->param_names[2 * i]); + } + } + g_object_thaw_notify (G_OBJECT (test)); + break; + } + default: + break; + } + + return GST_BASE_SINK_CLASS (parent_class)->event (basesink, event); +} + +static GstFlowReturn +gst_test_render_buffer (GstBaseSink * basesink, GstBuffer * buf) +{ + GstTest *test = GST_TEST (basesink); + guint i; + + for (i = 0; i < TESTS_COUNT; i++) { + if (test->tests[i]) { + tests[i].add (test->tests[i], buf); + } + } + return GST_FLOW_OK; +} + +static gboolean +gst_test_start (GstBaseSink * sink) +{ + GstTest *test = GST_TEST (sink); + + tests_set (test); + return TRUE; +} + +static gboolean +gst_test_stop (GstBaseSink * sink) +{ + GstTest *test = GST_TEST (sink); + + tests_unset (test); + return TRUE; +} + +static void +gst_test_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstTest *test = GST_TEST (object); + + if (prop_id == 0 || prop_id > 2 * TESTS_COUNT) { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return; + } + + if (prop_id % 2) { + /* real values can't be set */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } else { + /* expected values */ + GST_OBJECT_LOCK (test); + g_value_copy (value, &test->values[prop_id / 2 - 1]); + GST_OBJECT_UNLOCK (test); + } +} + +static void +gst_test_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstTest *test = GST_TEST (object); + guint id = (prop_id - 1) / 2; + + if (prop_id == 0 || prop_id > 2 * TESTS_COUNT) { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return; + } + + GST_OBJECT_LOCK (test); + + if (prop_id % 2) { + /* real values */ + tests[id].get_value (test->tests[id], value); + } else { + /* expected values */ + g_value_copy (&test->values[id], value); + } + + GST_OBJECT_UNLOCK (test); +} diff --git a/gst/debugutils/tests.c b/gst/debugutils/tests.c new file mode 100755 index 0000000..9ca2af9 --- /dev/null +++ b/gst/debugutils/tests.c @@ -0,0 +1,269 @@ +/* GStreamer + * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> + * + * includes code based on glibc 2.2.3's crypt/md5.c, + * Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tests.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +/* + *** LENGTH *** + */ + +typedef struct +{ + gint64 value; +} +LengthTest; + +static GParamSpec * +length_get_spec (const GstTestInfo * info, gboolean compare_value) +{ + if (compare_value) { + return g_param_spec_int64 ("expected-length", "expected length", + "expected length of stream", -1, G_MAXINT64, -1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + } else { + return g_param_spec_int64 ("length", "length", "length of stream", + -1, G_MAXINT64, -1, G_PARAM_READABLE); + } +} + +static gpointer +length_new (const GstTestInfo * info) +{ + return g_new0 (LengthTest, 1); +} + +static void +length_add (gpointer test, GstBuffer * buffer) +{ + LengthTest *t = test; + + t->value += gst_buffer_get_size (buffer); +} + +static gboolean +length_finish (gpointer test, GValue * value) +{ + LengthTest *t = test; + + if (g_value_get_int64 (value) == -1) + return TRUE; + + return t->value == g_value_get_int64 (value); +} + +static void +length_get_value (gpointer test, GValue * value) +{ + LengthTest *t = test; + + g_value_set_int64 (value, t ? t->value : -1); +} + +/* + *** BUFFER COUNT *** + */ + +static GParamSpec * +buffer_count_get_spec (const GstTestInfo * info, gboolean compare_value) +{ + if (compare_value) { + return g_param_spec_int64 ("expected-buffer-count", "expected buffer count", + "expected number of buffers in stream", + -1, G_MAXINT64, -1, G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + } else { + return g_param_spec_int64 ("buffer-count", "buffer count", + "number of buffers in stream", -1, G_MAXINT64, -1, G_PARAM_READABLE); + } +} + +static void +buffer_count_add (gpointer test, GstBuffer * buffer) +{ + LengthTest *t = test; + + t->value++; +} + +/* + *** TIMESTAMP / DURATION MATCHING *** + */ + +typedef struct +{ + guint64 diff; + guint count; + GstClockTime expected; +} +TimeDurTest; + +static GParamSpec * +timedur_get_spec (const GstTestInfo * info, gboolean compare_value) +{ + if (compare_value) { + return g_param_spec_int64 ("allowed-timestamp-deviation", + "allowed timestamp deviation", + "allowed average difference in usec between timestamp of next buffer " + "and expected timestamp from analyzing last buffer", + -1, G_MAXINT64, -1, G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + } else { + return g_param_spec_int64 ("timestamp-deviation", + "timestamp deviation", + "average difference in usec between timestamp of next buffer " + "and expected timestamp from analyzing last buffer", + -1, G_MAXINT64, -1, G_PARAM_READABLE); + } +} + +static gpointer +timedur_new (const GstTestInfo * info) +{ + TimeDurTest *ret = g_new0 (TimeDurTest, 1); + + ret->expected = GST_CLOCK_TIME_NONE; + + return ret; +} + +static void +timedur_add (gpointer test, GstBuffer * buffer) +{ + TimeDurTest *t = test; + + if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) && + GST_CLOCK_TIME_IS_VALID (t->expected)) { + t->diff += + ABS (GST_CLOCK_DIFF (t->expected, GST_BUFFER_TIMESTAMP (buffer))); + t->count++; + } + if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) && + GST_BUFFER_DURATION_IS_VALID (buffer)) { + t->expected = GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_DURATION (buffer); + } else { + t->expected = GST_CLOCK_TIME_NONE; + } +} + +static gboolean +timedur_finish (gpointer test, GValue * value) +{ + TimeDurTest *t = test; + + if (g_value_get_int64 (value) == -1) + return TRUE; + + return (t->diff / MAX (1, t->count)) <= g_value_get_int64 (value); +} + +static void +timedur_get_value (gpointer test, GValue * value) +{ + TimeDurTest *t = test; + + g_value_set_int64 (value, t ? (t->diff / MAX (1, t->count)) : -1); +} + +/* + *** MD5 *** + */ + +static GParamSpec * +md5_get_spec (const GstTestInfo * info, gboolean compare_value) +{ + if (compare_value) { + return g_param_spec_string ("expected-md5", "expected md5", + "expected md5 of processing the whole data", + "---", G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + } else { + return g_param_spec_string ("md5", "md5", + "md5 of processing the whole data", "---", G_PARAM_READABLE); + } +} + +static gpointer +md5_new (const GstTestInfo * info) +{ + return g_checksum_new (G_CHECKSUM_MD5); +} + +static void +md5_add (gpointer checksum, GstBuffer * buffer) +{ + GstMapInfo map; + + gst_buffer_map (buffer, &map, GST_MAP_READ); + g_checksum_update (checksum, map.data, map.size); + gst_buffer_unmap (buffer, &map); +} + +static gboolean +md5_finish (gpointer checksum, GValue * value) +{ + const gchar *expected, *result; + + expected = g_value_get_string (value); + result = g_checksum_get_string (checksum); + + if (g_str_equal (expected, "---")) + return TRUE; + if (g_str_equal (expected, result)) + return TRUE; + return FALSE; +} + +static void +md5_get_value (gpointer checksum, GValue * value) +{ + if (!checksum) { + g_value_set_string (value, "---"); + } else { + g_value_set_string (value, g_checksum_get_string (checksum)); + } +} + +static void +md5_free (gpointer checksum) +{ + g_checksum_free (checksum); +} + +/* + *** TESTINFO *** + */ + +const GstTestInfo tests[] = { + {length_get_spec, length_new, length_add, + length_finish, length_get_value, g_free}, + {buffer_count_get_spec, length_new, buffer_count_add, + length_finish, length_get_value, g_free}, + {timedur_get_spec, timedur_new, timedur_add, + timedur_finish, timedur_get_value, g_free}, + {md5_get_spec, md5_new, md5_add, + md5_finish, md5_get_value, md5_free} +}; diff --git a/gst/debugutils/tests.h b/gst/debugutils/tests.h new file mode 100644 index 0000000..c8fa088 --- /dev/null +++ b/gst/debugutils/tests.h @@ -0,0 +1,43 @@ +/* GStreamer + * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <gst/gst.h> + +#ifndef __GST_TESTS_H__ +#define __GST_TESTS_H__ + + +typedef struct _GstTestInfo GstTestInfo; + +struct _GstTestInfo +{ + GParamSpec *(*get_spec) (const GstTestInfo * info, gboolean compare_value); + gpointer (*new) (const GstTestInfo * info); + void (*add) (gpointer test, GstBuffer * buffer); + gboolean (*finish) (gpointer test, GValue * value); + void (*get_value) (gpointer test, GValue * value); + void (*free) (gpointer test); +}; + +extern const GstTestInfo tests[]; +/* keep up to date! */ +#define TESTS_COUNT (4) + + +#endif /* __GST_TESTS_H__ */ |