From fed9ccc4d4585e39e42dc6079432ff6aae32eb1a Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 16:49:49 +0900 Subject: tizen 2.4 release --- ext/Makefile.am | 93 ++ ext/Makefile.in | 840 ++++++++++++++ ext/a52dec/Makefile.am | 20 + ext/a52dec/Makefile.in | 839 ++++++++++++++ ext/a52dec/gsta52dec.c | 833 +++++++++++++ ext/a52dec/gsta52dec.h | 104 ++ ext/amrnb/GstAmrnbEnc.prs | 11 + ext/amrnb/Makefile.am | 23 + ext/amrnb/Makefile.in | 881 ++++++++++++++ ext/amrnb/README | 6 + ext/amrnb/amrnb.c | 42 + ext/amrnb/amrnbdec.c | 306 +++++ ext/amrnb/amrnbdec.h | 74 ++ ext/amrnb/amrnbenc.c | 292 +++++ ext/amrnb/amrnbenc.h | 70 ++ ext/amrwbdec/Makefile.am | 17 + ext/amrwbdec/Makefile.in | 846 ++++++++++++++ ext/amrwbdec/README | 6 + ext/amrwbdec/amrwb.c | 39 + ext/amrwbdec/amrwbdec.c | 233 ++++ ext/amrwbdec/amrwbdec.h | 73 ++ ext/cdio/Makefile.am | 23 + ext/cdio/Makefile.in | 849 ++++++++++++++ ext/cdio/gstcdio.c | 159 +++ ext/cdio/gstcdio.h | 61 + ext/cdio/gstcdiocddasrc.c | 520 +++++++++ ext/cdio/gstcdiocddasrc.h | 54 + ext/dvdread/Makefile.am | 12 + ext/dvdread/Makefile.in | 829 +++++++++++++ ext/dvdread/README | 5 + ext/dvdread/demo-play | 6 + ext/dvdread/dvdreadsrc.c | 1800 +++++++++++++++++++++++++++++ ext/dvdread/dvdreadsrc.h | 101 ++ ext/lame/Makefile.am | 11 + ext/lame/Makefile.in | 839 ++++++++++++++ ext/lame/gstlamemp3enc.c | 933 +++++++++++++++ ext/lame/gstlamemp3enc.h | 83 ++ ext/lame/plugin.c | 44 + ext/mad/Makefile.am | 29 + ext/mad/Makefile.in | 847 ++++++++++++++ ext/mad/gstmad.c | 554 +++++++++ ext/mad/gstmad.h | 82 ++ ext/mpeg2dec/Makefile.am | 11 + ext/mpeg2dec/Makefile.in | 829 +++++++++++++ ext/mpeg2dec/gstmpeg2dec.c | 1109 ++++++++++++++++++ ext/mpeg2dec/gstmpeg2dec.h | 88 ++ ext/sidplay/Makefile.am | 11 + ext/sidplay/Makefile.in | 830 +++++++++++++ ext/sidplay/gstsiddec.cc | 781 +++++++++++++ ext/sidplay/gstsiddec.h | 75 ++ ext/twolame/Makefile.am | 12 + ext/twolame/Makefile.in | 830 +++++++++++++ ext/twolame/gsttwolamemp2enc.c | 891 ++++++++++++++ ext/twolame/gsttwolamemp2enc.h | 88 ++ ext/x264/GstX264Enc.prs | 44 + ext/x264/Makefile.am | 37 + ext/x264/Makefile.in | 876 ++++++++++++++ ext/x264/gstx264enc.c | 2503 ++++++++++++++++++++++++++++++++++++++++ ext/x264/gstx264enc.h | 122 ++ 59 files changed, 22626 insertions(+) create mode 100644 ext/Makefile.am create mode 100644 ext/Makefile.in create mode 100644 ext/a52dec/Makefile.am create mode 100644 ext/a52dec/Makefile.in create mode 100644 ext/a52dec/gsta52dec.c create mode 100644 ext/a52dec/gsta52dec.h create mode 100644 ext/amrnb/GstAmrnbEnc.prs create mode 100644 ext/amrnb/Makefile.am create mode 100644 ext/amrnb/Makefile.in create mode 100644 ext/amrnb/README create mode 100644 ext/amrnb/amrnb.c create mode 100644 ext/amrnb/amrnbdec.c create mode 100644 ext/amrnb/amrnbdec.h create mode 100644 ext/amrnb/amrnbenc.c create mode 100644 ext/amrnb/amrnbenc.h create mode 100644 ext/amrwbdec/Makefile.am create mode 100644 ext/amrwbdec/Makefile.in create mode 100644 ext/amrwbdec/README create mode 100644 ext/amrwbdec/amrwb.c create mode 100644 ext/amrwbdec/amrwbdec.c create mode 100644 ext/amrwbdec/amrwbdec.h create mode 100644 ext/cdio/Makefile.am create mode 100644 ext/cdio/Makefile.in create mode 100644 ext/cdio/gstcdio.c create mode 100644 ext/cdio/gstcdio.h create mode 100644 ext/cdio/gstcdiocddasrc.c create mode 100644 ext/cdio/gstcdiocddasrc.h create mode 100644 ext/dvdread/Makefile.am create mode 100644 ext/dvdread/Makefile.in create mode 100644 ext/dvdread/README create mode 100755 ext/dvdread/demo-play create mode 100644 ext/dvdread/dvdreadsrc.c create mode 100644 ext/dvdread/dvdreadsrc.h create mode 100644 ext/lame/Makefile.am create mode 100644 ext/lame/Makefile.in create mode 100644 ext/lame/gstlamemp3enc.c create mode 100644 ext/lame/gstlamemp3enc.h create mode 100644 ext/lame/plugin.c create mode 100644 ext/mad/Makefile.am create mode 100644 ext/mad/Makefile.in create mode 100644 ext/mad/gstmad.c create mode 100644 ext/mad/gstmad.h create mode 100644 ext/mpeg2dec/Makefile.am create mode 100644 ext/mpeg2dec/Makefile.in create mode 100644 ext/mpeg2dec/gstmpeg2dec.c create mode 100644 ext/mpeg2dec/gstmpeg2dec.h create mode 100644 ext/sidplay/Makefile.am create mode 100644 ext/sidplay/Makefile.in create mode 100644 ext/sidplay/gstsiddec.cc create mode 100644 ext/sidplay/gstsiddec.h create mode 100644 ext/twolame/Makefile.am create mode 100644 ext/twolame/Makefile.in create mode 100644 ext/twolame/gsttwolamemp2enc.c create mode 100644 ext/twolame/gsttwolamemp2enc.h create mode 100644 ext/x264/GstX264Enc.prs create mode 100644 ext/x264/Makefile.am create mode 100644 ext/x264/Makefile.in create mode 100644 ext/x264/gstx264enc.c create mode 100644 ext/x264/gstx264enc.h (limited to 'ext') diff --git a/ext/Makefile.am b/ext/Makefile.am new file mode 100644 index 0000000..e34480d --- /dev/null +++ b/ext/Makefile.am @@ -0,0 +1,93 @@ +if USE_A52DEC +A52DEC_DIR = a52dec +else +A52DEC_DIR = +endif + +if USE_AMRNB + AMRNB_DIR = amrnb +else + AMRNB_DIR = +endif + +if USE_AMRWB + AMRWB_DIR = amrwbdec +else + AMRWB_DIR = +endif + +if USE_CDIO +CDIO_DIR = cdio +else +CDIO_DIR = +endif + +if USE_DVDREAD + DVDREAD_DIR = dvdread +else + DVDREAD_DIR = +endif + +if USE_LAME +LAME_DIR = lame +else +LAME_DIR = +endif + +if USE_MAD +MAD_DIR = mad +else +MAD_DIR = +endif + +if USE_MPEG2DEC +MPEG2DEC_DIR = mpeg2dec +else +MPEG2DEC_DIR = +endif + +if USE_SIDPLAY +SIDPLAY_DIR = sidplay +else +SIDPLAY_DIR = +endif + +if USE_TWOLAME +TWOLAME_DIR = twolame +else +TWOLAME_DIR = +endif + +if USE_X264 +X264_DIR=x264 +else +X264_DIR= +endif + +SUBDIRS = \ + $(A52DEC_DIR) \ + $(AMRNB_DIR) \ + $(AMRWB_DIR) \ + $(CDIO_DIR) \ + $(DVDREAD_DIR) \ + $(LAME_DIR) \ + $(MAD_DIR) \ + $(MPEG2DEC_DIR) \ + $(SIDPLAY_DIR) \ + $(TWOLAME_DIR) \ + $(X264_DIR) + +DIST_SUBDIRS = \ + a52dec \ + amrnb \ + amrwbdec \ + cdio \ + dvdread \ + lame \ + mad \ + mpeg2dec \ + sidplay \ + twolame \ + x264 + +include $(top_srcdir)/common/parallel-subdirs.mak diff --git a/ext/Makefile.in b/ext/Makefile.in new file mode 100644 index 0000000..bfd50ab --- /dev/null +++ b/ext/Makefile.in @@ -0,0 +1,840 @@ +# 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@ + +# include this at the end of $MODULE/ext/Makefile.am to force make to +# build subdirectories in parallel when make -jN is used. We will end up +# descending into all subdirectories a second time, but only after the first +# (parallel) run has finished, so it should go right through the second time. +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@ +DIST_COMMON = $(top_srcdir)/common/parallel-subdirs.mak \ + $(srcdir)/Makefile.in $(srcdir)/Makefile.am +subdir = ext +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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_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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +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) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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@ +@USE_A52DEC_FALSE@A52DEC_DIR = +@USE_A52DEC_TRUE@A52DEC_DIR = a52dec +@USE_AMRNB_FALSE@AMRNB_DIR = +@USE_AMRNB_TRUE@AMRNB_DIR = amrnb +@USE_AMRWB_FALSE@AMRWB_DIR = +@USE_AMRWB_TRUE@AMRWB_DIR = amrwbdec +@USE_CDIO_FALSE@CDIO_DIR = +@USE_CDIO_TRUE@CDIO_DIR = cdio +@USE_DVDREAD_FALSE@DVDREAD_DIR = +@USE_DVDREAD_TRUE@DVDREAD_DIR = dvdread +@USE_LAME_FALSE@LAME_DIR = +@USE_LAME_TRUE@LAME_DIR = lame +@USE_MAD_FALSE@MAD_DIR = +@USE_MAD_TRUE@MAD_DIR = mad +@USE_MPEG2DEC_FALSE@MPEG2DEC_DIR = +@USE_MPEG2DEC_TRUE@MPEG2DEC_DIR = mpeg2dec +@USE_SIDPLAY_FALSE@SIDPLAY_DIR = +@USE_SIDPLAY_TRUE@SIDPLAY_DIR = sidplay +@USE_TWOLAME_FALSE@TWOLAME_DIR = +@USE_TWOLAME_TRUE@TWOLAME_DIR = twolame +@USE_X264_FALSE@X264_DIR = +@USE_X264_TRUE@X264_DIR = x264 +SUBDIRS = \ + $(A52DEC_DIR) \ + $(AMRNB_DIR) \ + $(AMRWB_DIR) \ + $(CDIO_DIR) \ + $(DVDREAD_DIR) \ + $(LAME_DIR) \ + $(MAD_DIR) \ + $(MPEG2DEC_DIR) \ + $(SIDPLAY_DIR) \ + $(TWOLAME_DIR) \ + $(X264_DIR) + +DIST_SUBDIRS = \ + a52dec \ + amrnb \ + amrwbdec \ + cdio \ + dvdread \ + lame \ + mad \ + mpeg2dec \ + sidplay \ + twolame \ + x264 + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/parallel-subdirs.mak $(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 ext/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/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_srcdir)/common/parallel-subdirs.mak: + +$(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): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(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-recursive + +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-recursive + +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 + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +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-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean 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-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + + +.PHONY: independent-subdirs $(SUBDIRS) + +independent-subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +all-recursive: independent-subdirs + +# 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/ext/a52dec/Makefile.am b/ext/a52dec/Makefile.am new file mode 100644 index 0000000..6a43121 --- /dev/null +++ b/ext/a52dec/Makefile.am @@ -0,0 +1,20 @@ +plugin_LTLIBRARIES = libgsta52dec.la + +libgsta52dec_la_SOURCES = gsta52dec.c +libgsta52dec_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(ORC_CFLAGS) \ + $(A52DEC_CFLAGS) +libgsta52dec_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) \ + $(GST_LIBS) \ + -lgstaudio-$(GST_API_VERSION) \ + $(ORC_LIBS) \ + $(A52DEC_LIBS) +libgsta52dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgsta52dec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gsta52dec.h diff --git a/ext/a52dec/Makefile.in b/ext/a52dec/Makefile.in new file mode 100644 index 0000000..e138915 --- /dev/null +++ b/ext/a52dec/Makefile.in @@ -0,0 +1,839 @@ +# 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 = ext/a52dec +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgsta52dec_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgsta52dec_la_OBJECTS = libgsta52dec_la-gsta52dec.lo +libgsta52dec_la_OBJECTS = $(am_libgsta52dec_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 = +libgsta52dec_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgsta52dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgsta52dec_la_CFLAGS) $(CFLAGS) \ + $(libgsta52dec_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 = $(libgsta52dec_la_SOURCES) +DIST_SOURCES = $(libgsta52dec_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgsta52dec.la +libgsta52dec_la_SOURCES = gsta52dec.c +libgsta52dec_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(ORC_CFLAGS) \ + $(A52DEC_CFLAGS) + +libgsta52dec_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) \ + $(GST_LIBS) \ + -lgstaudio-$(GST_API_VERSION) \ + $(ORC_LIBS) \ + $(A52DEC_LIBS) + +libgsta52dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgsta52dec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gsta52dec.h +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 ext/a52dec/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/a52dec/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}; \ + } + +libgsta52dec.la: $(libgsta52dec_la_OBJECTS) $(libgsta52dec_la_DEPENDENCIES) $(EXTRA_libgsta52dec_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgsta52dec_la_LINK) -rpath $(plugindir) $(libgsta52dec_la_OBJECTS) $(libgsta52dec_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsta52dec_la-gsta52dec.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 $@ $< + +libgsta52dec_la-gsta52dec.lo: gsta52dec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgsta52dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgsta52dec_la_CFLAGS) $(CFLAGS) -MT libgsta52dec_la-gsta52dec.lo -MD -MP -MF $(DEPDIR)/libgsta52dec_la-gsta52dec.Tpo -c -o libgsta52dec_la-gsta52dec.lo `test -f 'gsta52dec.c' || echo '$(srcdir)/'`gsta52dec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsta52dec_la-gsta52dec.Tpo $(DEPDIR)/libgsta52dec_la-gsta52dec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsta52dec.c' object='libgsta52dec_la-gsta52dec.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 $(libgsta52dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgsta52dec_la_CFLAGS) $(CFLAGS) -c -o libgsta52dec_la-gsta52dec.lo `test -f 'gsta52dec.c' || echo '$(srcdir)/'`gsta52dec.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 + + +# 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/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c new file mode 100644 index 0000000..f62ab4c --- /dev/null +++ b/ext/a52dec/gsta52dec.c @@ -0,0 +1,833 @@ +/* GStreamer + * Copyright (C) <2001> David I. Lehn + * + * 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-a52dec + * + * Dolby Digital (AC-3) audio decoder. + * + * + * Example launch line + * |[ + * gst-launch dvdreadsrc title=1 ! mpegpsdemux ! a52dec ! audioresample ! audioconvert ! alsasink + * ]| Play audio track from a dvd. + * |[ + * gst-launch filesrc location=abc.ac3 ! a52dec ! audioresample ! audioconvert ! alsasink + * ]| Decode a stand alone file and play it. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include "_stdint.h" + +#include + +#include +#if !defined(A52_ACCEL_DETECT) +# include +#endif +#include "gsta52dec.h" + +#if HAVE_ORC +#include +#endif + +#ifdef LIBA52_DOUBLE +#define SAMPLE_WIDTH 64 +#define SAMPLE_FORMAT GST_AUDIO_NE(F64) +#define SAMPLE_TYPE GST_AUDIO_FORMAT_F64 +#else +#define SAMPLE_WIDTH 32 +#define SAMPLE_FORMAT GST_AUDIO_NE(F32) +#define SAMPLE_TYPE GST_AUDIO_FORMAT_F32 +#endif + +GST_DEBUG_CATEGORY_STATIC (a52dec_debug); +#define GST_CAT_DEFAULT (a52dec_debug) + +/* A52Dec args */ +enum +{ + ARG_0, + ARG_DRC, + ARG_MODE, + ARG_LFE, +}; + +static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-ac3; audio/ac3; audio/x-private1-ac3") + ); + +static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) " SAMPLE_FORMAT ", " + "layout = (string) interleaved, " + "rate = (int) [ 4000, 96000 ], " "channels = (int) [ 1, 6 ]") + ); + +#define gst_a52dec_parent_class parent_class +G_DEFINE_TYPE (GstA52Dec, gst_a52dec, GST_TYPE_AUDIO_DECODER); + +static gboolean gst_a52dec_start (GstAudioDecoder * dec); +static gboolean gst_a52dec_stop (GstAudioDecoder * dec); +static gboolean gst_a52dec_set_format (GstAudioDecoder * bdec, GstCaps * caps); +static gboolean gst_a52dec_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length); +static GstFlowReturn gst_a52dec_handle_frame (GstAudioDecoder * dec, + GstBuffer * buffer); + +static GstFlowReturn gst_a52dec_chain (GstPad * pad, GstObject * parent, + GstBuffer * buffer); +static void gst_a52dec_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_a52dec_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +#define GST_TYPE_A52DEC_MODE (gst_a52dec_mode_get_type()) +static GType +gst_a52dec_mode_get_type (void) +{ + static GType a52dec_mode_type = 0; + static const GEnumValue a52dec_modes[] = { + {A52_MONO, "Mono", "mono"}, + {A52_STEREO, "Stereo", "stereo"}, + {A52_3F, "3 Front", "3f"}, + {A52_2F1R, "2 Front, 1 Rear", "2f1r"}, + {A52_3F1R, "3 Front, 1 Rear", "3f1r"}, + {A52_2F2R, "2 Front, 2 Rear", "2f2r"}, + {A52_3F2R, "3 Front, 2 Rear", "3f2r"}, + {A52_DOLBY, "Dolby", "dolby"}, + {0, NULL, NULL}, + }; + + if (!a52dec_mode_type) { + a52dec_mode_type = g_enum_register_static ("GstA52DecMode", a52dec_modes); + } + return a52dec_mode_type; +} + +static void +gst_a52dec_class_init (GstA52DecClass * klass) +{ + GObjectClass *gobject_class; + GstElementClass *gstelement_class; + GstAudioDecoderClass *gstbase_class; + guint cpuflags = 0; + + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; + gstbase_class = (GstAudioDecoderClass *) klass; + + gobject_class->set_property = gst_a52dec_set_property; + gobject_class->get_property = gst_a52dec_get_property; + + gstbase_class->start = GST_DEBUG_FUNCPTR (gst_a52dec_start); + gstbase_class->stop = GST_DEBUG_FUNCPTR (gst_a52dec_stop); + gstbase_class->set_format = GST_DEBUG_FUNCPTR (gst_a52dec_set_format); + gstbase_class->parse = GST_DEBUG_FUNCPTR (gst_a52dec_parse); + gstbase_class->handle_frame = GST_DEBUG_FUNCPTR (gst_a52dec_handle_frame); + + /** + * GstA52Dec::drc + * + * Set to true to apply the recommended Dolby Digital dynamic range compression + * to the audio stream. Dynamic range compression makes loud sounds + * softer and soft sounds louder, so you can more easily listen + * to the stream without disturbing other people. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC, + g_param_spec_boolean ("drc", "Dynamic Range Compression", + "Use Dynamic Range Compression", FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstA52Dec::mode + * + * Force a particular output channel configuration from the decoder. By default, + * the channel downmix (if any) is chosen automatically based on the downstream + * capabilities of the pipeline. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MODE, + g_param_spec_enum ("mode", "Decoder Mode", "Decoding Mode (default 3f2r)", + GST_TYPE_A52DEC_MODE, A52_3F2R, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstA52Dec::lfe + * + * Whether to output the LFE (Low Frequency Emitter) channel of the audio stream. + */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LFE, + g_param_spec_boolean ("lfe", "LFE", "LFE", TRUE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_factory)); + gst_element_class_set_static_metadata (gstelement_class, + "ATSC A/52 audio decoder", "Codec/Decoder/Audio", + "Decodes ATSC A/52 encoded audio streams", + "David I. Lehn "); + + GST_DEBUG_CATEGORY_INIT (a52dec_debug, "a52dec", 0, + "AC3/A52 software decoder"); + + /* If no CPU instruction based acceleration is available, end up using the + * generic software djbfft based one when available in the used liba52 */ +#ifdef MM_ACCEL_DJBFFT + klass->a52_cpuflags = MM_ACCEL_DJBFFT; +#elif defined(A52_ACCEL_DETECT) + klass->a52_cpuflags = A52_ACCEL_DETECT; +#else + klass->a52_cpuflags = 0; +#endif + +#if HAVE_ORC && !defined(A52_ACCEL_DETECT) + cpuflags = orc_target_get_default_flags (orc_target_get_by_name ("mmx")); + if (cpuflags & ORC_TARGET_MMX_MMX) + klass->a52_cpuflags |= MM_ACCEL_X86_MMX; + if (cpuflags & ORC_TARGET_MMX_3DNOW) + klass->a52_cpuflags |= MM_ACCEL_X86_3DNOW; + if (cpuflags & ORC_TARGET_MMX_MMXEXT) + klass->a52_cpuflags |= MM_ACCEL_X86_MMXEXT; +#endif + + GST_LOG ("CPU flags: a52=%08x, orc=%08x", klass->a52_cpuflags, cpuflags); +} + +static void +gst_a52dec_init (GstA52Dec * a52dec) +{ + a52dec->request_channels = A52_CHANNEL; + a52dec->dynamic_range_compression = FALSE; + + a52dec->state = NULL; + a52dec->samples = NULL; + + /* retrieve and intercept base class chain. + * Quite HACKish, but that's dvd specs/caps for you, + * since one buffer needs to be split into 2 frames */ + a52dec->base_chain = GST_PAD_CHAINFUNC (GST_AUDIO_DECODER_SINK_PAD (a52dec)); + gst_pad_set_chain_function (GST_AUDIO_DECODER_SINK_PAD (a52dec), + GST_DEBUG_FUNCPTR (gst_a52dec_chain)); +} + +static gboolean +gst_a52dec_start (GstAudioDecoder * dec) +{ + GstA52Dec *a52dec = GST_A52DEC (dec); + GstA52DecClass *klass; + + GST_DEBUG_OBJECT (dec, "start"); + + klass = GST_A52DEC_CLASS (G_OBJECT_GET_CLASS (a52dec)); +#if defined(A52_ACCEL_DETECT) + a52dec->state = a52_init (); + /* This line is just to avoid being accused of not using klass */ + a52_accel (klass->a52_cpuflags & A52_ACCEL_DETECT); +#else + a52dec->state = a52_init (klass->a52_cpuflags); +#endif + + if (!a52dec->state) { + GST_ELEMENT_ERROR (GST_ELEMENT (a52dec), LIBRARY, INIT, (NULL), + ("failed to initialize a52 state")); + return FALSE; + } + + a52dec->samples = a52_samples (a52dec->state); + a52dec->bit_rate = -1; + a52dec->sample_rate = -1; + a52dec->stream_channels = A52_CHANNEL; + a52dec->using_channels = A52_CHANNEL; + a52dec->level = 1; + a52dec->bias = 0; + a52dec->flag_update = TRUE; + + /* call upon legacy upstream byte support (e.g. seeking) */ + gst_audio_decoder_set_estimate_rate (dec, TRUE); + + return TRUE; +} + +static gboolean +gst_a52dec_stop (GstAudioDecoder * dec) +{ + GstA52Dec *a52dec = GST_A52DEC (dec); + + GST_DEBUG_OBJECT (dec, "stop"); + + a52dec->samples = NULL; + if (a52dec->state) { + a52_free (a52dec->state); + a52dec->state = NULL; + } + + return TRUE; +} + +static GstFlowReturn +gst_a52dec_parse (GstAudioDecoder * bdec, GstAdapter * adapter, + gint * _offset, gint * len) +{ + GstA52Dec *a52dec; + const guint8 *data; + gint av, size; + gint length = 0, flags, sample_rate, bit_rate; + GstFlowReturn result = GST_FLOW_EOS; + + a52dec = GST_A52DEC (bdec); + + size = av = gst_adapter_available (adapter); + data = (const guint8 *) gst_adapter_map (adapter, av); + + /* find and read header */ + bit_rate = a52dec->bit_rate; + sample_rate = a52dec->sample_rate; + flags = 0; + while (size >= 7) { + length = a52_syncinfo ((guint8 *) data, &flags, &sample_rate, &bit_rate); + + if (length == 0) { + /* shift window to re-find sync */ + data++; + size--; + } else if (length <= size) { + GST_LOG_OBJECT (a52dec, "Sync: frame size %d", length); + result = GST_FLOW_OK; + break; + } else { + GST_LOG_OBJECT (a52dec, "Not enough data available (needed %d had %d)", + length, size); + break; + } + } + gst_adapter_unmap (adapter); + + *_offset = av - size; + *len = length; + + return result; +} + +static gint +gst_a52dec_channels (int flags, GstAudioChannelPosition * pos) +{ + gint chans = 0; + + if (flags & A52_LFE) { + chans += 1; + if (pos) { + pos[0] = GST_AUDIO_CHANNEL_POSITION_LFE1; + } + } + flags &= A52_CHANNEL_MASK; + switch (flags) { + case A52_3F2R: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; + pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_LEFT; + pos[4 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT; + } + chans += 5; + break; + case A52_2F2R: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_LEFT; + pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT; + } + chans += 4; + break; + case A52_3F1R: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; + pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_CENTER; + } + chans += 4; + break; + case A52_2F1R: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_CENTER; + } + chans += 3; + break; + case A52_3F: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; + pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + } + chans += 3; + break; + case A52_CHANNEL: /* Dual mono. Should really be handled as 2 src pads */ + case A52_STEREO: + case A52_DOLBY: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; + pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; + } + chans += 2; + break; + case A52_MONO: + if (pos) { + pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_MONO; + } + chans += 1; + break; + default: + /* error, caller should post error message */ + return 0; + } + + return chans; +} + +static gboolean +gst_a52dec_reneg (GstA52Dec * a52dec) +{ + gint channels; + gboolean result = FALSE; + GstAudioChannelPosition from[6], to[6]; + GstAudioInfo info; + + channels = gst_a52dec_channels (a52dec->using_channels, from); + + if (!channels) + goto done; + + GST_INFO_OBJECT (a52dec, "reneg channels:%d rate:%d", + channels, a52dec->sample_rate); + + memcpy (to, from, sizeof (GstAudioChannelPosition) * channels); + gst_audio_channel_positions_to_valid_order (to, channels); + gst_audio_get_channel_reorder_map (channels, from, to, + a52dec->channel_reorder_map); + + gst_audio_info_init (&info); + gst_audio_info_set_format (&info, + SAMPLE_TYPE, a52dec->sample_rate, channels, (channels > 1 ? to : NULL)); + + if (!gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (a52dec), &info)) + goto done; + + result = TRUE; + +done: + return result; +} + +static void +gst_a52dec_update_streaminfo (GstA52Dec * a52dec) +{ + GstTagList *taglist; + + taglist = gst_tag_list_new_empty (); + gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE, + (guint) a52dec->bit_rate, NULL); + + gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (a52dec), taglist, + GST_TAG_MERGE_REPLACE); + gst_tag_list_unref (taglist); +} + +static GstFlowReturn +gst_a52dec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer) +{ + GstA52Dec *a52dec; + gint channels, i; + gboolean need_reneg = FALSE; + gint chans; + gint length = 0, flags, sample_rate, bit_rate; + GstMapInfo map; + GstFlowReturn result = GST_FLOW_OK; + GstBuffer *outbuf; + const gint num_blocks = 6; + + a52dec = GST_A52DEC (bdec); + + /* no fancy draining */ + if (G_UNLIKELY (!buffer)) + return GST_FLOW_OK; + + /* parsed stuff already, so this should work out fine */ + gst_buffer_map (buffer, &map, GST_MAP_READ); + g_assert (map.size >= 7); + + /* re-obtain some sync header info, + * should be same as during _parse and could also be cached there, + * but anyway ... */ + bit_rate = a52dec->bit_rate; + sample_rate = a52dec->sample_rate; + flags = 0; + length = a52_syncinfo (map.data, &flags, &sample_rate, &bit_rate); + g_assert (length == map.size); + + /* update stream information, renegotiate or re-streaminfo if needed */ + need_reneg = FALSE; + if (a52dec->sample_rate != sample_rate) { + GST_DEBUG_OBJECT (a52dec, "sample rate changed"); + need_reneg = TRUE; + a52dec->sample_rate = sample_rate; + } + + if (flags) { + if (a52dec->stream_channels != (flags & (A52_CHANNEL_MASK | A52_LFE))) { + GST_DEBUG_OBJECT (a52dec, "stream channel flags changed, marking update"); + a52dec->flag_update = TRUE; + } + a52dec->stream_channels = flags & (A52_CHANNEL_MASK | A52_LFE); + } + + if (bit_rate != a52dec->bit_rate) { + a52dec->bit_rate = bit_rate; + gst_a52dec_update_streaminfo (a52dec); + } + + /* If we haven't had an explicit number of channels chosen through properties + * at this point, choose what to downmix to now, based on what the peer will + * accept - this allows a52dec to do downmixing in preference to a + * downstream element such as audioconvert. + */ + if (a52dec->request_channels != A52_CHANNEL) { + flags = a52dec->request_channels; + } else if (a52dec->flag_update) { + GstCaps *caps; + + a52dec->flag_update = FALSE; + + caps = gst_pad_get_allowed_caps (GST_AUDIO_DECODER_SRC_PAD (a52dec)); + if (caps && gst_caps_get_size (caps) > 0) { + GstCaps *copy = gst_caps_copy_nth (caps, 0); + GstStructure *structure = gst_caps_get_structure (copy, 0); + gint orig_channels = flags ? gst_a52dec_channels (flags, NULL) : 6; + gint fixed_channels = 0; + const int a52_channels[6] = { + A52_MONO, + A52_STEREO, + A52_STEREO | A52_LFE, + A52_2F2R, + A52_2F2R | A52_LFE, + A52_3F2R | A52_LFE, + }; + + /* Prefer the original number of channels, but fixate to something + * preferred (first in the caps) downstream if possible. + */ + gst_structure_fixate_field_nearest_int (structure, "channels", + orig_channels); + + if (gst_structure_get_int (structure, "channels", &fixed_channels) + && fixed_channels <= 6) { + if (fixed_channels < orig_channels) + flags = a52_channels[fixed_channels - 1]; + } else { + flags = a52_channels[5]; + } + + gst_caps_unref (copy); + } else if (flags) + flags = a52dec->stream_channels; + else + flags = A52_3F2R | A52_LFE; + + if (caps) + gst_caps_unref (caps); + } else { + flags = a52dec->using_channels; + } + + /* process */ + flags |= A52_ADJUST_LEVEL; + a52dec->level = 1; + if (a52_frame (a52dec->state, map.data, &flags, &a52dec->level, a52dec->bias)) { + gst_buffer_unmap (buffer, &map); + GST_AUDIO_DECODER_ERROR (a52dec, 1, STREAM, DECODE, (NULL), + ("a52_frame error"), result); + goto exit; + } + gst_buffer_unmap (buffer, &map); + + channels = flags & (A52_CHANNEL_MASK | A52_LFE); + if (a52dec->using_channels != channels) { + need_reneg = TRUE; + a52dec->using_channels = channels; + } + + /* negotiate if required */ + if (need_reneg) { + GST_DEBUG_OBJECT (a52dec, + "a52dec reneg: sample_rate:%d stream_chans:%d using_chans:%d", + a52dec->sample_rate, a52dec->stream_channels, a52dec->using_channels); + if (!gst_a52dec_reneg (a52dec)) + goto failed_negotiation; + } + + if (a52dec->dynamic_range_compression == FALSE) { + a52_dynrng (a52dec->state, NULL, NULL); + } + + flags &= (A52_CHANNEL_MASK | A52_LFE); + chans = gst_a52dec_channels (flags, NULL); + if (!chans) + goto invalid_flags; + + /* handle decoded data; + * each frame has 6 blocks, one block is 256 samples, ea */ + outbuf = + gst_buffer_new_and_alloc (256 * chans * (SAMPLE_WIDTH / 8) * num_blocks); + + gst_buffer_map (outbuf, &map, GST_MAP_WRITE); + { + guint8 *ptr = map.data; + for (i = 0; i < num_blocks; i++) { + if (a52_block (a52dec->state)) { + /* also marks discont */ + GST_AUDIO_DECODER_ERROR (a52dec, 1, STREAM, DECODE, (NULL), + ("error decoding block %d", i), result); + if (result != GST_FLOW_OK) { + gst_buffer_unmap (outbuf, &map); + goto exit; + } + } else { + gint n, c; + gint *reorder_map = a52dec->channel_reorder_map; + + for (n = 0; n < 256; n++) { + for (c = 0; c < chans; c++) { + ((sample_t *) ptr)[n * chans + reorder_map[c]] = + a52dec->samples[c * 256 + n]; + } + } + } + ptr += 256 * chans * (SAMPLE_WIDTH / 8); + } + } + gst_buffer_unmap (outbuf, &map); + + result = gst_audio_decoder_finish_frame (bdec, outbuf, 1); + +exit: + return result; + + /* ERRORS */ +failed_negotiation: + { + GST_ELEMENT_ERROR (a52dec, CORE, NEGOTIATION, (NULL), (NULL)); + return GST_FLOW_ERROR; + } +invalid_flags: + { + GST_ELEMENT_ERROR (GST_ELEMENT (a52dec), STREAM, DECODE, (NULL), + ("Invalid channel flags: %d", flags)); + return GST_FLOW_ERROR; + } +} + +static gboolean +gst_a52dec_set_format (GstAudioDecoder * bdec, GstCaps * caps) +{ + GstA52Dec *a52dec = GST_A52DEC (bdec); + GstStructure *structure; + + structure = gst_caps_get_structure (caps, 0); + + if (structure && gst_structure_has_name (structure, "audio/x-private1-ac3")) + a52dec->dvdmode = TRUE; + else + a52dec->dvdmode = FALSE; + + return TRUE; +} + +static GstFlowReturn +gst_a52dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) +{ + GstA52Dec *a52dec = GST_A52DEC (parent); + GstFlowReturn ret = GST_FLOW_OK; + gint first_access; + + if (a52dec->dvdmode) { + gsize size; + guint8 data[2]; + gint offset; + gint len; + GstBuffer *subbuf; + + size = gst_buffer_get_size (buf); + if (size < 2) + goto not_enough_data; + + gst_buffer_extract (buf, 0, data, 2); + first_access = (data[0] << 8) | data[1]; + + /* Skip the first_access header */ + offset = 2; + + if (first_access > 1) { + /* Length of data before first_access */ + len = first_access - 1; + + if (len <= 0 || offset + len > size) + goto bad_first_access_parameter; + + subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, len); + GST_BUFFER_TIMESTAMP (subbuf) = GST_CLOCK_TIME_NONE; + ret = a52dec->base_chain (pad, parent, subbuf); + if (ret != GST_FLOW_OK) { + gst_buffer_unref (buf); + goto done; + } + + offset += len; + len = size - offset; + + if (len > 0) { + subbuf = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, len); + GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf); + + ret = a52dec->base_chain (pad, parent, subbuf); + } + gst_buffer_unref (buf); + } else { + /* first_access = 0 or 1, so if there's a timestamp it applies to the first byte */ + subbuf = + gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, + size - offset); + GST_BUFFER_TIMESTAMP (subbuf) = GST_BUFFER_TIMESTAMP (buf); + gst_buffer_unref (buf); + ret = a52dec->base_chain (pad, parent, subbuf); + } + } else { + ret = a52dec->base_chain (pad, parent, buf); + } + +done: + return ret; + +/* ERRORS */ +not_enough_data: + { + GST_ELEMENT_ERROR (GST_ELEMENT (a52dec), STREAM, DECODE, (NULL), + ("Insufficient data in buffer. Can't determine first_acess")); + gst_buffer_unref (buf); + return GST_FLOW_ERROR; + } +bad_first_access_parameter: + { + GST_ELEMENT_ERROR (GST_ELEMENT (a52dec), STREAM, DECODE, (NULL), + ("Bad first_access parameter (%d) in buffer", first_access)); + gst_buffer_unref (buf); + return GST_FLOW_ERROR; + } +} + +static void +gst_a52dec_set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) +{ + GstA52Dec *src = GST_A52DEC (object); + + switch (prop_id) { + case ARG_DRC: + GST_OBJECT_LOCK (src); + src->dynamic_range_compression = g_value_get_boolean (value); + GST_OBJECT_UNLOCK (src); + break; + case ARG_MODE: + GST_OBJECT_LOCK (src); + src->request_channels &= ~A52_CHANNEL_MASK; + src->request_channels |= g_value_get_enum (value); + GST_OBJECT_UNLOCK (src); + break; + case ARG_LFE: + GST_OBJECT_LOCK (src); + src->request_channels &= ~A52_LFE; + src->request_channels |= g_value_get_boolean (value) ? A52_LFE : 0; + GST_OBJECT_UNLOCK (src); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_a52dec_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstA52Dec *src = GST_A52DEC (object); + + switch (prop_id) { + case ARG_DRC: + GST_OBJECT_LOCK (src); + g_value_set_boolean (value, src->dynamic_range_compression); + GST_OBJECT_UNLOCK (src); + break; + case ARG_MODE: + GST_OBJECT_LOCK (src); + g_value_set_enum (value, src->request_channels & A52_CHANNEL_MASK); + GST_OBJECT_UNLOCK (src); + break; + case ARG_LFE: + GST_OBJECT_LOCK (src); + g_value_set_boolean (value, src->request_channels & A52_LFE); + GST_OBJECT_UNLOCK (src); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ +#if HAVE_ORC + orc_init (); +#endif + + if (!gst_element_register (plugin, "a52dec", GST_RANK_SECONDARY, + GST_TYPE_A52DEC)) + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + a52dec, + "Decodes ATSC A/52 encoded audio streams", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/a52dec/gsta52dec.h b/ext/a52dec/gsta52dec.h new file mode 100644 index 0000000..4d1f650 --- /dev/null +++ b/ext/a52dec/gsta52dec.h @@ -0,0 +1,104 @@ +/* GStreamer + * Copyright (C) <2001> David I. Lehn + * + * 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_A52DEC_H__ +#define __GST_A52DEC_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define GST_TYPE_A52DEC \ + (gst_a52dec_get_type()) +#define GST_A52DEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_A52DEC,GstA52Dec)) +#define GST_A52DEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_A52DEC,GstA52DecClass)) +#define GST_IS_A52DEC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_A52DEC)) +#define GST_IS_A52DEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_A52DEC)) + +typedef struct _GstA52Dec GstA52Dec; +typedef struct _GstA52DecClass GstA52DecClass; + +struct _GstA52Dec { + GstAudioDecoder element; + + GstPadChainFunction base_chain; + + gboolean dvdmode; + gboolean flag_update; + int prev_flags; + + /* stream properties */ + int bit_rate; + int sample_rate; + int stream_channels; + int request_channels; + int using_channels; + + gint channel_reorder_map[6]; + + sample_t level; + sample_t bias; + gboolean dynamic_range_compression; + sample_t *samples; + a52_state_t *state; +}; + +struct _GstA52DecClass { + GstAudioDecoderClass parent_class; + + guint32 a52_cpuflags; +}; + +GType gst_a52dec_get_type (void); + +#ifndef A52_MONO +#define A52_MONO 1 +#endif +#ifndef A52_STEREO +#define A52_STEREO 2 +#endif +#ifndef A52_3F +#define A52_3F 3 +#endif +#ifndef A52_2F1R +#define A52_2F1R 4 +#endif +#ifndef A52_3F1R +#define A52_3F1R 5 +#endif +#ifndef A52_2F2R +#define A52_2F2R 6 +#endif +#ifndef A52_3F2R +#define A52_3F2R 7 +#endif +#ifndef A52_DOLBY +#define A52_DOLBY 10 +#endif + +G_END_DECLS + +#endif /* __GST_A52DEC_H__ */ diff --git a/ext/amrnb/GstAmrnbEnc.prs b/ext/amrnb/GstAmrnbEnc.prs new file mode 100644 index 0000000..69e3719 --- /dev/null +++ b/ext/amrnb/GstAmrnbEnc.prs @@ -0,0 +1,11 @@ +[_presets_] +version=0.10 +element-name=GstAmrnbEnc + +[enhance-size] +_meta/comment=Maximize compression, lowest bitrate +band-mode=0 + +[enhance-quality] +_meta/comment=Maximize quality, highest bitrate +band-mode=7 diff --git a/ext/amrnb/Makefile.am b/ext/amrnb/Makefile.am new file mode 100644 index 0000000..283f54d --- /dev/null +++ b/ext/amrnb/Makefile.am @@ -0,0 +1,23 @@ +plugin_LTLIBRARIES = libgstamrnb.la + +libgstamrnb_la_SOURCES = \ + amrnb.c \ + amrnbdec.c \ + amrnbenc.c + +libgstamrnb_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AMRNB_CFLAGS) +libgstamrnb_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ \ + $(GST_BASE_LIBS) $(GST_LIBS) $(AMRNB_LIBS) +libgstamrnb_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstamrnb_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = \ + amrnbdec.h \ + amrnbenc.h + +presetdir = $(datadir)/gstreamer-$(GST_API_VERSION)/presets +preset_DATA = GstAmrnbEnc.prs + +EXTRA_DIST = $(preset_DATA) diff --git a/ext/amrnb/Makefile.in b/ext/amrnb/Makefile.in new file mode 100644 index 0000000..b807d3f --- /dev/null +++ b/ext/amrnb/Makefile.in @@ -0,0 +1,881 @@ +# 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 = ext/amrnb +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(noinst_HEADERS) README +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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)" "$(DESTDIR)$(presetdir)" +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgstamrnb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstamrnb_la_OBJECTS = libgstamrnb_la-amrnb.lo \ + libgstamrnb_la-amrnbdec.lo libgstamrnb_la-amrnbenc.lo +libgstamrnb_la_OBJECTS = $(am_libgstamrnb_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 = +libgstamrnb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstamrnb_la_CFLAGS) $(CFLAGS) \ + $(libgstamrnb_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 = $(libgstamrnb_la_SOURCES) +DIST_SOURCES = $(libgstamrnb_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(preset_DATA) +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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstamrnb.la +libgstamrnb_la_SOURCES = \ + amrnb.c \ + amrnbdec.c \ + amrnbenc.c + +libgstamrnb_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AMRNB_CFLAGS) + +libgstamrnb_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ \ + $(GST_BASE_LIBS) $(GST_LIBS) $(AMRNB_LIBS) + +libgstamrnb_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstamrnb_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = \ + amrnbdec.h \ + amrnbenc.h + +presetdir = $(datadir)/gstreamer-$(GST_API_VERSION)/presets +preset_DATA = GstAmrnbEnc.prs +EXTRA_DIST = $(preset_DATA) +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 ext/amrnb/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/amrnb/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}; \ + } + +libgstamrnb.la: $(libgstamrnb_la_OBJECTS) $(libgstamrnb_la_DEPENDENCIES) $(EXTRA_libgstamrnb_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstamrnb_la_LINK) -rpath $(plugindir) $(libgstamrnb_la_OBJECTS) $(libgstamrnb_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstamrnb_la-amrnb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstamrnb_la-amrnbdec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstamrnb_la-amrnbenc.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 $@ $< + +libgstamrnb_la-amrnb.lo: amrnb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -MT libgstamrnb_la-amrnb.lo -MD -MP -MF $(DEPDIR)/libgstamrnb_la-amrnb.Tpo -c -o libgstamrnb_la-amrnb.lo `test -f 'amrnb.c' || echo '$(srcdir)/'`amrnb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstamrnb_la-amrnb.Tpo $(DEPDIR)/libgstamrnb_la-amrnb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amrnb.c' object='libgstamrnb_la-amrnb.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 $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -c -o libgstamrnb_la-amrnb.lo `test -f 'amrnb.c' || echo '$(srcdir)/'`amrnb.c + +libgstamrnb_la-amrnbdec.lo: amrnbdec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -MT libgstamrnb_la-amrnbdec.lo -MD -MP -MF $(DEPDIR)/libgstamrnb_la-amrnbdec.Tpo -c -o libgstamrnb_la-amrnbdec.lo `test -f 'amrnbdec.c' || echo '$(srcdir)/'`amrnbdec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstamrnb_la-amrnbdec.Tpo $(DEPDIR)/libgstamrnb_la-amrnbdec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amrnbdec.c' object='libgstamrnb_la-amrnbdec.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 $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -c -o libgstamrnb_la-amrnbdec.lo `test -f 'amrnbdec.c' || echo '$(srcdir)/'`amrnbdec.c + +libgstamrnb_la-amrnbenc.lo: amrnbenc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -MT libgstamrnb_la-amrnbenc.lo -MD -MP -MF $(DEPDIR)/libgstamrnb_la-amrnbenc.Tpo -c -o libgstamrnb_la-amrnbenc.lo `test -f 'amrnbenc.c' || echo '$(srcdir)/'`amrnbenc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstamrnb_la-amrnbenc.Tpo $(DEPDIR)/libgstamrnb_la-amrnbenc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amrnbenc.c' object='libgstamrnb_la-amrnbenc.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 $(libgstamrnb_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrnb_la_CFLAGS) $(CFLAGS) -c -o libgstamrnb_la-amrnbenc.lo `test -f 'amrnbenc.c' || echo '$(srcdir)/'`amrnbenc.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-presetDATA: $(preset_DATA) + @$(NORMAL_INSTALL) + @list='$(preset_DATA)'; test -n "$(presetdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(presetdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(presetdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(presetdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(presetdir)" || exit $$?; \ + done + +uninstall-presetDATA: + @$(NORMAL_UNINSTALL) + @list='$(preset_DATA)'; test -n "$(presetdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(presetdir)'; $(am__uninstall_files_from_dir) + +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) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(presetdir)"; 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-presetDATA + +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 uninstall-presetDATA + +.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-presetDATA 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 uninstall-presetDATA + + +# 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/ext/amrnb/README b/ext/amrnb/README new file mode 100644 index 0000000..879dbe7 --- /dev/null +++ b/ext/amrnb/README @@ -0,0 +1,6 @@ +Compiling AMRNB: +================ + +To compile the amrnb plugin, you need the opencore-amrnb development package. +If your distribution does not provide this package, you can download the +source code from "http://sourceforge.net/projects/opencore-amr". diff --git a/ext/amrnb/amrnb.c b/ext/amrnb/amrnb.c new file mode 100644 index 0000000..aa9c695 --- /dev/null +++ b/ext/amrnb/amrnb.c @@ -0,0 +1,42 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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 "amrnbdec.h" +#include "amrnbenc.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + return gst_element_register (plugin, "amrnbdec", + GST_RANK_PRIMARY, GST_TYPE_AMRNBDEC) && + gst_element_register (plugin, "amrnbenc", + GST_RANK_SECONDARY, GST_TYPE_AMRNBENC); +} + + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + amrnb, + "Adaptive Multi-Rate Narrow-Band", + plugin_init, VERSION, GST_LICENSE_UNKNOWN, GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN); diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c new file mode 100644 index 0000000..2388a95 --- /dev/null +++ b/ext/amrnb/amrnbdec.c @@ -0,0 +1,306 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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-amrnbdec + * @see_also: #GstAmrnbEnc, #GstAmrParse + * + * AMR narrowband decoder based on the + * opencore codec implementation. + * + * + * Example launch line + * |[ + * gst-launch filesrc location=abc.amr ! amrparse ! amrnbdec ! audioresample ! audioconvert ! alsasink + * ]| + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "amrnbdec.h" + +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/AMR, " "rate = (int) 8000, " "channels = (int) 1") + ); + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, format = (string) " GST_AUDIO_NE (S16) ", " + "layout = (string) interleaved, " + "rate = (int) 8000," "channels = (int) 1") + ); + +GST_DEBUG_CATEGORY_STATIC (gst_amrnbdec_debug); +#define GST_CAT_DEFAULT gst_amrnbdec_debug + +static const gint block_size_if1[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, + 0, 0, 0, 0, 0, 0, 0 +}; + +static const gint block_size_if2[16] = { 12, 13, 15, 17, 18, 20, 25, 30, 5, + 0, 0, 0, 0, 0, 0, 0 +}; + +static GType +gst_amrnb_variant_get_type (void) +{ + static GType gst_amrnb_variant_type = 0; + static const GEnumValue gst_amrnb_variant[] = { + {GST_AMRNB_VARIANT_IF1, "IF1", "IF1"}, + {GST_AMRNB_VARIANT_IF2, "IF2", "IF2"}, + {0, NULL, NULL}, + }; + if (!gst_amrnb_variant_type) { + gst_amrnb_variant_type = + g_enum_register_static ("GstAmrnbVariant", gst_amrnb_variant); + } + return gst_amrnb_variant_type; +} + +#define GST_AMRNB_VARIANT_TYPE (gst_amrnb_variant_get_type()) + +#define VARIANT_DEFAULT GST_AMRNB_VARIANT_IF1 +enum +{ + PROP_0, + PROP_VARIANT +}; + +static void gst_amrnbdec_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_amrnbdec_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +static gboolean gst_amrnbdec_start (GstAudioDecoder * dec); +static gboolean gst_amrnbdec_stop (GstAudioDecoder * dec); +static gboolean gst_amrnbdec_set_format (GstAudioDecoder * dec, GstCaps * caps); +static gboolean gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length); +static GstFlowReturn gst_amrnbdec_handle_frame (GstAudioDecoder * dec, + GstBuffer * buffer); + +#define gst_amrnbdec_parent_class parent_class +G_DEFINE_TYPE (GstAmrnbDec, gst_amrnbdec, GST_TYPE_AUDIO_DECODER); + +static void +gst_amrnbdec_class_init (GstAmrnbDecClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstAudioDecoderClass *base_class = GST_AUDIO_DECODER_CLASS (klass); + + object_class->set_property = gst_amrnbdec_set_property; + object_class->get_property = gst_amrnbdec_get_property; + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&src_template)); + + gst_element_class_set_static_metadata (element_class, "AMR-NB audio decoder", + "Codec/Decoder/Audio", + "Adaptive Multi-Rate Narrow-Band audio decoder", + "GStreamer maintainers "); + + base_class->start = GST_DEBUG_FUNCPTR (gst_amrnbdec_start); + base_class->stop = GST_DEBUG_FUNCPTR (gst_amrnbdec_stop); + base_class->set_format = GST_DEBUG_FUNCPTR (gst_amrnbdec_set_format); + base_class->parse = GST_DEBUG_FUNCPTR (gst_amrnbdec_parse); + base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_amrnbdec_handle_frame); + + g_object_class_install_property (object_class, PROP_VARIANT, + g_param_spec_enum ("variant", "Variant", + "The decoder variant", GST_AMRNB_VARIANT_TYPE, + VARIANT_DEFAULT, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + + GST_DEBUG_CATEGORY_INIT (gst_amrnbdec_debug, "amrnbdec", 0, + "AMR-NB audio decoder"); +} + +static void +gst_amrnbdec_init (GstAmrnbDec * amrnbdec) +{ + gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrnbdec), TRUE); +} + +static gboolean +gst_amrnbdec_start (GstAudioDecoder * dec) +{ + GstAmrnbDec *amrnbdec = GST_AMRNBDEC (dec); + + GST_DEBUG_OBJECT (dec, "start"); + if (!(amrnbdec->handle = Decoder_Interface_init ())) + return FALSE; + + amrnbdec->rate = 0; + amrnbdec->channels = 0; + + return TRUE; +} + +static gboolean +gst_amrnbdec_stop (GstAudioDecoder * dec) +{ + GstAmrnbDec *amrnbdec = GST_AMRNBDEC (dec); + + GST_DEBUG_OBJECT (dec, "stop"); + Decoder_Interface_exit (amrnbdec->handle); + + return TRUE; +} + +static void +gst_amrnbdec_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstAmrnbDec *self = GST_AMRNBDEC (object); + + switch (prop_id) { + case PROP_VARIANT: + self->variant = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + return; +} + +static void +gst_amrnbdec_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstAmrnbDec *self = GST_AMRNBDEC (object); + + switch (prop_id) { + case PROP_VARIANT: + g_value_set_enum (value, self->variant); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + return; +} + +static gboolean +gst_amrnbdec_set_format (GstAudioDecoder * dec, GstCaps * caps) +{ + GstStructure *structure; + GstAmrnbDec *amrnbdec; + GstAudioInfo info; + + amrnbdec = GST_AMRNBDEC (dec); + + structure = gst_caps_get_structure (caps, 0); + + /* get channel count */ + gst_structure_get_int (structure, "channels", &amrnbdec->channels); + gst_structure_get_int (structure, "rate", &amrnbdec->rate); + + /* create reverse caps */ + gst_audio_info_init (&info); + gst_audio_info_set_format (&info, + GST_AUDIO_FORMAT_S16, amrnbdec->rate, amrnbdec->channels, NULL); + + return gst_audio_decoder_set_output_format (dec, &info); +} + +static GstFlowReturn +gst_amrnbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length) +{ + GstAmrnbDec *amrnbdec = GST_AMRNBDEC (dec); + guint8 head[1]; + guint size; + gboolean sync, eos; + gint block, mode; + + size = gst_adapter_available (adapter); + g_return_val_if_fail (size > 0, GST_FLOW_ERROR); + + gst_audio_decoder_get_parse_state (dec, &sync, &eos); + + /* need to peek data to get the size */ + if (size < 1) + return GST_FLOW_ERROR; + + gst_adapter_copy (adapter, head, 0, 1); + + /* get size */ + switch (amrnbdec->variant) { + case GST_AMRNB_VARIANT_IF1: + mode = (head[0] >> 3) & 0x0F; + block = block_size_if1[mode] + 1; + break; + case GST_AMRNB_VARIANT_IF2: + mode = head[0] & 0x0F; + block = block_size_if2[mode] + 1; + break; + default: + g_assert_not_reached (); + return GST_FLOW_ERROR; + break; + } + + GST_DEBUG_OBJECT (amrnbdec, "mode %d, block %d", mode, block); + + if (block > size) + return GST_FLOW_EOS; + + *offset = 0; + *length = block; + + return GST_FLOW_OK; +} + +static GstFlowReturn +gst_amrnbdec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer) +{ + GstAmrnbDec *amrnbdec; + GstMapInfo inmap, outmap; + GstBuffer *out; + + amrnbdec = GST_AMRNBDEC (dec); + + /* no fancy flushing */ + if (!buffer || !gst_buffer_get_size (buffer)) + return GST_FLOW_OK; + + gst_buffer_map (buffer, &inmap, GST_MAP_READ); + + /* get output */ + out = gst_buffer_new_and_alloc (160 * 2); + /* decode */ + gst_buffer_map (out, &outmap, GST_MAP_WRITE); + Decoder_Interface_Decode (amrnbdec->handle, inmap.data, + (gint16 *) outmap.data, 0); + gst_buffer_unmap (out, &outmap); + + gst_buffer_unmap (buffer, &inmap); + + return gst_audio_decoder_finish_frame (dec, out, 1); +} diff --git a/ext/amrnb/amrnbdec.h b/ext/amrnb/amrnbdec.h new file mode 100644 index 0000000..6bda1ef --- /dev/null +++ b/ext/amrnb/amrnbdec.h @@ -0,0 +1,74 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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_AMRNBDEC_H__ +#define __GST_AMRNBDEC_H__ + +#include +#include + +#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER +#include +#else +#include +#endif + +G_BEGIN_DECLS + +#define GST_TYPE_AMRNBDEC \ + (gst_amrnbdec_get_type()) +#define GST_AMRNBDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AMRNBDEC, GstAmrnbDec)) +#define GST_AMRNBDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AMRNBDEC, GstAmrnbDecClass)) +#define GST_IS_AMRNBDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AMRNBDEC)) +#define GST_IS_AMRNBDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AMRNBDEC)) + +typedef struct _GstAmrnbDec GstAmrnbDec; +typedef struct _GstAmrnbDecClass GstAmrnbDecClass; + +typedef enum +{ + GST_AMRNB_VARIANT_IF1, + GST_AMRNB_VARIANT_IF2 +} GstAmrnbVariant; + +struct _GstAmrnbDec { + GstAudioDecoder element; + + GstAmrnbVariant variant; + + /* library handle */ + void *handle; + + /* output settings */ + gint channels, rate; +}; + +struct _GstAmrnbDecClass { + GstAudioDecoderClass parent_class; +}; + +GType gst_amrnbdec_get_type (void); + +G_END_DECLS + +#endif /* __GST_AMRNBDEC_H__ */ diff --git a/ext/amrnb/amrnbenc.c b/ext/amrnb/amrnbenc.c new file mode 100644 index 0000000..e0f21c2 --- /dev/null +++ b/ext/amrnb/amrnbenc.c @@ -0,0 +1,292 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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-amrnbenc + * @see_also: #GstAmrnbDec, #GstAmrnbParse + * + * AMR narrowband encoder based on the + * opencore codec implementation. + * + * + * Example launch line + * |[ + * gst-launch filesrc location=abc.wav ! wavparse ! audioresample ! audioconvert ! amrnbenc ! filesink location=abc.amr + * ]| + * Please note that the above stream misses the header, that is needed to play + * the stream. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "amrnbenc.h" + +static GType +gst_amrnbenc_bandmode_get_type (void) +{ + static GType gst_amrnbenc_bandmode_type = 0; + static const GEnumValue gst_amrnbenc_bandmode[] = { + {MR475, "MR475", "MR475"}, + {MR515, "MR515", "MR515"}, + {MR59, "MR59", "MR59"}, + {MR67, "MR67", "MR67"}, + {MR74, "MR74", "MR74"}, + {MR795, "MR795", "MR795"}, + {MR102, "MR102", "MR102"}, + {MR122, "MR122", "MR122"}, + {MRDTX, "MRDTX", "MRDTX"}, + {0, NULL, NULL}, + }; + if (!gst_amrnbenc_bandmode_type) { + gst_amrnbenc_bandmode_type = + g_enum_register_static ("GstAmrnbEncBandMode", gst_amrnbenc_bandmode); + } + return gst_amrnbenc_bandmode_type; +} + +#define GST_AMRNBENC_BANDMODE_TYPE (gst_amrnbenc_bandmode_get_type()) + +#define BANDMODE_DEFAULT MR122 +enum +{ + PROP_0, + PROP_BANDMODE +}; + +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, format = (string) " GST_AUDIO_NE (S16) ", " + "layout = (string) interleaved, " + "rate = (int) 8000," "channels = (int) 1") + ); + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/AMR, " "rate = (int) 8000, " "channels = (int) 1") + ); + +GST_DEBUG_CATEGORY_STATIC (gst_amrnbenc_debug); +#define GST_CAT_DEFAULT gst_amrnbenc_debug + +static gboolean gst_amrnbenc_start (GstAudioEncoder * enc); +static gboolean gst_amrnbenc_stop (GstAudioEncoder * enc); +static gboolean gst_amrnbenc_set_format (GstAudioEncoder * enc, + GstAudioInfo * info); +static GstFlowReturn gst_amrnbenc_handle_frame (GstAudioEncoder * enc, + GstBuffer * in_buf); + +#define gst_amrnbenc_parent_class parent_class +G_DEFINE_TYPE (GstAmrnbEnc, gst_amrnbenc, GST_TYPE_AUDIO_ENCODER); + +static void +gst_amrnbenc_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstAmrnbEnc *self = GST_AMRNBENC (object); + + switch (prop_id) { + case PROP_BANDMODE: + self->bandmode = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + return; +} + +static void +gst_amrnbenc_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstAmrnbEnc *self = GST_AMRNBENC (object); + + switch (prop_id) { + case PROP_BANDMODE: + g_value_set_enum (value, self->bandmode); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + return; +} + +static void +gst_amrnbenc_class_init (GstAmrnbEncClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstAudioEncoderClass *base_class = GST_AUDIO_ENCODER_CLASS (klass); + + object_class->set_property = gst_amrnbenc_set_property; + object_class->get_property = gst_amrnbenc_get_property; + + base_class->start = GST_DEBUG_FUNCPTR (gst_amrnbenc_start); + base_class->stop = GST_DEBUG_FUNCPTR (gst_amrnbenc_stop); + base_class->set_format = GST_DEBUG_FUNCPTR (gst_amrnbenc_set_format); + base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_amrnbenc_handle_frame); + + g_object_class_install_property (object_class, PROP_BANDMODE, + g_param_spec_enum ("band-mode", "Band Mode", + "Encoding Band Mode (Kbps)", GST_AMRNBENC_BANDMODE_TYPE, + BANDMODE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&src_template)); + + gst_element_class_set_static_metadata (element_class, "AMR-NB audio encoder", + "Codec/Encoder/Audio", + "Adaptive Multi-Rate Narrow-Band audio encoder", + "Wim Taymans "); + + GST_DEBUG_CATEGORY_INIT (gst_amrnbenc_debug, "amrnbenc", 0, + "AMR-NB audio encoder"); +} + +static void +gst_amrnbenc_init (GstAmrnbEnc * amrnbenc) +{ +} + +static gboolean +gst_amrnbenc_start (GstAudioEncoder * enc) +{ + GstAmrnbEnc *amrnbenc = GST_AMRNBENC (enc); + + GST_DEBUG_OBJECT (amrnbenc, "start"); + + if (!(amrnbenc->handle = Encoder_Interface_init (0))) + return FALSE; + + return TRUE; +} + +static gboolean +gst_amrnbenc_stop (GstAudioEncoder * enc) +{ + GstAmrnbEnc *amrnbenc = GST_AMRNBENC (enc); + + GST_DEBUG_OBJECT (amrnbenc, "stop"); + + Encoder_Interface_exit (amrnbenc->handle); + + return TRUE; +} + +static gboolean +gst_amrnbenc_set_format (GstAudioEncoder * enc, GstAudioInfo * info) +{ + GstAmrnbEnc *amrnbenc; + GstCaps *copy; + + amrnbenc = GST_AMRNBENC (enc); + + /* parameters already parsed for us */ + amrnbenc->rate = GST_AUDIO_INFO_RATE (info); + amrnbenc->channels = GST_AUDIO_INFO_CHANNELS (info); + + /* we do not really accept other input, but anyway ... */ + /* this is not wrong but will sound bad */ + if (amrnbenc->channels != 1) { + g_warning ("amrnbdec is only optimized for mono channels"); + } + if (amrnbenc->rate != 8000) { + g_warning ("amrnbdec is only optimized for 8000 Hz samplerate"); + } + + /* create reverse caps */ + copy = gst_caps_new_simple ("audio/AMR", + "channels", G_TYPE_INT, amrnbenc->channels, + "rate", G_TYPE_INT, amrnbenc->rate, NULL); + + gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (amrnbenc), copy); + gst_caps_unref (copy); + + /* report needs to base class: hand one frame at a time */ + gst_audio_encoder_set_frame_samples_min (enc, 160); + gst_audio_encoder_set_frame_samples_max (enc, 160); + gst_audio_encoder_set_frame_max (enc, 1); + + return TRUE; +} + +static GstFlowReturn +gst_amrnbenc_handle_frame (GstAudioEncoder * enc, GstBuffer * buffer) +{ + GstAmrnbEnc *amrnbenc; + GstFlowReturn ret; + GstBuffer *out; + GstMapInfo in_map, out_map; + gsize out_size; + + amrnbenc = GST_AMRNBENC (enc); + + g_return_val_if_fail (amrnbenc->handle, GST_FLOW_FLUSHING); + + /* we don't deal with squeezing remnants, so simply discard those */ + if (G_UNLIKELY (buffer == NULL)) { + GST_DEBUG_OBJECT (amrnbenc, "no data"); + return GST_FLOW_OK; + } + + gst_buffer_map (buffer, &in_map, GST_MAP_READ); + + if (G_UNLIKELY (in_map.size < 320)) { + gst_buffer_unmap (buffer, &in_map); + GST_DEBUG_OBJECT (amrnbenc, "discarding trailing data of %" G_GSIZE_FORMAT + " bytes", in_map.size); + return gst_audio_encoder_finish_frame (enc, NULL, -1); + } + + /* get output, max size is 32 */ + out = gst_buffer_new_and_alloc (32); + /* AMR encoder actually writes into the source data buffers it gets */ + /* should be able to handle that with what we are given */ + + gst_buffer_map (out, &out_map, GST_MAP_WRITE); + /* encode */ + out_size = + Encoder_Interface_Encode (amrnbenc->handle, amrnbenc->bandmode, + (short *) in_map.data, out_map.data, 0); + gst_buffer_unmap (out, &out_map); + gst_buffer_resize (out, 0, out_size); + gst_buffer_unmap (buffer, &in_map); + + GST_LOG_OBJECT (amrnbenc, "output data size %" G_GSIZE_FORMAT, out_size); + + if (out_size) { + ret = gst_audio_encoder_finish_frame (enc, out, 160); + } else { + /* should not happen (without dtx or so at least) */ + GST_WARNING_OBJECT (amrnbenc, "no encoded data; discarding input"); + gst_buffer_unref (out); + ret = gst_audio_encoder_finish_frame (enc, NULL, -1); + } + + return ret; +} diff --git a/ext/amrnb/amrnbenc.h b/ext/amrnb/amrnbenc.h new file mode 100644 index 0000000..f5345ff --- /dev/null +++ b/ext/amrnb/amrnbenc.h @@ -0,0 +1,70 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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_AMRNBENC_H__ +#define __GST_AMRNBENC_H__ + +#include +#include + +#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER +#include +#else +#include +#endif + +G_BEGIN_DECLS + +#define GST_TYPE_AMRNBENC \ + (gst_amrnbenc_get_type()) +#define GST_AMRNBENC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AMRNBENC, GstAmrnbEnc)) +#define GST_AMRNBENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AMRNBENC, GstAmrnbEncClass)) +#define GST_IS_AMRNBENC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AMRNBENC)) +#define GST_IS_AMRNBENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AMRNBENC)) + +typedef struct _GstAmrnbEnc GstAmrnbEnc; +typedef struct _GstAmrnbEncClass GstAmrnbEncClass; + +struct _GstAmrnbEnc { + GstAudioEncoder element; + + /* library handle */ + void *handle; + + /* input settings */ + gint channels, rate; + gint duration; + + /* property */ + enum Mode bandmode; +}; + +struct _GstAmrnbEncClass { + GstAudioEncoderClass parent_class; +}; + +GType gst_amrnbenc_get_type (void); + +G_END_DECLS + +#endif /* __GST_AMRNBENC_H__ */ diff --git a/ext/amrwbdec/Makefile.am b/ext/amrwbdec/Makefile.am new file mode 100644 index 0000000..aef2984 --- /dev/null +++ b/ext/amrwbdec/Makefile.am @@ -0,0 +1,17 @@ +plugin_LTLIBRARIES = libgstamrwbdec.la + +libgstamrwbdec_la_SOURCES = \ + amrwb.c \ + amrwbdec.c + +libgstamrwbdec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AMRWB_CFLAGS) +libgstamrwbdec_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ \ + $(GST_LIBS) $(AMRWB_LIBS) +libgstamrwbdec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstamrwbdec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = \ + amrwbdec.h diff --git a/ext/amrwbdec/Makefile.in b/ext/amrwbdec/Makefile.in new file mode 100644 index 0000000..01e36a4 --- /dev/null +++ b/ext/amrwbdec/Makefile.in @@ -0,0 +1,846 @@ +# 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 = ext/amrwbdec +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(noinst_HEADERS) README +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstamrwbdec_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstamrwbdec_la_OBJECTS = libgstamrwbdec_la-amrwb.lo \ + libgstamrwbdec_la-amrwbdec.lo +libgstamrwbdec_la_OBJECTS = $(am_libgstamrwbdec_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 = +libgstamrwbdec_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstamrwbdec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstamrwbdec_la_CFLAGS) $(CFLAGS) \ + $(libgstamrwbdec_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 = $(libgstamrwbdec_la_SOURCES) +DIST_SOURCES = $(libgstamrwbdec_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstamrwbdec.la +libgstamrwbdec_la_SOURCES = \ + amrwb.c \ + amrwbdec.c + +libgstamrwbdec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AMRWB_CFLAGS) + +libgstamrwbdec_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + $(GST_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ \ + $(GST_LIBS) $(AMRWB_LIBS) + +libgstamrwbdec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstamrwbdec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = \ + amrwbdec.h + +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 ext/amrwbdec/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/amrwbdec/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}; \ + } + +libgstamrwbdec.la: $(libgstamrwbdec_la_OBJECTS) $(libgstamrwbdec_la_DEPENDENCIES) $(EXTRA_libgstamrwbdec_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstamrwbdec_la_LINK) -rpath $(plugindir) $(libgstamrwbdec_la_OBJECTS) $(libgstamrwbdec_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstamrwbdec_la-amrwb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstamrwbdec_la-amrwbdec.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 $@ $< + +libgstamrwbdec_la-amrwb.lo: amrwb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstamrwbdec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrwbdec_la_CFLAGS) $(CFLAGS) -MT libgstamrwbdec_la-amrwb.lo -MD -MP -MF $(DEPDIR)/libgstamrwbdec_la-amrwb.Tpo -c -o libgstamrwbdec_la-amrwb.lo `test -f 'amrwb.c' || echo '$(srcdir)/'`amrwb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstamrwbdec_la-amrwb.Tpo $(DEPDIR)/libgstamrwbdec_la-amrwb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amrwb.c' object='libgstamrwbdec_la-amrwb.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 $(libgstamrwbdec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrwbdec_la_CFLAGS) $(CFLAGS) -c -o libgstamrwbdec_la-amrwb.lo `test -f 'amrwb.c' || echo '$(srcdir)/'`amrwb.c + +libgstamrwbdec_la-amrwbdec.lo: amrwbdec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstamrwbdec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrwbdec_la_CFLAGS) $(CFLAGS) -MT libgstamrwbdec_la-amrwbdec.lo -MD -MP -MF $(DEPDIR)/libgstamrwbdec_la-amrwbdec.Tpo -c -o libgstamrwbdec_la-amrwbdec.lo `test -f 'amrwbdec.c' || echo '$(srcdir)/'`amrwbdec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstamrwbdec_la-amrwbdec.Tpo $(DEPDIR)/libgstamrwbdec_la-amrwbdec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='amrwbdec.c' object='libgstamrwbdec_la-amrwbdec.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 $(libgstamrwbdec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstamrwbdec_la_CFLAGS) $(CFLAGS) -c -o libgstamrwbdec_la-amrwbdec.lo `test -f 'amrwbdec.c' || echo '$(srcdir)/'`amrwbdec.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 + + +# 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/ext/amrwbdec/README b/ext/amrwbdec/README new file mode 100644 index 0000000..835adef --- /dev/null +++ b/ext/amrwbdec/README @@ -0,0 +1,6 @@ +Compiling AMRWB decoder: +======================== + +To compile the amrwbdec plugin, you need the opencore-amrwb development +package. If your distribution does not provide this package, you can +download the source code from "http://sourceforge.net/projects/opencore-amr". diff --git a/ext/amrwbdec/amrwb.c b/ext/amrwbdec/amrwb.c new file mode 100644 index 0000000..65e78a9 --- /dev/null +++ b/ext/amrwbdec/amrwb.c @@ -0,0 +1,39 @@ +/* GStreamer Adaptive Multi-Rate Wide-Band (AMR-WB) Decoder plugin + * Copyright (C) 2006 Edgard Lima + * + * 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 "amrwbdec.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + return gst_element_register (plugin, "amrwbdec", + GST_RANK_PRIMARY, GST_TYPE_AMRWBDEC); +} + + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + amrwbdec, + "Adaptive Multi-Rate Wide-Band Decoder", + plugin_init, VERSION, GST_LICENSE_UNKNOWN, GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN); diff --git a/ext/amrwbdec/amrwbdec.c b/ext/amrwbdec/amrwbdec.c new file mode 100644 index 0000000..b6e5f98 --- /dev/null +++ b/ext/amrwbdec/amrwbdec.c @@ -0,0 +1,233 @@ +/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin + * Copyright (C) 2004 Ronald Bultje + * + * 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-amrwbdec + * @see_also: #GstAmrwbEnc + * + * AMR wideband decoder based on the + * opencore codec implementation. + * + * + * Example launch line + * |[ + * gst-launch filesrc location=abc.amr ! amrparse ! amrwbdec ! audioresample ! audioconvert ! alsasink + * ]| + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "amrwbdec.h" + +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/AMR-WB, " + "rate = (int) 16000, " "channels = (int) 1") + ); + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) " GST_AUDIO_NE (S16) ", " + "layout = (string) interleaved, " + "rate = (int) 16000, " "channels = (int) 1") + ); + +GST_DEBUG_CATEGORY_STATIC (gst_amrwbdec_debug); +#define GST_CAT_DEFAULT gst_amrwbdec_debug + +#define L_FRAME16k 320 /* Frame size at 16kHz */ + +static const unsigned char block_size[16] = + { 18, 24, 33, 37, 41, 47, 51, 59, 61, + 6, 0, 0, 0, 0, 1, 1 +}; + +static gboolean gst_amrwbdec_start (GstAudioDecoder * dec); +static gboolean gst_amrwbdec_stop (GstAudioDecoder * dec); +static gboolean gst_amrwbdec_set_format (GstAudioDecoder * dec, GstCaps * caps); +static gboolean gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length); +static GstFlowReturn gst_amrwbdec_handle_frame (GstAudioDecoder * dec, + GstBuffer * buffer); + +#define gst_amrwbdec_parent_class parent_class +G_DEFINE_TYPE (GstAmrwbDec, gst_amrwbdec, GST_TYPE_AUDIO_DECODER); + +static void +gst_amrwbdec_class_init (GstAmrwbDecClass * klass) +{ + GstAudioDecoderClass *base_class = GST_AUDIO_DECODER_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&sink_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&src_template)); + + gst_element_class_set_static_metadata (element_class, "AMR-WB audio decoder", + "Codec/Decoder/Audio", + "Adaptive Multi-Rate Wideband audio decoder", + "Renato Araujo "); + + base_class->start = GST_DEBUG_FUNCPTR (gst_amrwbdec_start); + base_class->stop = GST_DEBUG_FUNCPTR (gst_amrwbdec_stop); + base_class->set_format = GST_DEBUG_FUNCPTR (gst_amrwbdec_set_format); + base_class->parse = GST_DEBUG_FUNCPTR (gst_amrwbdec_parse); + base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_amrwbdec_handle_frame); + + GST_DEBUG_CATEGORY_INIT (gst_amrwbdec_debug, "amrwbdec", 0, + "AMR-WB audio decoder"); +} + +static void +gst_amrwbdec_init (GstAmrwbDec * amrwbdec) +{ + gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrwbdec), TRUE); +} + +static gboolean +gst_amrwbdec_start (GstAudioDecoder * dec) +{ + GstAmrwbDec *amrwbdec = GST_AMRWBDEC (dec); + + GST_DEBUG_OBJECT (dec, "start"); + if (!(amrwbdec->handle = D_IF_init ())) + return FALSE; + + amrwbdec->rate = 0; + amrwbdec->channels = 0; + + return TRUE; +} + +static gboolean +gst_amrwbdec_stop (GstAudioDecoder * dec) +{ + GstAmrwbDec *amrwbdec = GST_AMRWBDEC (dec); + + GST_DEBUG_OBJECT (dec, "stop"); + D_IF_exit (amrwbdec->handle); + + return TRUE; +} + +static gboolean +gst_amrwbdec_set_format (GstAudioDecoder * dec, GstCaps * caps) +{ + GstStructure *structure; + GstAmrwbDec *amrwbdec; + GstAudioInfo info; + + amrwbdec = GST_AMRWBDEC (dec); + + structure = gst_caps_get_structure (caps, 0); + + /* get channel count */ + gst_structure_get_int (structure, "channels", &amrwbdec->channels); + gst_structure_get_int (structure, "rate", &amrwbdec->rate); + + /* create reverse caps */ + gst_audio_info_init (&info); + gst_audio_info_set_format (&info, + GST_AUDIO_FORMAT_S16, amrwbdec->rate, amrwbdec->channels, NULL); + + gst_audio_decoder_set_output_format (dec, &info); + + return TRUE; +} + +static GstFlowReturn +gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length) +{ + GstAmrwbDec *amrwbdec = GST_AMRWBDEC (dec); + guint8 header[1]; + guint size; + gboolean sync, eos; + gint block, mode; + + size = gst_adapter_available (adapter); + g_return_val_if_fail (size > 0, GST_FLOW_ERROR); + + gst_audio_decoder_get_parse_state (dec, &sync, &eos); + + /* need to peek data to get the size */ + if (size < 1) + return GST_FLOW_ERROR; + + gst_adapter_copy (adapter, header, 0, 1); + mode = (header[0] >> 3) & 0x0F; + block = block_size[mode]; + + GST_DEBUG_OBJECT (amrwbdec, "mode %d, block %d", mode, block); + + if (block) { + if (block > size) + return GST_FLOW_EOS; + *offset = 0; + *length = block; + } else { + /* no frame yet, skip one byte */ + GST_LOG_OBJECT (amrwbdec, "skipping byte"); + *offset = 1; + return GST_FLOW_EOS; + } + + return GST_FLOW_OK; +} + +static GstFlowReturn +gst_amrwbdec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer) +{ + GstAmrwbDec *amrwbdec; + GstBuffer *out; + GstMapInfo inmap, outmap; + + amrwbdec = GST_AMRWBDEC (dec); + + /* no fancy flushing */ + if (!buffer || !gst_buffer_get_size (buffer)) + return GST_FLOW_OK; + + /* the library seems to write into the source data, hence the copy. */ + /* should be no problem */ + gst_buffer_map (buffer, &inmap, GST_MAP_READ); + + /* get output */ + out = gst_buffer_new_and_alloc (sizeof (gint16) * L_FRAME16k); + gst_buffer_map (out, &outmap, GST_MAP_WRITE); + + /* decode */ + D_IF_decode (amrwbdec->handle, (unsigned char *) inmap.data, + (short int *) outmap.data, _good_frame); + + gst_buffer_unmap (out, &outmap); + gst_buffer_unmap (buffer, &inmap); + + /* send out */ + return gst_audio_decoder_finish_frame (dec, out, 1); +} diff --git a/ext/amrwbdec/amrwbdec.h b/ext/amrwbdec/amrwbdec.h new file mode 100644 index 0000000..478d599 --- /dev/null +++ b/ext/amrwbdec/amrwbdec.h @@ -0,0 +1,73 @@ +/* GStreamer Adaptive Multi-Rate Wide-Band (AMR-WB) plugin + * Copyright (C) 2006 Edgard Lima + * + * 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_AMRWBDEC_H__ +#define __GST_AMRWBDEC_H__ + +#include +#include + +#ifdef HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER +#include +#include +#else +#include +#include +#endif + +G_BEGIN_DECLS + +#define GST_TYPE_AMRWBDEC \ + (gst_amrwbdec_get_type()) +#define GST_AMRWBDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AMRWBDEC, GstAmrwbDec)) +#define GST_AMRWBDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AMRWBDEC, GstAmrwbDecClass)) +#define GST_IS_AMRWBDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AMRWBDEC)) +#define GST_IS_AMRWBDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AMRWBDEC)) + +typedef struct _GstAmrwbDec GstAmrwbDec; +typedef struct _GstAmrwbDecClass GstAmrwbDecClass; + +/** + * GstAmrwbDec: + * + * Opaque data structure. + */ +struct _GstAmrwbDec { + GstAudioDecoder element; + + /* library handle */ + void *handle; + + /* output settings */ + gint channels, rate; +}; + +struct _GstAmrwbDecClass { + GstAudioDecoderClass parent_class; +}; + +GType gst_amrwbdec_get_type (void); + +G_END_DECLS + +#endif /* __GST_AMRWBDEC_H__ */ diff --git a/ext/cdio/Makefile.am b/ext/cdio/Makefile.am new file mode 100644 index 0000000..bd8f422 --- /dev/null +++ b/ext/cdio/Makefile.am @@ -0,0 +1,23 @@ +plugin_LTLIBRARIES = libgstcdio.la + +libgstcdio_la_SOURCES = \ + gstcdio.c \ + gstcdiocddasrc.c + +libgstcdio_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(CDIO_CFLAGS) + +libgstcdio_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) -lgsttag-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) \ + $(CDIO_LIBS) + +libgstcdio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstcdio_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = \ + gstcdio.h \ + gstcdiocddasrc.h diff --git a/ext/cdio/Makefile.in b/ext/cdio/Makefile.in new file mode 100644 index 0000000..df4d69f --- /dev/null +++ b/ext/cdio/Makefile.in @@ -0,0 +1,849 @@ +# 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 = ext/cdio +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstcdio_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgstcdio_la_OBJECTS = libgstcdio_la-gstcdio.lo \ + libgstcdio_la-gstcdiocddasrc.lo +libgstcdio_la_OBJECTS = $(am_libgstcdio_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 = +libgstcdio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstcdio_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstcdio_la_CFLAGS) $(CFLAGS) \ + $(libgstcdio_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 = $(libgstcdio_la_SOURCES) +DIST_SOURCES = $(libgstcdio_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstcdio.la +libgstcdio_la_SOURCES = \ + gstcdio.c \ + gstcdiocddasrc.c + +libgstcdio_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(CDIO_CFLAGS) + +libgstcdio_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) -lgsttag-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) \ + $(CDIO_LIBS) + +libgstcdio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstcdio_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = \ + gstcdio.h \ + gstcdiocddasrc.h + +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 ext/cdio/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/cdio/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}; \ + } + +libgstcdio.la: $(libgstcdio_la_OBJECTS) $(libgstcdio_la_DEPENDENCIES) $(EXTRA_libgstcdio_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstcdio_la_LINK) -rpath $(plugindir) $(libgstcdio_la_OBJECTS) $(libgstcdio_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstcdio_la-gstcdio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstcdio_la-gstcdiocddasrc.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 $@ $< + +libgstcdio_la-gstcdio.lo: gstcdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstcdio_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcdio_la_CFLAGS) $(CFLAGS) -MT libgstcdio_la-gstcdio.lo -MD -MP -MF $(DEPDIR)/libgstcdio_la-gstcdio.Tpo -c -o libgstcdio_la-gstcdio.lo `test -f 'gstcdio.c' || echo '$(srcdir)/'`gstcdio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstcdio_la-gstcdio.Tpo $(DEPDIR)/libgstcdio_la-gstcdio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstcdio.c' object='libgstcdio_la-gstcdio.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 $(libgstcdio_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcdio_la_CFLAGS) $(CFLAGS) -c -o libgstcdio_la-gstcdio.lo `test -f 'gstcdio.c' || echo '$(srcdir)/'`gstcdio.c + +libgstcdio_la-gstcdiocddasrc.lo: gstcdiocddasrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstcdio_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcdio_la_CFLAGS) $(CFLAGS) -MT libgstcdio_la-gstcdiocddasrc.lo -MD -MP -MF $(DEPDIR)/libgstcdio_la-gstcdiocddasrc.Tpo -c -o libgstcdio_la-gstcdiocddasrc.lo `test -f 'gstcdiocddasrc.c' || echo '$(srcdir)/'`gstcdiocddasrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstcdio_la-gstcdiocddasrc.Tpo $(DEPDIR)/libgstcdio_la-gstcdiocddasrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstcdiocddasrc.c' object='libgstcdio_la-gstcdiocddasrc.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 $(libgstcdio_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstcdio_la_CFLAGS) $(CFLAGS) -c -o libgstcdio_la-gstcdiocddasrc.lo `test -f 'gstcdiocddasrc.c' || echo '$(srcdir)/'`gstcdiocddasrc.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 + + +# 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/ext/cdio/gstcdio.c b/ext/cdio/gstcdio.c new file mode 100644 index 0000000..e89e105 --- /dev/null +++ b/ext/cdio/gstcdio.c @@ -0,0 +1,159 @@ +/* GStreamer + * Copyright (C) 1999 Erik Walthinsen + * Copyright (C) 2006 Tim-Philipp Müller + * + * 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 +#include + +static gboolean plugin_init (GstPlugin * plugin); + +/* cdio headers redefine VERSION etc., so do this here before including them */ +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + cdio, + "Read audio from audio CDs", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); + +#include "gstcdio.h" +#include "gstcdiocddasrc.h" + +#include + +GST_DEBUG_CATEGORY (gst_cdio_debug); + +void +gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext, track_t track, + cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags) +{ + const gchar *vars[] = { "GST_CDTEXT_TAG_ENCODING", "GST_TAG_ENCODING", NULL }; + const gchar *txt; + gchar *txt_utf8; + +#if LIBCDIO_VERSION_NUM > 83 + txt = cdtext_get_const (cdtext, field, track); +#else + txt = cdtext_get_const (field, cdtext); +#endif + if (txt == NULL || *txt == '\0') { + GST_DEBUG_OBJECT (src, "empty CD-TEXT field %u (%s)", field, gst_tag); + return; + } + + /* The character encoding is not specified, and there is no provision + * for indicating in the CD-Text data which encoding is in use.. */ + txt_utf8 = gst_tag_freeform_string_to_utf8 (txt, -1, vars); + + if (txt_utf8 == NULL) { + GST_WARNING_OBJECT (src, "CD-TEXT %s could not be converted to UTF-8, " + "try setting the GST_CDTEXT_TAG_ENCODING or GST_TAG_ENCODING " + "environment variable", gst_tag); + return; + } + + /* FIXME: beautify strings (they might be all uppercase for example)? */ + + if (*p_tags == NULL) + *p_tags = gst_tag_list_new_empty (); + + gst_tag_list_add (*p_tags, GST_TAG_MERGE_REPLACE, gst_tag, txt_utf8, NULL); + + GST_DEBUG_OBJECT (src, "CD-TEXT: %s = %s", gst_tag, txt_utf8); + g_free (txt_utf8); +} + +GstTagList * +#if LIBCDIO_VERSION_NUM > 83 +gst_cdio_get_cdtext (GstObject * src, cdtext_t * t, track_t track) +{ + GstTagList *tags = NULL; + +#else +gst_cdio_get_cdtext (GstObject * src, CdIo * cdio, track_t track) +{ + GstTagList *tags = NULL; + cdtext_t *t; + + t = cdio_get_cdtext (cdio, track); + if (t == NULL) { + GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", track); + return NULL; + } +#endif + + gst_cdio_add_cdtext_field (src, t, track, CDTEXT_FIELD_PERFORMER, + GST_TAG_ARTIST, &tags); + gst_cdio_add_cdtext_field (src, t, track, CDTEXT_FIELD_TITLE, GST_TAG_TITLE, + &tags); + + return tags; +} + +void +#if LIBCDIO_VERSION_NUM > 83 +gst_cdio_add_cdtext_album_tags (GstObject * src, cdtext_t * t, + GstTagList * tags) +{ +#else +gst_cdio_add_cdtext_album_tags (GstObject * src, CdIo * cdio, GstTagList * tags) +{ + cdtext_t *t; + + t = cdio_get_cdtext (cdio, 0); + if (t == NULL) { + GST_DEBUG_OBJECT (src, "no CD-TEXT for album"); + return; + } +#endif + + gst_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_PERFORMER, + GST_TAG_ALBUM_ARTIST, &tags); + gst_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_TITLE, GST_TAG_ALBUM, + &tags); + gst_cdio_add_cdtext_field (src, t, 0, CDTEXT_FIELD_GENRE, GST_TAG_GENRE, + &tags); + GST_DEBUG ("CD-TEXT album tags: %" GST_PTR_FORMAT, tags); +} + +static void +gst_cdio_log_handler (cdio_log_level_t level, const char *msg) +{ + const gchar *level_str[] = { "DEBUG", "INFO", "WARN", "ERROR", "ASSERT" }; + const gchar *s; + + s = level_str[CLAMP (level, 1, G_N_ELEMENTS (level_str)) - 1]; + GST_DEBUG ("CDIO-%s: %s", s, GST_STR_NULL (msg)); +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + if (!gst_element_register (plugin, "cdiocddasrc", GST_RANK_SECONDARY - 1, + GST_TYPE_CDIO_CDDA_SRC)) + return FALSE; + + cdio_log_set_handler (gst_cdio_log_handler); + + GST_DEBUG_CATEGORY_INIT (gst_cdio_debug, "cdio", 0, "libcdio elements"); + + return TRUE; +} diff --git a/ext/cdio/gstcdio.h b/ext/cdio/gstcdio.h new file mode 100644 index 0000000..6d7c733 --- /dev/null +++ b/ext/cdio/gstcdio.h @@ -0,0 +1,61 @@ +/* GStreamer + * Copyright (C) 1999 Erik Walthinsen + * Copyright (C) 2006 Tim-Philipp Müller + * + * 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_CDIO_H__ +#define __GST_CDIO_H__ + +#include +#include +#include + +#if LIBCDIO_VERSION_NUM <= 83 + #define CDTEXT_FIELD_PERFORMER CDTEXT_PERFORMER + #define CDTEXT_FIELD_GENRE CDTEXT_GENRE + #define CDTEXT_FIELD_TITLE CDTEXT_TITLE +#endif + +GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug); +#define GST_CAT_DEFAULT gst_cdio_debug + +void gst_cdio_add_cdtext_field (GstObject * src, + cdtext_t * cdtext, + track_t track, + cdtext_field_t field, + const gchar * gst_tag, + GstTagList ** p_tags); + +GstTagList * gst_cdio_get_cdtext (GstObject * src, +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t * t, +#else + CdIo * cdio, +#endif + track_t track); + +void gst_cdio_add_cdtext_album_tags (GstObject * src, +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t * t, +#else + CdIo * cdio, +#endif + GstTagList * tags); + +#endif /* __GST_CDIO_H__ */ + diff --git a/ext/cdio/gstcdiocddasrc.c b/ext/cdio/gstcdiocddasrc.c new file mode 100644 index 0000000..a13d908 --- /dev/null +++ b/ext/cdio/gstcdiocddasrc.c @@ -0,0 +1,520 @@ +/* GStreamer + * Copyright (C) 2006 Tim-Philipp Müller + * + * 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-cdiocddasrc + * @see_also: GstCdParanoiaSrc, GstAudioCdSrc + * + * + * + * cdiocddasrc reads and extracts raw audio from Audio CDs. It can operate + * in one of two modes: + * + * + * treat each track as a separate stream, counting time from the start + * of the track to the end of the track and posting EOS at the end of + * a track, or + * + * + * treat the entire disc as one stream, counting time from the start of + * the first track to the end of the last track, posting EOS only at + * the end of the last track. + * + * + * + * + * With a recent-enough version of libcdio, the element will extract + * CD-TEXT if this is supported by the CD-drive and CD-TEXT information + * is available on the CD. The information will be posted on the bus in + * form of a tag message. + * + * + * When opened, the element will also calculate a CDDB disc ID and a + * MusicBrainz disc ID, which applications can use to query online + * databases for artist/title information. These disc IDs will also be + * posted on the bus as part of the tag messages. + * + * + * cdiocddasrc supports the GstUriHandler interface, so applications can use + * playbin with cdda://<track-number> URIs for playback (they will have + * to connect to playbin's notify::source signal and set the device on the + * cd source in the notify callback if they want to set the device property). + * Applications should use seeks in "track" format to switch between different + * tracks of the same CD (passing a new cdda:// URI to playbin involves opening + * and closing the CD device, which is much slower). + * + * Example launch line + * + * + * gst-launch cdiocddasrc track=5 device=/dev/cdrom ! audioconvert ! vorbisenc ! oggmux ! filesink location=track5.ogg + * + * This pipeline extracts track 5 of the audio CD and encodes it into an + * Ogg/Vorbis file. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstcdio.h" +#include "gstcdiocddasrc.h" + +#include +#include "gst/gst-i18n-plugin.h" + +#include +#include +#include +#include + +#define SAMPLES_PER_SECTOR (CDIO_CD_FRAMESIZE_RAW / sizeof (gint16)) + +#define DEFAULT_READ_SPEED -1 + +enum +{ + PROP_0 = 0, + PROP_READ_SPEED +}; + +G_DEFINE_TYPE (GstCdioCddaSrc, gst_cdio_cdda_src, GST_TYPE_AUDIO_CD_SRC); + +static void gst_cdio_cdda_src_finalize (GObject * obj); +static void gst_cdio_cdda_src_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_cdio_cdda_src_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); +static GstBuffer *gst_cdio_cdda_src_read_sector (GstAudioCdSrc * src, + gint sector); +static gboolean gst_cdio_cdda_src_open (GstAudioCdSrc * src, + const gchar * device); +static void gst_cdio_cdda_src_close (GstAudioCdSrc * src); + +#if 0 +static gchar * +gst_cdio_cdda_src_get_default_device (GstAudioCdSrc * audiocdsrc) +{ + GstCdioCddaSrc *src; + gchar *default_device, *ret; + + src = GST_CDIO_CDDA_SRC (audiocdsrc); + + /* src->cdio may be NULL here */ + default_device = cdio_get_default_device (src->cdio); + + ret = g_strdup (default_device); + free (default_device); + + GST_LOG_OBJECT (src, "returning default device: %s", GST_STR_NULL (ret)); + + return ret; +} + +static gchar ** +gst_cdio_cdda_src_probe_devices (GstAudioCdSrc * audiocdsrc) +{ + char **devices, **ret, **d; + + /* FIXME: might return the same hardware device twice, e.g. + * as /dev/cdrom and /dev/dvd - gotta do something more sophisticated */ + devices = cdio_get_devices (DRIVER_DEVICE); + + if (devices == NULL) + goto no_devices; + + if (*devices == NULL) + goto empty_devices; + + ret = g_strdupv (devices); + for (d = devices; *d != NULL; ++d) { + GST_DEBUG_OBJECT (audiocdsrc, "device: %s", GST_STR_NULL (*d)); + free (*d); + } + free (devices); + + return ret; + + /* ERRORS */ +no_devices: + { + GST_DEBUG_OBJECT (audiocdsrc, "no devices found"); + return NULL; + } +empty_devices: + { + GST_DEBUG_OBJECT (audiocdsrc, "empty device list found"); + free (devices); + return NULL; + } +} +#endif + +static GstBuffer * +gst_cdio_cdda_src_read_sector (GstAudioCdSrc * audiocdsrc, gint sector) +{ + GstCdioCddaSrc *src; + guint8 *data; + + src = GST_CDIO_CDDA_SRC (audiocdsrc); + + data = g_malloc (CDIO_CD_FRAMESIZE_RAW); + + /* can't use pad_alloc because we can't return the GstFlowReturn (FIXME 0.11) */ + if (cdio_read_audio_sector (src->cdio, data, sector) != 0) + goto read_failed; + + if (src->swap_le_be) { + gint16 *pcm_data = (gint16 *) data; + gint i; + + for (i = 0; i < SAMPLES_PER_SECTOR; ++i) + pcm_data[i] = GUINT16_SWAP_LE_BE (pcm_data[i]); + } + + return gst_buffer_new_wrapped (data, CDIO_CD_FRAMESIZE_RAW); + + /* ERRORS */ +read_failed: + { + GST_WARNING_OBJECT (src, "read at sector %d failed!", sector); + GST_ELEMENT_ERROR (src, RESOURCE, READ, + (_("Could not read from CD.")), + ("cdio_read_audio_sector at %d failed: %s", sector, + g_strerror (errno))); + g_free (data); + return NULL; + } +} + +static gboolean +gst_cdio_cdda_src_do_detect_drive_endianness (GstCdioCddaSrc * src, gint from, + gint to) +{ + gint16 pcm_data[SAMPLES_PER_SECTOR], last_pcm_ne, last_pcm_oe; + gdouble ne_sumd0, ne_sumd1, ne_factor; + gdouble oe_sumd0, oe_sumd1, oe_factor; + gdouble diff; + gint sector; + gint i; + + ne_sumd0 = ne_sumd1 = 0.0; + oe_sumd0 = oe_sumd1 = 0.0; + last_pcm_ne = 0; + last_pcm_oe = 0; + + GST_LOG_OBJECT (src, "checking sector %d to %d", from, to); + + for (sector = from; sector < to; ++sector) { + if (cdio_read_audio_sector (src->cdio, pcm_data, sector) != 0) + goto read_failed; + + /* only evaluate samples for left channel */ + for (i = 0; i < SAMPLES_PER_SECTOR; i += 2) { + gint16 pcm; + + /* Native endianness first */ + pcm = pcm_data[i]; + ne_sumd0 += abs (pcm); + ne_sumd1 += abs (pcm - last_pcm_ne); + last_pcm_ne = pcm; + + /* other endianness next */ + pcm = GUINT16_SWAP_LE_BE (pcm); + oe_sumd0 += abs (pcm); + oe_sumd1 += abs (pcm - last_pcm_oe); + last_pcm_oe = pcm; + } + + } + + ne_factor = (ne_sumd1 / ne_sumd0); + oe_factor = (oe_sumd1 / oe_sumd0); + diff = ne_factor - oe_factor; + + GST_DEBUG_OBJECT (src, "Native: %.2f, Other: %.2f, diff: %.2f", + ne_factor, oe_factor, diff); + + if (diff > 0.5) { + GST_INFO_OBJECT (src, "Drive produces samples in other endianness"); + src->swap_le_be = TRUE; + return TRUE; + } else if (diff < -0.5) { + GST_INFO_OBJECT (src, "Drive produces samples in host endianness"); + src->swap_le_be = FALSE; + return TRUE; + } else { + GST_INFO_OBJECT (src, "Inconclusive, assuming host endianness"); + src->swap_le_be = FALSE; + return FALSE; + } + +/* ERRORS */ +read_failed: + { + GST_WARNING_OBJECT (src, "could not read sector %d", sector); + src->swap_le_be = FALSE; + return FALSE; + } +} + +static void +gst_cdio_cdda_src_detect_drive_endianness (GstCdioCddaSrc * src, gint first, + gint last) +{ + gint from, to; + + GST_INFO ("Detecting drive endianness"); + + /* try middle of disc first */ + from = (first + last) / 2; + to = MIN (from + 10, last); + if (gst_cdio_cdda_src_do_detect_drive_endianness (src, from, to)) + return; + + /* if that was inconclusive, try other places */ + from = (first + last) / 4; + to = MIN (from + 10, last); + if (gst_cdio_cdda_src_do_detect_drive_endianness (src, from, to)) + return; + + from = (first + last) * 3 / 4; + to = MIN (from + 10, last); + if (gst_cdio_cdda_src_do_detect_drive_endianness (src, from, to)) + return; + + /* if that's still inconclusive, we give up and assume host endianness */ + return; +} + +static gboolean +notcdio_track_is_audio_track (const CdIo * p_cdio, track_t i_track) +{ + return (cdio_get_track_format (p_cdio, i_track) == TRACK_FORMAT_AUDIO); +} + +static gboolean +gst_cdio_cdda_src_open (GstAudioCdSrc * audiocdsrc, const gchar * device) +{ + GstCdioCddaSrc *src; + discmode_t discmode; + gint first_track, num_tracks, i; + gint first_audio_sector = 0, last_audio_sector = 0; +#if LIBCDIO_VERSION_NUM > 83 + cdtext_t *cdtext; +#endif + + src = GST_CDIO_CDDA_SRC (audiocdsrc); + + g_assert (device != NULL); + g_assert (src->cdio == NULL); + + GST_LOG_OBJECT (src, "trying to open device %s", device); + + if (!(src->cdio = cdio_open (device, DRIVER_UNKNOWN))) + goto open_failed; + + discmode = cdio_get_discmode (src->cdio); + GST_LOG_OBJECT (src, "discmode: %d", (gint) discmode); + + if (discmode != CDIO_DISC_MODE_CD_DA && discmode != CDIO_DISC_MODE_CD_MIXED) + goto not_audio; + + first_track = cdio_get_first_track_num (src->cdio); + num_tracks = cdio_get_num_tracks (src->cdio); + + if (num_tracks <= 0 || first_track < 0) + return TRUE; /* base class will generate 'has no tracks' error */ + + if (src->read_speed != -1) + cdio_set_speed (src->cdio, src->read_speed); + +#if LIBCDIO_VERSION_NUM > 83 + cdtext = cdio_get_cdtext (src->cdio); + + if (NULL == cdtext) + GST_DEBUG_OBJECT (src, "no CD-TEXT on disc"); + else + gst_cdio_add_cdtext_album_tags (GST_OBJECT_CAST (src), cdtext, + audiocdsrc->tags); +#else + gst_cdio_add_cdtext_album_tags (GST_OBJECT_CAST (src), src->cdio, + audiocdsrc->tags); +#endif + + GST_LOG_OBJECT (src, "%u tracks, first track: %d", num_tracks, first_track); + + for (i = 0; i < num_tracks; ++i) { + GstAudioCdSrcTrack track = { 0, }; + gint len_sectors; + + len_sectors = cdio_get_track_sec_count (src->cdio, i + first_track); + + track.num = i + first_track; + track.is_audio = notcdio_track_is_audio_track (src->cdio, i + first_track); + + /* Note: LSN/LBA confusion all around us; in any case, this does + * the right thing here (for cddb id calculations etc. as well) */ + track.start = cdio_get_track_lsn (src->cdio, i + first_track); + track.end = track.start + len_sectors - 1; /* -1? */ + + if (track.is_audio) { + first_audio_sector = MIN (first_audio_sector, track.start); + last_audio_sector = MAX (last_audio_sector, track.end); + } +#if LIBCDIO_VERSION_NUM > 83 + if (NULL != cdtext) + track.tags = gst_cdio_get_cdtext (GST_OBJECT (src), cdtext, + i + first_track); +#else + track.tags = gst_cdio_get_cdtext (GST_OBJECT (src), src->cdio, + i + first_track); +#endif + + gst_audio_cd_src_add_track (GST_AUDIO_CD_SRC (src), &track); + } + + /* Try to detect if we need to byte-order swap the samples coming from the + * drive, which might be the case if the CD drive operates in a different + * endianness than the host CPU's endianness (happens on e.g. Powerbook G4) */ + gst_cdio_cdda_src_detect_drive_endianness (src, first_audio_sector, + last_audio_sector); + + return TRUE; + + /* ERRORS */ +open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open CD device for reading.")), + ("cdio_open() failed: %s", g_strerror (errno))); + return FALSE; + } +not_audio: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Disc is not an Audio CD.")), ("discmode: %d", (gint) discmode)); + + cdio_destroy (src->cdio); + src->cdio = NULL; + return FALSE; + } +} + +static void +gst_cdio_cdda_src_close (GstAudioCdSrc * audiocdsrc) +{ + GstCdioCddaSrc *src = GST_CDIO_CDDA_SRC (audiocdsrc); + + if (src->cdio) { + cdio_destroy (src->cdio); + src->cdio = NULL; + } +} + +static void +gst_cdio_cdda_src_init (GstCdioCddaSrc * src) +{ + src->read_speed = DEFAULT_READ_SPEED; /* don't need atomic access here */ + src->cdio = NULL; +} + +static void +gst_cdio_cdda_src_finalize (GObject * obj) +{ + GstCdioCddaSrc *src = GST_CDIO_CDDA_SRC (obj); + + if (src->cdio) { + cdio_destroy (src->cdio); + src->cdio = NULL; + } + + G_OBJECT_CLASS (gst_cdio_cdda_src_parent_class)->finalize (obj); +} + +static void +gst_cdio_cdda_src_class_init (GstCdioCddaSrcClass * klass) +{ + GstAudioCdSrcClass *audiocdsrc_class = GST_AUDIO_CD_SRC_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = gst_cdio_cdda_src_set_property; + gobject_class->get_property = gst_cdio_cdda_src_get_property; + gobject_class->finalize = gst_cdio_cdda_src_finalize; + + audiocdsrc_class->open = gst_cdio_cdda_src_open; + audiocdsrc_class->close = gst_cdio_cdda_src_close; + audiocdsrc_class->read_sector = gst_cdio_cdda_src_read_sector; +#if 0 + audiocdsrc_class->probe_devices = gst_cdio_cdda_src_probe_devices; + audiocdsrc_class->get_default_device = gst_cdio_cdda_src_get_default_device; +#endif + + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_READ_SPEED, + g_param_spec_int ("read-speed", "Read speed", + "Read from device at the specified speed (-1 = default)", -1, 100, + DEFAULT_READ_SPEED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_set_static_metadata (element_class, + "CD audio source (CDDA)", "Source/File", + "Read audio from CD using libcdio", + "Tim-Philipp Müller "); +} + +static void +gst_cdio_cdda_src_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstCdioCddaSrc *src = GST_CDIO_CDDA_SRC (object); + + switch (prop_id) { + case PROP_READ_SPEED:{ + gint speed; + + speed = g_value_get_int (value); + g_atomic_int_set (&src->read_speed, speed); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_cdio_cdda_src_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstCdioCddaSrc *src = GST_CDIO_CDDA_SRC (object); + + switch (prop_id) { + case PROP_READ_SPEED:{ + gint speed; + + speed = g_atomic_int_get (&src->read_speed); + g_value_set_int (value, speed); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} diff --git a/ext/cdio/gstcdiocddasrc.h b/ext/cdio/gstcdiocddasrc.h new file mode 100644 index 0000000..bee5f6d --- /dev/null +++ b/ext/cdio/gstcdiocddasrc.h @@ -0,0 +1,54 @@ +/* GStreamer + * Copyright (C) 2006 Tim-Philipp Müller + * + * 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_CDIO_CDDA_SRC_H__ +#define __GST_CDIO_CDDA_SRC_H__ + +#include +#include + +#define GST_TYPE_CDIO_CDDA_SRC (gst_cdio_cdda_src_get_type ()) +#define GST_CDIO_CDDA_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_CDIO_CDDA_SRC, GstCdioCddaSrc)) +#define GST_CDIO_CDDA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_CDIO_CDDA_SRC, GstCdioCddaSrcClass)) +#define GST_IS_CDIO_CDDA_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_CDIO_CDDA_SRC)) +#define GST_IS_CDIO_CDDA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_CDIO_CDDA_SRC)) + +typedef struct _GstCdioCddaSrc GstCdioCddaSrc; +typedef struct _GstCdioCddaSrcClass GstCdioCddaSrcClass; + +struct _GstCdioCddaSrc +{ + GstAudioCdSrc audiocdsrc; + + gint read_speed; /* ATOMIC */ + + gboolean swap_le_be; /* Drive produces samples in other endianness */ + + CdIo *cdio; /* NULL if not open */ +}; + +struct _GstCdioCddaSrcClass +{ + GstAudioCdSrcClass audiocdsrc_class; +}; + +GType gst_cdio_cdda_src_get_type (void); + +#endif /* __GST_CDIO_CDDA_SRC_H__ */ + diff --git a/ext/dvdread/Makefile.am b/ext/dvdread/Makefile.am new file mode 100644 index 0000000..30b4ba3 --- /dev/null +++ b/ext/dvdread/Makefile.am @@ -0,0 +1,12 @@ +plugin_LTLIBRARIES = libgstdvdread.la + +libgstdvdread_la_SOURCES = dvdreadsrc.c +libgstdvdread_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(DVDREAD_CFLAGS) +libgstdvdread_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) \ + $(GMODULE_NO_EXPORT_LIBS) $(DVDREAD_LIBS) +libgstdvdread_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstdvdread_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = dvdreadsrc.h + +EXTRA_DIST = README demo-play diff --git a/ext/dvdread/Makefile.in b/ext/dvdread/Makefile.in new file mode 100644 index 0000000..6f6b51b --- /dev/null +++ b/ext/dvdread/Makefile.in @@ -0,0 +1,829 @@ +# 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 = ext/dvdread +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(noinst_HEADERS) README +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstdvdread_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstdvdread_la_OBJECTS = libgstdvdread_la-dvdreadsrc.lo +libgstdvdread_la_OBJECTS = $(am_libgstdvdread_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 = +libgstdvdread_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstdvdread_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstdvdread_la_CFLAGS) $(CFLAGS) \ + $(libgstdvdread_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 = $(libgstdvdread_la_SOURCES) +DIST_SOURCES = $(libgstdvdread_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstdvdread.la +libgstdvdread_la_SOURCES = dvdreadsrc.c +libgstdvdread_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(DVDREAD_CFLAGS) +libgstdvdread_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) \ + $(GMODULE_NO_EXPORT_LIBS) $(DVDREAD_LIBS) + +libgstdvdread_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstdvdread_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = dvdreadsrc.h +EXTRA_DIST = README demo-play +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 ext/dvdread/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/dvdread/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}; \ + } + +libgstdvdread.la: $(libgstdvdread_la_OBJECTS) $(libgstdvdread_la_DEPENDENCIES) $(EXTRA_libgstdvdread_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstdvdread_la_LINK) -rpath $(plugindir) $(libgstdvdread_la_OBJECTS) $(libgstdvdread_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstdvdread_la-dvdreadsrc.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 $@ $< + +libgstdvdread_la-dvdreadsrc.lo: dvdreadsrc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstdvdread_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdvdread_la_CFLAGS) $(CFLAGS) -MT libgstdvdread_la-dvdreadsrc.lo -MD -MP -MF $(DEPDIR)/libgstdvdread_la-dvdreadsrc.Tpo -c -o libgstdvdread_la-dvdreadsrc.lo `test -f 'dvdreadsrc.c' || echo '$(srcdir)/'`dvdreadsrc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstdvdread_la-dvdreadsrc.Tpo $(DEPDIR)/libgstdvdread_la-dvdreadsrc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dvdreadsrc.c' object='libgstdvdread_la-dvdreadsrc.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 $(libgstdvdread_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstdvdread_la_CFLAGS) $(CFLAGS) -c -o libgstdvdread_la-dvdreadsrc.lo `test -f 'dvdreadsrc.c' || echo '$(srcdir)/'`dvdreadsrc.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 + + +# 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/ext/dvdread/README b/ext/dvdread/README new file mode 100644 index 0000000..acf8d08 --- /dev/null +++ b/ext/dvdread/README @@ -0,0 +1,5 @@ +Various Info +============ + +http://members.aol.com/mpucoder/DVD/index.html +http://dvd.sourceforge.net/ diff --git a/ext/dvdread/demo-play b/ext/dvdread/demo-play new file mode 100755 index 0000000..ed9d4d8 --- /dev/null +++ b/ext/dvdread/demo-play @@ -0,0 +1,6 @@ +#!/bin/sh +AUDIOSINK=`gconftool-2 -g /system/gstreamer/0.8/default/audiosink` +VIDEOSINK=`gconftool-2 -g /system/gstreamer/0.8/default/videosink` +gst-launch dvdreadsrc ! dvddemux name=demux .video_00 ! \ + { queue ! mpeg2dec ! videoconvert ! videoscale ! $VIDEOSINK } \ + { demux.audio_00 ! queue ! a52dec ! audioconvert ! audioscale ! $AUDIOSINK } diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c new file mode 100644 index 0000000..e928559 --- /dev/null +++ b/ext/dvdread/dvdreadsrc.c @@ -0,0 +1,1800 @@ +/* GStreamer DVD title source + * Copyright (C) 1999 Erik Walthinsen + * Copyright (C) 2001 Billy Biggs . + * Copyright (C) 2006 Tim-Philipp Müller + * + * 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 "_stdint.h" + +#include +#include +#include +#include +#include + +#include "dvdreadsrc.h" + +#include + +#include + +GST_DEBUG_CATEGORY_STATIC (gstgst_dvd_read_src_debug); +#define GST_CAT_DEFAULT (gstgst_dvd_read_src_debug) + +enum +{ + ARG_0, + ARG_DEVICE, + ARG_TITLE, + ARG_CHAPTER, + ARG_ANGLE +}; + +static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("video/mpeg, mpegversion=2, systemstream=(boolean)true")); + +static GstFormat title_format; +static GstFormat angle_format; +static GstFormat sector_format; +static GstFormat chapter_format; + +static gboolean gst_dvd_read_src_start (GstBaseSrc * basesrc); +static gboolean gst_dvd_read_src_stop (GstBaseSrc * basesrc); +static GstFlowReturn gst_dvd_read_src_create (GstPushSrc * pushsrc, + GstBuffer ** buf); +static gboolean gst_dvd_read_src_src_query (GstBaseSrc * basesrc, + GstQuery * query); +static gboolean gst_dvd_read_src_src_event (GstBaseSrc * basesrc, + GstEvent * event); +static gboolean gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, + gint angle); +static gboolean gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src, + gint chapter); +static gboolean gst_dvd_read_src_goto_sector (GstDvdReadSrc * src, gint angle); +static void gst_dvd_read_src_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_dvd_read_src_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); +static GstEvent *gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src, + const guint * clut); +static gboolean gst_dvd_read_src_get_size (GstDvdReadSrc * src, gint64 * size); +static gboolean gst_dvd_read_src_do_seek (GstBaseSrc * src, GstSegment * s); +static gint64 gst_dvd_read_src_convert_timecode (dvd_time_t * time); +static gint gst_dvd_read_src_get_next_cell (GstDvdReadSrc * src, + pgc_t * pgc, gint cell); +static GstClockTime gst_dvd_read_src_get_time_for_sector (GstDvdReadSrc * src, + guint sector); +static gint gst_dvd_read_src_get_sector_from_time (GstDvdReadSrc * src, + GstClockTime ts); + +static void gst_dvd_read_src_uri_handler_init (gpointer g_iface, + gpointer iface_data); + +#define gst_dvd_read_src_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstDvdReadSrc, gst_dvd_read_src, GST_TYPE_PUSH_SRC, + G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, + gst_dvd_read_src_uri_handler_init)); + +static void +gst_dvd_read_src_finalize (GObject * object) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (object); + + g_free (src->location); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gst_dvd_read_src_init (GstDvdReadSrc * src) +{ + src->dvd = NULL; + src->vts_file = NULL; + src->vmg_file = NULL; + src->dvd_title = NULL; + + src->location = g_strdup ("/dev/dvd"); + src->new_seek = TRUE; + src->new_cell = TRUE; + src->change_cell = FALSE; + src->uri_title = 1; + src->uri_chapter = 1; + src->uri_angle = 1; + + src->title_lang_event_pending = NULL; + src->pending_clut_event = NULL; + + gst_pad_use_fixed_caps (GST_BASE_SRC_PAD (src)); + gst_pad_set_caps (GST_BASE_SRC_PAD (src), + gst_static_pad_template_get_caps (&srctemplate)); +} + +static gboolean +gst_dvd_read_src_is_seekable (GstBaseSrc * src) +{ + return TRUE; +} + +static void +gst_dvd_read_src_class_init (GstDvdReadSrcClass * klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + GstPushSrcClass *gstpushsrc_class = GST_PUSH_SRC_CLASS (klass); + GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass); + + gobject_class->finalize = gst_dvd_read_src_finalize; + gobject_class->set_property = gst_dvd_read_src_set_property; + gobject_class->get_property = gst_dvd_read_src_get_property; + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEVICE, + g_param_spec_string ("device", "Device", + "DVD device location", NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TITLE, + g_param_spec_int ("title", "title", "title", + 1, 999, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CHAPTER, + g_param_spec_int ("chapter", "chapter", "chapter", + 1, 999, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ANGLE, + g_param_spec_int ("angle", "angle", "angle", + 1, 999, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&srctemplate)); + + gst_element_class_set_static_metadata (gstelement_class, "DVD Source", + "Source/File/DVD", + "Access a DVD title/chapter/angle using libdvdread", + "Erik Walthinsen "); + + gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_dvd_read_src_start); + gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_dvd_read_src_stop); + gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_dvd_read_src_src_query); + gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_dvd_read_src_src_event); + gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_dvd_read_src_do_seek); + gstbasesrc_class->is_seekable = + GST_DEBUG_FUNCPTR (gst_dvd_read_src_is_seekable); + + gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_dvd_read_src_create); + + title_format = gst_format_register ("title", "DVD title"); + angle_format = gst_format_register ("angle", "DVD angle"); + sector_format = gst_format_register ("sector", "DVD sector"); + chapter_format = gst_format_register ("chapter", "DVD chapter"); +} + +static gboolean +gst_dvd_read_src_start (GstBaseSrc * basesrc) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc); + + g_return_val_if_fail (src->location != NULL, FALSE); + + GST_DEBUG_OBJECT (src, "Opening DVD '%s'", src->location); + + if ((src->dvd = DVDOpen (src->location)) == NULL) + goto open_failed; + + /* Load the video manager to find out the information about the titles */ + GST_DEBUG_OBJECT (src, "Loading VMG info"); + + if (!(src->vmg_file = ifoOpen (src->dvd, 0))) + goto ifo_open_failed; + + src->tt_srpt = src->vmg_file->tt_srpt; + + src->title = src->uri_title - 1; + src->chapter = src->uri_chapter - 1; + src->angle = src->uri_angle - 1; + + if (!gst_dvd_read_src_goto_title (src, src->title, src->angle)) + goto title_open_failed; + + if (!gst_dvd_read_src_goto_chapter (src, src->chapter)) + goto chapter_open_failed; + + src->new_seek = FALSE; + src->change_cell = TRUE; + + return TRUE; + + /* ERRORS */ +open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD")), + ("DVDOpen(%s) failed: %s", src->location, g_strerror (errno))); + return FALSE; + } +ifo_open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD")), + ("ifoOpen() failed: %s", g_strerror (errno))); + return FALSE; + } +title_open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD title %d"), src->uri_title), (NULL)); + return FALSE; + } +chapter_open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Failed to go to chapter %d of DVD title %d"), + src->uri_chapter, src->uri_title), (NULL)); + return FALSE; + } +} + +static gboolean +gst_dvd_read_src_stop (GstBaseSrc * basesrc) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc); + + if (src->vts_file) { + ifoClose (src->vts_file); + src->vts_file = NULL; + } + if (src->vmg_file) { + ifoClose (src->vmg_file); + src->vmg_file = NULL; + } + if (src->dvd_title) { + DVDCloseFile (src->dvd_title); + src->dvd_title = NULL; + } + if (src->dvd) { + DVDClose (src->dvd); + src->dvd = NULL; + } + src->new_cell = TRUE; + src->new_seek = TRUE; + src->change_cell = FALSE; + src->chapter = 0; + src->title = 0; + src->need_newsegment = TRUE; + src->vts_tmapt = NULL; + if (src->title_lang_event_pending) { + gst_event_unref (src->title_lang_event_pending); + src->title_lang_event_pending = NULL; + } + if (src->pending_clut_event) { + gst_event_unref (src->pending_clut_event); + src->pending_clut_event = NULL; + } + if (src->chapter_starts) { + g_free (src->chapter_starts); + src->chapter_starts = NULL; + } + + GST_LOG_OBJECT (src, "closed DVD"); + + return TRUE; +} + +static void +cur_title_get_chapter_pgc (GstDvdReadSrc * src, gint chapter, gint * p_pgn, + gint * p_pgc_id, pgc_t ** p_pgc) +{ + pgc_t *pgc; + gint pgn, pgc_id; + + g_assert (chapter >= 0 && chapter < src->num_chapters); + + pgc_id = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter].pgcn; + pgn = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter].pgn; + pgc = src->vts_file->vts_pgcit->pgci_srp[pgc_id - 1].pgc; + + *p_pgn = pgn; + *p_pgc_id = pgc_id; + *p_pgc = pgc; +} + +static void +cur_title_get_chapter_bounds (GstDvdReadSrc * src, gint chapter, + gint * p_first_cell, gint * p_last_cell) +{ + pgc_t *pgc; + gint pgn, pgc_id, pgn_next_ch; + + g_assert (chapter >= 0 && chapter < src->num_chapters); + + cur_title_get_chapter_pgc (src, chapter, &pgn, &pgc_id, &pgc); + + *p_first_cell = pgc->program_map[pgn - 1] - 1; + + /* last cell is used as a 'up to boundary', not 'up to and including', + * i.e. it is the first cell not included in the chapter range */ + if (chapter == (src->num_chapters - 1)) { + *p_last_cell = pgc->nr_of_cells; + } else { + pgn_next_ch = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter + 1].pgn; + *p_last_cell = pgc->program_map[pgn_next_ch - 1] - 1; + } + + GST_DEBUG_OBJECT (src, "Chapter %d bounds: %d %d (within %d cells)", + chapter, *p_first_cell, *p_last_cell, pgc->nr_of_cells); +} + +static gboolean +gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src, gint chapter) +{ + gint i; + + /* make sure the chapter number is valid for this title */ + if (chapter < 0 || chapter >= src->num_chapters) { + GST_WARNING_OBJECT (src, "invalid chapter %d (only %d available)", + chapter, src->num_chapters); + chapter = CLAMP (chapter, 0, src->num_chapters - 1); + } + + /* determine which program chain we want to watch. This is + * based on the chapter number */ + cur_title_get_chapter_pgc (src, chapter, &src->pgn, &src->pgc_id, + &src->cur_pgc); + cur_title_get_chapter_bounds (src, chapter, &src->start_cell, + &src->last_cell); + + GST_LOG_OBJECT (src, "Opened chapter %d - cell %d-%d", chapter + 1, + src->start_cell, src->last_cell); + + /* retrieve position */ + src->cur_pack = 0; + for (i = 0; i < chapter; i++) { + gint c1, c2; + + cur_title_get_chapter_bounds (src, i, &c1, &c2); + + while (c1 < c2) { + src->cur_pack += + src->cur_pgc->cell_playback[c1].last_sector - + src->cur_pgc->cell_playback[c1].first_sector; + ++c1; + } + } + + /* prepare reading for new cell */ + src->new_cell = TRUE; + src->next_cell = src->start_cell; + + src->chapter = chapter; + + if (src->pending_clut_event) + gst_event_unref (src->pending_clut_event); + + src->pending_clut_event = + gst_dvd_read_src_make_clut_change_event (src, src->cur_pgc->palette); + + return TRUE; +} + +static void +gst_dvd_read_src_get_chapter_starts (GstDvdReadSrc * src) +{ + GstClockTime uptohere; + guint c; + + g_free (src->chapter_starts); + src->chapter_starts = g_new (GstClockTime, src->num_chapters); + + uptohere = (GstClockTime) 0; + for (c = 0; c < src->num_chapters; ++c) { + GstClockTime chapter_duration = 0; + gint cell_start, cell_end, cell; + gint pgn, pgc_id; + pgc_t *pgc; + + cur_title_get_chapter_pgc (src, c, &pgn, &pgc_id, &pgc); + cur_title_get_chapter_bounds (src, c, &cell_start, &cell_end); + + cell = cell_start; + while (cell < cell_end) { + dvd_time_t *cell_duration; + + cell_duration = &pgc->cell_playback[cell].playback_time; + chapter_duration += gst_dvd_read_src_convert_timecode (cell_duration); + cell = gst_dvd_read_src_get_next_cell (src, pgc, cell); + } + + src->chapter_starts[c] = uptohere; + + GST_INFO_OBJECT (src, "[%02u] Chapter %02u starts at %" GST_TIME_FORMAT + ", dur = %" GST_TIME_FORMAT ", cells %d-%d", src->title + 1, c + 1, + GST_TIME_ARGS (uptohere), GST_TIME_ARGS (chapter_duration), + cell_start, cell_end); + + uptohere += chapter_duration; + } +} + +static gboolean +gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle) +{ + GstStructure *s; + gchar lang_code[3] = { '\0', '\0', '\0' }, *t; + pgc_t *pgc0; + gint title_set_nr; + gint num_titles; + gint pgn0, pgc0_id; + gint i; + + /* make sure our title number is valid */ + num_titles = src->tt_srpt->nr_of_srpts; + GST_INFO_OBJECT (src, "There are %d titles on this DVD", num_titles); + if (title < 0 || title >= num_titles) + goto invalid_title; + + src->num_chapters = src->tt_srpt->title[title].nr_of_ptts; + GST_INFO_OBJECT (src, "Title %d has %d chapters", title + 1, + src->num_chapters); + + /* make sure the angle number is valid for this title */ + src->num_angles = src->tt_srpt->title[title].nr_of_angles; + GST_LOG_OBJECT (src, "Title %d has %d angles", title + 1, src->num_angles); + if (angle < 0 || angle >= src->num_angles) { + GST_WARNING_OBJECT (src, "Invalid angle %d (only %d available)", + angle, src->num_angles); + angle = CLAMP (angle, 0, src->num_angles - 1); + } + + /* load the VTS information for the title set our title is in */ + title_set_nr = src->tt_srpt->title[title].title_set_nr; + src->vts_file = ifoOpen (src->dvd, title_set_nr); + if (src->vts_file == NULL) + goto ifo_open_failed; + + src->ttn = src->tt_srpt->title[title].vts_ttn; + src->vts_ptt_srpt = src->vts_file->vts_ptt_srpt; + + /* interactive title? */ + if (src->num_chapters > 0 && + src->vts_ptt_srpt->title[src->ttn - 1].ptt[0].pgn == 0) { + goto commands_only_pgc; + } + + /* we've got enough info, time to open the title set data */ + src->dvd_title = DVDOpenFile (src->dvd, title_set_nr, DVD_READ_TITLE_VOBS); + if (src->dvd_title == NULL) + goto title_open_failed; + + GST_INFO_OBJECT (src, "Opened title %d, angle %d", title + 1, angle); + src->title = title; + src->angle = angle; + + /* build event */ + + if (src->title_lang_event_pending) { + gst_event_unref (src->title_lang_event_pending); + src->title_lang_event_pending = NULL; + } + + s = gst_structure_new ("application/x-gst-dvd", + "event", G_TYPE_STRING, "dvd-lang-codes", NULL); + + /* so we can filter out invalid/unused streams (same for all chapters) */ + cur_title_get_chapter_pgc (src, 0, &pgn0, &pgc0_id, &pgc0); + + /* audio */ + for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_audio_streams; i++) { + const audio_attr_t *a; + + /* audio stream present? */ + if (pgc0 != NULL && (pgc0->audio_control[i] & 0x8000) == 0) + continue; + + a = &src->vts_file->vtsi_mat->vts_audio_attr[i]; + + t = g_strdup_printf ("audio-%d-format", i); + gst_structure_set (s, t, G_TYPE_INT, (int) a->audio_format, NULL); + g_free (t); + t = g_strdup_printf ("audio-%d-stream", i); + gst_structure_set (s, t, G_TYPE_INT, (int) i, NULL); + g_free (t); + + if (a->lang_type) { + t = g_strdup_printf ("audio-%d-language", i); + lang_code[0] = (a->lang_code >> 8) & 0xff; + lang_code[1] = a->lang_code & 0xff; + gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL); + g_free (t); + } else { + lang_code[0] = '\0'; + } + + GST_INFO_OBJECT (src, "[%02d] Audio %02d: lang='%s', format=%d", + src->title + 1, i, lang_code, (gint) a->audio_format); + } + + /* subtitle */ + for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) { + const subp_attr_t *u; + const video_attr_t *v; + gint sid; + + /* subpicture stream present? */ + if (pgc0 != NULL && (pgc0->subp_control[i] & 0x80000000) == 0) + continue; + + u = &src->vts_file->vtsi_mat->vts_subp_attr[i]; + v = &src->vts_file->vtsi_mat->vts_video_attr; + + sid = i; + if (pgc0 != NULL) { + if (v->display_aspect_ratio == 0) /* 4:3 */ + sid = (pgc0->subp_control[i] >> 24) & 0x1f; + else if (v->display_aspect_ratio == 3) /* 16:9 */ + sid = (pgc0->subp_control[i] >> 8) & 0x1f; + } + + if (u->type) { + t = g_strdup_printf ("subpicture-%d-language", i); + lang_code[0] = (u->lang_code >> 8) & 0xff; + lang_code[1] = u->lang_code & 0xff; + gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL); + t = g_strdup_printf ("subpicture-%d-stream", i); + gst_structure_set (s, t, G_TYPE_INT, (int) sid, NULL); + g_free (t); + t = g_strdup_printf ("subpicture-%d-format", i); + gst_structure_set (s, t, G_TYPE_INT, (int) 0, NULL); + g_free (t); + } else { + lang_code[0] = '\0'; + } + + GST_INFO_OBJECT (src, "[%02d] Subtitle %02d: lang='%s', type=%d", + src->title + 1, sid, lang_code, u->type); + } + + src->title_lang_event_pending = + gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s); + + /* dump seek tables */ + src->vts_tmapt = src->vts_file->vts_tmapt; + if (src->vts_tmapt) { + gint i, j; + + GST_LOG_OBJECT (src, "nr_of_tmaps = %d", src->vts_tmapt->nr_of_tmaps); + for (i = 0; i < src->vts_tmapt->nr_of_tmaps; ++i) { + GST_LOG_OBJECT (src, "======= Table %d ===================", i); + GST_LOG_OBJECT (src, "Offset relative to VTS_TMAPTI: %d", + src->vts_tmapt->tmap_offset[i]); + GST_LOG_OBJECT (src, "Time unit (seconds) : %d", + src->vts_tmapt->tmap[i].tmu); + GST_LOG_OBJECT (src, "Number of entries : %d", + src->vts_tmapt->tmap[i].nr_of_entries); + for (j = 0; j < src->vts_tmapt->tmap[i].nr_of_entries; j++) { + guint64 time; + + time = (guint64) src->vts_tmapt->tmap[i].tmu * (j + 1) * GST_SECOND; + GST_LOG_OBJECT (src, "Time: %" GST_TIME_FORMAT " VOBU " + "Sector: 0x%08x %s", GST_TIME_ARGS (time), + src->vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff, + (src->vts_tmapt->tmap[i].map_ent[j] >> 31) ? "discontinuity" : ""); + } + } + } else { + GST_WARNING_OBJECT (src, "no vts_tmapt - seeking will suck"); + } + + gst_dvd_read_src_get_chapter_starts (src); + + return TRUE; + + /* ERRORS */ +invalid_title: + { + GST_WARNING_OBJECT (src, "Invalid title %d (only %d available)", + title, num_titles); + return FALSE; + } +ifo_open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD title %d"), title_set_nr), + ("ifoOpen(%d) failed: %s", title_set_nr, g_strerror (errno))); + return FALSE; + } +title_open_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD title %d"), title_set_nr), + ("Can't open title VOBS (VTS_%02d_1.VOB)", title_set_nr)); + return FALSE; + } +commands_only_pgc: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, + (_("Could not open DVD title %d. Interactive titles are not supported " + "by this element"), title_set_nr), + ("Commands-only PGC, not supported, use rsndvdbin")); + return FALSE; + } +} + +/* FIXME: double-check this function, compare against original */ +static gint +gst_dvd_read_src_get_next_cell (GstDvdReadSrc * src, pgc_t * pgc, gint cell) +{ + /* Check if we're entering an angle block. */ + if (pgc->cell_playback[cell].block_type != BLOCK_TYPE_ANGLE_BLOCK) + return (cell + 1); + + while (pgc->cell_playback[cell].block_mode != BLOCK_MODE_LAST_CELL) + ++cell; + + return cell + 1; +} + +/* Returns true if the pack is a NAV pack */ +static gboolean +gst_dvd_read_src_is_nav_pack (const guint8 * data, gint lbn, dsi_t * dsi_pack) +{ + if (GST_READ_UINT32_BE (data + 0x26) != 0x000001BF) + return FALSE; + + /* Check that this is substream 0 (PCI) */ + if (data[0x2c] != 0) + return FALSE; + + if (GST_READ_UINT32_BE (data + 0x400) != 0x000001BF) + return FALSE; + + /* Check that this is substream 1 (DSI) */ + if (data[0x406] != 1) + return FALSE; + + /* Check sizes of PCI and DSI packets */ + if (GST_READ_UINT16_BE (data + 0x2a) != 0x03d4) + return FALSE; + + if (GST_READ_UINT16_BE (data + 0x404) != 0x03fa) + return FALSE; + + /* Read the DSI packet into the provided struct and check it */ + navRead_DSI (dsi_pack, (unsigned char *) data + DSI_START_BYTE); + if (lbn != dsi_pack->dsi_gi.nv_pck_lbn) + return FALSE; + + return TRUE; +} + +/* find time for sector from index, returns NONE if there is no exact match */ +static GstClockTime +gst_dvd_read_src_get_time_for_sector (GstDvdReadSrc * src, guint sector) +{ + gint i, j; + + if (src->vts_tmapt == NULL || src->vts_tmapt->nr_of_tmaps == 0) + return GST_CLOCK_TIME_NONE; + + for (i = 0; i < src->vts_tmapt->nr_of_tmaps; ++i) { + for (j = 0; j < src->vts_tmapt->tmap[i].nr_of_entries; ++j) { + if ((src->vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff) == sector) + return (guint64) src->vts_tmapt->tmap[i].tmu * (j + 1) * GST_SECOND; + } + } + + if (sector == 0) + return (GstClockTime) 0; + + return GST_CLOCK_TIME_NONE; +} + +/* returns the sector in the index at (or before) the given time, or -1 */ +static gint +gst_dvd_read_src_get_sector_from_time (GstDvdReadSrc * src, GstClockTime ts) +{ + gint sector, j; + + if (src->vts_tmapt == NULL || src->vts_tmapt->nr_of_tmaps < src->ttn) + return -1; + + sector = 0; + for (j = 0; j < src->vts_tmapt->tmap[src->ttn - 1].nr_of_entries; ++j) { + GstClockTime entry_time; + + entry_time = + (guint64) src->vts_tmapt->tmap[src->ttn - 1].tmu * (j + 1) * GST_SECOND; + if (entry_time <= ts) { + sector = src->vts_tmapt->tmap[src->ttn - 1].map_ent[j] & 0x7fffffff; + } + if (entry_time >= ts) { + return sector; + } + } + + if (ts == 0) + return 0; + + return -1; +} + +typedef enum +{ + GST_DVD_READ_OK = 0, + GST_DVD_READ_ERROR = -1, + GST_DVD_READ_EOS = -2, + GST_DVD_READ_AGAIN = -3 +} GstDvdReadReturn; + +static GstDvdReadReturn +gst_dvd_read_src_read (GstDvdReadSrc * src, gint angle, gint new_seek, + GstBuffer ** p_buf) +{ + GstBuffer *buf; + GstSegment *seg; + guint8 oneblock[DVD_VIDEO_LB_LEN]; + dsi_t dsi_pack; + guint next_vobu, cur_output_size; + gint len; + gint retries; + gint64 next_time; + GstMapInfo map; + + seg = &(GST_BASE_SRC (src)->segment); + + /* playback by cell in this pgc, starting at the cell for our chapter */ + if (new_seek) + src->cur_cell = src->start_cell; + +again: + + if (src->cur_cell >= src->last_cell) { + /* advance to next chapter */ + if (src->chapter == (src->num_chapters - 1) || + (seg->format == chapter_format && seg->stop != -1 && + src->chapter == (seg->stop - 1))) { + GST_DEBUG_OBJECT (src, "end of chapter segment"); + goto eos; + } + + GST_INFO_OBJECT (src, "end of chapter %d, switch to next", + src->chapter + 1); + + ++src->chapter; + gst_dvd_read_src_goto_chapter (src, src->chapter); + + return GST_DVD_READ_AGAIN; + } + + if (src->new_cell || new_seek) { + if (!new_seek) { + src->cur_cell = src->next_cell; + if (src->cur_cell >= src->last_cell) { + GST_LOG_OBJECT (src, "last cell in chapter"); + goto again; + } + } + + /* take angle into account */ + if (src->cur_pgc->cell_playback[src->cur_cell].block_type + == BLOCK_TYPE_ANGLE_BLOCK) + src->cur_cell += angle; + + /* calculate next cell */ + src->next_cell = + gst_dvd_read_src_get_next_cell (src, src->cur_pgc, src->cur_cell); + + /* we loop until we're out of this cell */ + src->cur_pack = src->cur_pgc->cell_playback[src->cur_cell].first_sector; + src->new_cell = FALSE; + GST_DEBUG_OBJECT (src, "Starting new cell %d @ pack %d", src->cur_cell, + src->cur_pack); + } + + if (src->cur_pack >= src->cur_pgc->cell_playback[src->cur_cell].last_sector) { + src->new_cell = TRUE; + GST_LOG_OBJECT (src, "Beyond last sector for cell %d, going to next cell", + src->cur_cell); + return GST_DVD_READ_AGAIN; + } + + /* read NAV packet */ + retries = 0; +nav_retry: + retries++; + + len = DVDReadBlocks (src->dvd_title, src->cur_pack, 1, oneblock); + if (len != 1) + goto read_error; + + if (!gst_dvd_read_src_is_nav_pack (oneblock, src->cur_pack, &dsi_pack)) { + GST_LOG_OBJECT (src, "Skipping nav packet @ pack %d", src->cur_pack); + src->cur_pack++; + + if (retries < 2000) { + goto nav_retry; + } else { + GST_LOG_OBJECT (src, "No nav packet @ pack %d after 2000 blocks", + src->cur_pack); + goto read_error; + } + } + + /* determine where we go next. These values are the ones we + * mostly care about */ + cur_output_size = dsi_pack.dsi_gi.vobu_ea + 1; + + /* If we're not at the end of this cell, we can determine the next + * VOBU to display using the VOBU_SRI information section of the + * DSI. Using this value correctly follows the current angle, + * avoiding the doubled scenes in The Matrix, and makes our life + * really happy. + * + * Otherwise, we set our next address past the end of this cell to + * force the code above to go to the next cell in the program. */ + if (dsi_pack.vobu_sri.next_vobu != SRI_END_OF_CELL) { + next_vobu = src->cur_pack + (dsi_pack.vobu_sri.next_vobu & 0x7fffffff); + } else { + next_vobu = src->cur_pgc->cell_playback[src->cur_cell].last_sector + 1; + } + + g_assert (cur_output_size < 1024); + + /* create the buffer (TODO: use buffer pool?) */ + buf = + gst_buffer_new_allocate (NULL, cur_output_size * DVD_VIDEO_LB_LEN, NULL); + + GST_LOG_OBJECT (src, "Going to read %u sectors @ pack %d", cur_output_size, + src->cur_pack); + + gst_buffer_map (buf, &map, GST_MAP_WRITE); + /* read in and output cursize packs */ + len = + DVDReadBlocks (src->dvd_title, src->cur_pack, cur_output_size, map.data); + + if (len != cur_output_size) + goto block_read_error; + + gst_buffer_unmap (buf, &map); + gst_buffer_resize (buf, 0, cur_output_size * DVD_VIDEO_LB_LEN); + /* GST_BUFFER_OFFSET (buf) = priv->cur_pack * DVD_VIDEO_LB_LEN; */ + GST_BUFFER_TIMESTAMP (buf) = + gst_dvd_read_src_get_time_for_sector (src, src->cur_pack); + + *p_buf = buf; + + GST_LOG_OBJECT (src, "Read %u sectors", cur_output_size); + + src->cur_pack = next_vobu; + + next_time = GST_BUFFER_TIMESTAMP (buf); + if (GST_CLOCK_TIME_IS_VALID (next_time) && seg->format == GST_FORMAT_TIME && + GST_CLOCK_TIME_IS_VALID (seg->stop) && + next_time > seg->stop + 5 * GST_SECOND) { + GST_DEBUG_OBJECT (src, "end of TIME segment"); + goto eos; + } + + return GST_DVD_READ_OK; + + /* ERRORS */ +eos: + { + GST_INFO_OBJECT (src, "Reached end-of-segment/stream - EOS"); + return GST_DVD_READ_EOS; + } +read_error: + { + GST_ERROR_OBJECT (src, "Read failed for block %d", src->cur_pack); + return GST_DVD_READ_ERROR; + } +block_read_error: + { + GST_ERROR_OBJECT (src, "Read failed for %d blocks at %d", + cur_output_size, src->cur_pack); + gst_buffer_unmap (buf, &map); + gst_buffer_unref (buf); + return GST_DVD_READ_ERROR; + } +} + +/* we don't cache the result on purpose */ +static gboolean +gst_dvd_read_descrambler_available (void) +{ + GModule *module; + gpointer sym; + gsize res; + + module = g_module_open ("libdvdcss", 0); + if (module != NULL) { + res = g_module_symbol (module, "dvdcss_open", &sym); + g_module_close (module); + } else { + res = FALSE; + } + + return res; +} + +static GstFlowReturn +gst_dvd_read_src_create (GstPushSrc * pushsrc, GstBuffer ** p_buf) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (pushsrc); + GstPad *srcpad; + gint res; + + g_return_val_if_fail (src->dvd != NULL, GST_FLOW_ERROR); + + srcpad = GST_BASE_SRC (src)->srcpad; + + if (src->need_newsegment) { + GstSegment seg; + + gst_segment_init (&seg, GST_FORMAT_BYTES); + seg.start = src->cur_pack * DVD_VIDEO_LB_LEN; + seg.stop = -1; + seg.time = 0; + gst_pad_push_event (srcpad, gst_event_new_segment (&seg)); + src->need_newsegment = FALSE; + } + + if (src->new_seek) { + gst_dvd_read_src_goto_title (src, src->title, src->angle); + gst_dvd_read_src_goto_chapter (src, src->chapter); + + src->new_seek = FALSE; + src->change_cell = TRUE; + } + + if (src->title_lang_event_pending) { + gst_pad_push_event (srcpad, src->title_lang_event_pending); + src->title_lang_event_pending = NULL; + } + + if (src->pending_clut_event) { + gst_pad_push_event (srcpad, src->pending_clut_event); + src->pending_clut_event = NULL; + } + + /* read it in */ + do { + res = gst_dvd_read_src_read (src, src->angle, src->change_cell, p_buf); + } while (res == GST_DVD_READ_AGAIN); + + switch (res) { + case GST_DVD_READ_ERROR:{ + /* FIXME: figure out a way to detect if scrambling is the problem */ + if (!gst_dvd_read_descrambler_available ()) { + GST_ELEMENT_ERROR (src, RESOURCE, READ, + (_("Could not read DVD. This may be because the DVD is encrypted " + "and a DVD decryption library is not installed.")), (NULL)); + } else { + GST_ELEMENT_ERROR (src, RESOURCE, READ, (_("Could not read DVD.")), + (NULL)); + } + return GST_FLOW_ERROR; + } + case GST_DVD_READ_EOS:{ + return GST_FLOW_EOS; + } + case GST_DVD_READ_OK:{ + src->change_cell = FALSE; + return GST_FLOW_OK; + } + default: + break; + } + + g_return_val_if_reached (GST_FLOW_EOS); +} + +static void +gst_dvd_read_src_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (object); + gboolean started; + + GST_OBJECT_LOCK (src); + started = GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED); + + switch (prop_id) { + case ARG_DEVICE:{ + if (started) { + g_warning ("%s: property '%s' needs to be set before the device is " + "opened", GST_ELEMENT_NAME (src), pspec->name); + break;; + } + + g_free (src->location); + /* clear the filename if we get a NULL (is that possible?) */ + if (g_value_get_string (value) == NULL) { + src->location = g_strdup ("/dev/dvd"); + } else { + src->location = g_strdup (g_value_get_string (value)); + } + break; + } + case ARG_TITLE: + src->uri_title = g_value_get_int (value); + if (started) { + src->title = src->uri_title - 1; + src->new_seek = TRUE; + } + break; + case ARG_CHAPTER: + src->uri_chapter = g_value_get_int (value); + if (started) { + src->chapter = src->uri_chapter - 1; + src->new_seek = TRUE; + } + break; + case ARG_ANGLE: + src->uri_angle = g_value_get_int (value); + if (started) { + src->angle = src->uri_angle - 1; + } + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + + GST_OBJECT_UNLOCK (src); +} + +static void +gst_dvd_read_src_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (object); + + GST_OBJECT_LOCK (src); + + switch (prop_id) { + case ARG_DEVICE: + g_value_set_string (value, src->location); + break; + case ARG_TITLE: + g_value_set_int (value, src->uri_title); + break; + case ARG_CHAPTER: + g_value_set_int (value, src->uri_chapter); + break; + case ARG_ANGLE: + g_value_set_int (value, src->uri_angle); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + + GST_OBJECT_UNLOCK (src); +} + +static gboolean +gst_dvd_read_src_get_size (GstDvdReadSrc * src, gint64 * size) +{ + gboolean ret = FALSE; + + if (src->dvd_title) { + gssize blocks; + + blocks = DVDFileSize (src->dvd_title); + if (blocks >= 0) { + *size = (gint64) blocks *DVD_VIDEO_LB_LEN; + + ret = TRUE; + } else { + GST_WARNING_OBJECT (src, "DVDFileSize(%p) failed!", src->dvd_title); + } + } + + return ret; +} + +/*** Querying and seeking ***/ + +static gboolean +gst_dvd_read_src_handle_seek_event (GstDvdReadSrc * src, GstEvent * event) +{ + GstSeekFlags flags; + GstSeekType cur_type, end_type; + gint64 new_off, total; + GstFormat format; + GstPad *srcpad; + gboolean query_ok; + gdouble rate; + + gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &new_off, + &end_type, NULL); + + if (rate <= 0.0) { + GST_DEBUG_OBJECT (src, "cannot do backwards playback yet"); + return FALSE; + } + + if (end_type != GST_SEEK_TYPE_NONE) { + if ((format != chapter_format && format != GST_FORMAT_TIME) || + end_type != GST_SEEK_TYPE_SET) { + GST_DEBUG_OBJECT (src, "end seek type not supported"); + return FALSE; + } + } + + if (cur_type != GST_SEEK_TYPE_SET) { + GST_DEBUG_OBJECT (src, "only SEEK_TYPE_SET is supported"); + return FALSE; + } + + if (format == angle_format) { + GST_OBJECT_LOCK (src); + if (new_off < 0 || new_off >= src->num_angles) { + GST_OBJECT_UNLOCK (src); + GST_DEBUG_OBJECT (src, "invalid angle %d, only %d available", + src->num_angles, src->num_angles); + return FALSE; + } + src->angle = (gint) new_off; + GST_OBJECT_UNLOCK (src); + GST_DEBUG_OBJECT (src, "switched to angle %d", (gint) new_off + 1); + return TRUE; + } + + if (format != chapter_format && format != title_format && + format != GST_FORMAT_BYTES && format != GST_FORMAT_TIME) { + GST_DEBUG_OBJECT (src, "unsupported seek format %d (%s)", format, + gst_format_get_name (format)); + return FALSE; + } + + if (format == GST_FORMAT_BYTES) { + GST_DEBUG_OBJECT (src, "Requested seek to byte %" G_GUINT64_FORMAT, + new_off); + } else if (format == GST_FORMAT_TIME) { + GST_DEBUG_OBJECT (src, "Requested seek to time %" GST_TIME_FORMAT, + GST_TIME_ARGS (new_off)); + if (gst_dvd_read_src_get_sector_from_time (src, new_off) < 0) { + GST_DEBUG_OBJECT (src, "Can't find sector for requested time"); + return FALSE; + } + } + + srcpad = GST_BASE_SRC_PAD (src); + + /* check whether the seek looks reasonable (ie within possible range) */ + if (format == GST_FORMAT_BYTES) { + GST_OBJECT_LOCK (src); + query_ok = gst_dvd_read_src_get_size (src, &total); + GST_OBJECT_UNLOCK (src); + } else { + query_ok = gst_pad_query_duration (srcpad, format, &total); + } + + if (!query_ok) { + GST_DEBUG_OBJECT (src, "Failed to query duration in format %s", + gst_format_get_name (format)); + return FALSE; + } + + GST_DEBUG_OBJECT (src, "Total %s: %12" G_GINT64_FORMAT, + gst_format_get_name (format), total); + GST_DEBUG_OBJECT (src, "Seek to %s: %12" G_GINT64_FORMAT, + gst_format_get_name (format), new_off); + + if (new_off >= total) { + GST_DEBUG_OBJECT (src, "Seek position out of range"); + return FALSE; + } + + /* set segment to seek format; this allows us to use the do_seek + * virtual function and let the base source handle all the tricky + * stuff for us. We don't use the segment internally anyway */ + /* FIXME: can't take the stream lock here - what to do? */ + GST_OBJECT_LOCK (src); + GST_BASE_SRC (src)->segment.format = format; + GST_BASE_SRC (src)->segment.start = 0; + GST_BASE_SRC (src)->segment.stop = total; + GST_BASE_SRC (src)->segment.duration = total; + GST_OBJECT_UNLOCK (src); + + return GST_BASE_SRC_CLASS (parent_class)->event (GST_BASE_SRC (src), event); +} + +static void +gst_dvd_read_src_get_sector_bounds (GstDvdReadSrc * src, gint * first, + gint * last) +{ + gint c1, c2, tmp; + cur_title_get_chapter_bounds (src, 0, &c1, &tmp); + cur_title_get_chapter_bounds (src, src->num_chapters - 1, &tmp, &c2); + *first = src->cur_pgc->cell_playback[c1].first_sector; + *last = src->cur_pgc->cell_playback[c2].last_sector; +} + +static gboolean +gst_dvd_read_src_do_seek (GstBaseSrc * basesrc, GstSegment * s) +{ + GstDvdReadSrc *src; + + src = GST_DVD_READ_SRC (basesrc); + + GST_DEBUG_OBJECT (src, "Seeking to %s: %12" G_GINT64_FORMAT, + gst_format_get_name (s->format), s->position); + + if (s->format == sector_format || s->format == GST_FORMAT_BYTES + || s->format == GST_FORMAT_TIME) { + guint old; + + old = src->cur_pack; + + if (s->format == sector_format) { + gint first, last; + gst_dvd_read_src_get_sector_bounds (src, &first, &last); + GST_DEBUG_OBJECT (src, "Format is sector, seeking to %" G_GINT64_FORMAT, + s->position); + src->cur_pack = s->position; + if (src->cur_pack < first) + src->cur_pack = first; + if (src->cur_pack > last) + src->cur_pack = last; + } else if (s->format == GST_FORMAT_TIME) { + gint sector; + GST_DEBUG_OBJECT (src, "Format is time"); + + sector = gst_dvd_read_src_get_sector_from_time (src, s->position); + + GST_DEBUG_OBJECT (src, "Time %" GST_TIME_FORMAT " => sector %d", + GST_TIME_ARGS (s->position), sector); + + /* really shouldn't happen, we've checked this earlier ... */ + g_return_val_if_fail (sector >= 0, FALSE); + + src->cur_pack = sector; + } else { + /* byte format */ + gint first, last; + gst_dvd_read_src_get_sector_bounds (src, &first, &last); + GST_DEBUG_OBJECT (src, "Format is byte"); + src->cur_pack = s->position / DVD_VIDEO_LB_LEN; + if (((gint64) src->cur_pack * DVD_VIDEO_LB_LEN) != s->position) { + GST_LOG_OBJECT (src, "rounded down offset %" G_GINT64_FORMAT " => %" + G_GINT64_FORMAT, s->position, + (gint64) src->cur_pack * DVD_VIDEO_LB_LEN); + } + src->cur_pack += first; + } + + if (!gst_dvd_read_src_goto_sector (src, src->angle)) { + GST_DEBUG_OBJECT (src, "seek to sector 0x%08x failed", src->cur_pack); + src->cur_pack = old; + return FALSE; + } + + GST_LOG_OBJECT (src, "seek to sector 0x%08x ok", src->cur_pack); + } else if (s->format == chapter_format) { + if (!gst_dvd_read_src_goto_chapter (src, (gint) s->position)) { + GST_DEBUG_OBJECT (src, "seek to chapter %d failed", + (gint) s->position + 1); + return FALSE; + } + GST_INFO_OBJECT (src, "seek to chapter %d ok", (gint) s->position + 1); + src->chapter = s->position; + } else if (s->format == title_format) { + if (!gst_dvd_read_src_goto_title (src, (gint) s->position, src->angle) || + !gst_dvd_read_src_goto_chapter (src, 0)) { + GST_DEBUG_OBJECT (src, "seek to title %d failed", (gint) s->position); + return FALSE; + } + src->title = (gint) s->position; + src->chapter = 0; + GST_INFO_OBJECT (src, "seek to title %d ok", src->title + 1); + } else { + g_return_val_if_reached (FALSE); + } + + src->need_newsegment = TRUE; + return TRUE; +} + +static gboolean +gst_dvd_read_src_src_event (GstBaseSrc * basesrc, GstEvent * event) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc); + gboolean res; + + GST_LOG_OBJECT (src, "handling %s event", GST_EVENT_TYPE_NAME (event)); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_SEEK: + res = gst_dvd_read_src_handle_seek_event (src, event); + break; + default: + res = GST_BASE_SRC_CLASS (parent_class)->event (basesrc, event); + break; + } + + return res; +} + +static GstEvent * +gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src, + const guint * clut) +{ + GstStructure *structure; + gchar name[16]; + gint i; + + structure = gst_structure_new ("application/x-gst-dvd", + "event", G_TYPE_STRING, "dvd-spu-clut-change", NULL); + + /* Create a separate field for each value in the table. */ + for (i = 0; i < 16; i++) { + g_snprintf (name, sizeof (name), "clut%02d", i); + gst_structure_set (structure, name, G_TYPE_INT, (int) clut[i], NULL); + } + + /* Create the DVD event and put the structure into it. */ + return gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, structure); +} + +static gint64 +gst_dvd_read_src_convert_timecode (dvd_time_t * time) +{ + gint64 ret_time; + const gint64 one_hour = 3600 * GST_SECOND; + const gint64 one_min = 60 * GST_SECOND; + + g_return_val_if_fail ((time->hour >> 4) < 0xa + && (time->hour & 0xf) < 0xa, -1); + g_return_val_if_fail ((time->minute >> 4) < 0x7 + && (time->minute & 0xf) < 0xa, -1); + g_return_val_if_fail ((time->second >> 4) < 0x7 + && (time->second & 0xf) < 0xa, -1); + + ret_time = ((time->hour >> 4) * 10 + (time->hour & 0xf)) * one_hour; + ret_time += ((time->minute >> 4) * 10 + (time->minute & 0xf)) * one_min; + ret_time += ((time->second >> 4) * 10 + (time->second & 0xf)) * GST_SECOND; + + return ret_time; +} + +static gboolean +gst_dvd_read_src_do_duration_query (GstDvdReadSrc * src, GstQuery * query) +{ + GstFormat format; + gint64 val; + + gst_query_parse_duration (query, &format, NULL); + + switch (format) { + case GST_FORMAT_TIME:{ + if (src->cur_pgc == NULL) + return FALSE; + val = gst_dvd_read_src_convert_timecode (&src->cur_pgc->playback_time); + if (val < 0) + return FALSE; + break; + } + case GST_FORMAT_BYTES:{ + if (!gst_dvd_read_src_get_size (src, &val)) + return FALSE; + break; + } + default:{ + if (format == sector_format) { + val = DVDFileSize (src->dvd_title); + } else if (format == title_format) { + val = src->tt_srpt->nr_of_srpts; + } else if (format == chapter_format) { + val = src->num_chapters; + } else if (format == angle_format) { + val = src->tt_srpt->title[src->title].nr_of_angles; + } else { + GST_DEBUG_OBJECT (src, "Don't know how to handle format %d (%s)", + format, gst_format_get_name (format)); + return FALSE; + } + break; + } + } + + GST_LOG_OBJECT (src, "duration = %" G_GINT64_FORMAT " %s", val, + gst_format_get_name (format)); + + gst_query_set_duration (query, format, val); + return TRUE; +} + +static gboolean +gst_dvd_read_src_do_position_query (GstDvdReadSrc * src, GstQuery * query) +{ + GstFormat format; + gint64 val; + + gst_query_parse_position (query, &format, NULL); + + switch (format) { + case GST_FORMAT_BYTES:{ + val = (gint64) src->cur_pack * DVD_VIDEO_LB_LEN; + break; + } + default:{ + if (format == sector_format) { + val = src->cur_pack; + } else if (format == title_format) { + val = src->title; + } else if (format == chapter_format) { + val = src->chapter; + } else if (format == angle_format) { + val = src->angle; + } else { + GST_DEBUG_OBJECT (src, "Don't know how to handle format %d (%s)", + format, gst_format_get_name (format)); + return FALSE; + } + break; + } + } + + GST_LOG_OBJECT (src, "position = %" G_GINT64_FORMAT " %s", val, + gst_format_get_name (format)); + + gst_query_set_position (query, format, val); + return TRUE; +} + +static gboolean +gst_dvd_read_src_do_convert_query (GstDvdReadSrc * src, GstQuery * query) +{ + GstFormat src_format, dest_format; + gboolean ret = FALSE; + gint64 src_val, dest_val = -1; + + gst_query_parse_convert (query, &src_format, &src_val, &dest_format, NULL); + + if (src_format == dest_format) { + dest_val = src_val; + ret = TRUE; + goto done; + } + + /* Formats to consider: TIME, DEFAULT, BYTES, title, chapter, sector. + * Note: title and chapter are counted as starting from 0 here, just like + * in the context of seek events. Another note: DEFAULT format is undefined */ + + if (src_format == GST_FORMAT_BYTES) { + src_format = sector_format; + src_val /= DVD_VIDEO_LB_LEN; + } + + if (src_format == sector_format) { + /* SECTOR => xyz */ + if (dest_format == GST_FORMAT_TIME && src_val < G_MAXUINT) { + dest_val = gst_dvd_read_src_get_time_for_sector (src, (guint) src_val); + ret = (dest_val >= 0); + } else if (dest_format == GST_FORMAT_BYTES) { + dest_val = src_val * DVD_VIDEO_LB_LEN; + ret = TRUE; + } else { + ret = FALSE; + } + } else if (src_format == title_format) { + /* TITLE => xyz */ + if (dest_format == GST_FORMAT_TIME) { + /* not really true, but we use this to trick the base source into + * handling seeks in title-format for us (the source won't know that + * we changed the title in this case) (changing titles should really + * be done with an interface rather than a seek, but for now we're + * stuck with this mechanism. Fix in 0.11) */ + dest_val = (GstClockTime) 0; + ret = TRUE; + } else { + ret = FALSE; + } + } else if (src_format == chapter_format) { + /* CHAPTER => xyz */ + if (dest_format == GST_FORMAT_TIME) { + if (src->num_chapters >= 0 && src_val < src->num_chapters) { + dest_val = src->chapter_starts[src_val]; + ret = TRUE; + } + } else if (dest_format == sector_format) { + } else { + ret = FALSE; + } + } else if (src_format == GST_FORMAT_TIME) { + /* TIME => xyz */ + if (dest_format == sector_format || dest_format == GST_FORMAT_BYTES) { + dest_val = gst_dvd_read_src_get_sector_from_time (src, src_val); + ret = (dest_val >= 0); + if (dest_format == GST_FORMAT_BYTES) + dest_val *= DVD_VIDEO_LB_LEN; + } else if (dest_format == chapter_format) { + if (src->chapter_starts != NULL) { + gint i; + + for (i = src->num_chapters - 1; i >= 0; --i) { + if (src->chapter_starts && src->chapter_starts[i] >= src_val) { + dest_val = i; + ret = TRUE; + break; + } + } + } else { + ret = FALSE; + } + } else { + ret = FALSE; + } + } else { + ret = FALSE; + } + +done: + + if (ret) { + gst_query_set_convert (query, src_format, src_val, dest_format, dest_val); + } + + return ret; +} + +static gboolean +gst_dvd_read_src_src_query (GstBaseSrc * basesrc, GstQuery * query) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc); + gboolean res = TRUE; + + GST_LOG_OBJECT (src, "handling %s query", GST_QUERY_TYPE_NAME (query)); + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_DURATION: + GST_OBJECT_LOCK (src); + if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) { + res = gst_dvd_read_src_do_duration_query (src, query); + } else { + GST_DEBUG_OBJECT (src, "query failed: not started"); + res = FALSE; + } + GST_OBJECT_UNLOCK (src); + break; + case GST_QUERY_POSITION: + GST_OBJECT_LOCK (src); + if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) { + res = gst_dvd_read_src_do_position_query (src, query); + } else { + GST_DEBUG_OBJECT (src, "query failed: not started"); + res = FALSE; + } + GST_OBJECT_UNLOCK (src); + break; + case GST_QUERY_CONVERT: + GST_OBJECT_LOCK (src); + if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) { + res = gst_dvd_read_src_do_convert_query (src, query); + } else { + GST_DEBUG_OBJECT (src, "query failed: not started"); + res = FALSE; + } + GST_OBJECT_UNLOCK (src); + break; + default: + res = GST_BASE_SRC_CLASS (parent_class)->query (basesrc, query); + break; + } + + return res; +} + +static gboolean +gst_dvd_read_src_goto_sector (GstDvdReadSrc * src, int angle) +{ + gint seek_to = src->cur_pack; + gint chapter, next, cur, i; + + /* retrieve position */ + src->cur_pack = 0; + GST_DEBUG_OBJECT (src, "Goto sector %d, angle %d, within %d chapters", + seek_to, angle, src->num_chapters); + + for (i = 0; i < src->num_chapters; i++) { + gint c1, c2; + + cur_title_get_chapter_bounds (src, i, &c1, &c2); + GST_DEBUG_OBJECT (src, " Looking in chapter %d, bounds: %d %d", i, c1, c2); + + for (next = cur = c1; cur < c2;) { + gint first = src->cur_pgc->cell_playback[cur].first_sector; + gint last = src->cur_pgc->cell_playback[cur].last_sector; + GST_DEBUG_OBJECT (src, "Cell %d sector bounds: %d %d", cur, first, last); + cur = next; + if (src->cur_pgc->cell_playback[cur].block_type == BLOCK_TYPE_ANGLE_BLOCK) + cur += angle; + next = gst_dvd_read_src_get_next_cell (src, src->cur_pgc, cur); + /* seeking to 0 should end up at first chapter in any case */ + if ((seek_to >= first && seek_to <= last) || (seek_to == 0 && i == 0)) { + GST_DEBUG_OBJECT (src, "Seek target found in chapter %d", i); + chapter = i; + goto done; + } + } + } + + GST_DEBUG_OBJECT (src, "Seek to sector %u failed", seek_to); + + return FALSE; + +done: + { + /* so chapter $chapter and cell $cur contain our sector + * of interest. Let's go there! */ + GST_INFO_OBJECT (src, "Seek succeeded, going to chapter %u, cell %u", + chapter + 1, cur); + + gst_dvd_read_src_goto_chapter (src, chapter); + src->cur_cell = cur; + src->next_cell = next; + src->new_cell = FALSE; + src->cur_pack = seek_to; + + return TRUE; + } +} + + +/*** URI interface ***/ + +static GstURIType +gst_dvd_read_src_uri_get_type (GType type) +{ + return GST_URI_SRC; +} + +static const gchar *const * +gst_dvd_read_src_uri_get_protocols (GType type) +{ + static const gchar *protocols[] = { "dvd", NULL }; + + return protocols; +} + +static gchar * +gst_dvd_read_src_uri_get_uri (GstURIHandler * handler) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (handler); + gchar *uri; + + GST_OBJECT_LOCK (src); + uri = g_strdup_printf ("dvd://%d,%d,%d", src->uri_title, src->uri_chapter, + src->uri_angle); + GST_OBJECT_UNLOCK (src); + + return uri; +} + +static gboolean +gst_dvd_read_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, + GError ** error) +{ + GstDvdReadSrc *src = GST_DVD_READ_SRC (handler); + + /* parse out the new t/c/a and seek to them */ + { + gchar *location = NULL; + gchar **strs; + gchar **strcur; + gint pos = 0; + + location = gst_uri_get_location (uri); + + GST_OBJECT_LOCK (src); + + src->uri_title = 1; + src->uri_chapter = 1; + src->uri_angle = 1; + + if (!location) + goto empty_location; + + strcur = strs = g_strsplit (location, ",", 0); + while (strcur && *strcur) { + gint val; + + if (!sscanf (*strcur, "%d", &val)) + break; + + if (val <= 0) { + g_warning ("Invalid value %d in URI '%s'. Must be 1 or greater", + val, location); + break; + } + + switch (pos) { + case 0: + src->uri_title = val; + break; + case 1: + src->uri_chapter = val; + break; + case 2: + src->uri_angle = val; + break; + } + + strcur++; + pos++; + } + + if (pos > 0 && GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) { + src->title = src->uri_title - 1; + src->chapter = src->uri_chapter - 1; + src->angle = src->uri_angle - 1; + src->new_seek = TRUE; + } + + g_strfreev (strs); + g_free (location); + + empty_location: + + GST_OBJECT_UNLOCK (src); + } + + return TRUE; +} + +static void +gst_dvd_read_src_uri_handler_init (gpointer g_iface, gpointer iface_data) +{ + GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface; + + iface->get_type = gst_dvd_read_src_uri_get_type; + iface->get_protocols = gst_dvd_read_src_uri_get_protocols; + iface->get_uri = gst_dvd_read_src_uri_get_uri; + iface->set_uri = gst_dvd_read_src_uri_set_uri; +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (gstgst_dvd_read_src_debug, "dvdreadsrc", 0, + "DVD reader element based on dvdreadsrc"); + +#ifdef ENABLE_NLS + GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE, + LOCALEDIR); + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif /* ENABLE_NLS */ + + if (!gst_element_register (plugin, "dvdreadsrc", GST_RANK_NONE, + GST_TYPE_DVD_READ_SRC)) { + return FALSE; + } + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + dvdread, + "Access a DVD with dvdread", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/dvdread/dvdreadsrc.h b/ext/dvdread/dvdreadsrc.h new file mode 100644 index 0000000..4fa6372 --- /dev/null +++ b/ext/dvdread/dvdreadsrc.h @@ -0,0 +1,101 @@ +/* GStreamer DVD title source + * Copyright (C) <1999> Erik Walthinsen + * Copyright (C) <2001> Billy Biggs . + * Copyright (C) <2006> Tim-Philipp Müller + * + * 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_DVD_READ_SRC_H__ +#define __GST_DVD_READ_SRC_H__ + +#include +#include + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GST_TYPE_DVD_READ_SRC (gst_dvd_read_src_get_type()) +#define GST_DVD_READ_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVD_READ_SRC,GstDvdReadSrc)) +#define GST_DVD_READ_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVD_READ_SRC,GstDvdReadSrcClass)) +#define GST_IS_DVD_READ_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVD_READ_SRC)) +#define GST_IS_DVD_READ_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVD_READ_SRC)) + +typedef struct _GstDvdReadSrc GstDvdReadSrc; +typedef struct _GstDvdReadSrcClass GstDvdReadSrcClass; + +struct _GstDvdReadSrc { + GstPushSrc pushsrc; + + /* location */ + gchar *location; + + gboolean new_seek; + gboolean change_cell; + + gboolean new_cell; + + gint uri_title; /* set via the URI handler or properties, */ + gint uri_chapter; /* otherwise not touched; these values */ + gint uri_angle; /* start from 1 */ + + gint title; /* current position while open, set to the */ + gint chapter; /* URI-set values in ::start(). these */ + gint angle; /* values start from 0 */ + + gint start_cell, last_cell, cur_cell; + gint cur_pack; + gint next_cell; + dvd_reader_t *dvd; + ifo_handle_t *vmg_file; + + /* title stuff */ + gint ttn; + tt_srpt_t *tt_srpt; + ifo_handle_t *vts_file; + vts_ptt_srpt_t *vts_ptt_srpt; + vts_tmapt_t *vts_tmapt; + dvd_file_t *dvd_title; + gint num_chapters; + gint num_angles; + + GstClockTime *chapter_starts; /* start time of chapters within title */ + + /* which program chain to watch (based on title and chapter number) */ + pgc_t *cur_pgc; + gint pgc_id; + gint pgn; + + gboolean need_newsegment; + GstEvent *title_lang_event_pending; + GstEvent *pending_clut_event; +}; + +struct _GstDvdReadSrcClass { + GstPushSrcClass parent_class; +}; + +GType gst_dvd_read_src_get_type (void); + +G_END_DECLS + +#endif /* __GST_DVD_READ_SRC_H__ */ + diff --git a/ext/lame/Makefile.am b/ext/lame/Makefile.am new file mode 100644 index 0000000..c7124dd --- /dev/null +++ b/ext/lame/Makefile.am @@ -0,0 +1,11 @@ +plugin_LTLIBRARIES = libgstlame.la + +libgstlame_la_SOURCES = gstlamemp3enc.c plugin.c +libgstlame_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(LAME_CFLAGS) +libgstlame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(LAME_LIBS) +libgstlame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstlame_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gstlamemp3enc.h diff --git a/ext/lame/Makefile.in b/ext/lame/Makefile.in new file mode 100644 index 0000000..6689dc6 --- /dev/null +++ b/ext/lame/Makefile.in @@ -0,0 +1,839 @@ +# 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 = ext/lame +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstlame_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgstlame_la_OBJECTS = libgstlame_la-gstlamemp3enc.lo \ + libgstlame_la-plugin.lo +libgstlame_la_OBJECTS = $(am_libgstlame_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 = +libgstlame_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstlame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstlame_la_CFLAGS) $(CFLAGS) \ + $(libgstlame_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 = $(libgstlame_la_SOURCES) +DIST_SOURCES = $(libgstlame_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstlame.la +libgstlame_la_SOURCES = gstlamemp3enc.c plugin.c +libgstlame_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(LAME_CFLAGS) + +libgstlame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(LAME_LIBS) + +libgstlame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstlame_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gstlamemp3enc.h +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 ext/lame/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/lame/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}; \ + } + +libgstlame.la: $(libgstlame_la_OBJECTS) $(libgstlame_la_DEPENDENCIES) $(EXTRA_libgstlame_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstlame_la_LINK) -rpath $(plugindir) $(libgstlame_la_OBJECTS) $(libgstlame_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstlame_la-gstlamemp3enc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstlame_la-plugin.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 $@ $< + +libgstlame_la-gstlamemp3enc.lo: gstlamemp3enc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstlame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstlame_la_CFLAGS) $(CFLAGS) -MT libgstlame_la-gstlamemp3enc.lo -MD -MP -MF $(DEPDIR)/libgstlame_la-gstlamemp3enc.Tpo -c -o libgstlame_la-gstlamemp3enc.lo `test -f 'gstlamemp3enc.c' || echo '$(srcdir)/'`gstlamemp3enc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstlame_la-gstlamemp3enc.Tpo $(DEPDIR)/libgstlame_la-gstlamemp3enc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstlamemp3enc.c' object='libgstlame_la-gstlamemp3enc.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 $(libgstlame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstlame_la_CFLAGS) $(CFLAGS) -c -o libgstlame_la-gstlamemp3enc.lo `test -f 'gstlamemp3enc.c' || echo '$(srcdir)/'`gstlamemp3enc.c + +libgstlame_la-plugin.lo: plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstlame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstlame_la_CFLAGS) $(CFLAGS) -MT libgstlame_la-plugin.lo -MD -MP -MF $(DEPDIR)/libgstlame_la-plugin.Tpo -c -o libgstlame_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstlame_la-plugin.Tpo $(DEPDIR)/libgstlame_la-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugin.c' object='libgstlame_la-plugin.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 $(libgstlame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstlame_la_CFLAGS) $(CFLAGS) -c -o libgstlame_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.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 + + +# 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/ext/lame/gstlamemp3enc.c b/ext/lame/gstlamemp3enc.c new file mode 100644 index 0000000..ee528be --- /dev/null +++ b/ext/lame/gstlamemp3enc.c @@ -0,0 +1,933 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * Copyright (C) <2004> Wim Taymans + * Copyright (C) <2005> Thomas Vander Stichele + * Copyright (C) <2009> Sebastian Dröge + * + * 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-lamemp3enc + * @see_also: lame, mad, vorbisenc + * + * This element encodes raw integer audio into an MPEG-1 layer 3 (MP3) stream. + * Note that MP3 is not + * a free format, there are licensing and patent issues to take into + * consideration. See Ogg/Vorbis + * for a royalty free (and often higher quality) alternative. + * + * + * Output sample rate + * If no fixed output sample rate is negotiated on the element's src pad, + * the element will choose an optimal sample rate to resample to internally. + * For example, a 16-bit 44.1 KHz mono audio stream encoded at 48 kbit will + * get resampled to 32 KHz. Use filter caps on the src pad to force a + * particular sample rate. + * + * + * Example pipelines + * |[ + * gst-launch -v audiotestsrc wave=sine num-buffers=100 ! audioconvert ! lamemp3enc ! filesink location=sine.mp3 + * ]| Encode a test sine signal to MP3. + * |[ + * gst-launch -v alsasrc ! audioconvert ! lamemp3enc target=bitrate bitrate=192 ! filesink location=alsasrc.mp3 + * ]| Record from a sound card using ALSA and encode to MP3 with an average bitrate of 192kbps + * |[ + * gst-launch -v filesrc location=music.wav ! decodebin ! audioconvert ! audioresample ! lamemp3enc target=quality quality=0 ! id3v2mux ! filesink location=music.mp3 + * ]| Transcode from a .wav file to MP3 (the id3v2mux element is optional) with best VBR quality + * |[ + * gst-launch -v cdda://5 ! audioconvert ! lamemp3enc target=bitrate cbr=true bitrate=192 ! filesink location=track5.mp3 + * ]| Encode Audio CD track 5 to MP3 with a constant bitrate of 192kbps + * |[ + * gst-launch -v audiotestsrc num-buffers=10 ! audio/x-raw,rate=44100,channels=1 ! lamemp3enc target=bitrate cbr=true bitrate=48 ! filesink location=test.mp3 + * ]| Encode to a fixed sample rate + * + * + * Since: 0.10.12 + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include "gstlamemp3enc.h" +#include + +/* lame < 3.98 */ +#ifndef HAVE_LAME_SET_VBR_QUALITY +#define lame_set_VBR_quality(flags,q) lame_set_VBR_q((flags),(int)(q)) +#endif + +GST_DEBUG_CATEGORY_STATIC (debug); +#define GST_CAT_DEFAULT debug + +/* elementfactory information */ + +/* LAMEMP3ENC can do MPEG-1, MPEG-2, and MPEG-2.5, so it has 9 possible + * sample rates it supports */ +static GstStaticPadTemplate gst_lamemp3enc_sink_template = + GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) " GST_AUDIO_NE (S16) ", " + "layout = (string) interleaved, " + "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) 1; " + "audio/x-raw, " + "format = (string) " GST_AUDIO_NE (S16) ", " + "layout = (string) interleaved, " + "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) 2, " "channel-mask = (bitmask) 0x3") + ); + +static GstStaticPadTemplate gst_lamemp3enc_src_template = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/mpeg, " + "mpegversion = (int) 1, " + "layer = (int) 3, " + "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) [ 1, 2 ]") + ); + +/********** Define useful types for non-programmatic interfaces **********/ +enum +{ + LAMEMP3ENC_TARGET_QUALITY = 0, + LAMEMP3ENC_TARGET_BITRATE +}; + +#define GST_TYPE_LAMEMP3ENC_TARGET (gst_lamemp3enc_target_get_type()) +static GType +gst_lamemp3enc_target_get_type (void) +{ + static GType lame_target_type = 0; + static GEnumValue lame_targets[] = { + {LAMEMP3ENC_TARGET_QUALITY, "Quality", "quality"}, + {LAMEMP3ENC_TARGET_BITRATE, "Bitrate", "bitrate"}, + {0, NULL, NULL} + }; + + if (!lame_target_type) { + lame_target_type = + g_enum_register_static ("GstLameMP3EncTarget", lame_targets); + } + return lame_target_type; +} + +enum +{ + LAMEMP3ENC_ENCODING_ENGINE_QUALITY_FAST = 0, + LAMEMP3ENC_ENCODING_ENGINE_QUALITY_STANDARD, + LAMEMP3ENC_ENCODING_ENGINE_QUALITY_HIGH +}; + +#define GST_TYPE_LAMEMP3ENC_ENCODING_ENGINE_QUALITY (gst_lamemp3enc_encoding_engine_quality_get_type()) +static GType +gst_lamemp3enc_encoding_engine_quality_get_type (void) +{ + static GType lame_encoding_engine_quality_type = 0; + static GEnumValue lame_encoding_engine_quality[] = { + {0, "Fast", "fast"}, + {1, "Standard", "standard"}, + {2, "High", "high"}, + {0, NULL, NULL} + }; + + if (!lame_encoding_engine_quality_type) { + lame_encoding_engine_quality_type = + g_enum_register_static ("GstLameMP3EncEncodingEngineQuality", + lame_encoding_engine_quality); + } + return lame_encoding_engine_quality_type; +} + +/********** Standard stuff for signals and arguments **********/ + +enum +{ + ARG_0, + ARG_TARGET, + ARG_BITRATE, + ARG_CBR, + ARG_QUALITY, + ARG_ENCODING_ENGINE_QUALITY, + ARG_MONO +}; + +#define DEFAULT_TARGET LAMEMP3ENC_TARGET_QUALITY +#define DEFAULT_BITRATE 128 +#define DEFAULT_CBR FALSE +#define DEFAULT_QUALITY 4 +#define DEFAULT_ENCODING_ENGINE_QUALITY LAMEMP3ENC_ENCODING_ENGINE_QUALITY_STANDARD +#define DEFAULT_MONO FALSE + +static gboolean gst_lamemp3enc_start (GstAudioEncoder * enc); +static gboolean gst_lamemp3enc_stop (GstAudioEncoder * enc); +static gboolean gst_lamemp3enc_set_format (GstAudioEncoder * enc, + GstAudioInfo * info); +static GstFlowReturn gst_lamemp3enc_handle_frame (GstAudioEncoder * enc, + GstBuffer * in_buf); +static void gst_lamemp3enc_flush (GstAudioEncoder * enc); + +static void gst_lamemp3enc_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_lamemp3enc_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); +static gboolean gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags); + +#define gst_lamemp3enc_parent_class parent_class +G_DEFINE_TYPE (GstLameMP3Enc, gst_lamemp3enc, GST_TYPE_AUDIO_ENCODER); + +static void +gst_lamemp3enc_release_memory (GstLameMP3Enc * lame) +{ + if (lame->lgf) { + lame_close (lame->lgf); + lame->lgf = NULL; + } +} + +static void +gst_lamemp3enc_finalize (GObject * obj) +{ + gst_lamemp3enc_release_memory (GST_LAMEMP3ENC (obj)); + + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + +static void +gst_lamemp3enc_class_init (GstLameMP3EncClass * klass) +{ + GObjectClass *gobject_class; + GstElementClass *gstelement_class; + GstAudioEncoderClass *base_class; + + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; + base_class = (GstAudioEncoderClass *) klass; + + gobject_class->set_property = gst_lamemp3enc_set_property; + gobject_class->get_property = gst_lamemp3enc_get_property; + gobject_class->finalize = gst_lamemp3enc_finalize; + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&gst_lamemp3enc_src_template)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&gst_lamemp3enc_sink_template)); + + gst_element_class_set_static_metadata (gstelement_class, + "L.A.M.E. mp3 encoder", "Codec/Encoder/Audio", + "High-quality free MP3 encoder", + "Sebastian Dröge "); + + base_class->start = GST_DEBUG_FUNCPTR (gst_lamemp3enc_start); + base_class->stop = GST_DEBUG_FUNCPTR (gst_lamemp3enc_stop); + base_class->set_format = GST_DEBUG_FUNCPTR (gst_lamemp3enc_set_format); + base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_lamemp3enc_handle_frame); + base_class->flush = GST_DEBUG_FUNCPTR (gst_lamemp3enc_flush); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TARGET, + g_param_spec_enum ("target", "Target", + "Optimize for quality or bitrate", GST_TYPE_LAMEMP3ENC_TARGET, + DEFAULT_TARGET, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, + g_param_spec_int ("bitrate", "Bitrate (kb/s)", + "Bitrate in kbit/sec (Only valid if target is bitrate, for CBR one " + "of 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, " + "256 or 320)", 8, 320, DEFAULT_BITRATE, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CBR, + g_param_spec_boolean ("cbr", "CBR", "Enforce constant bitrate encoding " + "(Only valid if target is bitrate)", DEFAULT_CBR, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUALITY, + g_param_spec_float ("quality", "Quality", + "VBR Quality from 0 to 10, 0 being the best " + "(Only valid if target is quality)", 0.0, 9.999, + DEFAULT_QUALITY, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), + ARG_ENCODING_ENGINE_QUALITY, g_param_spec_enum ("encoding-engine-quality", + "Encoding Engine Quality", "Quality/speed of the encoding engine, " + "this does not affect the bitrate!", + GST_TYPE_LAMEMP3ENC_ENCODING_ENGINE_QUALITY, + DEFAULT_ENCODING_ENGINE_QUALITY, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MONO, + g_param_spec_boolean ("mono", "Mono", "Enforce mono encoding", + DEFAULT_MONO, + G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +} + +static void +gst_lamemp3enc_init (GstLameMP3Enc * lame) +{ +} + +static gboolean +gst_lamemp3enc_start (GstAudioEncoder * enc) +{ + GstLameMP3Enc *lame = GST_LAMEMP3ENC (enc); + + GST_DEBUG_OBJECT (lame, "start"); + + if (!lame->adapter) + lame->adapter = gst_adapter_new (); + gst_adapter_clear (lame->adapter); + + return TRUE; +} + +static gboolean +gst_lamemp3enc_stop (GstAudioEncoder * enc) +{ + GstLameMP3Enc *lame = GST_LAMEMP3ENC (enc); + + GST_DEBUG_OBJECT (lame, "stop"); + + if (lame->adapter) { + g_object_unref (lame->adapter); + lame->adapter = NULL; + } + + gst_lamemp3enc_release_memory (lame); + return TRUE; +} + +static gboolean +gst_lamemp3enc_set_format (GstAudioEncoder * enc, GstAudioInfo * info) +{ + GstLameMP3Enc *lame; + gint out_samplerate; + gint version; + GstCaps *othercaps; + GstClockTime latency; + GstTagList *tags = NULL; + + lame = GST_LAMEMP3ENC (enc); + + /* parameters already parsed for us */ + lame->samplerate = GST_AUDIO_INFO_RATE (info); + lame->num_channels = GST_AUDIO_INFO_CHANNELS (info); + + /* but we might be asked to reconfigure, so reset */ + gst_lamemp3enc_release_memory (lame); + + GST_DEBUG_OBJECT (lame, "setting up lame"); + if (!gst_lamemp3enc_setup (lame, &tags)) + goto setup_failed; + + out_samplerate = lame_get_out_samplerate (lame->lgf); + if (out_samplerate == 0) + goto zero_output_rate; + if (out_samplerate != lame->samplerate) { + GST_WARNING_OBJECT (lame, + "output samplerate %d is different from incoming samplerate %d", + out_samplerate, lame->samplerate); + } + lame->out_samplerate = out_samplerate; + + version = lame_get_version (lame->lgf); + if (version == 0) + version = 2; + else if (version == 1) + version = 1; + else if (version == 2) + version = 3; + + othercaps = + gst_caps_new_simple ("audio/mpeg", + "mpegversion", G_TYPE_INT, 1, + "mpegaudioversion", G_TYPE_INT, version, + "layer", G_TYPE_INT, 3, + "channels", G_TYPE_INT, lame->mono ? 1 : lame->num_channels, + "rate", G_TYPE_INT, out_samplerate, NULL); + + /* and use these caps */ + gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (enc), othercaps); + gst_caps_unref (othercaps); + + /* base class feedback: + * - we will handle buffers, just hand us all available + * - report latency */ + latency = gst_util_uint64_scale_int (lame_get_framesize (lame->lgf), + GST_SECOND, lame->samplerate); + gst_audio_encoder_set_latency (enc, latency, latency); + + if (tags) { + gst_audio_encoder_merge_tags (enc, tags, GST_TAG_MERGE_REPLACE); + gst_tag_list_unref (tags); + } + + return TRUE; + +zero_output_rate: + { + if (tags) + gst_tag_list_unref (tags); + GST_ELEMENT_ERROR (lame, LIBRARY, SETTINGS, (NULL), + ("LAME mp3 audio decided on a zero sample rate")); + return FALSE; + } +setup_failed: + { + GST_ELEMENT_ERROR (lame, LIBRARY, SETTINGS, + (_("Failed to configure LAME mp3 audio encoder. Check your encoding parameters.")), (NULL)); + return FALSE; + } +} + +/* three underscores for ___rate is really really really + * private as opposed to one underscore */ +/* call this MACRO outside of the NULL state so that we have a higher chance + * of actually having a pipeline and bus to get the message through */ + +#define CHECK_AND_FIXUP_BITRATE(obj,param,rate) \ +G_STMT_START { \ + gint ___rate = rate; \ + gint maxrate = 320; \ + gint multiplier = 64; \ + if (rate == 0) { \ + ___rate = rate; \ + } else if (rate <= 64) { \ + maxrate = 64; multiplier = 8; \ + if ((rate % 8) != 0) ___rate = GST_ROUND_UP_8 (rate); \ + } else if (rate <= 128) { \ + maxrate = 128; multiplier = 16; \ + if ((rate % 16) != 0) ___rate = GST_ROUND_UP_16 (rate); \ + } else if (rate <= 256) { \ + maxrate = 256; multiplier = 32; \ + if ((rate % 32) != 0) ___rate = GST_ROUND_UP_32 (rate); \ + } else if (rate <= 320) { \ + maxrate = 320; multiplier = 64; \ + if ((rate % 64) != 0) ___rate = GST_ROUND_UP_64 (rate); \ + } \ + if (___rate != rate) { \ + GST_ELEMENT_WARNING (obj, LIBRARY, SETTINGS, \ + (_("The requested bitrate %d kbit/s for property '%s' " \ + "is not allowed. " \ + "The bitrate was changed to %d kbit/s."), rate, \ + param, ___rate), \ + ("A bitrate below %d should be a multiple of %d.", \ + maxrate, multiplier)); \ + rate = ___rate; \ + } \ +} G_STMT_END + +static void +gst_lamemp3enc_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstLameMP3Enc *lame; + + lame = GST_LAMEMP3ENC (object); + + switch (prop_id) { + case ARG_TARGET: + lame->target = g_value_get_enum (value); + break; + case ARG_BITRATE: + lame->bitrate = g_value_get_int (value); + break; + case ARG_CBR: + lame->cbr = g_value_get_boolean (value); + break; + case ARG_QUALITY: + lame->quality = g_value_get_float (value); + break; + case ARG_ENCODING_ENGINE_QUALITY: + lame->encoding_engine_quality = g_value_get_enum (value); + break; + case ARG_MONO: + lame->mono = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_lamemp3enc_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstLameMP3Enc *lame; + + lame = GST_LAMEMP3ENC (object); + + switch (prop_id) { + case ARG_TARGET: + g_value_set_enum (value, lame->target); + break; + case ARG_BITRATE: + g_value_set_int (value, lame->bitrate); + break; + case ARG_CBR: + g_value_set_boolean (value, lame->cbr); + break; + case ARG_QUALITY: + g_value_set_float (value, lame->quality); + break; + case ARG_ENCODING_ENGINE_QUALITY: + g_value_set_enum (value, lame->encoding_engine_quality); + break; + case ARG_MONO: + g_value_set_boolean (value, lame->mono); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +/* **** credits go to mpegaudioparse **** */ + +static const guint mp3types_bitrates[2][3][16] = { + { + {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,}, + {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,}, + {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,} + }, + { + {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,}, + {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,}, + {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,} + }, +}; + +static const guint mp3types_freqs[3][3] = { {44100, 48000, 32000}, +{22050, 24000, 16000}, +{11025, 12000, 8000} +}; + +static inline guint +mp3_type_frame_length_from_header (GstLameMP3Enc * lame, guint32 header, + guint * put_version, guint * put_layer, guint * put_channels, + guint * put_bitrate, guint * put_samplerate, guint * put_mode, + guint * put_crc) +{ + guint length; + gulong mode, samplerate, bitrate, layer, channels, padding, crc; + gulong version; + gint lsf, mpg25; + + if (header & (1 << 20)) { + lsf = (header & (1 << 19)) ? 0 : 1; + mpg25 = 0; + } else { + lsf = 1; + mpg25 = 1; + } + + version = 1 + lsf + mpg25; + + layer = 4 - ((header >> 17) & 0x3); + + crc = (header >> 16) & 0x1; + + bitrate = (header >> 12) & 0xF; + bitrate = mp3types_bitrates[lsf][layer - 1][bitrate] * 1000; + /* The caller has ensured we have a valid header, so bitrate can't be + zero here. */ + g_assert (bitrate != 0); + + samplerate = (header >> 10) & 0x3; + samplerate = mp3types_freqs[lsf + mpg25][samplerate]; + + padding = (header >> 9) & 0x1; + + mode = (header >> 6) & 0x3; + channels = (mode == 3) ? 1 : 2; + + switch (layer) { + case 1: + length = 4 * ((bitrate * 12) / samplerate + padding); + break; + case 2: + length = (bitrate * 144) / samplerate + padding; + break; + default: + case 3: + length = (bitrate * 144) / (samplerate << lsf) + padding; + break; + } + + GST_DEBUG_OBJECT (lame, "Calculated mp3 frame length of %u bytes", length); + GST_DEBUG_OBJECT (lame, "samplerate = %lu, bitrate = %lu, version = %lu, " + "layer = %lu, channels = %lu", samplerate, bitrate, version, + layer, channels); + + if (put_version) + *put_version = version; + if (put_layer) + *put_layer = layer; + if (put_channels) + *put_channels = channels; + if (put_bitrate) + *put_bitrate = bitrate; + if (put_samplerate) + *put_samplerate = samplerate; + if (put_mode) + *put_mode = mode; + if (put_crc) + *put_crc = crc; + + return length; +} + +static gboolean +mp3_sync_check (GstLameMP3Enc * lame, unsigned long head) +{ + GST_DEBUG_OBJECT (lame, "checking mp3 header 0x%08lx", head); + /* if it's not a valid sync */ + if ((head & 0xffe00000) != 0xffe00000) { + GST_WARNING_OBJECT (lame, "invalid sync"); + return FALSE; + } + /* if it's an invalid MPEG version */ + if (((head >> 19) & 3) == 0x1) { + GST_WARNING_OBJECT (lame, "invalid MPEG version: 0x%lx", (head >> 19) & 3); + return FALSE; + } + /* if it's an invalid layer */ + if (!((head >> 17) & 3)) { + GST_WARNING_OBJECT (lame, "invalid layer: 0x%lx", (head >> 17) & 3); + return FALSE; + } + /* if it's an invalid bitrate */ + if (((head >> 12) & 0xf) == 0x0) { + GST_WARNING_OBJECT (lame, "invalid bitrate: 0x%lx." + "Free format files are not supported yet", (head >> 12) & 0xf); + return FALSE; + } + if (((head >> 12) & 0xf) == 0xf) { + GST_WARNING_OBJECT (lame, "invalid bitrate: 0x%lx", (head >> 12) & 0xf); + return FALSE; + } + /* if it's an invalid samplerate */ + if (((head >> 10) & 0x3) == 0x3) { + GST_WARNING_OBJECT (lame, "invalid samplerate: 0x%lx", (head >> 10) & 0x3); + return FALSE; + } + + if ((head & 0x3) == 0x2) { + /* Ignore this as there are some files with emphasis 0x2 that can + * be played fine. See BGO #537235 */ + GST_WARNING_OBJECT (lame, "invalid emphasis: 0x%lx", head & 0x3); + } + + return TRUE; +} + +/* **** end mpegaudioparse **** */ + +static GstFlowReturn +gst_lamemp3enc_finish_frames (GstLameMP3Enc * lame) +{ + gint av; + guint header; + GstFlowReturn result = GST_FLOW_OK; + + /* limited parsing, we don't expect to lose sync here */ + while ((result == GST_FLOW_OK) && + ((av = gst_adapter_available (lame->adapter)) > 4)) { + guint rate, version, layer, size; + GstBuffer *mp3_buf; + const guint8 *data; + guint samples_per_frame; + + data = gst_adapter_map (lame->adapter, 4); + header = GST_READ_UINT32_BE (data); + gst_adapter_unmap (lame->adapter); + + if (!mp3_sync_check (lame, header)) + goto invalid_header; + + size = mp3_type_frame_length_from_header (lame, header, &version, &layer, + NULL, NULL, &rate, NULL, NULL); + + if (G_UNLIKELY (layer != 3 || rate != lame->out_samplerate)) { + GST_DEBUG_OBJECT (lame, + "unexpected mp3 header with rate %u, version %u, layer %u", + rate, version, layer); + goto invalid_header; + } + + if (size > av) { + /* pretty likely to occur when lame is holding back on us */ + GST_LOG_OBJECT (lame, "frame size %u (> %d)", size, av); + break; + } + + /* Account for the internal resampling, finish frame really wants to + * know about the number of incoming samples + */ + samples_per_frame = (version == 1) ? 1152 : 576; + samples_per_frame *= lame->samplerate; + samples_per_frame /= lame->out_samplerate; + + /* should be ok now */ + mp3_buf = gst_adapter_take_buffer (lame->adapter, size); + /* number of samples for MPEG-1, layer 3 */ + result = gst_audio_encoder_finish_frame (GST_AUDIO_ENCODER (lame), + mp3_buf, samples_per_frame); + } + +exit: + return result; + + /* ERRORS */ +invalid_header: + { + GST_ELEMENT_ERROR (lame, STREAM, ENCODE, + ("invalid lame mp3 sync header %08X", header), (NULL)); + result = GST_FLOW_ERROR; + goto exit; + } +} + +static GstFlowReturn +gst_lamemp3enc_flush_full (GstLameMP3Enc * lame, gboolean push) +{ + GstBuffer *buf; + GstMapInfo map; + gint size; + GstFlowReturn result = GST_FLOW_OK; + gint av; + + if (!lame->lgf) + return GST_FLOW_OK; + + buf = gst_buffer_new_and_alloc (7200); + gst_buffer_map (buf, &map, GST_MAP_WRITE); + size = lame_encode_flush (lame->lgf, map.data, 7200); + + if (size > 0) { + gst_buffer_unmap (buf, &map); + gst_buffer_resize (buf, 0, size); + GST_DEBUG_OBJECT (lame, "collecting final %d bytes", size); + gst_adapter_push (lame->adapter, buf); + } else { + gst_buffer_unmap (buf, &map); + GST_DEBUG_OBJECT (lame, "no final packet (size=%d, push=%d)", size, push); + gst_buffer_unref (buf); + result = GST_FLOW_OK; + } + + if (push) { + result = gst_lamemp3enc_finish_frames (lame); + } else { + /* never mind */ + gst_adapter_clear (lame->adapter); + } + + /* either way, we expect nothing left */ + if ((av = gst_adapter_available (lame->adapter))) { + /* should this be more fatal ?? */ + GST_WARNING_OBJECT (lame, "unparsed %d bytes left after flushing", av); + /* clean up anyway */ + gst_adapter_clear (lame->adapter); + } + + return result; +} + +static void +gst_lamemp3enc_flush (GstAudioEncoder * enc) +{ + gst_lamemp3enc_flush_full (GST_LAMEMP3ENC (enc), FALSE); +} + +static GstFlowReturn +gst_lamemp3enc_handle_frame (GstAudioEncoder * enc, GstBuffer * in_buf) +{ + GstLameMP3Enc *lame; + gint mp3_buffer_size, mp3_size; + GstBuffer *mp3_buf; + GstFlowReturn result; + gint num_samples; + GstMapInfo in_map, mp3_map; + + lame = GST_LAMEMP3ENC (enc); + + /* squeeze remaining and push */ + if (G_UNLIKELY (in_buf == NULL)) + return gst_lamemp3enc_flush_full (lame, TRUE); + + gst_buffer_map (in_buf, &in_map, GST_MAP_READ); + + num_samples = in_map.size / 2; + + /* allocate space for output */ + mp3_buffer_size = 1.25 * num_samples + 7200; + mp3_buf = gst_buffer_new_allocate (NULL, mp3_buffer_size, NULL); + gst_buffer_map (mp3_buf, &mp3_map, GST_MAP_WRITE); + + /* lame seems to be too stupid to get mono interleaved going */ + if (lame->num_channels == 1) { + mp3_size = lame_encode_buffer (lame->lgf, + (short int *) in_map.data, + (short int *) in_map.data, num_samples, mp3_map.data, mp3_buffer_size); + } else { + mp3_size = lame_encode_buffer_interleaved (lame->lgf, + (short int *) in_map.data, + num_samples / lame->num_channels, mp3_map.data, mp3_buffer_size); + } + gst_buffer_unmap (in_buf, &in_map); + + GST_LOG_OBJECT (lame, "encoded %" G_GSIZE_FORMAT " bytes of audio " + "to %d bytes of mp3", in_map.size, mp3_size); + + if (G_LIKELY (mp3_size > 0)) { + /* unfortunately lame does not provide frame delineated output, + * so collect output and parse into frames ... */ + gst_buffer_unmap (mp3_buf, &mp3_map); + gst_buffer_resize (mp3_buf, 0, mp3_size); + gst_adapter_push (lame->adapter, mp3_buf); + result = gst_lamemp3enc_finish_frames (lame); + } else { + gst_buffer_unmap (mp3_buf, &mp3_map); + if (mp3_size < 0) { + /* eat error ? */ + g_warning ("error %d", mp3_size); + } + gst_buffer_unref (mp3_buf); + result = GST_FLOW_OK; + } + + return result; +} + +/* set up the encoder state */ +static gboolean +gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags) +{ + gboolean res; + +#define CHECK_ERROR(command) G_STMT_START {\ + if ((command) < 0) { \ + GST_ERROR_OBJECT (lame, "setup failed: " G_STRINGIFY (command)); \ + if (*tags) { \ + gst_tag_list_unref (*tags); \ + *tags = NULL; \ + } \ + return FALSE; \ + } \ +}G_STMT_END + + int retval; + GstCaps *allowed_caps; + + GST_DEBUG_OBJECT (lame, "starting setup"); + + lame->lgf = lame_init (); + + if (lame->lgf == NULL) + return FALSE; + + *tags = gst_tag_list_new_empty (); + + /* copy the parameters over */ + lame_set_in_samplerate (lame->lgf, lame->samplerate); + + /* let lame choose default samplerate unless outgoing sample rate is fixed */ + allowed_caps = gst_pad_get_allowed_caps (GST_AUDIO_ENCODER_SRC_PAD (lame)); + + if (allowed_caps != NULL) { + GstStructure *structure; + gint samplerate; + + structure = gst_caps_get_structure (allowed_caps, 0); + + if (gst_structure_get_int (structure, "rate", &samplerate)) { + GST_DEBUG_OBJECT (lame, "Setting sample rate to %d as fixed in src caps", + samplerate); + lame_set_out_samplerate (lame->lgf, samplerate); + } else { + GST_DEBUG_OBJECT (lame, "Letting lame choose sample rate"); + lame_set_out_samplerate (lame->lgf, 0); + } + gst_caps_unref (allowed_caps); + allowed_caps = NULL; + } else { + GST_DEBUG_OBJECT (lame, "No peer yet, letting lame choose sample rate"); + lame_set_out_samplerate (lame->lgf, 0); + } + + CHECK_ERROR (lame_set_num_channels (lame->lgf, lame->num_channels)); + CHECK_ERROR (lame_set_bWriteVbrTag (lame->lgf, 0)); + + if (lame->target == LAMEMP3ENC_TARGET_QUALITY) { + CHECK_ERROR (lame_set_VBR (lame->lgf, vbr_default)); + CHECK_ERROR (lame_set_VBR_quality (lame->lgf, lame->quality)); + } else { + if (lame->cbr) { + CHECK_AND_FIXUP_BITRATE (lame, "bitrate", lame->bitrate); + CHECK_ERROR (lame_set_VBR (lame->lgf, vbr_off)); + CHECK_ERROR (lame_set_brate (lame->lgf, lame->bitrate)); + } else { + CHECK_ERROR (lame_set_VBR (lame->lgf, vbr_abr)); + CHECK_ERROR (lame_set_VBR_mean_bitrate_kbps (lame->lgf, lame->bitrate)); + } + gst_tag_list_add (*tags, GST_TAG_MERGE_REPLACE, GST_TAG_BITRATE, + lame->bitrate * 1000, NULL); + } + + if (lame->encoding_engine_quality == LAMEMP3ENC_ENCODING_ENGINE_QUALITY_FAST) + CHECK_ERROR (lame_set_quality (lame->lgf, 7)); + else if (lame->encoding_engine_quality == + LAMEMP3ENC_ENCODING_ENGINE_QUALITY_HIGH) + CHECK_ERROR (lame_set_quality (lame->lgf, 2)); + /* else default */ + + if (lame->mono) + CHECK_ERROR (lame_set_mode (lame->lgf, MONO)); + + /* initialize the lame encoder */ + if ((retval = lame_init_params (lame->lgf)) >= 0) { + /* FIXME: it would be nice to print out the mode here */ + GST_INFO + ("lame encoder setup (target %s, quality %f, bitrate %d, %d Hz, %d channels)", + (lame->target == LAMEMP3ENC_TARGET_QUALITY) ? "quality" : "bitrate", + lame->quality, lame->bitrate, lame->samplerate, lame->num_channels); + res = TRUE; + } else { + GST_ERROR_OBJECT (lame, "lame_init_params returned %d", retval); + res = FALSE; + } + + GST_DEBUG_OBJECT (lame, "done with setup"); + return res; +#undef CHECK_ERROR +} + +gboolean +gst_lamemp3enc_register (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (debug, "lamemp3enc", 0, "lame mp3 encoder"); + + if (!gst_element_register (plugin, "lamemp3enc", GST_RANK_PRIMARY, + GST_TYPE_LAMEMP3ENC)) + return FALSE; + + return TRUE; +} diff --git a/ext/lame/gstlamemp3enc.h b/ext/lame/gstlamemp3enc.h new file mode 100644 index 0000000..25dbc46 --- /dev/null +++ b/ext/lame/gstlamemp3enc.h @@ -0,0 +1,83 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * Copyright (C) <2009> Sebastian Dröge + * + * 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_LAMEMP3ENC_H__ +#define __GST_LAMEMP3ENC_H__ + + +#include +#include +#include + +G_BEGIN_DECLS + +#include + +#define GST_TYPE_LAMEMP3ENC \ + (gst_lamemp3enc_get_type()) +#define GST_LAMEMP3ENC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LAMEMP3ENC,GstLameMP3Enc)) +#define GST_LAMEMP3ENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_LAMEMP3ENC,GstLameMP3EncClass)) +#define GST_IS_LAMEMP3ENC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LAMEMP3ENC)) +#define GST_IS_LAMEMP3ENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_LAMEMP3ENC)) + +typedef struct _GstLameMP3Enc GstLameMP3Enc; +typedef struct _GstLameMP3EncClass GstLameMP3EncClass; + +/** + * GstLameMP3Enc: + * + * Opaque data structure. + */ +struct _GstLameMP3Enc { + GstAudioEncoder element; + + /*< private >*/ + gint samplerate; + gint out_samplerate; + gint num_channels; + + /* properties */ + gint target; + gint bitrate; + gboolean cbr; + gfloat quality; + gint encoding_engine_quality; + gboolean mono; + + lame_global_flags *lgf; + + GstAdapter *adapter; +}; + +struct _GstLameMP3EncClass { + GstAudioEncoderClass parent_class; +}; + +GType gst_lamemp3enc_get_type(void); +gboolean gst_lamemp3enc_register (GstPlugin * plugin); + +G_END_DECLS + +#endif /* __GST_LAMEMP3ENC_H__ */ diff --git a/ext/lame/plugin.c b/ext/lame/plugin.c new file mode 100644 index 0000000..6aae21e --- /dev/null +++ b/ext/lame/plugin.c @@ -0,0 +1,44 @@ +/* GStreamer + * Copyright (C) <2009> Sebastian Dröge + * + * 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 +#include + +#include "gstlamemp3enc.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ +#ifdef ENABLE_NLS + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif /* ENABLE_NLS */ + + return gst_lamemp3enc_register (plugin); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + lame, + "Encode MP3s with LAME", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/mad/Makefile.am b/ext/mad/Makefile.am new file mode 100644 index 0000000..ca796d6 --- /dev/null +++ b/ext/mad/Makefile.am @@ -0,0 +1,29 @@ +plugin_LTLIBRARIES = libgstmad.la + +libgstmad_la_SOURCES = gstmad.c + +libgstmad_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \ + $(MAD_CFLAGS) +libgstmad_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(MAD_LIBS) +libgstmad_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstmad_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gstmad.h + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer \ + -:PROJECT libgstmad -:SHARED libgstmad \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstmad_la_SOURCES) \ + -:CPPFLAGS $(CPPFLAGS) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstmad_la_CFLAGS) \ + -:LDFLAGS $(libgstmad_la_LDFLAGS) \ + $(libgstmad_la_LIBADD) \ + -ldl \ + -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ + LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ + > $@ diff --git a/ext/mad/Makefile.in b/ext/mad/Makefile.in new file mode 100644 index 0000000..b26a23a --- /dev/null +++ b/ext/mad/Makefile.in @@ -0,0 +1,847 @@ +# 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 = ext/mad +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstmad_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgstmad_la_OBJECTS = libgstmad_la-gstmad.lo +libgstmad_la_OBJECTS = $(am_libgstmad_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 = +libgstmad_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstmad_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstmad_la_CFLAGS) $(CFLAGS) \ + $(libgstmad_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 = $(libgstmad_la_SOURCES) +DIST_SOURCES = $(libgstmad_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstmad.la +libgstmad_la_SOURCES = gstmad.c +libgstmad_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \ + $(MAD_CFLAGS) + +libgstmad_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ + $(GST_BASE_LIBS) $(GST_LIBS) $(MAD_LIBS) + +libgstmad_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstmad_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gstmad.h +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 ext/mad/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/mad/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}; \ + } + +libgstmad.la: $(libgstmad_la_OBJECTS) $(libgstmad_la_DEPENDENCIES) $(EXTRA_libgstmad_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstmad_la_LINK) -rpath $(plugindir) $(libgstmad_la_OBJECTS) $(libgstmad_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstmad_la-gstmad.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 $@ $< + +libgstmad_la-gstmad.lo: gstmad.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstmad_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmad_la_CFLAGS) $(CFLAGS) -MT libgstmad_la-gstmad.lo -MD -MP -MF $(DEPDIR)/libgstmad_la-gstmad.Tpo -c -o libgstmad_la-gstmad.lo `test -f 'gstmad.c' || echo '$(srcdir)/'`gstmad.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstmad_la-gstmad.Tpo $(DEPDIR)/libgstmad_la-gstmad.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstmad.c' object='libgstmad_la-gstmad.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 $(libgstmad_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmad_la_CFLAGS) $(CFLAGS) -c -o libgstmad_la-gstmad.lo `test -f 'gstmad.c' || echo '$(srcdir)/'`gstmad.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 libgstmad -:SHARED libgstmad \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstmad_la_SOURCES) \ + -:CPPFLAGS $(CPPFLAGS) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstmad_la_CFLAGS) \ + -:LDFLAGS $(libgstmad_la_LDFLAGS) \ + $(libgstmad_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/ext/mad/gstmad.c b/ext/mad/gstmad.c new file mode 100644 index 0000000..8de38a8 --- /dev/null +++ b/ext/mad/gstmad.c @@ -0,0 +1,554 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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-mad + * @see_also: lame + * + * MP3 audio decoder. + * + * + * Example pipelines + * |[ + * gst-launch filesrc location=music.mp3 ! mpegaudioparse ! mad ! audioconvert ! audioresample ! autoaudiosink + * ]| Decode and play the mp3 file + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include "gstmad.h" +#include + +enum +{ + ARG_0, + ARG_HALF, + ARG_IGNORE_CRC +}; + +GST_DEBUG_CATEGORY_STATIC (mad_debug); +#define GST_CAT_DEFAULT mad_debug + +static GstStaticPadTemplate mad_src_template_factory = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) " GST_AUDIO_NE (S32) ", " + "layout = (string) interleaved, " + "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) [ 1, 2 ]") + ); + +/* FIXME: make three caps, for mpegversion 1, 2 and 2.5 */ +static GstStaticPadTemplate mad_sink_template_factory = +GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/mpeg, " + "mpegversion = (int) 1, " + "layer = (int) [ 1, 3 ], " + "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) [ 1, 2 ]") + ); + + +static gboolean gst_mad_start (GstAudioDecoder * dec); +static gboolean gst_mad_stop (GstAudioDecoder * dec); +static gboolean gst_mad_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * offset, gint * length); +static GstFlowReturn gst_mad_handle_frame (GstAudioDecoder * dec, + GstBuffer * buffer); +static void gst_mad_flush (GstAudioDecoder * dec, gboolean hard); + +static void gst_mad_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_mad_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +#define parent_class gst_mad_parent_class +G_DEFINE_TYPE (GstMad, gst_mad, GST_TYPE_AUDIO_DECODER); + +static void +gst_mad_class_init (GstMadClass * klass) +{ + GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *element_class = (GstElementClass *) klass; + GstAudioDecoderClass *base_class = (GstAudioDecoderClass *) klass; + + gobject_class->set_property = gst_mad_set_property; + gobject_class->get_property = gst_mad_get_property; + + /* init properties */ + /* currently, string representations are used, we might want to change that */ + /* FIXME: descriptions need to be more technical, + * default values and ranges need to be selected right */ + g_object_class_install_property (gobject_class, ARG_HALF, + g_param_spec_boolean ("half", "Half", "Generate PCM at 1/2 sample rate", + FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_IGNORE_CRC, + g_param_spec_boolean ("ignore-crc", "Ignore CRC", "Ignore CRC errors", + TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&mad_sink_template_factory)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&mad_src_template_factory)); + + gst_element_class_set_static_metadata (element_class, "mad mp3 decoder", + "Codec/Decoder/Audio", + "Uses mad code to decode mp3 streams", + "Wim Taymans "); + + base_class->start = GST_DEBUG_FUNCPTR (gst_mad_start); + base_class->stop = GST_DEBUG_FUNCPTR (gst_mad_stop); + base_class->parse = GST_DEBUG_FUNCPTR (gst_mad_parse); + base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_mad_handle_frame); + base_class->flush = GST_DEBUG_FUNCPTR (gst_mad_flush); +} + +static void +gst_mad_init (GstMad * mad) +{ + GstAudioDecoder *dec; + + dec = GST_AUDIO_DECODER (mad); + gst_audio_decoder_set_tolerance (dec, 20 * GST_MSECOND); + + mad->half = FALSE; + mad->ignore_crc = TRUE; +} + +static gboolean +gst_mad_start (GstAudioDecoder * dec) +{ + GstMad *mad = GST_MAD (dec); + guint options = 0; + + GST_DEBUG_OBJECT (dec, "start"); + mad_stream_init (&mad->stream); + mad_frame_init (&mad->frame); + mad_synth_init (&mad->synth); + mad->rate = 0; + mad->channels = 0; + mad->caps_set = FALSE; + mad->frame.header.samplerate = 0; + if (mad->ignore_crc) + options |= MAD_OPTION_IGNORECRC; + if (mad->half) + options |= MAD_OPTION_HALFSAMPLERATE; + mad_stream_options (&mad->stream, options); + mad->header.mode = -1; + mad->header.emphasis = -1; + mad->eos = FALSE; + + /* call upon legacy upstream byte support (e.g. seeking) */ + gst_audio_decoder_set_estimate_rate (dec, TRUE); + + return TRUE; +} + +static gboolean +gst_mad_stop (GstAudioDecoder * dec) +{ + GstMad *mad = GST_MAD (dec); + + GST_DEBUG_OBJECT (dec, "stop"); + mad_synth_finish (&mad->synth); + mad_frame_finish (&mad->frame); + mad_stream_finish (&mad->stream); + + return TRUE; +} + +static inline gint32 +scale (mad_fixed_t sample) +{ +#if MAD_F_FRACBITS < 28 + /* round */ + sample += (1L << (28 - MAD_F_FRACBITS - 1)); +#endif + + /* clip */ + if (sample >= MAD_F_ONE) + sample = MAD_F_ONE - 1; + else if (sample < -MAD_F_ONE) + sample = -MAD_F_ONE; + +#if MAD_F_FRACBITS < 28 + /* quantize */ + sample >>= (28 - MAD_F_FRACBITS); +#endif + + /* convert from 29 bits to 32 bits */ + return (gint32) (sample << 3); +} + +/* internal function to check if the header has changed and thus the + * caps need to be reset. Only call during normal mode, not resyncing */ +static void +gst_mad_check_caps_reset (GstMad * mad) +{ + guint nchannels; + guint rate; + + nchannels = MAD_NCHANNELS (&mad->frame.header); + +#if MAD_VERSION_MINOR <= 12 + rate = mad->header.sfreq; +#else + rate = mad->frame.header.samplerate; +#endif + + /* rate and channels are not supposed to change in a continuous stream, + * so check this first before doing anything */ + + /* only set caps if they weren't already set for this continuous stream */ + if (!gst_pad_has_current_caps (GST_AUDIO_DECODER_SRC_PAD (mad)) + || mad->channels != nchannels || mad->rate != rate) { + GstAudioInfo info; + static const GstAudioChannelPosition chan_pos[2][2] = { + {GST_AUDIO_CHANNEL_POSITION_MONO}, + {GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, + GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT} + }; + + if (mad->caps_set) { + GST_DEBUG_OBJECT (mad, "Header changed from %d Hz/%d ch to %d Hz/%d ch, " + "failed sync after seek ?", mad->rate, mad->channels, rate, + nchannels); + /* we're conservative on stream changes. However, our *initial* caps + * might have been wrong as well - mad ain't perfect in syncing. So, + * we count caps changes and change if we pass a limit treshold (3). */ + if (nchannels != mad->pending_channels || rate != mad->pending_rate) { + mad->times_pending = 0; + mad->pending_channels = nchannels; + mad->pending_rate = rate; + } + if (++mad->times_pending < 3) + return; + } + + if (mad->stream.options & MAD_OPTION_HALFSAMPLERATE) + rate >>= 1; + + /* we set the caps even when the pad is not connected so they + * can be gotten for streaminfo */ + gst_audio_info_init (&info); + gst_audio_info_set_format (&info, + GST_AUDIO_FORMAT_S32, rate, nchannels, chan_pos[nchannels - 1]); + + gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (mad), &info); + + mad->caps_set = TRUE; + mad->channels = nchannels; + mad->rate = rate; + } +} + +static GstFlowReturn +gst_mad_parse (GstAudioDecoder * dec, GstAdapter * adapter, + gint * _offset, gint * len) +{ + GstMad *mad; + GstFlowReturn ret = GST_FLOW_EOS; + gint av, size, offset; + const guint8 *data; + gboolean eos, sync; + guint8 *guard = NULL; + + mad = GST_MAD (dec); + + av = gst_adapter_available (adapter); + data = gst_adapter_map (adapter, av); + + gst_audio_decoder_get_parse_state (dec, &sync, &eos); + GST_LOG_OBJECT (mad, "parse state sync %d, eos %d", sync, eos); + + if (eos) { + /* This is one streaming hack right there. + * mad will not decode the last frame if it is not followed by + * a number of 0 bytes, due to some buffer overflow, which can + * not be fixed for reasons I did not inquire into, see + * http://www.mars.org/mailman/public/mad-dev/2001-May/000262.html + */ + guard = g_malloc (av + MAD_BUFFER_GUARD); + /* let's be nice and not mess with baseclass state and keep hacks local */ + memcpy (guard, data, av); + memset (guard + av, 0, MAD_BUFFER_GUARD); + GST_DEBUG_OBJECT (mad, "Added %u zero guard bytes in the adapter; " + "using fallback buffer of size %u", + MAD_BUFFER_GUARD, av + MAD_BUFFER_GUARD); + data = guard; + av = av + MAD_BUFFER_GUARD; + } + + /* we basically let mad library do parsing, + * and translate that back to baseclass. + * if a frame is found (and also decoded), subsequent handle_frame + * only needs to synthesize it */ + + offset = 0; + size = 0; + +resume: + if (G_UNLIKELY (offset + MAD_BUFFER_GUARD > av)) + goto exit; + + GST_LOG_OBJECT (mad, "setup mad stream at offset %d (of av %d)", offset, av); + mad_stream_buffer (&mad->stream, data + offset, av - offset); + /* convey sync idea to mad */ + mad->stream.sync = sync; + /* if we get back here, lost sync anyway */ + sync = FALSE; + + while (TRUE) { + GST_LOG_OBJECT (mad, "decoding the header now"); + if (mad_header_decode (&mad->frame.header, &mad->stream) == -1) { + /* HACK it seems mad reports wrong error when it is trying to determine + * free bitrate and scanning for next header */ + if (mad->stream.error == MAD_ERROR_LOSTSYNC) { + const guint8 *ptr = mad->stream.this_frame; + guint32 header; + + if (ptr >= data && ptr < data + av) { + header = GST_READ_UINT32_BE (ptr); + /* looks like possible freeform header with not much data */ + if (((header & 0xFFE00000) == 0xFFE00000) && + (((header >> 12) & 0xF) == 0x0) && (av < 4096)) { + GST_DEBUG_OBJECT (mad, "overriding freeform LOST_SYNC to BUFLEN"); + mad->stream.error = MAD_ERROR_BUFLEN; + } + } + } + if (mad->stream.error == MAD_ERROR_BUFLEN) { + GST_LOG_OBJECT (mad, "not enough data, getting more"); + offset = mad->stream.next_frame - data; + break; + } else if (mad->stream.error == MAD_ERROR_LOSTSYNC) { + GST_LOG_OBJECT (mad, "lost sync"); + continue; + } else { + /* probably some bogus header, basically also lost sync */ + GST_DEBUG_OBJECT (mad, "mad_header_decode had an error: %s", + mad_stream_errorstr (&mad->stream)); + continue; + } + } + + /* could have a frame now, subsequent will confirm */ + offset = mad->stream.this_frame - data; + size = mad->stream.next_frame - mad->stream.this_frame; + g_assert (size); + + GST_LOG_OBJECT (mad, "parsing and decoding one frame now " + "(offset %d, size %d)", offset, size); + if (mad_frame_decode (&mad->frame, &mad->stream) == -1) { + GST_LOG_OBJECT (mad, "got error %d", mad->stream.error); + + /* not enough data, need to wait for next buffer? */ + if (mad->stream.error == MAD_ERROR_BUFLEN) { + /* not really expect this error at this stage anymore + * assume bogus frame and bad sync and move along a bit */ + GST_WARNING_OBJECT (mad, "not enough data (unexpected), moving along"); + offset++; + goto resume; + } else if (mad->stream.error == MAD_ERROR_BADDATAPTR) { + GST_DEBUG_OBJECT (mad, "bad data ptr, skipping presumed frame"); + /* flush past presumed frame */ + offset += size; + goto resume; + } else { + GST_WARNING_OBJECT (mad, "mad_frame_decode had an error: %s", + mad_stream_errorstr (&mad->stream)); + if (!MAD_RECOVERABLE (mad->stream.error)) { + /* well, all may be well enough bytes later on ... */ + GST_AUDIO_DECODER_ERROR (mad, 1, STREAM, DECODE, (NULL), + ("mad error: %s", mad_stream_errorstr (&mad->stream)), ret); + } + /* move along and try again */ + offset++; + goto resume; + } + g_assert_not_reached (); + } + + /* so decoded ok, got a frame now */ + ret = GST_FLOW_OK; + break; + } + +exit: + + gst_adapter_unmap (adapter); + + *_offset = offset; + *len = size; + + /* ensure that if we added some dummy guard bytes above, we don't claim + to have used them as they're unknown to the caller. */ + if (eos) { + g_assert (av >= MAD_BUFFER_GUARD); + av -= MAD_BUFFER_GUARD; + if (*_offset > av) + *_offset = av; + if (*len > av) + *len = av; + g_assert (guard); + g_free (guard); + } + + return ret; +} + +static GstFlowReturn +gst_mad_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer) +{ + GstMad *mad; + GstFlowReturn ret = GST_FLOW_EOS; + GstBuffer *outbuffer; + guint nsamples; + GstMapInfo outmap; + gint32 *outdata; + mad_fixed_t const *left_ch, *right_ch; + + mad = GST_MAD (dec); + + /* no fancy draining */ + if (G_UNLIKELY (!buffer)) + return GST_FLOW_OK; + + /* _parse prepared a frame */ + nsamples = MAD_NSBSAMPLES (&mad->frame.header) * + (mad->stream.options & MAD_OPTION_HALFSAMPLERATE ? 16 : 32); + GST_LOG_OBJECT (mad, "mad frame with %d samples", nsamples); + + /* arrange for initial caps before pushing data, + * and update later on if needed */ + gst_mad_check_caps_reset (mad); + + mad_synth_frame (&mad->synth, &mad->frame); + left_ch = mad->synth.pcm.samples[0]; + right_ch = mad->synth.pcm.samples[1]; + + outbuffer = gst_buffer_new_and_alloc (nsamples * mad->channels * 4); + + gst_buffer_map (outbuffer, &outmap, GST_MAP_WRITE); + outdata = (gint32 *) outmap.data; + + /* output sample(s) in 16-bit signed native-endian PCM */ + if (mad->channels == 1) { + gint count = nsamples; + + while (count--) { + *outdata++ = scale (*left_ch++) & 0xffffffff; + } + } else { + gint count = nsamples; + + while (count--) { + *outdata++ = scale (*left_ch++) & 0xffffffff; + *outdata++ = scale (*right_ch++) & 0xffffffff; + } + } + + gst_buffer_unmap (outbuffer, &outmap); + + ret = gst_audio_decoder_finish_frame (dec, outbuffer, 1); + + return ret; +} + +static void +gst_mad_flush (GstAudioDecoder * dec, gboolean hard) +{ + GstMad *mad; + + mad = GST_MAD (dec); + if (hard) { + mad_frame_mute (&mad->frame); + mad_synth_mute (&mad->synth); + } +} + +static void +gst_mad_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstMad *mad; + + mad = GST_MAD (object); + + switch (prop_id) { + case ARG_HALF: + mad->half = g_value_get_boolean (value); + break; + case ARG_IGNORE_CRC: + mad->ignore_crc = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_mad_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstMad *mad; + + mad = GST_MAD (object); + + switch (prop_id) { + case ARG_HALF: + g_value_set_boolean (value, mad->half); + break; + case ARG_IGNORE_CRC: + g_value_set_boolean (value, mad->ignore_crc); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +/* plugin initialisation */ + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (mad_debug, "mad", 0, "mad mp3 decoding"); + + /* FIXME 0.11: rename to something better like madmp3dec or madmpegaudiodec + * or so? */ + return gst_element_register (plugin, "mad", GST_RANK_SECONDARY, + gst_mad_get_type ()); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + mad, + "mp3 decoding based on the mad library", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/mad/gstmad.h b/ext/mad/gstmad.h new file mode 100644 index 0000000..f3011c1 --- /dev/null +++ b/ext/mad/gstmad.h @@ -0,0 +1,82 @@ +/* GStreamer + * Copyright (C) 2003 Benjamin Otte + * + * 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_MAD_H__ +#define __GST_MAD_H__ + +#include +#include +#include + +#include + +G_BEGIN_DECLS + +#define GST_TYPE_MAD \ + (gst_mad_get_type()) +#define GST_MAD(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MAD,GstMad)) +#define GST_MAD_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MAD,GstMadClass)) +#define GST_IS_MAD(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MAD)) +#define GST_IS_MAD_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MAD)) + + +typedef struct _GstMad GstMad; +typedef struct _GstMadClass GstMadClass; + +struct _GstMad +{ + GstAudioDecoder element; + + /* state */ + struct mad_stream stream; + struct mad_frame frame; + struct mad_synth synth; + + /* info */ + struct mad_header header; + + /* negotiated format */ + gint rate, pending_rate; + gint channels, pending_channels; + gint times_pending; + gboolean caps_set; /* used to keep track of whether to change/update caps */ + + gboolean eos; + + /* properties */ + gboolean half; + gboolean ignore_crc; +}; + +struct _GstMadClass +{ + GstAudioDecoderClass parent_class; +}; + +GType gst_mad_get_type (void); +gboolean gst_mad_register (GstPlugin * plugin); + +G_END_DECLS + +#endif /* __GST_MAD_H__ */ diff --git a/ext/mpeg2dec/Makefile.am b/ext/mpeg2dec/Makefile.am new file mode 100644 index 0000000..593e2c3 --- /dev/null +++ b/ext/mpeg2dec/Makefile.am @@ -0,0 +1,11 @@ +plugin_LTLIBRARIES = libgstmpeg2dec.la + +libgstmpeg2dec_la_SOURCES = gstmpeg2dec.c +libgstmpeg2dec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CFLAGS) $(MPEG2DEC_CFLAGS) +libgstmpeg2dec_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \ + $(GST_LIBS) $(MPEG2DEC_LIBS) +libgstmpeg2dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstmpeg2dec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gstmpeg2dec.h diff --git a/ext/mpeg2dec/Makefile.in b/ext/mpeg2dec/Makefile.in new file mode 100644 index 0000000..99bafd9 --- /dev/null +++ b/ext/mpeg2dec/Makefile.in @@ -0,0 +1,829 @@ +# 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 = ext/mpeg2dec +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstmpeg2dec_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgstmpeg2dec_la_OBJECTS = libgstmpeg2dec_la-gstmpeg2dec.lo +libgstmpeg2dec_la_OBJECTS = $(am_libgstmpeg2dec_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 = +libgstmpeg2dec_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstmpeg2dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstmpeg2dec_la_CFLAGS) $(CFLAGS) \ + $(libgstmpeg2dec_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 = $(libgstmpeg2dec_la_SOURCES) +DIST_SOURCES = $(libgstmpeg2dec_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstmpeg2dec.la +libgstmpeg2dec_la_SOURCES = gstmpeg2dec.c +libgstmpeg2dec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CFLAGS) $(MPEG2DEC_CFLAGS) + +libgstmpeg2dec_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \ + $(GST_LIBS) $(MPEG2DEC_LIBS) + +libgstmpeg2dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstmpeg2dec_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gstmpeg2dec.h +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 ext/mpeg2dec/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/mpeg2dec/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}; \ + } + +libgstmpeg2dec.la: $(libgstmpeg2dec_la_OBJECTS) $(libgstmpeg2dec_la_DEPENDENCIES) $(EXTRA_libgstmpeg2dec_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstmpeg2dec_la_LINK) -rpath $(plugindir) $(libgstmpeg2dec_la_OBJECTS) $(libgstmpeg2dec_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstmpeg2dec_la-gstmpeg2dec.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 $@ $< + +libgstmpeg2dec_la-gstmpeg2dec.lo: gstmpeg2dec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstmpeg2dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmpeg2dec_la_CFLAGS) $(CFLAGS) -MT libgstmpeg2dec_la-gstmpeg2dec.lo -MD -MP -MF $(DEPDIR)/libgstmpeg2dec_la-gstmpeg2dec.Tpo -c -o libgstmpeg2dec_la-gstmpeg2dec.lo `test -f 'gstmpeg2dec.c' || echo '$(srcdir)/'`gstmpeg2dec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstmpeg2dec_la-gstmpeg2dec.Tpo $(DEPDIR)/libgstmpeg2dec_la-gstmpeg2dec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstmpeg2dec.c' object='libgstmpeg2dec_la-gstmpeg2dec.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 $(libgstmpeg2dec_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmpeg2dec_la_CFLAGS) $(CFLAGS) -c -o libgstmpeg2dec_la-gstmpeg2dec.lo `test -f 'gstmpeg2dec.c' || echo '$(srcdir)/'`gstmpeg2dec.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 + + +# 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/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c new file mode 100644 index 0000000..28616c5 --- /dev/null +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -0,0 +1,1109 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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 + +#include + +#include "gstmpeg2dec.h" + +#include +#include + +/* 16byte-aligns a buffer for libmpeg2 */ +#define ALIGN_16(p) ((void *)(((uintptr_t)(p) + 15) & ~((uintptr_t)15))) + +/* mpeg2dec changed a struct name after 0.3.1, here's a workaround */ +/* mpeg2dec also only defined MPEG2_RELEASE after 0.3.1 + #if MPEG2_RELEASE < MPEG2_VERSION(0,3,2) +*/ +#ifndef MPEG2_RELEASE +#define MPEG2_VERSION(a,b,c) ((((a)&0xff)<<16)|(((b)&0xff)<<8)|((c)&0xff)) +#define MPEG2_RELEASE MPEG2_VERSION(0,3,1) +typedef picture_t mpeg2_picture_t; +typedef gint mpeg2_state_t; + +#define STATE_BUFFER 0 +#endif + +GST_DEBUG_CATEGORY_STATIC (mpeg2dec_debug); +#define GST_CAT_DEFAULT (mpeg2dec_debug) +GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE); + +/* Send a warning message about decoding errors after receiving this many + * STATE_INVALID return values from mpeg2_parse. -1 means never. + */ +#define WARN_THRESHOLD (5) + +static GstStaticPadTemplate sink_template_factory = +GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("video/mpeg, " + "mpegversion = (int) [ 1, 2 ], " "systemstream = (boolean) false") + ); + +static GstStaticPadTemplate src_template_factory = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("video/x-raw, " + "format = (string) { YV12, I420, Y42B, Y444 }, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " + "framerate = (fraction) [ 0/1, 2147483647/1 ]") + ); + +#define gst_mpeg2dec_parent_class parent_class +G_DEFINE_TYPE (GstMpeg2dec, gst_mpeg2dec, GST_TYPE_VIDEO_DECODER); + +static void gst_mpeg2dec_finalize (GObject * object); + +/* GstVideoDecoder base class method */ +static gboolean gst_mpeg2dec_open (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_close (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_start (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_stop (GstVideoDecoder * decoder); +static gboolean gst_mpeg2dec_set_format (GstVideoDecoder * decoder, + GstVideoCodecState * state); +static gboolean gst_mpeg2dec_flush (GstVideoDecoder * decoder); +static GstFlowReturn gst_mpeg2dec_finish (GstVideoDecoder * decoder); +static GstFlowReturn gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder, + GstVideoCodecFrame * frame); +static gboolean gst_mpeg2dec_decide_allocation (GstVideoDecoder * decoder, + GstQuery * query); + +static void gst_mpeg2dec_clear_buffers (GstMpeg2dec * mpeg2dec); +static gboolean gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, + GstVideoCodecFrame * in_frame, GstVideoFrame * in_vframe); + +static void +gst_mpeg2dec_class_init (GstMpeg2decClass * klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstVideoDecoderClass *video_decoder_class = GST_VIDEO_DECODER_CLASS (klass); + + gobject_class->finalize = gst_mpeg2dec_finalize; + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&src_template_factory)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&sink_template_factory)); + gst_element_class_set_static_metadata (element_class, + "mpeg1 and mpeg2 video decoder", "Codec/Decoder/Video", + "Uses libmpeg2 to decode MPEG video streams", + "Wim Taymans "); + + video_decoder_class->open = GST_DEBUG_FUNCPTR (gst_mpeg2dec_open); + video_decoder_class->close = GST_DEBUG_FUNCPTR (gst_mpeg2dec_close); + video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_mpeg2dec_start); + video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_mpeg2dec_stop); + video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_mpeg2dec_flush); + video_decoder_class->set_format = GST_DEBUG_FUNCPTR (gst_mpeg2dec_set_format); + video_decoder_class->handle_frame = + GST_DEBUG_FUNCPTR (gst_mpeg2dec_handle_frame); + video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_mpeg2dec_finish); + video_decoder_class->decide_allocation = + GST_DEBUG_FUNCPTR (gst_mpeg2dec_decide_allocation); + + GST_DEBUG_CATEGORY_INIT (mpeg2dec_debug, "mpeg2dec", 0, + "MPEG-2 Video Decoder"); +} + +static void +gst_mpeg2dec_init (GstMpeg2dec * mpeg2dec) +{ + gst_video_decoder_set_packetized (GST_VIDEO_DECODER (mpeg2dec), TRUE); + gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (mpeg2dec), TRUE); + + /* initialize the mpeg2dec acceleration */ +} + +static void +gst_mpeg2dec_finalize (GObject * object) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (object); + + if (mpeg2dec->decoder) { + GST_DEBUG_OBJECT (mpeg2dec, "closing decoder"); + mpeg2_close (mpeg2dec->decoder); + mpeg2dec->decoder = NULL; + } + + gst_mpeg2dec_clear_buffers (mpeg2dec); + g_free (mpeg2dec->dummybuf[3]); + mpeg2dec->dummybuf[3] = NULL; + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static gboolean +gst_mpeg2dec_open (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + mpeg2_accel (MPEG2_ACCEL_DETECT); + if ((mpeg2dec->decoder = mpeg2_init ()) == NULL) + return FALSE; + mpeg2dec->info = mpeg2_info (mpeg2dec->decoder); + + return TRUE; +} + +static gboolean +gst_mpeg2dec_close (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + if (mpeg2dec->decoder) { + mpeg2_close (mpeg2dec->decoder); + mpeg2dec->decoder = NULL; + mpeg2dec->info = NULL; + } + gst_mpeg2dec_clear_buffers (mpeg2dec); + + return TRUE; +} + +static gboolean +gst_mpeg2dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + /* Save input state to be used as reference for output state */ + if (mpeg2dec->input_state) + gst_video_codec_state_unref (mpeg2dec->input_state); + mpeg2dec->input_state = gst_video_codec_state_ref (state); + + return TRUE; +} + +static gboolean +gst_mpeg2dec_start (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_PICTURE; + + return TRUE; +} + +static gboolean +gst_mpeg2dec_stop (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + mpeg2_reset (mpeg2dec->decoder, 0); + mpeg2_skip (mpeg2dec->decoder, 1); + + gst_mpeg2dec_clear_buffers (mpeg2dec); + + if (mpeg2dec->input_state) + gst_video_codec_state_unref (mpeg2dec->input_state); + mpeg2dec->input_state = NULL; + + return TRUE; +} + +static gboolean +gst_mpeg2dec_flush (GstVideoDecoder * decoder) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + + /* reset the initial video state */ + mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_PICTURE; + mpeg2_reset (mpeg2dec->decoder, 1); + mpeg2_skip (mpeg2dec->decoder, 1); + + gst_mpeg2dec_clear_buffers (mpeg2dec); + + return TRUE; +} + +static GstFlowReturn +gst_mpeg2dec_finish (GstVideoDecoder * decoder) +{ + return GST_FLOW_OK; +} + +static gboolean +gst_mpeg2dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) +{ + GstMpeg2dec *dec = GST_MPEG2DEC (decoder); + GstVideoCodecState *state; + GstBufferPool *pool; + guint size, min, max; + GstStructure *config; + GstAllocator *allocator; + GstAllocationParams params; + gboolean update_allocator; + + /* Set allocation parameters to guarantee 16-byte aligned output buffers */ + if (gst_query_get_n_allocation_params (query) > 0) { + gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms); + update_allocator = TRUE; + } else { + allocator = NULL; + gst_allocation_params_init (¶ms); + update_allocator = FALSE; + } + + params.align = MAX (params.align, 15); + + if (update_allocator) + gst_query_set_nth_allocation_param (query, 0, allocator, ¶ms); + else + gst_query_add_allocation_param (query, allocator, ¶ms); + if (allocator) + gst_object_unref (allocator); + + /* Now chain up to the parent class to guarantee that we can + * get a buffer pool from the query */ + if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder, + query)) + return FALSE; + + state = gst_video_decoder_get_output_state (decoder); + + gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); + + dec->has_cropping = FALSE; + config = gst_buffer_pool_get_config (pool); + if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) { + gst_buffer_pool_config_add_option (config, + GST_BUFFER_POOL_OPTION_VIDEO_META); + dec->has_cropping = + gst_query_find_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, + NULL); + } + + if (dec->has_cropping) { + GstCaps *caps; + + /* Calculate uncropped size */ + size = MAX (size, dec->decoded_info.size); + caps = gst_video_info_to_caps (&dec->decoded_info); + gst_buffer_pool_config_set_params (config, caps, size, min, max); + gst_caps_unref (caps); + } + + gst_buffer_pool_set_config (pool, config); + + gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max); + + gst_object_unref (pool); + gst_video_codec_state_unref (state); + + return TRUE; +} + +static GstFlowReturn +gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, GstVideoCodecFrame * in_frame, + GstVideoFrame * input_vframe) +{ + GstVideoCodecState *state; + GstVideoInfo *info; + GstVideoInfo *dinfo; + guint c, n_planes; + GstVideoFrame output_frame; + GstFlowReturn ret; + + state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (dec)); + info = &state->info; + dinfo = &dec->decoded_info; + + GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, dec, + "Copying input buffer %ux%u (%" G_GSIZE_FORMAT ") to output buffer " + "%ux%u (%" G_GSIZE_FORMAT ")", dinfo->width, dinfo->height, + dinfo->size, info->width, info->height, info->size); + + ret = + gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (dec), + in_frame); + if (ret != GST_FLOW_OK) + goto beach; + + if (!gst_video_frame_map (&output_frame, info, in_frame->output_buffer, + GST_MAP_WRITE)) + goto map_fail; + + n_planes = GST_VIDEO_FRAME_N_PLANES (&output_frame); + for (c = 0; c < n_planes; c++) { + guint w, h, j; + guint8 *sp, *dp; + gint ss, ds; + + sp = GST_VIDEO_FRAME_PLANE_DATA (input_vframe, c); + dp = GST_VIDEO_FRAME_PLANE_DATA (&output_frame, c); + + ss = GST_VIDEO_FRAME_PLANE_STRIDE (input_vframe, c); + ds = GST_VIDEO_FRAME_PLANE_STRIDE (&output_frame, c); + + w = MIN (ABS (ss), ABS (ds)); + h = GST_VIDEO_FRAME_COMP_HEIGHT (&output_frame, c); + + GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy plane %u, w:%u h:%u ", c, w, h); + + for (j = 0; j < h; j++) { + memcpy (dp, sp, w); + dp += ds; + sp += ss; + } + } + + gst_video_frame_unmap (&output_frame); + + GST_BUFFER_FLAGS (in_frame->output_buffer) = + GST_BUFFER_FLAGS (input_vframe->buffer); + +beach: + gst_video_codec_state_unref (state); + + return ret; + +map_fail: + { + GST_ERROR_OBJECT (dec, "Failed to map output frame"); + gst_video_codec_state_unref (state); + return GST_FLOW_ERROR; + } +} + +static void +frame_user_data_destroy_notify (GstBuffer * buf) +{ + GST_DEBUG ("Releasing buffer %p", buf); + if (buf) + gst_buffer_unref (buf); +} + +static GstFlowReturn +gst_mpeg2dec_alloc_sized_buf (GstMpeg2dec * mpeg2dec, guint size, + GstVideoCodecFrame * frame, GstBuffer ** buffer) +{ + GstFlowReturn ret = GST_FLOW_OK; + GstVideoCodecState *state; + + state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (mpeg2dec)); + + if (!mpeg2dec->need_cropping || mpeg2dec->has_cropping) { + /* need parsed input, but that might be slightly bogus, + * so avoid giving up altogether and mark it as error */ + if (frame->output_buffer) { + gst_buffer_replace (&frame->output_buffer, NULL); + GST_VIDEO_DECODER_ERROR (mpeg2dec, 1, STREAM, DECODE, + ("decoding error"), ("Input not correctly parsed"), ret); + } + ret = + gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (mpeg2dec), + frame); + *buffer = frame->output_buffer; + } else { + GstAllocationParams params = { 0, 15, 0, 0 }; + + *buffer = gst_buffer_new_allocate (NULL, size, ¶ms); + gst_video_codec_frame_set_user_data (frame, *buffer, + (GDestroyNotify) frame_user_data_destroy_notify); + } + + gst_video_codec_state_unref (state); + + return ret; +} + +typedef struct +{ + gint id; + GstVideoFrame frame; +} GstMpeg2DecBuffer; + +static void +gst_mpeg2dec_clear_buffers (GstMpeg2dec * mpeg2dec) +{ + GList *l; + while ((l = g_list_first (mpeg2dec->buffers))) { + GstMpeg2DecBuffer *mbuf = l->data; + gst_video_frame_unmap (&mbuf->frame); + g_slice_free (GstMpeg2DecBuffer, mbuf); + mpeg2dec->buffers = g_list_delete_link (mpeg2dec->buffers, l); + } +} + +static void +gst_mpeg2dec_save_buffer (GstMpeg2dec * mpeg2dec, gint id, + GstVideoFrame * frame) +{ + GstMpeg2DecBuffer *mbuf; + + GST_LOG_OBJECT (mpeg2dec, "Saving local info for frame %d", id); + + mbuf = g_slice_new0 (GstMpeg2DecBuffer); + mbuf->id = id; + mbuf->frame = *frame; + + mpeg2dec->buffers = g_list_prepend (mpeg2dec->buffers, mbuf); +} + +static gint +gst_mpeg2dec_buffer_compare (GstMpeg2DecBuffer * mbuf, gconstpointer id) +{ + if (mbuf->id == GPOINTER_TO_INT (id)) + return 0; + return -1; +} + +static void +gst_mpeg2dec_discard_buffer (GstMpeg2dec * mpeg2dec, gint id) +{ + GList *l = g_list_find_custom (mpeg2dec->buffers, GINT_TO_POINTER (id), + (GCompareFunc) gst_mpeg2dec_buffer_compare); + + if (l) { + GstMpeg2DecBuffer *mbuf = l->data; + gst_video_frame_unmap (&mbuf->frame); + g_slice_free (GstMpeg2DecBuffer, mbuf); + mpeg2dec->buffers = g_list_delete_link (mpeg2dec->buffers, l); + GST_LOG_OBJECT (mpeg2dec, "Discarded local info for frame %d", id); + } else { + GST_WARNING ("Could not find buffer %d, will be leaked until next reset", + id); + } +} + +static GstVideoFrame * +gst_mpeg2dec_get_buffer (GstMpeg2dec * mpeg2dec, gint id) +{ + GList *l = g_list_find_custom (mpeg2dec->buffers, GINT_TO_POINTER (id), + (GCompareFunc) gst_mpeg2dec_buffer_compare); + + if (l) { + GstMpeg2DecBuffer *mbuf = l->data; + return &mbuf->frame; + } + + return NULL; +} + +static GstFlowReturn +gst_mpeg2dec_alloc_buffer (GstMpeg2dec * mpeg2dec, GstVideoCodecFrame * frame, + GstBuffer ** buffer) +{ + GstFlowReturn ret; + GstVideoFrame vframe; + guint8 *buf[3]; + + ret = + gst_mpeg2dec_alloc_sized_buf (mpeg2dec, mpeg2dec->decoded_info.size, + frame, buffer); + if (G_UNLIKELY (ret != GST_FLOW_OK)) + goto beach; + + if (mpeg2dec->need_cropping && mpeg2dec->has_cropping) { + GstVideoCropMeta *crop; + GstVideoCodecState *state; + GstVideoInfo *vinfo; + + state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (mpeg2dec)); + vinfo = &state->info; + + crop = gst_buffer_add_video_crop_meta (frame->output_buffer); + /* we can do things slightly more efficient when we know that + * downstream understands clipping */ + crop->x = 0; + crop->y = 0; + crop->width = vinfo->width; + crop->height = vinfo->height; + + gst_video_codec_state_unref (state); + } + + if (!gst_video_frame_map (&vframe, &mpeg2dec->decoded_info, *buffer, + GST_MAP_READ | GST_MAP_WRITE)) + goto map_fail; + + buf[0] = GST_VIDEO_FRAME_PLANE_DATA (&vframe, 0); + buf[1] = GST_VIDEO_FRAME_PLANE_DATA (&vframe, 1); + buf[2] = GST_VIDEO_FRAME_PLANE_DATA (&vframe, 2); + + GST_DEBUG_OBJECT (mpeg2dec, "set_buf: %p %p %p, frame %i", + buf[0], buf[1], buf[2], frame->system_frame_number); + + /* Note: We use a non-null 'id' value to make the distinction + * between the dummy buffers (which have an id of NULL) and the + * ones we did */ + mpeg2_set_buf (mpeg2dec->decoder, buf, + GINT_TO_POINTER (frame->system_frame_number + 1)); + gst_mpeg2dec_save_buffer (mpeg2dec, frame->system_frame_number, &vframe); + +beach: + return ret; + +map_fail: + { + GST_ERROR_OBJECT (mpeg2dec, "Failed to map frame"); + return GST_FLOW_ERROR; + } +} + +static void +init_dummybuf (GstMpeg2dec * mpeg2dec) +{ + g_free (mpeg2dec->dummybuf[3]); + + /* libmpeg2 needs 16 byte aligned buffers... care for this here */ + mpeg2dec->dummybuf[3] = g_malloc0 (mpeg2dec->decoded_info.size + 15); + mpeg2dec->dummybuf[0] = ALIGN_16 (mpeg2dec->dummybuf[3]); + mpeg2dec->dummybuf[1] = + mpeg2dec->dummybuf[0] + + GST_VIDEO_INFO_PLANE_OFFSET (&mpeg2dec->decoded_info, 1); + mpeg2dec->dummybuf[2] = + mpeg2dec->dummybuf[0] + + GST_VIDEO_INFO_PLANE_OFFSET (&mpeg2dec->decoded_info, 2); +} + +static GstFlowReturn +handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) +{ + GstFlowReturn ret = GST_FLOW_OK; + GstClockTime latency; + const mpeg2_sequence_t *sequence; + GstVideoCodecState *state; + GstVideoInfo *dinfo = &mpeg2dec->decoded_info; + GstVideoInfo *vinfo; + GstVideoInfo pre_crop_info; + GstVideoFormat format; + + sequence = info->sequence; + + if (sequence->frame_period == 0) + goto invalid_frame_period; + + /* mpeg2 video can only be from 16x16 to 4096x4096. Everything + * else is a corrupted file */ + if (sequence->width > 4096 || sequence->width < 16 || + sequence->height > 4096 || sequence->height < 16) + goto invalid_size; + + GST_DEBUG_OBJECT (mpeg2dec, + "widthxheight: %dx%d , decoded_widthxheight: %dx%d", + sequence->picture_width, sequence->picture_height, sequence->width, + sequence->height); + + if (sequence->picture_width != sequence->width || + sequence->picture_height != sequence->height) { + GST_DEBUG_OBJECT (mpeg2dec, "we need to crop"); + mpeg2dec->need_cropping = TRUE; + } else { + GST_DEBUG_OBJECT (mpeg2dec, "no cropping needed"); + mpeg2dec->need_cropping = FALSE; + } + + /* get subsampling */ + if (sequence->chroma_width < sequence->width) { + /* horizontally subsampled */ + if (sequence->chroma_height < sequence->height) { + /* and vertically subsamples */ + format = GST_VIDEO_FORMAT_I420; + } else { + format = GST_VIDEO_FORMAT_Y42B; + } + } else { + /* not subsampled */ + format = GST_VIDEO_FORMAT_Y444; + } + + state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (mpeg2dec), + format, sequence->picture_width, sequence->picture_height, + mpeg2dec->input_state); + vinfo = &state->info; + + /* If we don't have a valid upstream PAR override it */ + if (GST_VIDEO_INFO_PAR_N (vinfo) == 1 && + GST_VIDEO_INFO_PAR_D (vinfo) == 1 && + sequence->pixel_width != 0 && sequence->pixel_height != 0) { +#if MPEG2_RELEASE >= MPEG2_VERSION(0,5,0) + guint pixel_width, pixel_height; + if (mpeg2_guess_aspect (sequence, &pixel_width, &pixel_height)) { + vinfo->par_n = pixel_width; + vinfo->par_d = pixel_height; + } +#else + vinfo->par_n = sequence->pixel_width; + vinfo->par_d = sequence->pixel_height; +#endif + GST_DEBUG_OBJECT (mpeg2dec, "Setting PAR %d x %d", + vinfo->par_n, vinfo->par_d); + } + vinfo->fps_n = 27000000; + vinfo->fps_d = sequence->frame_period; + + if (!(sequence->flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) + vinfo->interlace_mode = GST_VIDEO_INTERLACE_MODE_MIXED; + else + vinfo->interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; + + vinfo->chroma_site = GST_VIDEO_CHROMA_SITE_MPEG2; + vinfo->colorimetry.range = GST_VIDEO_COLOR_RANGE_16_235; + + if (sequence->flags & SEQ_FLAG_COLOUR_DESCRIPTION) { + /* do color description */ + switch (sequence->colour_primaries) { + case 1: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_BT709; + break; + case 4: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_BT470M; + break; + case 5: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_BT470BG; + break; + case 6: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M; + break; + case 7: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE240M; + break; + /* 0 forbidden */ + /* 2 unspecified */ + /* 3 reserved */ + /* 8-255 reseved */ + default: + vinfo->colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN; + break; + } + /* matrix coefficients */ + switch (sequence->matrix_coefficients) { + case 1: + vinfo->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT709; + break; + case 4: + vinfo->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_FCC; + break; + case 5: + case 6: + vinfo->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601; + break; + case 7: + vinfo->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_SMPTE240M; + break; + /* 0 forbidden */ + /* 2 unspecified */ + /* 3 reserved */ + /* 8-255 reseved */ + default: + vinfo->colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_UNKNOWN; + break; + } + /* transfer characteristics */ + switch (sequence->transfer_characteristics) { + case 1: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_BT709; + break; + case 4: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_GAMMA22; + break; + case 5: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_GAMMA28; + break; + case 6: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_BT709; + break; + case 7: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_SMPTE240M; + break; + case 8: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_GAMMA10; + break; + /* 0 forbidden */ + /* 2 unspecified */ + /* 3 reserved */ + /* 9-255 reseved */ + default: + vinfo->colorimetry.transfer = GST_VIDEO_TRANSFER_UNKNOWN; + break; + } + } + + GST_DEBUG_OBJECT (mpeg2dec, + "sequence flags: %d, frame period: %d, frame rate: %d/%d", + sequence->flags, sequence->frame_period, vinfo->fps_n, vinfo->fps_d); + GST_DEBUG_OBJECT (mpeg2dec, "profile: %02x, colour_primaries: %d", + sequence->profile_level_id, sequence->colour_primaries); + GST_DEBUG_OBJECT (mpeg2dec, "transfer chars: %d, matrix coef: %d", + sequence->transfer_characteristics, sequence->matrix_coefficients); + GST_DEBUG_OBJECT (mpeg2dec, + "FLAGS: CONSTRAINED_PARAMETERS:%d, PROGRESSIVE_SEQUENCE:%d", + sequence->flags & SEQ_FLAG_CONSTRAINED_PARAMETERS, + sequence->flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE); + GST_DEBUG_OBJECT (mpeg2dec, "FLAGS: LOW_DELAY:%d, COLOUR_DESCRIPTION:%d", + sequence->flags & SEQ_FLAG_LOW_DELAY, + sequence->flags & SEQ_FLAG_COLOUR_DESCRIPTION); + + /* we store the codec size before cropping */ + *dinfo = *vinfo; + gst_video_info_set_format (&pre_crop_info, format, sequence->width, + sequence->height); + dinfo->width = sequence->width; + dinfo->height = sequence->height; + dinfo->size = pre_crop_info.size; + memcpy (dinfo->stride, pre_crop_info.stride, sizeof (pre_crop_info.stride)); + memcpy (dinfo->offset, pre_crop_info.offset, sizeof (pre_crop_info.offset)); + + /* Mpeg2dec has 2 frame latency to produce a picture and 1 frame latency in + * it's parser */ + latency = gst_util_uint64_scale (3, vinfo->fps_d, vinfo->fps_n); + gst_video_decoder_set_latency (GST_VIDEO_DECODER (mpeg2dec), latency, + latency); + + if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (mpeg2dec))) + goto negotiation_fail; + + gst_video_codec_state_unref (state); + + mpeg2_custom_fbuf (mpeg2dec->decoder, 1); + + init_dummybuf (mpeg2dec); + + /* Pump in some null buffers, because otherwise libmpeg2 doesn't + * initialise the discard_fbuf->id */ + mpeg2_set_buf (mpeg2dec->decoder, mpeg2dec->dummybuf, NULL); + mpeg2_set_buf (mpeg2dec->decoder, mpeg2dec->dummybuf, NULL); + mpeg2_set_buf (mpeg2dec->decoder, mpeg2dec->dummybuf, NULL); + gst_mpeg2dec_clear_buffers (mpeg2dec); + + return ret; + +invalid_frame_period: + { + GST_WARNING_OBJECT (mpeg2dec, "Frame period is 0!"); + return GST_FLOW_ERROR; + } +invalid_size: + { + GST_ERROR_OBJECT (mpeg2dec, "Invalid frame dimensions: %d x %d", + sequence->width, sequence->height); + return GST_FLOW_ERROR; + } + +negotiation_fail: + { + GST_WARNING_OBJECT (mpeg2dec, "Failed to negotiate with downstream"); + gst_video_codec_state_unref (state); + return GST_FLOW_ERROR; + } +} + +static GstFlowReturn +handle_picture (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info, + GstVideoCodecFrame * frame) +{ + GstFlowReturn ret; + gint type; + const gchar *type_str = NULL; + gboolean key_frame = FALSE; + const mpeg2_picture_t *picture = info->current_picture; + GstBuffer *buffer; + + ret = gst_mpeg2dec_alloc_buffer (mpeg2dec, frame, &buffer); + if (ret != GST_FLOW_OK) + return ret; + + type = picture->flags & PIC_MASK_CODING_TYPE; + switch (type) { + case PIC_FLAG_CODING_TYPE_I: + key_frame = TRUE; + mpeg2_skip (mpeg2dec->decoder, 0); + type_str = "I"; + break; + case PIC_FLAG_CODING_TYPE_P: + type_str = "P"; + break; + case PIC_FLAG_CODING_TYPE_B: + type_str = "B"; + break; + default: + gst_video_codec_frame_ref (frame); + ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (mpeg2dec), frame); + GST_VIDEO_DECODER_ERROR (mpeg2dec, 1, STREAM, DECODE, + ("decoding error"), ("Invalid picture type"), ret); + return ret; + } + + GST_DEBUG_OBJECT (mpeg2dec, "handle picture type %s", type_str); + GST_DEBUG_OBJECT (mpeg2dec, "picture %s, frame %i", + key_frame ? ", kf," : " ", frame->system_frame_number); + + if (GST_VIDEO_INFO_IS_INTERLACED (&mpeg2dec->decoded_info)) { + /* This implies SEQ_FLAG_PROGRESSIVE_SEQUENCE is not set */ + if (picture->flags & PIC_FLAG_TOP_FIELD_FIRST) { + GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF); + } + if (!(picture->flags & PIC_FLAG_PROGRESSIVE_FRAME)) { + GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED); + } +#if MPEG2_RELEASE >= MPEG2_VERSION(0,5,0) + /* repeat field introduced in 0.5.0 */ + if (picture->flags & PIC_FLAG_REPEAT_FIRST_FIELD) { + GST_BUFFER_FLAG_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF); + } +#endif + } + + if (mpeg2dec->discont_state == MPEG2DEC_DISC_NEW_PICTURE && key_frame) { + mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_KEYFRAME; + } + + GST_DEBUG_OBJECT (mpeg2dec, + "picture: %s %s %s %s %s fields:%d ts:%" + GST_TIME_FORMAT, + (picture->flags & PIC_FLAG_PROGRESSIVE_FRAME ? "prog" : " "), + (picture->flags & PIC_FLAG_TOP_FIELD_FIRST ? "tff" : " "), +#if MPEG2_RELEASE >= MPEG2_VERSION(0,5,0) + (picture->flags & PIC_FLAG_REPEAT_FIRST_FIELD ? "rff" : " "), +#else + "unknown rff", +#endif + (picture->flags & PIC_FLAG_SKIP ? "skip" : " "), + (picture->flags & PIC_FLAG_COMPOSITE_DISPLAY ? "composite" : " "), + picture->nb_fields, GST_TIME_ARGS (frame->pts)); + + return ret; +} + +static GstFlowReturn +handle_slice (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) +{ + GstFlowReturn ret = GST_FLOW_OK; + GstVideoCodecFrame *frame; + const mpeg2_picture_t *picture; + gboolean key_frame = FALSE; + GstVideoCodecState *state; + + GST_DEBUG_OBJECT (mpeg2dec, + "fbuf:%p display_picture:%p current_picture:%p fbuf->id:%d", + info->display_fbuf, info->display_picture, info->current_picture, + GPOINTER_TO_INT (info->display_fbuf->id) - 1); + + /* Note, the fbuf-id is shifted by 1 to make the difference between + * NULL values (used by dummy buffers) and 'real' values */ + frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (mpeg2dec), + GPOINTER_TO_INT (info->display_fbuf->id) - 1); + if (!frame) + goto no_frame; + picture = info->display_picture; + key_frame = (picture->flags & PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_I; + + GST_DEBUG_OBJECT (mpeg2dec, "picture flags: %d, type: %d, keyframe: %d", + picture->flags, picture->flags & PIC_MASK_CODING_TYPE, key_frame); + + if (key_frame) { + mpeg2_skip (mpeg2dec->decoder, 0); + } + + if (mpeg2dec->discont_state == MPEG2DEC_DISC_NEW_KEYFRAME && key_frame) + mpeg2dec->discont_state = MPEG2DEC_DISC_NONE; + + if (picture->flags & PIC_FLAG_SKIP) { + GST_DEBUG_OBJECT (mpeg2dec, "dropping buffer because of skip flag"); + ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (mpeg2dec), frame); + mpeg2_skip (mpeg2dec->decoder, 1); + return ret; + } + + if (mpeg2dec->discont_state != MPEG2DEC_DISC_NONE) { + GST_DEBUG_OBJECT (mpeg2dec, "dropping buffer, discont state %d", + mpeg2dec->discont_state); + ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (mpeg2dec), frame); + return ret; + } + + state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (mpeg2dec)); + + /* do cropping if the target region is smaller than the input one */ + if (mpeg2dec->need_cropping && !mpeg2dec->has_cropping) { + GstVideoFrame *vframe; + + if (gst_video_decoder_get_max_decode_time (GST_VIDEO_DECODER (mpeg2dec), + frame) < 0) { + GST_DEBUG_OBJECT (mpeg2dec, "dropping buffer crop, too late"); + ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (mpeg2dec), frame); + goto beach; + } + + GST_DEBUG_OBJECT (mpeg2dec, "cropping buffer"); + vframe = gst_mpeg2dec_get_buffer (mpeg2dec, frame->system_frame_number); + g_assert (vframe != NULL); + ret = gst_mpeg2dec_crop_buffer (mpeg2dec, frame, vframe); + } + + ret = gst_video_decoder_finish_frame (GST_VIDEO_DECODER (mpeg2dec), frame); + +beach: + gst_video_codec_state_unref (state); + return ret; + +no_frame: + { + GST_DEBUG ("display buffer does not have a valid frame"); + return GST_FLOW_OK; + } +} + +static GstFlowReturn +gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder, + GstVideoCodecFrame * frame) +{ + GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder); + GstBuffer *buf = frame->input_buffer; + GstMapInfo minfo; + const mpeg2_info_t *info; + mpeg2_state_t state; + gboolean done = FALSE; + GstFlowReturn ret = GST_FLOW_OK; + + GST_LOG_OBJECT (mpeg2dec, "received frame %d, timestamp %" + GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT, + frame->system_frame_number, + GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->duration)); + + gst_buffer_ref (buf); + if (!gst_buffer_map (buf, &minfo, GST_MAP_READ)) { + GST_ERROR_OBJECT (mpeg2dec, "Failed to map input buffer"); + return GST_FLOW_ERROR; + } + + info = mpeg2dec->info; + + GST_LOG_OBJECT (mpeg2dec, "calling mpeg2_buffer"); + mpeg2_buffer (mpeg2dec->decoder, minfo.data, minfo.data + minfo.size); + GST_LOG_OBJECT (mpeg2dec, "calling mpeg2_buffer done"); + + while (!done) { + GST_LOG_OBJECT (mpeg2dec, "calling parse"); + state = mpeg2_parse (mpeg2dec->decoder); + GST_DEBUG_OBJECT (mpeg2dec, "parse state %d", state); + + switch (state) { +#if MPEG2_RELEASE >= MPEG2_VERSION (0, 5, 0) + case STATE_SEQUENCE_MODIFIED: + GST_DEBUG_OBJECT (mpeg2dec, "sequence modified"); + mpeg2dec->discont_state = MPEG2DEC_DISC_NEW_PICTURE; + gst_mpeg2dec_clear_buffers (mpeg2dec); + /* fall through */ +#endif + case STATE_SEQUENCE: + ret = handle_sequence (mpeg2dec, info); + /* if there is an error handling the sequence + * reset the decoder, maybe something more elegant + * could be done. + */ + if (ret == GST_FLOW_ERROR) { + GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE, + ("decoding error"), ("Bad sequence header"), ret); + gst_video_decoder_drop_frame (decoder, frame); + gst_mpeg2dec_flush (decoder); + goto done; + } + break; + case STATE_SEQUENCE_REPEATED: + GST_DEBUG_OBJECT (mpeg2dec, "sequence repeated"); + break; + case STATE_GOP: + GST_DEBUG_OBJECT (mpeg2dec, "gop"); + break; + case STATE_PICTURE: + ret = handle_picture (mpeg2dec, info, frame); + break; + case STATE_SLICE_1ST: + GST_LOG_OBJECT (mpeg2dec, "1st slice of frame encountered"); + break; + case STATE_PICTURE_2ND: + GST_LOG_OBJECT (mpeg2dec, + "Second picture header encountered. Decoding 2nd field"); + break; +#if MPEG2_RELEASE >= MPEG2_VERSION (0, 4, 0) + case STATE_INVALID_END: + GST_DEBUG_OBJECT (mpeg2dec, "invalid end"); +#endif + case STATE_END: + GST_DEBUG_OBJECT (mpeg2dec, "end"); + case STATE_SLICE: + GST_DEBUG_OBJECT (mpeg2dec, "display_fbuf:%p, discard_fbuf:%p", + info->display_fbuf, info->discard_fbuf); + if (info->display_fbuf && info->display_fbuf->id) { + ret = handle_slice (mpeg2dec, info); + } else { + GST_DEBUG_OBJECT (mpeg2dec, "no picture to display"); + } + if (info->discard_fbuf && info->discard_fbuf->id) + gst_mpeg2dec_discard_buffer (mpeg2dec, + GPOINTER_TO_INT (info->discard_fbuf->id) - 1); + if (state != STATE_SLICE) { + gst_mpeg2dec_clear_buffers (mpeg2dec); + } + break; + case STATE_BUFFER: + done = TRUE; + break; + /* error */ + case STATE_INVALID: + GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE, + ("decoding error"), ("Reached libmpeg2 invalid state"), ret); + continue; + default: + GST_ERROR_OBJECT (mpeg2dec, "Unknown libmpeg2 state %d, FIXME", state); + ret = GST_FLOW_OK; + gst_video_codec_frame_unref (frame); + goto done; + } + + if (ret != GST_FLOW_OK) { + GST_DEBUG_OBJECT (mpeg2dec, "exit loop, reason %s", + gst_flow_get_name (ret)); + break; + } + } + + gst_video_codec_frame_unref (frame); + +done: + gst_buffer_unmap (buf, &minfo); + gst_buffer_unref (buf); + return ret; +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + if (!gst_element_register (plugin, "mpeg2dec", GST_RANK_PRIMARY, + GST_TYPE_MPEG2DEC)) + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + mpeg2dec, + "LibMpeg2 decoder", plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN); diff --git a/ext/mpeg2dec/gstmpeg2dec.h b/ext/mpeg2dec/gstmpeg2dec.h new file mode 100644 index 0000000..9623b72 --- /dev/null +++ b/ext/mpeg2dec/gstmpeg2dec.h @@ -0,0 +1,88 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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_MPEG2DEC_H__ +#define __GST_MPEG2DEC_H__ + + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GST_TYPE_MPEG2DEC \ + (gst_mpeg2dec_get_type()) +#define GST_MPEG2DEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MPEG2DEC,GstMpeg2dec)) +#define GST_MPEG2DEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MPEG2DEC,GstMpeg2decClass)) +#define GST_IS_MPEG2DEC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPEG2DEC)) +#define GST_IS_MPEG2DEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2DEC)) + +#define MPEG_TIME_TO_GST_TIME(time) ((time) == -1 ? -1 : ((time) * (GST_MSECOND/10)) / G_GINT64_CONSTANT(9)) +#define GST_TIME_TO_MPEG_TIME(time) ((time) == -1 ? -1 : ((time) * G_GINT64_CONSTANT(9)) / (GST_MSECOND/10)) + +typedef struct _GstMpeg2dec GstMpeg2dec; +typedef struct _GstMpeg2decClass GstMpeg2decClass; + +typedef enum +{ + MPEG2DEC_DISC_NONE = 0, + MPEG2DEC_DISC_NEW_PICTURE, + MPEG2DEC_DISC_NEW_KEYFRAME +} DiscontState; + +struct _GstMpeg2dec { + GstVideoDecoder element; + + mpeg2dec_t *decoder; + const mpeg2_info_t *info; + + /* Buffer lifetime management */ + GList *buffers; + + /* FIXME This should not be necessary. It is used to prevent image + * corruption when the parser does not behave the way it should. + * See https://bugzilla.gnome.org/show_bug.cgi?id=674238 + */ + DiscontState discont_state; + + /* video state */ + GstVideoCodecState *input_state; + GstVideoInfo decoded_info; + gboolean need_cropping; + gboolean has_cropping; + + guint8 *dummybuf[4]; +}; + +struct _GstMpeg2decClass { + GstVideoDecoderClass parent_class; +}; + +GType gst_mpeg2dec_get_type(void); + +G_END_DECLS + +#endif /* __GST_MPEG2DEC_H__ */ diff --git a/ext/sidplay/Makefile.am b/ext/sidplay/Makefile.am new file mode 100644 index 0000000..d44b227 --- /dev/null +++ b/ext/sidplay/Makefile.am @@ -0,0 +1,11 @@ +plugin_LTLIBRARIES = libgstsid.la + +libgstsid_la_SOURCES = gstsiddec.cc +libgstsid_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \ + $(GST_CXXFLAGS) $(SIDPLAY_CFLAGS) +libgstsid_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(SIDPLAY_LIBS) \ + -lgstaudio-$(GST_API_VERSION) +libgstsid_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstsid_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gstsiddec.h diff --git a/ext/sidplay/Makefile.in b/ext/sidplay/Makefile.in new file mode 100644 index 0000000..dab6356 --- /dev/null +++ b/ext/sidplay/Makefile.in @@ -0,0 +1,830 @@ +# 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 = ext/sidplay +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgstsid_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgstsid_la_OBJECTS = libgstsid_la-gstsiddec.lo +libgstsid_la_OBJECTS = $(am_libgstsid_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 = +libgstsid_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(libgstsid_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CXXLD) $(libgstsid_la_CXXFLAGS) $(CXXFLAGS) \ + $(libgstsid_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 +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(libgstsid_la_SOURCES) +DIST_SOURCES = $(libgstsid_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstsid.la +libgstsid_la_SOURCES = gstsiddec.cc +libgstsid_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \ + $(GST_CXXFLAGS) $(SIDPLAY_CFLAGS) + +libgstsid_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(SIDPLAY_LIBS) \ + -lgstaudio-$(GST_API_VERSION) + +libgstsid_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstsid_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gstsiddec.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .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 ext/sidplay/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/sidplay/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}; \ + } + +libgstsid.la: $(libgstsid_la_OBJECTS) $(libgstsid_la_DEPENDENCIES) $(EXTRA_libgstsid_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libgstsid_la_LINK) -rpath $(plugindir) $(libgstsid_la_OBJECTS) $(libgstsid_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstsid_la-gstsiddec.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +libgstsid_la-gstsiddec.lo: gstsiddec.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(libgstsid_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstsid_la_CXXFLAGS) $(CXXFLAGS) -MT libgstsid_la-gstsiddec.lo -MD -MP -MF $(DEPDIR)/libgstsid_la-gstsiddec.Tpo -c -o libgstsid_la-gstsiddec.lo `test -f 'gstsiddec.cc' || echo '$(srcdir)/'`gstsiddec.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstsid_la-gstsiddec.Tpo $(DEPDIR)/libgstsid_la-gstsiddec.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gstsiddec.cc' object='libgstsid_la-gstsiddec.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(libgstsid_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstsid_la_CXXFLAGS) $(CXXFLAGS) -c -o libgstsid_la-gstsiddec.lo `test -f 'gstsiddec.cc' || echo '$(srcdir)/'`gstsiddec.cc + +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 + + +# 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/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc new file mode 100644 index 0000000..a7cac36 --- /dev/null +++ b/ext/sidplay/gstsiddec.cc @@ -0,0 +1,781 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * (C) <2006> Wim Taymans + * + * 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-siddec + * + * This element decodes .sid files to raw audio. .sid files are in fact + * small Commodore 64 programs that are executed on an emulated 6502 CPU and a + * MOS 6581 sound chip. + * + * This plugin will first load the complete program into memory before starting + * the emulator and producing output. + * + * Seeking is not (and cannot be) implemented. + * + * + * Example pipelines + * |[ + * gst-launch -v filesrc location=Hawkeye.sid ! siddec ! audioconvert ! alsasink + * ]| Decode a sid file and play back the audio using alsasink. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include "gstsiddec.h" + +#define DEFAULT_TUNE 0 +#define DEFAULT_CLOCK SIDTUNE_CLOCK_PAL +#define DEFAULT_MEMORY MPU_BANK_SWITCHING +#define DEFAULT_FILTER TRUE +#define DEFAULT_MEASURED_VOLUME TRUE +#define DEFAULT_MOS8580 FALSE +#define DEFAULT_FORCE_SPEED FALSE +#define DEFAULT_BLOCKSIZE 4096 + +enum +{ + PROP_0, + PROP_TUNE, + PROP_CLOCK, + PROP_MEMORY, + PROP_FILTER, + PROP_MEASURED_VOLUME, + PROP_MOS8580, + PROP_FORCE_SPEED, + PROP_BLOCKSIZE, + PROP_METADATA +}; + +static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-sid") + ); + +#define FORMATS "{ "GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)", S8, U8 }" + +static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) " FORMATS ", " + "layout = (string) interleaved, " + "rate = (int) [ 8000, 48000 ], " "channels = (int) [ 1, 2 ]") + ); + +GST_DEBUG_CATEGORY_STATIC (gst_siddec_debug); +#define GST_CAT_DEFAULT gst_siddec_debug + +#define GST_TYPE_SID_CLOCK (gst_sid_clock_get_type()) +static GType +gst_sid_clock_get_type (void) +{ + static GType sid_clock_type = 0; + static const GEnumValue sid_clock[] = { + {SIDTUNE_CLOCK_PAL, "PAL", "pal"}, + {SIDTUNE_CLOCK_NTSC, "NTSC", "ntsc"}, + {0, NULL, NULL}, + }; + + if (!sid_clock_type) { + sid_clock_type = g_enum_register_static ("GstSidClock", sid_clock); + } + return sid_clock_type; +} + +#define GST_TYPE_SID_MEMORY (gst_sid_memory_get_type()) +static GType +gst_sid_memory_get_type (void) +{ + static GType sid_memory_type = 0; + static const GEnumValue sid_memory[] = { + {MPU_BANK_SWITCHING, "Bank Switching", "bank-switching"}, + {MPU_TRANSPARENT_ROM, "Transparent ROM", "transparent-rom"}, + {MPU_PLAYSID_ENVIRONMENT, "Playsid Environment", "playsid-environment"}, + {0, NULL, NULL}, + }; + + if (!sid_memory_type) { + sid_memory_type = g_enum_register_static ("GstSidMemory", sid_memory); + } + return sid_memory_type; +} + +static void gst_siddec_finalize (GObject * object); + +static GstFlowReturn gst_siddec_chain (GstPad * pad, GstObject * parent, + GstBuffer * buffer); +static gboolean gst_siddec_sink_event (GstPad * pad, GstObject * parent, + GstEvent * event); + +static gboolean gst_siddec_src_convert (GstPad * pad, GstFormat src_format, + gint64 src_value, GstFormat * dest_format, gint64 * dest_value); +static gboolean gst_siddec_src_event (GstPad * pad, GstObject * parent, + GstEvent * event); +static gboolean gst_siddec_src_query (GstPad * pad, GstObject * parent, + GstQuery * query); + +static void gst_siddec_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); +static void gst_siddec_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); + +#define gst_siddec_parent_class parent_class +G_DEFINE_TYPE (GstSidDec, gst_siddec, GST_TYPE_ELEMENT); + +static void +gst_siddec_class_init (GstSidDecClass * klass) +{ + GObjectClass *gobject_class; + GstElementClass *gstelement_class; + + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; + + gobject_class->finalize = gst_siddec_finalize; + gobject_class->set_property = gst_siddec_set_property; + gobject_class->get_property = gst_siddec_get_property; + + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TUNE, + g_param_spec_int ("tune", "tune", "tune", + 0, 100, DEFAULT_TUNE, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CLOCK, + g_param_spec_enum ("clock", "clock", "clock", + GST_TYPE_SID_CLOCK, DEFAULT_CLOCK, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MEMORY, + g_param_spec_enum ("memory", "memory", "memory", GST_TYPE_SID_MEMORY, + DEFAULT_MEMORY, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILTER, + g_param_spec_boolean ("filter", "filter", "filter", DEFAULT_FILTER, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MEASURED_VOLUME, + g_param_spec_boolean ("measured-volume", "measured_volume", + "measured_volume", DEFAULT_MEASURED_VOLUME, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MOS8580, + g_param_spec_boolean ("mos8580", "mos8580", "mos8580", DEFAULT_MOS8580, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FORCE_SPEED, + g_param_spec_boolean ("force-speed", "force_speed", "force_speed", + DEFAULT_FORCE_SPEED, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BLOCKSIZE, + g_param_spec_uint ("blocksize", "Block size", + "Size in bytes to output per buffer", 1, G_MAXUINT, + DEFAULT_BLOCKSIZE, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); + g_object_class_install_property (gobject_class, PROP_METADATA, + g_param_spec_boxed ("metadata", "Metadata", "Metadata", GST_TYPE_CAPS, + (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); + + gst_element_class_set_static_metadata (gstelement_class, "Sid decoder", + "Codec/Decoder/Audio", "Use libsidplay to decode SID audio tunes", + "Wim Taymans "); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_templ)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_templ)); + + GST_DEBUG_CATEGORY_INIT (gst_siddec_debug, "siddec", 0, + "C64 sid song player"); +} + +static void +gst_siddec_init (GstSidDec * siddec) +{ + siddec->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink"); + gst_pad_set_event_function (siddec->sinkpad, gst_siddec_sink_event); + gst_pad_set_chain_function (siddec->sinkpad, gst_siddec_chain); + gst_element_add_pad (GST_ELEMENT (siddec), siddec->sinkpad); + + siddec->srcpad = gst_pad_new_from_static_template (&src_templ, "src"); + gst_pad_set_event_function (siddec->srcpad, gst_siddec_src_event); + gst_pad_set_query_function (siddec->srcpad, gst_siddec_src_query); + gst_pad_use_fixed_caps (siddec->srcpad); + gst_element_add_pad (GST_ELEMENT (siddec), siddec->srcpad); + + siddec->engine = new emuEngine (); + siddec->tune = new sidTune (0); + siddec->config = (emuConfig *) g_malloc (sizeof (emuConfig)); + + /* get default config parameters */ + siddec->engine->getConfig (*siddec->config); + + siddec->config->mos8580 = DEFAULT_MOS8580; // mos8580 + siddec->config->memoryMode = DEFAULT_MEMORY; // memory mode + siddec->config->clockSpeed = DEFAULT_CLOCK; // clock speed + siddec->config->forceSongSpeed = DEFAULT_FORCE_SPEED; // force song speed + + siddec->engine->setConfig (*siddec->config); + + siddec->tune_buffer = (guchar *) g_malloc (maxSidtuneFileLen); + siddec->tune_len = 0; + siddec->tune_number = 0; + siddec->total_bytes = 0; + siddec->blocksize = DEFAULT_BLOCKSIZE; + + siddec->have_group_id = FALSE; + siddec->group_id = G_MAXUINT; +} + +static void +gst_siddec_finalize (GObject * object) +{ + GstSidDec *siddec = GST_SIDDEC (object); + + g_free (siddec->config); + g_free (siddec->tune_buffer); + + delete (siddec->tune); + delete (siddec->engine); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +update_tags (GstSidDec * siddec) +{ + sidTuneInfo info; + GstTagList *list; + + if (siddec->tune->getInfo (info)) { + list = gst_tag_list_new_empty (); + + if (info.nameString) { + gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, + GST_TAG_TITLE, info.nameString, (void *) NULL); + } + if (info.authorString) { + gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, + GST_TAG_ARTIST, info.authorString, (void *) NULL); + } + if (info.copyrightString) { + gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, + GST_TAG_COPYRIGHT, info.copyrightString, (void *) NULL); + } + gst_pad_push_event (siddec->srcpad, gst_event_new_tag (list)); + } +} + +static gboolean +siddec_negotiate (GstSidDec * siddec) +{ + GstCaps *allowed; + GstStructure *structure; + int rate = 44100; + int channels = 1; + GstCaps *caps; + const gchar *str; + GstAudioFormat format; + GstEvent *event; + gchar *stream_id; + + allowed = gst_pad_get_allowed_caps (siddec->srcpad); + if (!allowed) + goto nothing_allowed; + + GST_DEBUG_OBJECT (siddec, "allowed caps: %" GST_PTR_FORMAT, allowed); + + allowed = gst_caps_normalize (allowed); + + structure = gst_caps_get_structure (allowed, 0); + + str = gst_structure_get_string (structure, "format"); + if (str == NULL) + goto invalid_format; + + format = gst_audio_format_from_string (str); + switch (format) { + case GST_AUDIO_FORMAT_S8: + siddec->config->bitsPerSample = 8; + siddec->config->sampleFormat = SIDEMU_SIGNED_PCM; + break; + case GST_AUDIO_FORMAT_U8: + siddec->config->bitsPerSample = 8; + siddec->config->sampleFormat = SIDEMU_UNSIGNED_PCM; + break; + case GST_AUDIO_FORMAT_S16: + siddec->config->bitsPerSample = 16; + siddec->config->sampleFormat = SIDEMU_SIGNED_PCM; + break; + case GST_AUDIO_FORMAT_U16: + siddec->config->bitsPerSample = 16; + siddec->config->sampleFormat = SIDEMU_UNSIGNED_PCM; + break; + default: + goto invalid_format; + } + + gst_structure_get_int (structure, "rate", &rate); + siddec->config->frequency = rate; + gst_structure_get_int (structure, "channels", &channels); + siddec->config->channels = channels; + + stream_id = + gst_pad_create_stream_id (siddec->srcpad, GST_ELEMENT_CAST (siddec), + NULL); + + event = gst_pad_get_sticky_event (siddec->sinkpad, GST_EVENT_STREAM_START, 0); + if (event) { + if (gst_event_parse_group_id (event, &siddec->group_id)) + siddec->have_group_id = TRUE; + else + siddec->have_group_id = FALSE; + gst_event_unref (event); + } else if (!siddec->have_group_id) { + siddec->have_group_id = TRUE; + siddec->group_id = gst_util_group_id_next (); + } + + event = gst_event_new_stream_start (stream_id); + if (siddec->have_group_id) + gst_event_set_group_id (event, siddec->group_id); + + gst_pad_push_event (siddec->srcpad, event); + g_free (stream_id); + + caps = gst_caps_new_simple ("audio/x-raw", + "format", G_TYPE_STRING, gst_audio_format_to_string (format), + "layout", G_TYPE_STRING, "interleaved", + "rate", G_TYPE_INT, siddec->config->frequency, + "channels", G_TYPE_INT, siddec->config->channels, NULL); + gst_pad_set_caps (siddec->srcpad, caps); + gst_caps_unref (caps); + + gst_caps_unref (allowed); + + siddec->engine->setConfig (*siddec->config); + + return TRUE; + + /* ERRORS */ +nothing_allowed: + { + GST_DEBUG_OBJECT (siddec, "could not get allowed caps"); + return FALSE; + } +invalid_format: + { + GST_DEBUG_OBJECT (siddec, "invalid audio caps"); + gst_caps_unref (allowed); + return FALSE; + } +} + +static void +play_loop (GstPad * pad) +{ + GstFlowReturn ret; + GstSidDec *siddec; + GstBuffer *out; + GstMapInfo outmap; + gint64 value, offset, time; + GstFormat format; + + siddec = GST_SIDDEC (gst_pad_get_parent (pad)); + + out = gst_buffer_new_and_alloc (siddec->blocksize); + + gst_buffer_map (out, &outmap, GST_MAP_WRITE); + sidEmuFillBuffer (*siddec->engine, *siddec->tune, + outmap.data, siddec->blocksize); + gst_buffer_unmap (out, &outmap); + + /* get offset in samples */ + format = GST_FORMAT_DEFAULT; + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &offset); + GST_BUFFER_OFFSET (out) = offset; + + /* get current timestamp */ + format = GST_FORMAT_TIME; + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &time); + GST_BUFFER_TIMESTAMP (out) = time; + + /* update position and get new timestamp to calculate duration */ + siddec->total_bytes += siddec->blocksize; + + /* get offset in samples */ + format = GST_FORMAT_DEFAULT; + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); + GST_BUFFER_OFFSET_END (out) = value; + + format = GST_FORMAT_TIME; + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); + GST_BUFFER_DURATION (out) = value - time; + + if ((ret = gst_pad_push (siddec->srcpad, out)) != GST_FLOW_OK) + goto pause; + +done: + gst_object_unref (siddec); + + return; + + /* ERRORS */ +pause: + { + const gchar *reason = gst_flow_get_name (ret); + + if (ret == GST_FLOW_EOS) { + /* perform EOS logic, FIXME, segment seek? */ + gst_pad_push_event (pad, gst_event_new_eos ()); + } else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) { + /* for fatal errors we post an error message */ + GST_ELEMENT_ERROR (siddec, STREAM, FAILED, + (NULL), ("streaming task paused, reason %s", reason)); + gst_pad_push_event (pad, gst_event_new_eos ()); + } + + GST_INFO_OBJECT (siddec, "pausing task, reason: %s", reason); + gst_pad_pause_task (pad); + goto done; + } +} + +static gboolean +start_play_tune (GstSidDec * siddec) +{ + gboolean res; + GstSegment segment; + + if (!siddec->tune->load (siddec->tune_buffer, siddec->tune_len)) + goto could_not_load; + + update_tags (siddec); + + if (!siddec_negotiate (siddec)) + goto could_not_negotiate; + + if (!sidEmuInitializeSong (*siddec->engine, *siddec->tune, + siddec->tune_number)) + goto could_not_init; + + gst_segment_init (&segment, GST_FORMAT_TIME); + gst_pad_push_event (siddec->srcpad, gst_event_new_segment (&segment)); + siddec->total_bytes = 0; + siddec->have_group_id = FALSE; + siddec->group_id = G_MAXUINT; + + res = gst_pad_start_task (siddec->srcpad, + (GstTaskFunction) play_loop, siddec->srcpad, NULL); + return res; + + /* ERRORS */ +could_not_load: + { + GST_ELEMENT_ERROR (siddec, LIBRARY, INIT, + ("Could not load tune"), ("Could not load tune")); + return FALSE; + } +could_not_negotiate: + { + GST_ELEMENT_ERROR (siddec, CORE, NEGOTIATION, + ("Could not negotiate format"), ("Could not negotiate format")); + return FALSE; + } +could_not_init: + { + GST_ELEMENT_ERROR (siddec, LIBRARY, INIT, + ("Could not initialize song"), ("Could not initialize song")); + return FALSE; + } +} + +static gboolean +gst_siddec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) +{ + GstSidDec *siddec; + gboolean res; + + siddec = GST_SIDDEC (parent); + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_EOS: + res = start_play_tune (siddec); + break; + case GST_EVENT_SEGMENT: + res = TRUE; + break; + default: + res = TRUE; + break; + } + gst_event_unref (event); + + return res; +} + +static GstFlowReturn +gst_siddec_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) +{ + GstSidDec *siddec; + guint64 size; + + siddec = GST_SIDDEC (parent); + + size = gst_buffer_get_size (buffer); + if (siddec->tune_len + size > maxSidtuneFileLen) + goto overflow; + + gst_buffer_extract (buffer, 0, siddec->tune_buffer + siddec->tune_len, size); + + siddec->tune_len += size; + + gst_buffer_unref (buffer); + + return GST_FLOW_OK; + + /* ERRORS */ +overflow: + { + GST_ELEMENT_ERROR (siddec, STREAM, DECODE, + (NULL), ("Input data bigger than allowed buffer size")); + return GST_FLOW_ERROR; + } +} + +static gboolean +gst_siddec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, + GstFormat * dest_format, gint64 * dest_value) +{ + gboolean res = TRUE; + guint scale = 1; + GstSidDec *siddec; + gint bytes_per_sample; + + siddec = GST_SIDDEC (gst_pad_get_parent (pad)); + + if (src_format == *dest_format) { + *dest_value = src_value; + return TRUE; + } + + bytes_per_sample = + (siddec->config->bitsPerSample >> 3) * siddec->config->channels; + + switch (src_format) { + case GST_FORMAT_BYTES: + switch (*dest_format) { + case GST_FORMAT_DEFAULT: + if (bytes_per_sample == 0) + return FALSE; + *dest_value = src_value / bytes_per_sample; + break; + case GST_FORMAT_TIME: + { + gint byterate = bytes_per_sample * siddec->config->frequency; + + if (byterate == 0) + return FALSE; + *dest_value = + gst_util_uint64_scale_int (src_value, GST_SECOND, byterate); + break; + } + default: + res = FALSE; + } + break; + case GST_FORMAT_DEFAULT: + switch (*dest_format) { + case GST_FORMAT_BYTES: + *dest_value = src_value * bytes_per_sample; + break; + case GST_FORMAT_TIME: + if (siddec->config->frequency == 0) + return FALSE; + *dest_value = + gst_util_uint64_scale_int (src_value, GST_SECOND, + siddec->config->frequency); + break; + default: + res = FALSE; + } + break; + case GST_FORMAT_TIME: + switch (*dest_format) { + case GST_FORMAT_BYTES: + scale = bytes_per_sample; + /* fallthrough */ + case GST_FORMAT_DEFAULT: + *dest_value = + gst_util_uint64_scale_int (src_value, + scale * siddec->config->frequency, GST_SECOND); + break; + default: + res = FALSE; + } + break; + default: + res = FALSE; + } + + return res; +} + +static gboolean +gst_siddec_src_event (GstPad * pad, GstObject * parent, GstEvent * event) +{ + gboolean res = FALSE; + + switch (GST_EVENT_TYPE (event)) { + default: + break; + } + gst_event_unref (event); + + return res; +} + +static gboolean +gst_siddec_src_query (GstPad * pad, GstObject * parent, GstQuery * query) +{ + gboolean res = TRUE; + GstSidDec *siddec; + + siddec = GST_SIDDEC (parent); + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_POSITION: + { + GstFormat format; + gint64 current; + + gst_query_parse_position (query, &format, NULL); + + /* we only know about our bytes, convert to requested format */ + res &= gst_siddec_src_convert (pad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, ¤t); + if (res) { + gst_query_set_position (query, format, current); + } + break; + } + default: + res = gst_pad_query_default (pad, parent, query); + break; + } + + return res; +} + +static void +gst_siddec_set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) +{ + GstSidDec *siddec = GST_SIDDEC (object); + + switch (prop_id) { + case PROP_TUNE: + siddec->tune_number = g_value_get_int (value); + break; + case PROP_CLOCK: + siddec->config->clockSpeed = g_value_get_enum (value); + break; + case PROP_MEMORY: + siddec->config->memoryMode = g_value_get_enum (value); + break; + case PROP_FILTER: + siddec->config->emulateFilter = g_value_get_boolean (value); + break; + case PROP_MEASURED_VOLUME: + siddec->config->measuredVolume = g_value_get_boolean (value); + break; + case PROP_MOS8580: + siddec->config->mos8580 = g_value_get_boolean (value); + break; + case PROP_BLOCKSIZE: + siddec->blocksize = g_value_get_uint (value); + break; + case PROP_FORCE_SPEED: + siddec->config->forceSongSpeed = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return; + } + siddec->engine->setConfig (*siddec->config); +} + +static void +gst_siddec_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstSidDec *siddec = GST_SIDDEC (object); + + switch (prop_id) { + case PROP_TUNE: + g_value_set_int (value, siddec->tune_number); + break; + case PROP_CLOCK: + g_value_set_enum (value, siddec->config->clockSpeed); + break; + case PROP_MEMORY: + g_value_set_enum (value, siddec->config->memoryMode); + break; + case PROP_FILTER: + g_value_set_boolean (value, siddec->config->emulateFilter); + break; + case PROP_MEASURED_VOLUME: + g_value_set_boolean (value, siddec->config->measuredVolume); + break; + case PROP_MOS8580: + g_value_set_boolean (value, siddec->config->mos8580); + break; + case PROP_FORCE_SPEED: + g_value_set_boolean (value, siddec->config->forceSongSpeed); + break; + case PROP_BLOCKSIZE: + g_value_set_uint (value, siddec->blocksize); + break; + case PROP_METADATA: + g_value_set_boxed (value, NULL); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + return gst_element_register (plugin, "siddec", GST_RANK_PRIMARY, + GST_TYPE_SIDDEC); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + siddec, + "Uses libsidplay to decode .sid files", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/sidplay/gstsiddec.h b/ext/sidplay/gstsiddec.h new file mode 100644 index 0000000..127895d --- /dev/null +++ b/ext/sidplay/gstsiddec.h @@ -0,0 +1,75 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * + * 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_SIDDEC_H__ +#define __GST_SIDDEC_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +#define GST_TYPE_SIDDEC \ + (gst_siddec_get_type()) +#define GST_SIDDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SIDDEC,GstSidDec)) +#define GST_SIDDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SIDDEC,GstSidDecClass)) +#define GST_IS_SIDDEC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SIDDEC)) +#define GST_IS_SIDDEC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SIDDEC)) + +typedef struct _GstSidDec GstSidDec; +typedef struct _GstSidDecClass GstSidDecClass; + +struct _GstSidDec { + GstElement element; + + /* pads */ + GstPad *sinkpad, + *srcpad; + + gboolean have_group_id; + guint group_id; + + guchar *tune_buffer; + gint tune_len; + gint tune_number; + guint64 total_bytes; + + emuEngine *engine; + sidTune *tune; + emuConfig *config; + + guint blocksize; +}; + +struct _GstSidDecClass { + GstElementClass parent_class; +}; + +GType gst_siddec_get_type (void); + +G_END_DECLS + +#endif /* __GST_SIDDEC_H__ */ diff --git a/ext/twolame/Makefile.am b/ext/twolame/Makefile.am new file mode 100644 index 0000000..b6de82c --- /dev/null +++ b/ext/twolame/Makefile.am @@ -0,0 +1,12 @@ +plugin_LTLIBRARIES = libgsttwolame.la + +libgsttwolame_la_SOURCES = gsttwolamemp2enc.c +libgsttwolame_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(TWOLAME_CFLAGS) +libgsttwolame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ -lgstpbutils-@GST_API_VERSION@ \ + $(GST_LIBS) $(TWOLAME_LIBS) +libgsttwolame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgsttwolame_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gsttwolamemp2enc.h diff --git a/ext/twolame/Makefile.in b/ext/twolame/Makefile.in new file mode 100644 index 0000000..3017506 --- /dev/null +++ b/ext/twolame/Makefile.in @@ -0,0 +1,830 @@ +# 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 = ext/twolame +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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 = +libgsttwolame_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgsttwolame_la_OBJECTS = libgsttwolame_la-gsttwolamemp2enc.lo +libgsttwolame_la_OBJECTS = $(am_libgsttwolame_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 = +libgsttwolame_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgsttwolame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgsttwolame_la_CFLAGS) $(CFLAGS) \ + $(libgsttwolame_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 = $(libgsttwolame_la_SOURCES) +DIST_SOURCES = $(libgsttwolame_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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgsttwolame.la +libgsttwolame_la_SOURCES = gsttwolamemp2enc.c +libgsttwolame_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(TWOLAME_CFLAGS) + +libgsttwolame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ + -lgstaudio-@GST_API_VERSION@ -lgstpbutils-@GST_API_VERSION@ \ + $(GST_LIBS) $(TWOLAME_LIBS) + +libgsttwolame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgsttwolame_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gsttwolamemp2enc.h +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 ext/twolame/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/twolame/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}; \ + } + +libgsttwolame.la: $(libgsttwolame_la_OBJECTS) $(libgsttwolame_la_DEPENDENCIES) $(EXTRA_libgsttwolame_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgsttwolame_la_LINK) -rpath $(plugindir) $(libgsttwolame_la_OBJECTS) $(libgsttwolame_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsttwolame_la-gsttwolamemp2enc.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 $@ $< + +libgsttwolame_la-gsttwolamemp2enc.lo: gsttwolamemp2enc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgsttwolame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgsttwolame_la_CFLAGS) $(CFLAGS) -MT libgsttwolame_la-gsttwolamemp2enc.lo -MD -MP -MF $(DEPDIR)/libgsttwolame_la-gsttwolamemp2enc.Tpo -c -o libgsttwolame_la-gsttwolamemp2enc.lo `test -f 'gsttwolamemp2enc.c' || echo '$(srcdir)/'`gsttwolamemp2enc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsttwolame_la-gsttwolamemp2enc.Tpo $(DEPDIR)/libgsttwolame_la-gsttwolamemp2enc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsttwolamemp2enc.c' object='libgsttwolame_la-gsttwolamemp2enc.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 $(libgsttwolame_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgsttwolame_la_CFLAGS) $(CFLAGS) -c -o libgsttwolame_la-gsttwolamemp2enc.lo `test -f 'gsttwolamemp2enc.c' || echo '$(srcdir)/'`gsttwolamemp2enc.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 + + +# 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/ext/twolame/gsttwolamemp2enc.c b/ext/twolame/gsttwolamemp2enc.c new file mode 100644 index 0000000..12b6f5a --- /dev/null +++ b/ext/twolame/gsttwolamemp2enc.c @@ -0,0 +1,891 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * Copyright (C) <2004> Wim Taymans + * Copyright (C) <2005> Thomas Vander Stichele + * Copyright (C) <2008> Sebastian Dröge + * + * 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. + */ + +/* + * Based on the lame element. + */ + +/** + * SECTION:element-twolame + * @see_also: mad, lame + * + * This element encodes raw integer audio into an MPEG-1 layer 2 (MP2) stream. + * + * + * Example pipelines + * |[ + * gst-launch -v audiotestsrc wave=sine num-buffers=100 ! audioconvert ! twolame ! filesink location=sine.mp2 + * ]| Encode a test sine signal to MP2. + * |[ + * gst-launch -v alsasrc ! audioconvert ! twolame bitrate=192 ! filesink location=alsasrc.mp2 + * ]| Record from a sound card using ALSA and encode to MP2 + * |[ + * gst-launch -v filesrc location=music.wav ! decodebin ! audioconvert ! audioresample ! twolame bitrate=192 ! id3v2mux ! filesink location=music.mp2 + * ]| Transcode from a .wav file to MP2 (the id3v2mux element is optional) + * |[ + * gst-launch -v cdda://5 ! audioconvert ! twolame bitrate=192 ! filesink location=track5.mp2 + * ]| Encode Audio CD track 5 to MP2 + * + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "string.h" +#include "gsttwolamemp2enc.h" +#include "gst/gst-i18n-plugin.h" + +GST_DEBUG_CATEGORY_STATIC (debug); +#define GST_CAT_DEFAULT debug + +/* TwoLAME can do MPEG-1, MPEG-2 so it has 6 possible + * sample rates it supports */ +static GstStaticPadTemplate gst_two_lame_sink_template = + GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw, " + "format = (string) { " GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (S16) " }, " + "layout = (string) interleaved, " + "rate = (int) { 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) 1; " + "audio/x-raw, " + "format = (string) { " GST_AUDIO_NE (F32) ", " GST_AUDIO_NE (S16) " }, " + "layout = (string) interleaved, " + "rate = (int) { 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) 2," "channel-mask = (bitmask) 0x3") + ); + +static GstStaticPadTemplate gst_two_lame_src_template = +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/mpeg, " + "mpegversion = (int) 1, " + "layer = (int) 2, " + "rate = (int) { 16000, 22050, 24000, 32000, 44100, 48000 }, " + "channels = (int) [ 1, 2 ]") + ); + +static struct +{ + gint mode; + gint psymodel; + gint bitrate; + gint padding; + gboolean energy_level_extension; + gint emphasis; + gboolean error_protection; + gboolean copyright; + gboolean original; + gboolean vbr; + gfloat vbr_level; + gfloat ath_level; + gint vbr_max_bitrate; + gboolean quick_mode; + gint quick_mode_count; +} gst_two_lame_default_settings; + +/********** Define useful types for non-programmatic interfaces **********/ +#define GST_TYPE_TWO_LAME_MODE (gst_two_lame_mode_get_type()) +static GType +gst_two_lame_mode_get_type (void) +{ + static GType two_lame_mode_type = 0; + static GEnumValue two_lame_modes[] = { + {TWOLAME_AUTO_MODE, "Auto", "auto"}, + {TWOLAME_STEREO, "Stereo", "stereo"}, + {TWOLAME_JOINT_STEREO, "Joint Stereo", "joint"}, + {TWOLAME_DUAL_CHANNEL, "Dual Channel", "dual"}, + {TWOLAME_MONO, "Mono", "mono"}, + {0, NULL, NULL} + }; + + if (!two_lame_mode_type) { + two_lame_mode_type = + g_enum_register_static ("GstTwoLameMode", two_lame_modes); + } + return two_lame_mode_type; +} + +#define GST_TYPE_TWO_LAME_PADDING (gst_two_lame_padding_get_type()) +static GType +gst_two_lame_padding_get_type (void) +{ + static GType two_lame_padding_type = 0; + static GEnumValue two_lame_padding[] = { + {TWOLAME_PAD_NO, "No Padding", "never"}, + {TWOLAME_PAD_ALL, "Always Pad", "always"}, + {0, NULL, NULL} + }; + + if (!two_lame_padding_type) { + two_lame_padding_type = + g_enum_register_static ("GstTwoLamePadding", two_lame_padding); + } + return two_lame_padding_type; +} + +#define GST_TYPE_TWO_LAME_EMPHASIS (gst_two_lame_emphasis_get_type()) +static GType +gst_two_lame_emphasis_get_type (void) +{ + static GType two_lame_emphasis_type = 0; + static GEnumValue two_lame_emphasis[] = { + {TWOLAME_EMPHASIS_N, "No emphasis", "none"}, + {TWOLAME_EMPHASIS_5, "50/15 ms", "5"}, + {TWOLAME_EMPHASIS_C, "CCIT J.17", "ccit"}, + {0, NULL, NULL} + }; + + if (!two_lame_emphasis_type) { + two_lame_emphasis_type = + g_enum_register_static ("GstTwoLameEmphasis", two_lame_emphasis); + } + + return two_lame_emphasis_type; +} + +/********** Standard stuff for signals and arguments **********/ + +enum +{ + ARG_0, + ARG_MODE, + ARG_PSYMODEL, + ARG_BITRATE, + ARG_PADDING, + ARG_ENERGY_LEVEL_EXTENSION, + ARG_EMPHASIS, + ARG_ERROR_PROTECTION, + ARG_COPYRIGHT, + ARG_ORIGINAL, + ARG_VBR, + ARG_VBR_LEVEL, + ARG_ATH_LEVEL, + ARG_VBR_MAX_BITRATE, + ARG_QUICK_MODE, + ARG_QUICK_MODE_COUNT +}; + +static gboolean gst_two_lame_start (GstAudioEncoder * enc); +static gboolean gst_two_lame_stop (GstAudioEncoder * enc); +static gboolean gst_two_lame_set_format (GstAudioEncoder * enc, + GstAudioInfo * info); +static GstFlowReturn gst_two_lame_handle_frame (GstAudioEncoder * enc, + GstBuffer * in_buf); +static void gst_two_lame_flush (GstAudioEncoder * enc); + +static void gst_two_lame_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_two_lame_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); +static gboolean gst_two_lame_setup (GstTwoLame * twolame); + +G_DEFINE_TYPE (GstTwoLame, gst_two_lame, GST_TYPE_AUDIO_ENCODER); + +static void +gst_two_lame_release_memory (GstTwoLame * twolame) +{ + if (twolame->glopts) { + twolame_close (&twolame->glopts); + twolame->glopts = NULL; + } +} + +static void +gst_two_lame_finalize (GObject * obj) +{ + gst_two_lame_release_memory (GST_TWO_LAME (obj)); + + G_OBJECT_CLASS (gst_two_lame_parent_class)->finalize (obj); +} + +static void +gst_two_lame_class_init (GstTwoLameClass * klass) +{ + GObjectClass *gobject_class; + GstAudioEncoderClass *gstbase_class; + + gobject_class = (GObjectClass *) klass; + gstbase_class = (GstAudioEncoderClass *) klass; + + gobject_class->set_property = gst_two_lame_set_property; + gobject_class->get_property = gst_two_lame_get_property; + gobject_class->finalize = gst_two_lame_finalize; + + gstbase_class->start = GST_DEBUG_FUNCPTR (gst_two_lame_start); + gstbase_class->stop = GST_DEBUG_FUNCPTR (gst_two_lame_stop); + gstbase_class->set_format = GST_DEBUG_FUNCPTR (gst_two_lame_set_format); + gstbase_class->handle_frame = GST_DEBUG_FUNCPTR (gst_two_lame_handle_frame); + gstbase_class->flush = GST_DEBUG_FUNCPTR (gst_two_lame_flush); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MODE, + g_param_spec_enum ("mode", "Mode", "Encoding mode", + GST_TYPE_TWO_LAME_MODE, gst_two_lame_default_settings.mode, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PSYMODEL, + g_param_spec_int ("psymodel", "Psychoacoustic Model", + "Psychoacoustic model used to encode the audio", + -1, 4, gst_two_lame_default_settings.psymodel, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, + g_param_spec_int ("bitrate", "Bitrate (kb/s)", + "Bitrate in kbit/sec (8, 16, 24, 32, 40, 48, 56, 64, 80, 96, " + "112, 128, 144, 160, 192, 224, 256, 320, 384)", + 8, 384, gst_two_lame_default_settings.bitrate, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PADDING, + g_param_spec_enum ("padding", "Padding", "Padding type", + GST_TYPE_TWO_LAME_PADDING, gst_two_lame_default_settings.padding, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), + ARG_ENERGY_LEVEL_EXTENSION, + g_param_spec_boolean ("energy-level-extension", "Energy Level Extension", + "Write peak PCM level to each frame", + gst_two_lame_default_settings.energy_level_extension, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_EMPHASIS, + g_param_spec_enum ("emphasis", "Emphasis", + "Pre-emphasis to apply to the decoded audio", + GST_TYPE_TWO_LAME_EMPHASIS, gst_two_lame_default_settings.emphasis, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ERROR_PROTECTION, + g_param_spec_boolean ("error-protection", "Error protection", + "Adds checksum to every frame", + gst_two_lame_default_settings.error_protection, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_COPYRIGHT, + g_param_spec_boolean ("copyright", "Copyright", "Mark as copyright", + gst_two_lame_default_settings.copyright, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ORIGINAL, + g_param_spec_boolean ("original", "Original", "Mark as original", + gst_two_lame_default_settings.original, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VBR, + g_param_spec_boolean ("vbr", "VBR", "Enable variable bitrate mode", + gst_two_lame_default_settings.vbr, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VBR_LEVEL, + g_param_spec_float ("vbr-level", "VBR Level", "VBR Level", + -10.0, 10.0, gst_two_lame_default_settings.vbr_level, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ATH_LEVEL, + g_param_spec_float ("ath-level", "ATH Level", "ATH Level in dB", + -G_MAXFLOAT, G_MAXFLOAT, gst_two_lame_default_settings.ath_level, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VBR_MAX_BITRATE, + g_param_spec_int ("vbr-max-bitrate", "VBR max bitrate", + "Specify maximum VBR bitrate (0=off, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, " + "112, 128, 144, 160, 192, 224, 256, 320, 384)", + 0, 384, gst_two_lame_default_settings.vbr_max_bitrate, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUICK_MODE, + g_param_spec_boolean ("quick-mode", "Quick mode", + "Calculate Psymodel every frames", + gst_two_lame_default_settings.quick_mode, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUICK_MODE_COUNT, + g_param_spec_int ("quick-mode-count", "Quick mode count", + "Calculate Psymodel every n frames", + 0, G_MAXINT, gst_two_lame_default_settings.quick_mode_count, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_static_pad_template_get (&gst_two_lame_src_template)); + gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass), + gst_static_pad_template_get (&gst_two_lame_sink_template)); + + gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass), + "TwoLAME mp2 encoder", "Codec/Encoder/Audio", + "High-quality free MP2 encoder", + "Sebastian Dröge "); +} + +static gboolean +gst_two_lame_set_format (GstAudioEncoder * enc, GstAudioInfo * info) +{ + GstTwoLame *twolame; + gint out_samplerate; + gint version; + GstCaps *othercaps; + + twolame = GST_TWO_LAME (enc); + + /* parameters already parsed for us */ + twolame->samplerate = GST_AUDIO_INFO_RATE (info); + twolame->num_channels = GST_AUDIO_INFO_CHANNELS (info); + twolame->float_input = !GST_AUDIO_INFO_IS_INTEGER (info); + + /* but we might be asked to reconfigure, so reset */ + gst_two_lame_release_memory (twolame); + + GST_DEBUG_OBJECT (twolame, "setting up twolame"); + if (!gst_two_lame_setup (twolame)) + goto setup_failed; + + out_samplerate = twolame_get_out_samplerate (twolame->glopts); + if (out_samplerate == 0) + goto zero_output_rate; + + if (out_samplerate != twolame->samplerate) { + GST_WARNING_OBJECT (twolame, + "output samplerate %d is different from incoming samplerate %d", + out_samplerate, twolame->samplerate); + } + + version = twolame_get_version (twolame->glopts); + if (version == TWOLAME_MPEG2) + version = 2; + else + version = 1; + + othercaps = + gst_caps_new_simple ("audio/mpeg", + "mpegversion", G_TYPE_INT, 1, + "mpegaudioversion", G_TYPE_INT, version, + "layer", G_TYPE_INT, 2, + "channels", G_TYPE_INT, + twolame->mode == TWOLAME_MONO ? 1 : twolame->num_channels, "rate", + G_TYPE_INT, out_samplerate, NULL); + + /* and use these caps */ + gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (twolame), othercaps); + gst_caps_unref (othercaps); + + /* report needs to base class: + * hand one frame at a time, if we are pretty sure what a frame is */ + if (out_samplerate == twolame->samplerate) { + gst_audio_encoder_set_frame_samples_min (enc, 1152); + gst_audio_encoder_set_frame_samples_max (enc, 1152); + gst_audio_encoder_set_frame_max (enc, 1); + } + + return TRUE; + +zero_output_rate: + { + GST_ELEMENT_ERROR (twolame, LIBRARY, SETTINGS, (NULL), + ("TwoLAME decided on a zero sample rate")); + return FALSE; + } +setup_failed: + { + GST_ELEMENT_ERROR (twolame, LIBRARY, SETTINGS, + (_("Failed to configure TwoLAME encoder. Check your encoding parameters.")), (NULL)); + return FALSE; + } +} + +static void +gst_two_lame_init (GstTwoLame * twolame) +{ + GST_DEBUG_OBJECT (twolame, "starting initialization"); + + twolame->mode = gst_two_lame_default_settings.mode; + twolame->psymodel = gst_two_lame_default_settings.psymodel; + twolame->bitrate = gst_two_lame_default_settings.bitrate; + twolame->padding = gst_two_lame_default_settings.padding; + twolame->energy_level_extension = + gst_two_lame_default_settings.energy_level_extension; + twolame->emphasis = gst_two_lame_default_settings.emphasis; + twolame->error_protection = gst_two_lame_default_settings.error_protection; + twolame->copyright = gst_two_lame_default_settings.copyright; + twolame->original = gst_two_lame_default_settings.original; + twolame->vbr = gst_two_lame_default_settings.vbr; + twolame->vbr_level = gst_two_lame_default_settings.vbr_level; + twolame->ath_level = gst_two_lame_default_settings.ath_level; + twolame->vbr_max_bitrate = gst_two_lame_default_settings.vbr_max_bitrate; + twolame->quick_mode = gst_two_lame_default_settings.quick_mode; + twolame->quick_mode_count = gst_two_lame_default_settings.quick_mode_count; + + GST_DEBUG_OBJECT (twolame, "done initializing"); +} + +static gboolean +gst_two_lame_start (GstAudioEncoder * enc) +{ + GstTwoLame *twolame = GST_TWO_LAME (enc); + + GST_DEBUG_OBJECT (twolame, "start"); + return TRUE; +} + +static gboolean +gst_two_lame_stop (GstAudioEncoder * enc) +{ + GstTwoLame *twolame = GST_TWO_LAME (enc); + + GST_DEBUG_OBJECT (twolame, "stop"); + + gst_two_lame_release_memory (twolame); + return TRUE; +} + +/* three underscores for ___rate is really really really + * private as opposed to one underscore */ +/* call this MACRO outside of the NULL state so that we have a higher chance + * of actually having a pipeline and bus to get the message through */ + +#define CHECK_AND_FIXUP_BITRATE(obj,param,rate) \ +G_STMT_START { \ + gint ___rate = rate; \ + gint maxrate = 320; \ + gint multiplier = 64; \ + if (rate <= 64) { \ + maxrate = 64; multiplier = 8; \ + if ((rate % 8) != 0) ___rate = GST_ROUND_UP_8 (rate); \ + } else if (rate <= 144) { \ + maxrate = 144; multiplier = 16; \ + if ((rate % 16) != 0) ___rate = GST_ROUND_UP_16 (rate); \ + } else if (rate <= 256) { \ + maxrate = 256; multiplier = 32; \ + if ((rate % 32) != 0) ___rate = GST_ROUND_UP_32 (rate); \ + } else if (rate <= 384) { \ + maxrate = 384; multiplier = 64; \ + if ((rate % 64) != 0) ___rate = GST_ROUND_UP_64 (rate); \ + } \ + if (___rate != rate) { \ + GST_ELEMENT_WARNING (obj, LIBRARY, SETTINGS, \ + (_("The requested bitrate %d kbit/s for property '%s' " \ + "is not allowed. " \ + "The bitrate was changed to %d kbit/s."), rate, \ + param, ___rate), \ + ("A bitrate below %d should be a multiple of %d.", \ + maxrate, multiplier)); \ + rate = ___rate; \ + } \ +} G_STMT_END + +static void +gst_two_lame_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstTwoLame *twolame = GST_TWO_LAME (object); + + switch (prop_id) { + case ARG_MODE: + twolame->mode = g_value_get_enum (value); + break; + case ARG_PSYMODEL: + twolame->psymodel = g_value_get_int (value); + break; + case ARG_BITRATE: + twolame->bitrate = g_value_get_int (value); + break; + case ARG_PADDING: + twolame->padding = g_value_get_enum (value); + break; + case ARG_ENERGY_LEVEL_EXTENSION: + twolame->energy_level_extension = g_value_get_boolean (value); + break; + case ARG_EMPHASIS: + twolame->emphasis = g_value_get_enum (value); + break; + case ARG_ERROR_PROTECTION: + twolame->error_protection = g_value_get_boolean (value); + break; + case ARG_COPYRIGHT: + twolame->copyright = g_value_get_boolean (value); + break; + case ARG_ORIGINAL: + twolame->original = g_value_get_boolean (value); + break; + case ARG_VBR: + twolame->vbr = g_value_get_boolean (value); + break; + case ARG_VBR_LEVEL: + twolame->vbr_level = g_value_get_float (value); + break; + case ARG_ATH_LEVEL: + twolame->ath_level = g_value_get_float (value); + break; + case ARG_VBR_MAX_BITRATE: + twolame->vbr_max_bitrate = g_value_get_int (value); + break; + case ARG_QUICK_MODE: + twolame->quick_mode = g_value_get_boolean (value); + break; + case ARG_QUICK_MODE_COUNT: + twolame->quick_mode_count = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_two_lame_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) +{ + GstTwoLame *twolame = GST_TWO_LAME (object); + + switch (prop_id) { + case ARG_MODE: + g_value_set_enum (value, twolame->mode); + break; + case ARG_PSYMODEL: + g_value_set_int (value, twolame->psymodel); + break; + case ARG_BITRATE: + g_value_set_int (value, twolame->bitrate); + break; + case ARG_PADDING: + g_value_set_enum (value, twolame->padding); + break; + case ARG_ENERGY_LEVEL_EXTENSION: + g_value_set_boolean (value, twolame->energy_level_extension); + break; + case ARG_EMPHASIS: + g_value_set_enum (value, twolame->emphasis); + break; + case ARG_ERROR_PROTECTION: + g_value_set_boolean (value, twolame->error_protection); + break; + case ARG_COPYRIGHT: + g_value_set_boolean (value, twolame->copyright); + break; + case ARG_ORIGINAL: + g_value_set_boolean (value, twolame->original); + break; + case ARG_VBR: + g_value_set_boolean (value, twolame->vbr); + break; + case ARG_VBR_LEVEL: + g_value_set_float (value, twolame->vbr_level); + break; + case ARG_ATH_LEVEL: + g_value_set_float (value, twolame->ath_level); + break; + case ARG_VBR_MAX_BITRATE: + g_value_set_int (value, twolame->vbr_max_bitrate); + break; + case ARG_QUICK_MODE: + g_value_set_boolean (value, twolame->quick_mode); + break; + case ARG_QUICK_MODE_COUNT: + g_value_set_int (value, twolame->quick_mode_count); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static GstFlowReturn +gst_two_lame_flush_full (GstTwoLame * lame, gboolean push) +{ + GstBuffer *buf; + GstMapInfo map; + gint size; + GstFlowReturn result = GST_FLOW_OK; + + if (!lame->glopts) + return GST_FLOW_OK; + + buf = gst_buffer_new_and_alloc (16384); + gst_buffer_map (buf, &map, GST_MAP_WRITE); + size = twolame_encode_flush (lame->glopts, map.data, 16384); + gst_buffer_unmap (buf, &map); + + if (size > 0 && push) { + gst_buffer_set_size (buf, size); + GST_DEBUG_OBJECT (lame, "pushing final packet of %u bytes", size); + result = gst_audio_encoder_finish_frame (GST_AUDIO_ENCODER (lame), buf, -1); + } else { + GST_DEBUG_OBJECT (lame, "no final packet (size=%d, push=%d)", size, push); + gst_buffer_unref (buf); + result = GST_FLOW_OK; + } + return result; +} + +static void +gst_two_lame_flush (GstAudioEncoder * enc) +{ + gst_two_lame_flush_full (GST_TWO_LAME (enc), FALSE); +} + +static GstFlowReturn +gst_two_lame_handle_frame (GstAudioEncoder * enc, GstBuffer * buf) +{ + GstTwoLame *twolame; + gint mp3_buffer_size, mp3_size; + GstBuffer *mp3_buf; + GstFlowReturn result; + gint num_samples; + GstMapInfo map, mp3_map; + + twolame = GST_TWO_LAME (enc); + + /* squeeze remaining and push */ + if (G_UNLIKELY (buf == NULL)) + return gst_two_lame_flush_full (twolame, TRUE); + + gst_buffer_map (buf, &map, GST_MAP_READ); + + if (twolame->float_input) + num_samples = map.size / 4; + else + num_samples = map.size / 2; + + /* allocate space for output */ + mp3_buffer_size = 1.25 * num_samples + 16384; + mp3_buf = gst_buffer_new_and_alloc (mp3_buffer_size); + gst_buffer_map (mp3_buf, &mp3_map, GST_MAP_WRITE); + + if (twolame->num_channels == 1) { + if (twolame->float_input) + mp3_size = twolame_encode_buffer_float32 (twolame->glopts, + (float *) map.data, + (float *) map.data, num_samples, mp3_map.data, mp3_buffer_size); + else + mp3_size = twolame_encode_buffer (twolame->glopts, + (short int *) map.data, + (short int *) map.data, num_samples, mp3_map.data, mp3_buffer_size); + } else { + if (twolame->float_input) + mp3_size = twolame_encode_buffer_float32_interleaved (twolame->glopts, + (float *) map.data, + num_samples / twolame->num_channels, mp3_map.data, mp3_buffer_size); + else + mp3_size = twolame_encode_buffer_interleaved (twolame->glopts, + (short int *) map.data, + num_samples / twolame->num_channels, mp3_map.data, mp3_buffer_size); + } + + GST_LOG_OBJECT (twolame, "encoded %" G_GSIZE_FORMAT " bytes of audio " + "to %d bytes of mp3", map.size, mp3_size); + + gst_buffer_unmap (buf, &map); + gst_buffer_unmap (mp3_buf, &mp3_map); + + if (mp3_size > 0) { + gst_buffer_set_size (mp3_buf, mp3_size); + result = gst_audio_encoder_finish_frame (enc, mp3_buf, -1); + } else { + if (mp3_size < 0) { + /* eat error ? */ + g_warning ("error %d", mp3_size); + } + gst_buffer_unref (mp3_buf); + result = GST_FLOW_OK; + } + + return result; +} + +/* set up the encoder state */ +static gboolean +gst_two_lame_setup (GstTwoLame * twolame) +{ + +#define CHECK_ERROR(command) G_STMT_START {\ + if ((command) < 0) { \ + GST_ERROR_OBJECT (twolame, "setup failed: " G_STRINGIFY (command)); \ + return FALSE; \ + } \ +}G_STMT_END + + int retval; + GstCaps *allowed_caps; + + GST_DEBUG_OBJECT (twolame, "starting setup"); + + /* check if we're already setup; if we are, we might want to check + * if this initialization is compatible with the previous one */ + /* FIXME: do this */ + if (twolame->setup) { + GST_WARNING_OBJECT (twolame, "already setup"); + twolame->setup = FALSE; + } + + twolame->glopts = twolame_init (); + + if (twolame->glopts == NULL) + return FALSE; + + /* copy the parameters over */ + twolame_set_in_samplerate (twolame->glopts, twolame->samplerate); + + /* let twolame choose default samplerate unless outgoing sample rate is fixed */ + allowed_caps = gst_pad_get_allowed_caps (GST_AUDIO_ENCODER_SRC_PAD (twolame)); + + if (allowed_caps != NULL) { + GstStructure *structure; + gint samplerate; + + structure = gst_caps_get_structure (allowed_caps, 0); + + if (gst_structure_get_int (structure, "rate", &samplerate)) { + GST_DEBUG_OBJECT (twolame, + "Setting sample rate to %d as fixed in src caps", samplerate); + twolame_set_out_samplerate (twolame->glopts, samplerate); + } else { + GST_DEBUG_OBJECT (twolame, "Letting twolame choose sample rate"); + twolame_set_out_samplerate (twolame->glopts, 0); + } + gst_caps_unref (allowed_caps); + allowed_caps = NULL; + } else { + GST_DEBUG_OBJECT (twolame, + "No peer yet, letting twolame choose sample rate"); + twolame_set_out_samplerate (twolame->glopts, 0); + } + + /* force mono encoding if we only have one channel */ + if (twolame->num_channels == 1) + twolame->mode = 3; + + /* Fix bitrates and MPEG version */ + + CHECK_ERROR (twolame_set_num_channels (twolame->glopts, + twolame->num_channels)); + + CHECK_ERROR (twolame_set_mode (twolame->glopts, twolame->mode)); + CHECK_ERROR (twolame_set_psymodel (twolame->glopts, twolame->psymodel)); + CHECK_AND_FIXUP_BITRATE (twolame, "bitrate", twolame->bitrate); + CHECK_ERROR (twolame_set_bitrate (twolame->glopts, twolame->bitrate)); + CHECK_ERROR (twolame_set_padding (twolame->glopts, twolame->padding)); + CHECK_ERROR (twolame_set_energy_levels (twolame->glopts, + twolame->energy_level_extension)); + CHECK_ERROR (twolame_set_emphasis (twolame->glopts, twolame->emphasis)); + CHECK_ERROR (twolame_set_error_protection (twolame->glopts, + twolame->error_protection)); + CHECK_ERROR (twolame_set_copyright (twolame->glopts, twolame->copyright)); + CHECK_ERROR (twolame_set_original (twolame->glopts, twolame->original)); + CHECK_ERROR (twolame_set_VBR (twolame->glopts, twolame->vbr)); + CHECK_ERROR (twolame_set_VBR_level (twolame->glopts, twolame->vbr_level)); + CHECK_ERROR (twolame_set_ATH_level (twolame->glopts, twolame->ath_level)); + CHECK_AND_FIXUP_BITRATE (twolame, "vbr-max-bitrate", + twolame->vbr_max_bitrate); + CHECK_ERROR (twolame_set_VBR_max_bitrate_kbps (twolame->glopts, + twolame->vbr_max_bitrate)); + CHECK_ERROR (twolame_set_quick_mode (twolame->glopts, twolame->quick_mode)); + CHECK_ERROR (twolame_set_quick_count (twolame->glopts, + twolame->quick_mode_count)); + + /* initialize the twolame encoder */ + if ((retval = twolame_init_params (twolame->glopts)) >= 0) { + twolame->setup = TRUE; + /* FIXME: it would be nice to print out the mode here */ + GST_INFO ("twolame encoder setup (%d kbit/s, %d Hz, %d channels)", + twolame->bitrate, twolame->samplerate, twolame->num_channels); + } else { + GST_ERROR_OBJECT (twolame, "twolame_init_params returned %d", retval); + } + + GST_DEBUG_OBJECT (twolame, "done with setup"); + + return twolame->setup; +#undef CHECK_ERROR +} + +static gboolean +gst_two_lame_get_default_settings (void) +{ + twolame_options *glopts = NULL; + + glopts = twolame_init (); + if (glopts == NULL) { + GST_ERROR ("Couldn't initialize TwoLAME"); + return FALSE; + } + + twolame_set_num_channels (glopts, 2); + twolame_set_in_samplerate (glopts, 44100); + + if (twolame_init_params (glopts) != 0) { + GST_ERROR ("Couldn't set default parameters"); + return FALSE; + } + + gst_two_lame_default_settings.mode = TWOLAME_JOINT_STEREO; /* twolame_get_mode (glopts); */ + gst_two_lame_default_settings.psymodel = twolame_get_psymodel (glopts); + gst_two_lame_default_settings.bitrate = twolame_get_bitrate (glopts); + gst_two_lame_default_settings.padding = twolame_get_padding (glopts); + gst_two_lame_default_settings.energy_level_extension = + twolame_get_energy_levels (glopts); + gst_two_lame_default_settings.emphasis = twolame_get_emphasis (glopts); + gst_two_lame_default_settings.error_protection = + twolame_get_error_protection (glopts); + gst_two_lame_default_settings.copyright = twolame_get_copyright (glopts); + gst_two_lame_default_settings.original = twolame_get_original (glopts); + gst_two_lame_default_settings.vbr = twolame_get_VBR (glopts); + gst_two_lame_default_settings.vbr_level = twolame_get_VBR_level (glopts); + gst_two_lame_default_settings.ath_level = twolame_get_ATH_level (glopts); + gst_two_lame_default_settings.vbr_max_bitrate = + twolame_get_VBR_max_bitrate_kbps (glopts); + gst_two_lame_default_settings.quick_mode = twolame_get_quick_mode (glopts); + gst_two_lame_default_settings.quick_mode_count = + twolame_get_quick_count (glopts); + + twolame_close (&glopts); + + return TRUE; +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (debug, "twolame", 0, "twolame mp2 encoder"); + + if (!gst_two_lame_get_default_settings ()) + return FALSE; + +#ifdef ENABLE_NLS + GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE, + LOCALEDIR); + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif /* ENABLE_NLS */ + + if (!gst_element_register (plugin, "twolamemp2enc", GST_RANK_PRIMARY, + GST_TYPE_TWO_LAME)) + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + twolame, + "Encode MP2s with TwoLAME", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/ext/twolame/gsttwolamemp2enc.h b/ext/twolame/gsttwolamemp2enc.h new file mode 100644 index 0000000..72a6bea --- /dev/null +++ b/ext/twolame/gsttwolamemp2enc.h @@ -0,0 +1,88 @@ +/* GStreamer + * Copyright (C) <1999> Erik Walthinsen + * Copyright (C) <2008> Sebastian Dröge + * + * 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_TWO_LAME_H__ +#define __GST_TWO_LAME_H__ + + +#include +#include + +G_BEGIN_DECLS + +#include + +#define GST_TYPE_TWO_LAME \ + (gst_two_lame_get_type()) +#define GST_TWO_LAME(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TWO_LAME,GstTwoLame)) +#define GST_TWO_LAME_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TWO_LAME,GstTwoLameClass)) +#define GST_IS_TWO_LAME(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TWO_LAME)) +#define GST_IS_TWO_LAME_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TWO_LAME)) + +typedef struct _GstTwoLame GstTwoLame; +typedef struct _GstTwoLameClass GstTwoLameClass; + +/** + * GstTwoLame: + * + * Opaque data structure. + */ +struct _GstTwoLame { + GstAudioEncoder element; + + gint samplerate; + gint num_channels; + gboolean float_input; + gboolean setup; + + gint mode; + gint psymodel; + gint bitrate; + gint padding; + gboolean energy_level_extension; + gint emphasis; + gboolean error_protection; + gboolean copyright; + gboolean original; + gboolean vbr; + gfloat vbr_level; + gfloat ath_level; + gint vbr_max_bitrate; + gboolean quick_mode; + gint quick_mode_count; + + twolame_options *glopts; +}; + +struct _GstTwoLameClass { + GstAudioEncoderClass parent_class; +}; + +GType gst_two_lame_get_type(void); + +G_END_DECLS + + +#endif /* __GST_TWO_LAME_H__ */ diff --git a/ext/x264/GstX264Enc.prs b/ext/x264/GstX264Enc.prs new file mode 100644 index 0000000..84c76a9 --- /dev/null +++ b/ext/x264/GstX264Enc.prs @@ -0,0 +1,44 @@ +[_presets_] +version=0.10 +element-name=GstX264Enc + +[Profile Baseline] +_meta/comment=Baseline Profile +bframes=0 +cabac=false +dct8x8=false + +[Profile Main] +_meta/comment=Main Profile +cabac=true +dct8x8=false + +[Profile High] +_meta/comment=High Profile +cabac=true +dct8x8=true + +[Quality Low] +_meta/comment=Low quality +pass=qual +quantizer=27 +subme=4 +threads=0 + +[Quality Normal] +_meta/comment=Normal quality +pass=qual +quantizer=21 +me=umh +subme=6 +ref=3 +threads=0 + +[Quality High] +_meta/comment=High quality +pass=qual +quantizer=18 +me=umh +subme=6 +ref=3 +threads=0 diff --git a/ext/x264/Makefile.am b/ext/x264/Makefile.am new file mode 100644 index 0000000..aae9603 --- /dev/null +++ b/ext/x264/Makefile.am @@ -0,0 +1,37 @@ +plugin_LTLIBRARIES = libgstx264.la + +libgstx264_la_SOURCES = gstx264enc.c +libgstx264_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(X264_CFLAGS) +libgstx264_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + -lgstvideo-$(GST_API_VERSION) \ + -lgstpbutils-$(GST_API_VERSION) \ + $(GST_LIBS) \ + $(X264_LIBS) +libgstx264_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstx264_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) + +noinst_HEADERS = gstx264enc.h + +presetdir = $(datadir)/gstreamer-$(GST_API_VERSION)/presets +preset_DATA = GstX264Enc.prs + +EXTRA_DIST = $(preset_DATA) + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer \ + -:PROJECT libgstx264 -:SHARED libgstx264 \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstx264_la_SOURCES) \ + -:CPPFLAGS $(CPPFLAGS) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstx264_la_CFLAGS) -I'$$(GSTREAMER_AGGREGATE_TOP)/x264' \ + -:LDFLAGS $(libgstx264_la_LDFLAGS) \ + $(libgstx264_la_LIBADD) \ + -ldl \ + -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ + LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \ + > $@ diff --git a/ext/x264/Makefile.in b/ext/x264/Makefile.in new file mode 100644 index 0000000..b614506 --- /dev/null +++ b/ext/x264/Makefile.in @@ -0,0 +1,876 @@ +# 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 = ext/x264 +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-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-function.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-plugin-docs.m4 \ + $(top_srcdir)/common/m4/gst-plugindir.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/a52.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gst-sid.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)" "$(DESTDIR)$(presetdir)" +LTLIBRARIES = $(plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgstx264_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libgstx264_la_OBJECTS = libgstx264_la-gstx264enc.lo +libgstx264_la_OBJECTS = $(am_libgstx264_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 = +libgstx264_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(libgstx264_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(libgstx264_la_CFLAGS) $(CFLAGS) \ + $(libgstx264_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 = $(libgstx264_la_SOURCES) +DIST_SOURCES = $(libgstx264_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(preset_DATA) +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) +A52DEC_CFLAGS = @A52DEC_CFLAGS@ +A52DEC_LIBS = @A52DEC_LIBS@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMRNB_CFLAGS = @AMRNB_CFLAGS@ +AMRNB_LIBS = @AMRNB_LIBS@ +AMRWB_CFLAGS = @AMRWB_CFLAGS@ +AMRWB_LIBS = @AMRWB_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CDIO_CFLAGS = @CDIO_CFLAGS@ +CDIO_LIBS = @CDIO_LIBS@ +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@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DVDREAD_LIBS = @DVDREAD_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERROR_CFLAGS = @ERROR_CFLAGS@ +ERROR_CXXFLAGS = @ERROR_CXXFLAGS@ +EXEEXT = @EXEEXT@ +FFLAGS = @FFLAGS@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_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@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +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_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_OPTION_CFLAGS = @GST_OPTION_CFLAGS@ +GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@ +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@ +HAVE_CXX = @HAVE_CXX@ +HAVE_DVDREAD = @HAVE_DVDREAD@ +HAVE_LAME = @HAVE_LAME@ +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@ +LAME_CFLAGS = @LAME_CFLAGS@ +LAME_LIBS = @LAME_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALEDIR = @LOCALEDIR@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAD_CFLAGS = @MAD_CFLAGS@ +MAD_LIBS = @MAD_LIBS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@ +MPEG2DEC_LIBS = @MPEG2DEC_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +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@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@ +SIDPLAY_LIBS = @SIDPLAY_LIBS@ +STRIP = @STRIP@ +TWOLAME_CFLAGS = @TWOLAME_CFLAGS@ +TWOLAME_LIBS = @TWOLAME_LIBS@ +USE_NLS = @USE_NLS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VALGRIND_PATH = @VALGRIND_PATH@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WARNING_CXXFLAGS = @WARNING_CXXFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +X264_CFLAGS = @X264_CFLAGS@ +X264_LIBS = @X264_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +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@ +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 = libgstx264.la +libgstx264_la_SOURCES = gstx264enc.c +libgstx264_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CFLAGS) \ + $(X264_CFLAGS) + +libgstx264_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + -lgstvideo-$(GST_API_VERSION) \ + -lgstpbutils-$(GST_API_VERSION) \ + $(GST_LIBS) \ + $(X264_LIBS) + +libgstx264_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstx264_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) +noinst_HEADERS = gstx264enc.h +presetdir = $(datadir)/gstreamer-$(GST_API_VERSION)/presets +preset_DATA = GstX264Enc.prs +EXTRA_DIST = $(preset_DATA) +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 ext/x264/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ext/x264/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}; \ + } + +libgstx264.la: $(libgstx264_la_OBJECTS) $(libgstx264_la_DEPENDENCIES) $(EXTRA_libgstx264_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgstx264_la_LINK) -rpath $(plugindir) $(libgstx264_la_OBJECTS) $(libgstx264_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstx264_la-gstx264enc.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 $@ $< + +libgstx264_la-gstx264enc.lo: gstx264enc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstx264_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstx264_la_CFLAGS) $(CFLAGS) -MT libgstx264_la-gstx264enc.lo -MD -MP -MF $(DEPDIR)/libgstx264_la-gstx264enc.Tpo -c -o libgstx264_la-gstx264enc.lo `test -f 'gstx264enc.c' || echo '$(srcdir)/'`gstx264enc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstx264_la-gstx264enc.Tpo $(DEPDIR)/libgstx264_la-gstx264enc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstx264enc.c' object='libgstx264_la-gstx264enc.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 $(libgstx264_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstx264_la_CFLAGS) $(CFLAGS) -c -o libgstx264_la-gstx264enc.lo `test -f 'gstx264enc.c' || echo '$(srcdir)/'`gstx264enc.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-presetDATA: $(preset_DATA) + @$(NORMAL_INSTALL) + @list='$(preset_DATA)'; test -n "$(presetdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(presetdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(presetdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(presetdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(presetdir)" || exit $$?; \ + done + +uninstall-presetDATA: + @$(NORMAL_UNINSTALL) + @list='$(preset_DATA)'; test -n "$(presetdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(presetdir)'; $(am__uninstall_files_from_dir) + +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) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(presetdir)"; 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-presetDATA + +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 uninstall-presetDATA + +.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-presetDATA 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 uninstall-presetDATA + + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer \ + -:PROJECT libgstx264 -:SHARED libgstx264 \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgstx264_la_SOURCES) \ + -:CPPFLAGS $(CPPFLAGS) \ + -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstx264_la_CFLAGS) -I'$$(GSTREAMER_AGGREGATE_TOP)/x264' \ + -:LDFLAGS $(libgstx264_la_LDFLAGS) \ + $(libgstx264_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/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c new file mode 100644 index 0000000..e0d84b3 --- /dev/null +++ b/ext/x264/gstx264enc.c @@ -0,0 +1,2503 @@ +/* GStreamer H264 encoder plugin + * Copyright (C) 2005 Michal Benes + * Copyright (C) 2005 Josef Zlomek + * Copyright (C) 2008 Mark Nauwelaerts + * + * 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-x264enc + * @see_also: faac + * + * This element encodes raw video into H264 compressed data, + * also otherwise known as MPEG-4 AVC (Advanced Video Codec). + * + * The #GstX264Enc:pass property controls the type of encoding. In case of Constant + * Bitrate Encoding (actually ABR), the #GstX264Enc:bitrate will determine the quality + * of the encoding. This will similarly be the case if this target bitrate + * is to obtained in multiple (2 or 3) pass encoding. + * Alternatively, one may choose to perform Constant Quantizer or Quality encoding, + * in which case the #GstX264Enc:quantizer property controls much of the outcome, in that case #GstX264Enc:bitrate is the maximum bitrate. + * + * The H264 profile that is eventually used depends on a few settings. + * If #GstX264Enc:dct8x8 is enabled, then High profile is used. + * Otherwise, if #GstX264Enc:cabac entropy coding is enabled or #GstX264Enc:bframes + * are allowed, then Main Profile is in effect, and otherwise Baseline profile + * applies. The high profile is imposed by default, + * which is fine for most software players and settings, + * but in some cases (e.g. hardware platforms) a more restricted profile/level + * may be necessary. The recommended way to set a profile is to set it in the + * downstream caps. + * + * If a preset/tuning are specified then these will define the default values and + * the property defaults will be ignored. After this the option-string property is + * applied, followed by the user-set properties, fast first pass restrictions and + * finally the profile restrictions. + * + * Some settings, including the default settings, may lead to quite + * some latency (i.e. frame buffering) in the encoder. This may cause problems + * with pipeline stalling in non-trivial pipelines, because the encoder latency + * is often considerably higher than the default size of a simple queue + * element. Such problems are caused by one of the queues in the other + * non-x264enc streams/branches filling up and blocking upstream. They can + * be fixed by relaxing the default time/size/buffer limits on the queue + * elements in the non-x264 branches, or using a (single) multiqueue element + * for all branches. Also see the last example below. + * + * + * + * Example pipeline + * |[ + * gst-launch -v videotestsrc num-buffers=1000 ! x264enc qp-min=18 ! \ + * avimux ! filesink location=videotestsrc.avi + * ]| This example pipeline will encode a test video source to H264 muxed in an + * AVI container, while ensuring a sane minimum quantization factor to avoid + * some (excessive) waste. + * |[ + * gst-launch -v videotestsrc num-buffers=1000 ! x264enc pass=quant ! \ + * matroskamux ! filesink location=videotestsrc.avi + * ]| This example pipeline will encode a test video source to H264 using fixed + * quantization, and muxes it in a Matroska container. + * |[ + * gst-launch -v videotestsrc num-buffers=1000 ! x264enc pass=5 quantizer=25 speed-preset=6 ! video/x-h264, profile=baseline ! \ + * qtmux ! filesink location=videotestsrc.mov + * ]| This example pipeline will encode a test video source to H264 using + * constant quality at around Q25 using the 'medium' speed/quality preset and + * restricting the options used so that the output is H.264 Baseline Profile + * compliant and finally multiplexing the output in Quicktime mov format. + * |[ + * gst-launch -v videotestsrc num-buffers=1000 ! tee name=t ! queue ! xvimagesink \ + * t. ! queue ! x264enc rc-lookahead=5 ! fakesink + * ]| This example pipeline will encode a test video source to H264 while + * displaying the input material at the same time. As mentioned above, + * specific settings are needed in this case to avoid pipeline stalling. + * Depending on goals and context, other approaches are possible, e.g. + * tune=zerolatency might be configured, or queue sizes increased. + * + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gstx264enc.h" + +#include +#include +#include +#include + +#include +#include + +GST_DEBUG_CATEGORY_STATIC (x264_enc_debug); +#define GST_CAT_DEFAULT x264_enc_debug + +enum +{ + ARG_0, + ARG_THREADS, + ARG_SLICED_THREADS, + ARG_SYNC_LOOKAHEAD, + ARG_PASS, + ARG_QUANTIZER, + ARG_MULTIPASS_CACHE_FILE, + ARG_BYTE_STREAM, + ARG_BITRATE, + ARG_INTRA_REFRESH, + ARG_VBV_BUF_CAPACITY, + ARG_ME, + ARG_SUBME, + ARG_ANALYSE, + ARG_DCT8x8, + ARG_REF, + ARG_BFRAMES, + ARG_B_ADAPT, + ARG_B_PYRAMID, + ARG_WEIGHTB, + ARG_SPS_ID, + ARG_AU_NALU, + ARG_TRELLIS, + ARG_KEYINT_MAX, + ARG_CABAC, + ARG_QP_MIN, + ARG_QP_MAX, + ARG_QP_STEP, + ARG_IP_FACTOR, + ARG_PB_FACTOR, + ARG_RC_MB_TREE, + ARG_RC_LOOKAHEAD, + ARG_NR, + ARG_INTERLACED, + ARG_OPTION_STRING, + ARG_SPEED_PRESET, + ARG_PSY_TUNE, + ARG_TUNE, +}; + +#define ARG_THREADS_DEFAULT 0 /* 0 means 'auto' which is 1.5x number of CPU cores */ +#define ARG_PASS_DEFAULT 0 +#define ARG_QUANTIZER_DEFAULT 21 +#define ARG_MULTIPASS_CACHE_FILE_DEFAULT "x264.log" +#define ARG_BYTE_STREAM_DEFAULT FALSE +#define ARG_BITRATE_DEFAULT (2 * 1024) +#define ARG_VBV_BUF_CAPACITY_DEFAULT 600 +#define ARG_ME_DEFAULT X264_ME_HEX +#define ARG_SUBME_DEFAULT 1 +#define ARG_ANALYSE_DEFAULT 0 +#define ARG_DCT8x8_DEFAULT FALSE +#define ARG_REF_DEFAULT 1 +#define ARG_BFRAMES_DEFAULT 0 +#define ARG_B_ADAPT_DEFAULT TRUE +#define ARG_B_PYRAMID_DEFAULT FALSE +#define ARG_WEIGHTB_DEFAULT FALSE +#define ARG_SPS_ID_DEFAULT 0 +#define ARG_AU_NALU_DEFAULT TRUE +#define ARG_TRELLIS_DEFAULT TRUE +#define ARG_KEYINT_MAX_DEFAULT 0 +#define ARG_CABAC_DEFAULT TRUE +#define ARG_QP_MIN_DEFAULT 10 +#define ARG_QP_MAX_DEFAULT 51 +#define ARG_QP_STEP_DEFAULT 4 +#define ARG_IP_FACTOR_DEFAULT 1.4 +#define ARG_PB_FACTOR_DEFAULT 1.3 +#define ARG_NR_DEFAULT 0 +#define ARG_INTERLACED_DEFAULT FALSE +#define ARG_SLICED_THREADS_DEFAULT FALSE +#define ARG_SYNC_LOOKAHEAD_DEFAULT -1 +#define ARG_RC_MB_TREE_DEFAULT TRUE +#define ARG_RC_LOOKAHEAD_DEFAULT 40 +#define ARG_INTRA_REFRESH_DEFAULT FALSE +#define ARG_OPTION_STRING_DEFAULT "" +static GString *x264enc_defaults; +#define ARG_SPEED_PRESET_DEFAULT 6 /* 'medium' preset - matches x264 CLI default */ +#define ARG_PSY_TUNE_DEFAULT 0 /* no psy tuning */ +#define ARG_TUNE_DEFAULT 0 /* no tuning */ + +enum +{ + GST_X264_ENC_STREAM_FORMAT_FROM_PROPERTY, + GST_X264_ENC_STREAM_FORMAT_AVC, + GST_X264_ENC_STREAM_FORMAT_BYTE_STREAM +}; + +enum +{ + GST_X264_ENC_PASS_CBR = 0, + GST_X264_ENC_PASS_QUANT = 0x04, + GST_X264_ENC_PASS_QUAL, + GST_X264_ENC_PASS_PASS1 = 0x11, + GST_X264_ENC_PASS_PASS2, + GST_X264_ENC_PASS_PASS3 +}; + +#define GST_X264_ENC_PASS_TYPE (gst_x264_enc_pass_get_type()) +static GType +gst_x264_enc_pass_get_type (void) +{ + static GType pass_type = 0; + + static const GEnumValue pass_types[] = { + {GST_X264_ENC_PASS_CBR, "Constant Bitrate Encoding", "cbr"}, + {GST_X264_ENC_PASS_QUANT, "Constant Quantizer", "quant"}, + {GST_X264_ENC_PASS_QUAL, "Constant Quality", "qual"}, + {GST_X264_ENC_PASS_PASS1, "VBR Encoding - Pass 1", "pass1"}, + {GST_X264_ENC_PASS_PASS2, "VBR Encoding - Pass 2", "pass2"}, + {GST_X264_ENC_PASS_PASS3, "VBR Encoding - Pass 3", "pass3"}, + {0, NULL, NULL} + }; + + if (!pass_type) { + pass_type = g_enum_register_static ("GstX264EncPass", pass_types); + } + return pass_type; +} + +#define GST_X264_ENC_ME_TYPE (gst_x264_enc_me_get_type()) +static GType +gst_x264_enc_me_get_type (void) +{ + static GType me_type = 0; + static GEnumValue *me_types; + int n, i; + + if (me_type != 0) + return me_type; + + n = 0; + while (x264_motion_est_names[n] != NULL) + n++; + + me_types = g_new0 (GEnumValue, n + 1); + + for (i = 0; i < n; i++) { + me_types[i].value = i; + me_types[i].value_name = x264_motion_est_names[i]; + me_types[i].value_nick = x264_motion_est_names[i]; + } + + me_type = g_enum_register_static ("GstX264EncMe", me_types); + + return me_type; +} + +#define GST_X264_ENC_ANALYSE_TYPE (gst_x264_enc_analyse_get_type()) +static GType +gst_x264_enc_analyse_get_type (void) +{ + static GType analyse_type = 0; + static const GFlagsValue analyse_types[] = { + {X264_ANALYSE_I4x4, "i4x4", "i4x4"}, + {X264_ANALYSE_I8x8, "i8x8", "i8x8"}, + {X264_ANALYSE_PSUB16x16, "p8x8", "p8x8"}, + {X264_ANALYSE_PSUB8x8, "p4x4", "p4x4"}, + {X264_ANALYSE_BSUB16x16, "b8x8", "b8x8"}, + {0, NULL, NULL}, + }; + + if (!analyse_type) { + analyse_type = g_flags_register_static ("GstX264EncAnalyse", analyse_types); + } + return analyse_type; +} + +#define GST_X264_ENC_SPEED_PRESET_TYPE (gst_x264_enc_speed_preset_get_type()) +static GType +gst_x264_enc_speed_preset_get_type (void) +{ + static GType speed_preset_type = 0; + static GEnumValue *speed_preset_types; + int n, i; + + if (speed_preset_type != 0) + return speed_preset_type; + + n = 0; + while (x264_preset_names[n] != NULL) + n++; + + speed_preset_types = g_new0 (GEnumValue, n + 2); + + speed_preset_types[0].value = 0; + speed_preset_types[0].value_name = "No preset"; + speed_preset_types[0].value_nick = "None"; + + for (i = 1; i <= n; i++) { + speed_preset_types[i].value = i; + speed_preset_types[i].value_name = x264_preset_names[i - 1]; + speed_preset_types[i].value_nick = x264_preset_names[i - 1]; + } + + speed_preset_type = + g_enum_register_static ("GstX264EncPreset", speed_preset_types); + + return speed_preset_type; +} + +static const GFlagsValue tune_types[] = { + {0x0, "No tuning", "none"}, + {0x1, "Still image", "stillimage"}, + {0x2, "Fast decode", "fastdecode"}, + {0x4, "Zero latency", "zerolatency"}, + {0, NULL, NULL}, +}; + +#define GST_X264_ENC_TUNE_TYPE (gst_x264_enc_tune_get_type()) +static GType +gst_x264_enc_tune_get_type (void) +{ + static GType tune_type = 0; + + if (!tune_type) { + tune_type = g_flags_register_static ("GstX264EncTune", tune_types + 1); + } + return tune_type; +} + +enum +{ + GST_X264_ENC_TUNE_NONE, + GST_X264_ENC_TUNE_FILM, + GST_X264_ENC_TUNE_ANIMATION, + GST_X264_ENC_TUNE_GRAIN, + GST_X264_ENC_TUNE_PSNR, + GST_X264_ENC_TUNE_SSIM, + GST_X264_ENC_TUNE_LAST +}; + +static const GEnumValue psy_tune_types[] = { + {GST_X264_ENC_TUNE_NONE, "No tuning", "none"}, + {GST_X264_ENC_TUNE_FILM, "Film", "film"}, + {GST_X264_ENC_TUNE_ANIMATION, "Animation", "animation"}, + {GST_X264_ENC_TUNE_GRAIN, "Grain", "grain"}, + {GST_X264_ENC_TUNE_PSNR, "PSNR", "psnr"}, + {GST_X264_ENC_TUNE_SSIM, "SSIM", "ssim"}, + {0, NULL, NULL}, +}; + +#define GST_X264_ENC_PSY_TUNE_TYPE (gst_x264_enc_psy_tune_get_type()) +static GType +gst_x264_enc_psy_tune_get_type (void) +{ + static GType psy_tune_type = 0; + + if (!psy_tune_type) { + psy_tune_type = + g_enum_register_static ("GstX264EncPsyTune", psy_tune_types); + } + return psy_tune_type; +} + +static void +gst_x264_enc_build_tunings_string (GstX264Enc * x264enc) +{ + int i = 1; + + if (x264enc->tunings) + g_string_free (x264enc->tunings, TRUE); + + if (x264enc->psy_tune) { + x264enc->tunings = + g_string_new (psy_tune_types[x264enc->psy_tune].value_nick); + } else { + x264enc->tunings = g_string_new (NULL); + } + + while (tune_types[i].value_name) { + if (x264enc->tune & (1 << (i - 1))) + g_string_append_printf (x264enc->tunings, "%s%s", + x264enc->tunings->len ? "," : "", tune_types[i].value_nick); + i++; + } + + if (x264enc->tunings->len) + GST_DEBUG_OBJECT (x264enc, "Constructed tunings string: %s", + x264enc->tunings->str); +} + +#if G_BYTE_ORDER == G_LITTLE_ENDIAN +#define FORMATS "I420, YV12, Y42B, Y444, NV12, I420_10LE, I422_10LE, Y444_10LE" +#else +#define FORMATS "I420, YV12, Y42B, Y444, NV12, I420_10BE, I422_10BE, Y444_10BE" +#endif + +static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("video/x-raw, " + "format = (string) { " FORMATS " }, " + "framerate = (fraction) [0, MAX], " + "width = (int) [ 16, MAX ], " "height = (int) [ 16, MAX ]") + ); + +static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("video/x-h264, " + "framerate = (fraction) [0/1, MAX], " + "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ], " + "stream-format = (string) { avc, byte-stream }, " + "alignment = (string) au, " + "profile = (string) { high-4:4:4, high-4:2:2, high-10, high, main," + " baseline, constrained-baseline, high-4:4:4-intra, high-4:2:2-intra," + " high-10-intra }") + ); + +static void gst_x264_enc_finalize (GObject * object); +static gboolean gst_x264_enc_start (GstVideoEncoder * encoder); +static gboolean gst_x264_enc_stop (GstVideoEncoder * encoder); +static gboolean gst_x264_enc_flush (GstVideoEncoder * encoder); + +static gboolean gst_x264_enc_init_encoder (GstX264Enc * encoder); +static void gst_x264_enc_close_encoder (GstX264Enc * encoder); + +static GstFlowReturn gst_x264_enc_finish (GstVideoEncoder * encoder); +static GstFlowReturn gst_x264_enc_handle_frame (GstVideoEncoder * encoder, + GstVideoCodecFrame * frame); +static void gst_x264_enc_flush_frames (GstX264Enc * encoder, gboolean send); +static GstFlowReturn gst_x264_enc_encode_frame (GstX264Enc * encoder, + x264_picture_t * pic_in, GstVideoCodecFrame * input_frame, int *i_nal, + gboolean send); +static gboolean gst_x264_enc_set_format (GstVideoEncoder * video_enc, + GstVideoCodecState * state); +static gboolean gst_x264_enc_propose_allocation (GstVideoEncoder * encoder, + GstQuery * query); + +static void gst_x264_enc_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_x264_enc_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); + +#define gst_x264_enc_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstX264Enc, gst_x264_enc, GST_TYPE_VIDEO_ENCODER, + G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL)); + +/* don't forget to free the string after use */ +static const gchar * +gst_x264_enc_build_partitions (gint analyse) +{ + GString *string; + + if (!analyse) + return NULL; + + string = g_string_new (NULL); + if (analyse & X264_ANALYSE_I4x4) + g_string_append (string, "i4x4"); + if (analyse & X264_ANALYSE_I8x8) + g_string_append (string, ",i8x8"); + if (analyse & X264_ANALYSE_PSUB16x16) + g_string_append (string, ",p8x8"); + if (analyse & X264_ANALYSE_PSUB8x8) + g_string_append (string, ",p4x4"); + if (analyse & X264_ANALYSE_BSUB16x16) + g_string_append (string, ",b8x8"); + + return (const gchar *) g_string_free (string, FALSE); +} + +static void +set_value (GValue * val, gint count, ...) +{ + const gchar *fmt = NULL; + GValue sval = G_VALUE_INIT; + va_list ap; + gint i; + + g_value_init (&sval, G_TYPE_STRING); + + if (count > 1) + g_value_init (val, GST_TYPE_LIST); + + va_start (ap, count); + for (i = 0; i < count; i++) { + fmt = va_arg (ap, const gchar *); + g_value_set_string (&sval, fmt); + if (count > 1) { + gst_value_list_append_value (val, &sval); + } + } + va_end (ap); + + if (count == 1) + *val = sval; + else + g_value_unset (&sval); +} + +static void +gst_x264_enc_add_x264_chroma_format (GstStructure * s, + int x264_chroma_format_local) +{ + GValue fmt = G_VALUE_INIT; + + if (x264_bit_depth == 8) { + GST_INFO ("This x264 build supports 8-bit depth"); + if (x264_chroma_format_local == 0) { + set_value (&fmt, 5, "I420", "YV12", "Y42B", "Y444", "NV12"); + } else if (x264_chroma_format_local == X264_CSP_I420) { + set_value (&fmt, 3, "I420", "YV12", "NV12"); + } else if (x264_chroma_format_local == X264_CSP_I422) { + set_value (&fmt, 1, "Y42B"); + } else if (x264_chroma_format_local == X264_CSP_I444) { + set_value (&fmt, 1, "Y444"); + } else { + GST_ERROR ("Unsupported chroma format %d", x264_chroma_format_local); + } + } else if (x264_bit_depth == 10) { + GST_INFO ("This x264 build supports 10-bit depth"); + + if (G_BYTE_ORDER == G_LITTLE_ENDIAN) { + if (x264_chroma_format_local == 0) { + set_value (&fmt, 3, "I420_10LE", "I422_10LE", "Y444_10LE"); + } else if (x264_chroma_format_local == X264_CSP_I420) { + set_value (&fmt, 1, "I420_10LE"); + } else if (x264_chroma_format_local == X264_CSP_I422) { + set_value (&fmt, 1, "I422_10LE"); + } else if (x264_chroma_format_local == X264_CSP_I444) { + set_value (&fmt, 1, "Y444_10LE"); + } else { + GST_ERROR ("Unsupported chroma format %d", x264_chroma_format_local); + } + } else { + if (x264_chroma_format_local == 0) { + set_value (&fmt, 3, "I420_10BE", "I422_10BE", "Y444_10BE"); + } else if (x264_chroma_format_local == X264_CSP_I420) { + set_value (&fmt, 1, "I420_10BE"); + } else if (x264_chroma_format_local == X264_CSP_I422) { + set_value (&fmt, 1, "I422_10BE"); + } else if (x264_chroma_format_local == X264_CSP_I444) { + set_value (&fmt, 1, "Y444_10BE"); + } else { + GST_ERROR ("Unsupported chroma format %d", x264_chroma_format_local); + } + } + } else { + GST_ERROR ("Unsupported bit depth %d, we only support 8-bit and 10-bit", + x264_bit_depth); + } + + if (G_VALUE_TYPE (&fmt) != G_TYPE_INVALID) + gst_structure_take_value (s, "format", &fmt); +} + +static GstCaps * +gst_x264_enc_get_supported_input_caps (void) +{ + GstCaps *caps; + + caps = gst_caps_new_simple ("video/x-raw", + "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, + "width", GST_TYPE_INT_RANGE, 16, G_MAXINT, + "height", GST_TYPE_INT_RANGE, 16, G_MAXINT, NULL); + + gst_x264_enc_add_x264_chroma_format (gst_caps_get_structure (caps, 0), + x264_chroma_format); + + GST_DEBUG ("returning %" GST_PTR_FORMAT, caps); + return caps; +} + +static void +check_formats (const gchar * str, gboolean * has_420, gboolean * has_422, + gboolean * has_444) +{ + if (g_str_has_prefix (str, "high-4:4:4")) + *has_444 = TRUE; + else if (g_str_has_prefix (str, "high-4:2:2")) + *has_422 = TRUE; + else + *has_420 = TRUE; +} + + +/* allowed input caps depending on whether libx264 was built for 8 or 10 bits */ +static GstCaps * +gst_x264_enc_sink_getcaps (GstVideoEncoder * enc, GstCaps * filter) +{ + GstCaps *supported_incaps; + GstCaps *allowed; + GstCaps *filter_caps, *fcaps; + gint i, j, k; + + supported_incaps = gst_x264_enc_get_supported_input_caps (); + + /* Allow downstream to specify width/height/framerate/PAR constraints + * and forward them upstream for video converters to handle + */ + if (!supported_incaps) + supported_incaps = gst_pad_get_pad_template_caps (enc->sinkpad); + allowed = gst_pad_get_allowed_caps (enc->srcpad); + + if (!allowed || gst_caps_is_empty (allowed) || gst_caps_is_any (allowed)) { + fcaps = supported_incaps; + goto done; + } + + GST_LOG_OBJECT (enc, "template caps %" GST_PTR_FORMAT, supported_incaps); + GST_LOG_OBJECT (enc, "allowed caps %" GST_PTR_FORMAT, allowed); + + filter_caps = gst_caps_new_empty (); + + for (i = 0; i < gst_caps_get_size (supported_incaps); i++) { + GQuark q_name = + gst_structure_get_name_id (gst_caps_get_structure (supported_incaps, + i)); + + for (j = 0; j < gst_caps_get_size (allowed); j++) { + const GstStructure *allowed_s = gst_caps_get_structure (allowed, j); + const GValue *val; + GstStructure *s; + + s = gst_structure_new_id_empty (q_name); + if ((val = gst_structure_get_value (allowed_s, "width"))) + gst_structure_set_value (s, "width", val); + if ((val = gst_structure_get_value (allowed_s, "height"))) + gst_structure_set_value (s, "height", val); + if ((val = gst_structure_get_value (allowed_s, "framerate"))) + gst_structure_set_value (s, "framerate", val); + if ((val = gst_structure_get_value (allowed_s, "pixel-aspect-ratio"))) + gst_structure_set_value (s, "pixel-aspect-ratio", val); + if ((val = gst_structure_get_value (allowed_s, "profile"))) { + gboolean has_420 = FALSE; + gboolean has_422 = FALSE; + gboolean has_444 = FALSE; + + if (G_VALUE_HOLDS_STRING (val)) { + check_formats (g_value_get_string (val), &has_420, &has_422, + &has_444); + } else if (GST_VALUE_HOLDS_LIST (val)) { + for (k = 0; k < gst_value_list_get_size (val); k++) { + const GValue *vlist = gst_value_list_get_value (val, k); + + if (G_VALUE_HOLDS_STRING (vlist)) + check_formats (g_value_get_string (vlist), &has_420, &has_422, + &has_444); + } + } + + if (has_444 && has_422 && has_420) + gst_x264_enc_add_x264_chroma_format (s, 0); + else if (has_444) + gst_x264_enc_add_x264_chroma_format (s, X264_CSP_I444); + else if (has_422) + gst_x264_enc_add_x264_chroma_format (s, X264_CSP_I422); + else if (has_420) + gst_x264_enc_add_x264_chroma_format (s, X264_CSP_I420); + } + + filter_caps = gst_caps_merge_structure (filter_caps, s); + } + } + + fcaps = gst_caps_intersect (filter_caps, supported_incaps); + gst_caps_unref (filter_caps); + gst_caps_unref (supported_incaps); + + if (filter) { + GST_LOG_OBJECT (enc, "intersecting with %" GST_PTR_FORMAT, filter); + filter_caps = gst_caps_intersect (fcaps, filter); + gst_caps_unref (fcaps); + fcaps = filter_caps; + } + +done: + gst_caps_replace (&allowed, NULL); + + GST_LOG_OBJECT (enc, "proxy caps %" GST_PTR_FORMAT, fcaps); + + return fcaps; +} + +static void +gst_x264_enc_class_init (GstX264EncClass * klass) +{ + GObjectClass *gobject_class; + GstElementClass *element_class; + GstVideoEncoderClass *gstencoder_class; + const gchar *partitions = NULL; + + x264enc_defaults = g_string_new (""); + + gobject_class = G_OBJECT_CLASS (klass); + element_class = GST_ELEMENT_CLASS (klass); + gstencoder_class = GST_VIDEO_ENCODER_CLASS (klass); + + gobject_class->set_property = gst_x264_enc_set_property; + gobject_class->get_property = gst_x264_enc_get_property; + gobject_class->finalize = gst_x264_enc_finalize; + + gstencoder_class->set_format = GST_DEBUG_FUNCPTR (gst_x264_enc_set_format); + gstencoder_class->handle_frame = + GST_DEBUG_FUNCPTR (gst_x264_enc_handle_frame); + gstencoder_class->start = GST_DEBUG_FUNCPTR (gst_x264_enc_start); + gstencoder_class->stop = GST_DEBUG_FUNCPTR (gst_x264_enc_stop); + gstencoder_class->flush = GST_DEBUG_FUNCPTR (gst_x264_enc_flush); + gstencoder_class->finish = GST_DEBUG_FUNCPTR (gst_x264_enc_finish); + gstencoder_class->getcaps = GST_DEBUG_FUNCPTR (gst_x264_enc_sink_getcaps); + gstencoder_class->propose_allocation = + GST_DEBUG_FUNCPTR (gst_x264_enc_propose_allocation); + + /* options for which we don't use string equivalents */ + g_object_class_install_property (gobject_class, ARG_PASS, + g_param_spec_enum ("pass", "Encoding pass/type", + "Encoding pass/type", GST_X264_ENC_PASS_TYPE, + ARG_PASS_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_QUANTIZER, + g_param_spec_uint ("quantizer", "Constant Quantizer", + "Constant quantizer or quality to apply", + 0, 50, ARG_QUANTIZER_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_BITRATE, + g_param_spec_uint ("bitrate", "Bitrate", "Bitrate in kbit/sec", 1, + 100 * 1024, ARG_BITRATE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + GST_PARAM_MUTABLE_PLAYING)); + g_object_class_install_property (gobject_class, ARG_VBV_BUF_CAPACITY, + g_param_spec_uint ("vbv-buf-capacity", "VBV buffer capacity", + "Size of the VBV buffer in milliseconds", + 0, 10000, ARG_VBV_BUF_CAPACITY_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + GST_PARAM_MUTABLE_PLAYING)); + g_object_class_install_property (gobject_class, ARG_SPEED_PRESET, + g_param_spec_enum ("speed-preset", "Speed/quality preset", + "Preset name for speed/quality tradeoff options (can affect decode " + "compatibility - impose restrictions separately for your target decoder)", + GST_X264_ENC_SPEED_PRESET_TYPE, ARG_SPEED_PRESET_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_PSY_TUNE, + g_param_spec_enum ("psy-tune", "Psychovisual tuning preset", + "Preset name for psychovisual tuning options", + GST_X264_ENC_PSY_TUNE_TYPE, ARG_PSY_TUNE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_TUNE, + g_param_spec_flags ("tune", "Content tuning preset", + "Preset name for non-psychovisual tuning options", + GST_X264_ENC_TUNE_TYPE, ARG_TUNE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, ARG_OPTION_STRING, + g_param_spec_string ("option-string", "Option string", + "String of x264 options (overridden by element properties)", + ARG_OPTION_STRING_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /* options for which we _do_ use string equivalents */ + g_object_class_install_property (gobject_class, ARG_THREADS, + g_param_spec_uint ("threads", "Threads", + "Number of threads used by the codec (0 for automatic)", + 0, 4, ARG_THREADS_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /* NOTE: this first string append doesn't require the ':' delimiter but the + * rest do */ + g_string_append_printf (x264enc_defaults, "threads=%d", ARG_THREADS_DEFAULT); + g_object_class_install_property (gobject_class, ARG_SLICED_THREADS, + g_param_spec_boolean ("sliced-threads", "Sliced Threads", + "Low latency but lower efficiency threading", + ARG_SLICED_THREADS_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":sliced-threads=%d", + ARG_SLICED_THREADS_DEFAULT); + g_object_class_install_property (gobject_class, ARG_SYNC_LOOKAHEAD, + g_param_spec_int ("sync-lookahead", "Sync Lookahead", + "Number of buffer frames for threaded lookahead (-1 for automatic)", + -1, 250, ARG_SYNC_LOOKAHEAD_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":sync-lookahead=%d", + ARG_SYNC_LOOKAHEAD_DEFAULT); + g_object_class_install_property (gobject_class, ARG_MULTIPASS_CACHE_FILE, + g_param_spec_string ("multipass-cache-file", "Multipass Cache File", + "Filename for multipass cache file", + ARG_MULTIPASS_CACHE_FILE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":stats=%s", + ARG_MULTIPASS_CACHE_FILE_DEFAULT); + g_object_class_install_property (gobject_class, ARG_BYTE_STREAM, + g_param_spec_boolean ("byte-stream", "Byte Stream", + "Generate byte stream format of NALU", ARG_BYTE_STREAM_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":annexb=%d", + ARG_BYTE_STREAM_DEFAULT); + g_object_class_install_property (gobject_class, ARG_INTRA_REFRESH, + g_param_spec_boolean ("intra-refresh", "Intra Refresh", + "Use Periodic Intra Refresh instead of IDR frames", + ARG_INTRA_REFRESH_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":intra-refresh=%d", + ARG_INTRA_REFRESH_DEFAULT); + g_object_class_install_property (gobject_class, ARG_ME, + g_param_spec_enum ("me", "Motion Estimation", + "Integer pixel motion estimation method", GST_X264_ENC_ME_TYPE, + ARG_ME_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":me=%s", + x264_motion_est_names[ARG_ME_DEFAULT]); + g_object_class_install_property (gobject_class, ARG_SUBME, + g_param_spec_uint ("subme", "Subpixel Motion Estimation", + "Subpixel motion estimation and partition decision quality: 1=fast, 10=best", + 1, 10, ARG_SUBME_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":subme=%d", ARG_SUBME_DEFAULT); + g_object_class_install_property (gobject_class, ARG_ANALYSE, + g_param_spec_flags ("analyse", "Analyse", "Partitions to consider", + GST_X264_ENC_ANALYSE_TYPE, ARG_ANALYSE_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + partitions = gst_x264_enc_build_partitions (ARG_ANALYSE_DEFAULT); + if (partitions) { + g_string_append_printf (x264enc_defaults, ":partitions=%s", partitions); + g_free ((gpointer) partitions); + } + g_object_class_install_property (gobject_class, ARG_DCT8x8, + g_param_spec_boolean ("dct8x8", "DCT8x8", + "Adaptive spatial transform size", ARG_DCT8x8_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":8x8dct=%d", ARG_DCT8x8_DEFAULT); + g_object_class_install_property (gobject_class, ARG_REF, + g_param_spec_uint ("ref", "Reference Frames", + "Number of reference frames", + 1, 12, ARG_REF_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":ref=%d", ARG_REF_DEFAULT); + g_object_class_install_property (gobject_class, ARG_BFRAMES, + g_param_spec_uint ("bframes", "B-Frames", + "Number of B-frames between I and P", + 0, 4, ARG_BFRAMES_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":bframes=%d", ARG_BFRAMES_DEFAULT); + g_object_class_install_property (gobject_class, ARG_B_ADAPT, + g_param_spec_boolean ("b-adapt", "B-Adapt", + "Automatically decide how many B-frames to use", + ARG_B_ADAPT_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":b-adapt=%d", ARG_B_ADAPT_DEFAULT); + g_object_class_install_property (gobject_class, ARG_B_PYRAMID, + g_param_spec_boolean ("b-pyramid", "B-Pyramid", + "Keep some B-frames as references", ARG_B_PYRAMID_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":b-pyramid=%s", + x264_b_pyramid_names[ARG_B_PYRAMID_DEFAULT]); + g_object_class_install_property (gobject_class, ARG_WEIGHTB, + g_param_spec_boolean ("weightb", "Weighted B-Frames", + "Weighted prediction for B-frames", ARG_WEIGHTB_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":weightb=%d", ARG_WEIGHTB_DEFAULT); + g_object_class_install_property (gobject_class, ARG_SPS_ID, + g_param_spec_uint ("sps-id", "SPS ID", + "SPS and PPS ID number", + 0, 31, ARG_SPS_ID_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":sps-id=%d", ARG_SPS_ID_DEFAULT); + g_object_class_install_property (gobject_class, ARG_AU_NALU, + g_param_spec_boolean ("aud", "AUD", + "Use AU (Access Unit) delimiter", ARG_AU_NALU_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":aud=%d", ARG_AU_NALU_DEFAULT); + g_object_class_install_property (gobject_class, ARG_TRELLIS, + g_param_spec_boolean ("trellis", "Trellis quantization", + "Enable trellis searched quantization", ARG_TRELLIS_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":trellis=%d", ARG_TRELLIS_DEFAULT); + g_object_class_install_property (gobject_class, ARG_KEYINT_MAX, + g_param_spec_uint ("key-int-max", "Key-frame maximal interval", + "Maximal distance between two key-frames (0 for automatic)", + 0, G_MAXINT, ARG_KEYINT_MAX_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":keyint=%d", + ARG_KEYINT_MAX_DEFAULT); + g_object_class_install_property (gobject_class, ARG_CABAC, + g_param_spec_boolean ("cabac", "Use CABAC", "Enable CABAC entropy coding", + ARG_CABAC_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":cabac=%d", ARG_CABAC_DEFAULT); + g_object_class_install_property (gobject_class, ARG_QP_MIN, + g_param_spec_uint ("qp-min", "Minimum Quantizer", + "Minimum quantizer", 0, 51, ARG_QP_MIN_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":qpmin=%d", ARG_QP_MIN_DEFAULT); + g_object_class_install_property (gobject_class, ARG_QP_MAX, + g_param_spec_uint ("qp-max", "Maximum Quantizer", + "Maximum quantizer", 0, 51, ARG_QP_MAX_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":qpmax=%d", ARG_QP_MAX_DEFAULT); + g_object_class_install_property (gobject_class, ARG_QP_STEP, + g_param_spec_uint ("qp-step", "Maximum Quantizer Difference", + "Maximum quantizer difference between frames", + 0, 50, ARG_QP_STEP_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":qpstep=%d", ARG_QP_STEP_DEFAULT); + g_object_class_install_property (gobject_class, ARG_IP_FACTOR, + g_param_spec_float ("ip-factor", "IP-Factor", + "Quantizer factor between I- and P-frames", + 0, 2, ARG_IP_FACTOR_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":ip-factor=%f", + ARG_IP_FACTOR_DEFAULT); + g_object_class_install_property (gobject_class, ARG_PB_FACTOR, + g_param_spec_float ("pb-factor", "PB-Factor", + "Quantizer factor between P- and B-frames", 0, 2, + ARG_PB_FACTOR_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":pb-factor=%f", + ARG_PB_FACTOR_DEFAULT); + g_object_class_install_property (gobject_class, ARG_RC_MB_TREE, + g_param_spec_boolean ("mb-tree", "Macroblock Tree", + "Macroblock-Tree ratecontrol", + ARG_RC_MB_TREE_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":mbtree=%d", + ARG_RC_MB_TREE_DEFAULT); + g_object_class_install_property (gobject_class, ARG_RC_LOOKAHEAD, + g_param_spec_int ("rc-lookahead", "Rate Control Lookahead", + "Number of frames for frametype lookahead", 0, 250, + ARG_RC_LOOKAHEAD_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":rc-lookahead=%d", + ARG_RC_LOOKAHEAD_DEFAULT); + g_object_class_install_property (gobject_class, ARG_NR, + g_param_spec_uint ("noise-reduction", "Noise Reduction", + "Noise reduction strength", + 0, 100000, ARG_NR_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":nr=%d", ARG_NR_DEFAULT); + g_object_class_install_property (gobject_class, ARG_INTERLACED, + g_param_spec_boolean ("interlaced", "Interlaced", + "Interlaced material", ARG_INTERLACED_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_string_append_printf (x264enc_defaults, ":interlaced=%d", + ARG_INTERLACED_DEFAULT); + + /* append deblock parameters */ + g_string_append_printf (x264enc_defaults, ":deblock=0,0"); + /* append weighted prediction parameter */ + g_string_append_printf (x264enc_defaults, ":weightp=0"); + + gst_element_class_set_static_metadata (element_class, + "x264enc", "Codec/Encoder/Video", "H264 Encoder", + "Josef Zlomek , " + "Mark Nauwelaerts "); + + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&sink_factory)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&src_factory)); +} + +static void +gst_x264_enc_log_callback (gpointer private, gint level, const char *format, + va_list args) +{ +#ifndef GST_DISABLE_GST_DEBUG + GstDebugLevel gst_level; + GObject *object = (GObject *) private; + + switch (level) { + case X264_LOG_NONE: + gst_level = GST_LEVEL_NONE; + break; + case X264_LOG_ERROR: + gst_level = GST_LEVEL_ERROR; + break; + case X264_LOG_WARNING: + gst_level = GST_LEVEL_WARNING; + break; + case X264_LOG_INFO: + gst_level = GST_LEVEL_INFO; + break; + default: + /* push x264enc debug down to our lower levels to avoid some clutter */ + gst_level = GST_LEVEL_LOG; + break; + } + + gst_debug_log_valist (x264_enc_debug, gst_level, "", "", 0, object, format, + args); +#endif /* GST_DISABLE_GST_DEBUG */ +} + +/* initialize the new element + * instantiate pads and add them to element + * set functions + * initialize structure + */ +static void +gst_x264_enc_init (GstX264Enc * encoder) +{ + /* properties */ + encoder->threads = ARG_THREADS_DEFAULT; + encoder->sliced_threads = ARG_SLICED_THREADS_DEFAULT; + encoder->sync_lookahead = ARG_SYNC_LOOKAHEAD_DEFAULT; + encoder->pass = ARG_PASS_DEFAULT; + encoder->quantizer = ARG_QUANTIZER_DEFAULT; + encoder->mp_cache_file = g_strdup (ARG_MULTIPASS_CACHE_FILE_DEFAULT); + encoder->byte_stream = ARG_BYTE_STREAM_DEFAULT; + encoder->bitrate = ARG_BITRATE_DEFAULT; + encoder->intra_refresh = ARG_INTRA_REFRESH_DEFAULT; + encoder->vbv_buf_capacity = ARG_VBV_BUF_CAPACITY_DEFAULT; + encoder->me = ARG_ME_DEFAULT; + encoder->subme = ARG_SUBME_DEFAULT; + encoder->analyse = ARG_ANALYSE_DEFAULT; + encoder->dct8x8 = ARG_DCT8x8_DEFAULT; + encoder->ref = ARG_REF_DEFAULT; + encoder->bframes = ARG_BFRAMES_DEFAULT; + encoder->b_adapt = ARG_B_ADAPT_DEFAULT; + encoder->b_pyramid = ARG_B_PYRAMID_DEFAULT; + encoder->weightb = ARG_WEIGHTB_DEFAULT; + encoder->sps_id = ARG_SPS_ID_DEFAULT; + encoder->au_nalu = ARG_AU_NALU_DEFAULT; + encoder->trellis = ARG_TRELLIS_DEFAULT; + encoder->keyint_max = ARG_KEYINT_MAX_DEFAULT; + encoder->cabac = ARG_CABAC_DEFAULT; + encoder->qp_min = ARG_QP_MIN_DEFAULT; + encoder->qp_max = ARG_QP_MAX_DEFAULT; + encoder->qp_step = ARG_QP_STEP_DEFAULT; + encoder->ip_factor = ARG_IP_FACTOR_DEFAULT; + encoder->pb_factor = ARG_PB_FACTOR_DEFAULT; + encoder->mb_tree = ARG_RC_MB_TREE_DEFAULT; + encoder->rc_lookahead = ARG_RC_LOOKAHEAD_DEFAULT; + encoder->noise_reduction = ARG_NR_DEFAULT; + encoder->interlaced = ARG_INTERLACED_DEFAULT; + encoder->option_string = g_string_new (NULL); + encoder->option_string_prop = g_string_new (ARG_OPTION_STRING_DEFAULT); + encoder->speed_preset = ARG_SPEED_PRESET_DEFAULT; + encoder->psy_tune = ARG_PSY_TUNE_DEFAULT; + encoder->tune = ARG_TUNE_DEFAULT; + + x264_param_default (&encoder->x264param); + + /* log callback setup; part of parameters */ + encoder->x264param.pf_log = gst_x264_enc_log_callback; + encoder->x264param.p_log_private = encoder; + encoder->x264param.i_log_level = X264_LOG_DEBUG; +} + +typedef struct +{ + GstVideoCodecFrame *frame; + GstVideoFrame vframe; +} FrameData; + +static FrameData * +gst_x264_enc_queue_frame (GstX264Enc * enc, GstVideoCodecFrame * frame, + GstVideoInfo * info) +{ + GstVideoFrame vframe; + FrameData *fdata; + + if (!gst_video_frame_map (&vframe, info, frame->input_buffer, GST_MAP_READ)) + return NULL; + + fdata = g_slice_new (FrameData); + fdata->frame = gst_video_codec_frame_ref (frame); + fdata->vframe = vframe; + + enc->pending_frames = g_list_prepend (enc->pending_frames, fdata); + + return fdata; +} + +static void +gst_x264_enc_dequeue_frame (GstX264Enc * enc, GstVideoCodecFrame * frame) +{ + GList *l; + + for (l = enc->pending_frames; l; l = l->next) { + FrameData *fdata = l->data; + + if (fdata->frame != frame) + continue; + + gst_video_frame_unmap (&fdata->vframe); + gst_video_codec_frame_unref (fdata->frame); + g_slice_free (FrameData, fdata); + + enc->pending_frames = g_list_delete_link (enc->pending_frames, l); + return; + } +} + +static void +gst_x264_enc_dequeue_all_frames (GstX264Enc * enc) +{ + GList *l; + + for (l = enc->pending_frames; l; l = l->next) { + FrameData *fdata = l->data; + + gst_video_frame_unmap (&fdata->vframe); + gst_video_codec_frame_unref (fdata->frame); + g_slice_free (FrameData, fdata); + } + g_list_free (enc->pending_frames); + enc->pending_frames = NULL; +} + +static gboolean +gst_x264_enc_start (GstVideoEncoder * encoder) +{ + GstX264Enc *x264enc = GST_X264_ENC (encoder); + + x264enc->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_FROM_PROPERTY; + + return TRUE; +} + +static gboolean +gst_x264_enc_stop (GstVideoEncoder * encoder) +{ + GstX264Enc *x264enc = GST_X264_ENC (encoder); + + gst_x264_enc_flush_frames (x264enc, FALSE); + gst_x264_enc_close_encoder (x264enc); + gst_x264_enc_dequeue_all_frames (x264enc); + + if (x264enc->input_state) + gst_video_codec_state_unref (x264enc->input_state); + x264enc->input_state = NULL; + + return TRUE; +} + + +static gboolean +gst_x264_enc_flush (GstVideoEncoder * encoder) +{ + GstX264Enc *x264enc = GST_X264_ENC (encoder); + + gst_x264_enc_flush_frames (x264enc, FALSE); + gst_x264_enc_close_encoder (x264enc); + gst_x264_enc_dequeue_all_frames (x264enc); + + gst_x264_enc_init_encoder (x264enc); + + return TRUE; +} + +static void +gst_x264_enc_finalize (GObject * object) +{ + GstX264Enc *encoder = GST_X264_ENC (object); + + if (encoder->input_state) + gst_video_codec_state_unref (encoder->input_state); + encoder->input_state = NULL; + +#define FREE_STRING(ptr) \ + if (ptr) \ + g_string_free (ptr, TRUE); + + FREE_STRING (encoder->tunings); + FREE_STRING (encoder->option_string); + FREE_STRING (encoder->option_string_prop); + +#undef FREE_STRING + + g_free (encoder->mp_cache_file); + encoder->mp_cache_file = NULL; + + gst_x264_enc_close_encoder (encoder); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +/* + * gst_x264_enc_parse_options + * @encoder: Encoder to which options are assigned + * @str: Option string + * + * Parse option string and assign to x264 parameters + * + */ +static gboolean +gst_x264_enc_parse_options (GstX264Enc * encoder, const gchar * str) +{ + GStrv kvpairs; + guint npairs, i; + gint parse_result = 0, ret = 0; + gchar *options = (gchar *) str; + + while (*options == ':') + options++; + + kvpairs = g_strsplit (options, ":", 0); + npairs = g_strv_length (kvpairs); + + for (i = 0; i < npairs; i++) { + GStrv key_val = g_strsplit (kvpairs[i], "=", 2); + + parse_result = + x264_param_parse (&encoder->x264param, key_val[0], key_val[1]); + + if (parse_result == X264_PARAM_BAD_NAME) { + GST_ERROR_OBJECT (encoder, "Bad name for option %s=%s", + key_val[0] ? key_val[0] : "", key_val[1] ? key_val[1] : ""); + } + if (parse_result == X264_PARAM_BAD_VALUE) { + GST_ERROR_OBJECT (encoder, + "Bad value for option %s=%s (Note: a NULL value for a non-boolean triggers this)", + key_val[0] ? key_val[0] : "", key_val[1] ? key_val[1] : ""); + } + + g_strfreev (key_val); + + if (parse_result) + ret++; + } + + g_strfreev (kvpairs); + return !ret; +} + +static gint +gst_x264_enc_gst_to_x264_video_format (GstVideoFormat format, gint * nplanes) +{ + switch (format) { + case GST_VIDEO_FORMAT_I420: + case GST_VIDEO_FORMAT_YV12: + if (nplanes) + *nplanes = 3; + return X264_CSP_I420; + case GST_VIDEO_FORMAT_I420_10BE: + case GST_VIDEO_FORMAT_I420_10LE: + if (nplanes) + *nplanes = 3; + return X264_CSP_I420 | X264_CSP_HIGH_DEPTH; + case GST_VIDEO_FORMAT_Y42B: + if (nplanes) + *nplanes = 3; + return X264_CSP_I422; + case GST_VIDEO_FORMAT_I422_10BE: + case GST_VIDEO_FORMAT_I422_10LE: + if (nplanes) + *nplanes = 3; + return X264_CSP_I422 | X264_CSP_HIGH_DEPTH; + case GST_VIDEO_FORMAT_Y444: + if (nplanes) + *nplanes = 3; + return X264_CSP_I444; + case GST_VIDEO_FORMAT_Y444_10BE: + case GST_VIDEO_FORMAT_Y444_10LE: + if (nplanes) + *nplanes = 3; + return X264_CSP_I444 | X264_CSP_HIGH_DEPTH; + case GST_VIDEO_FORMAT_NV12: + if (nplanes) + *nplanes = 2; + return X264_CSP_NV12; + default: + g_return_val_if_reached (GST_VIDEO_FORMAT_UNKNOWN); + } +} + +/* + * gst_x264_enc_init_encoder + * @encoder: Encoder which should be initialized. + * + * Initialize x264 encoder. + * + */ +static gboolean +gst_x264_enc_init_encoder (GstX264Enc * encoder) +{ + guint pass = 0; + GstVideoInfo *info; + + if (!encoder->input_state) { + GST_DEBUG_OBJECT (encoder, "Have no input state yet"); + return FALSE; + } + + info = &encoder->input_state->info; + + /* make sure that the encoder is closed */ + gst_x264_enc_close_encoder (encoder); + + GST_OBJECT_LOCK (encoder); + + gst_x264_enc_build_tunings_string (encoder); + + /* set x264 parameters and use preset/tuning if present */ + GST_DEBUG_OBJECT (encoder, "Applying defaults with preset %s, tunings %s", + encoder->speed_preset ? x264_preset_names[encoder->speed_preset - 1] : "", + encoder->tunings && encoder->tunings->len ? encoder->tunings->str : ""); + x264_param_default_preset (&encoder->x264param, + encoder->speed_preset ? x264_preset_names[encoder->speed_preset - + 1] : NULL, encoder->tunings + && encoder->tunings->len ? encoder->tunings->str : NULL); + + /* log callback setup; part of parameters + * this needs to be done again after every *param_default* () call */ + encoder->x264param.pf_log = gst_x264_enc_log_callback; + encoder->x264param.p_log_private = encoder; + encoder->x264param.i_log_level = X264_LOG_DEBUG; + + /* if no preset nor tuning, use property defaults */ + if (!encoder->speed_preset && !encoder->tunings->len) { + GST_DEBUG_OBJECT (encoder, "Applying x264enc_defaults"); + if (x264enc_defaults->len + && gst_x264_enc_parse_options (encoder, + x264enc_defaults->str) == FALSE) { + GST_DEBUG_OBJECT (encoder, + "x264enc_defaults string contains errors. This is a bug."); + goto unlock_and_return; + } + } else { + /* When using presets we need to respect the default output format */ + encoder->x264param.b_aud = encoder->au_nalu; + encoder->x264param.b_annexb = encoder->byte_stream; + } + + /* setup appropriate timebase for gstreamer */ + encoder->x264param.i_timebase_num = 1; + encoder->x264param.i_timebase_den = 1000000000; + + /* apply option-string property */ + if (encoder->option_string_prop && encoder->option_string_prop->len) { + GST_DEBUG_OBJECT (encoder, "Applying option-string: %s", + encoder->option_string_prop->str); + if (gst_x264_enc_parse_options (encoder, + encoder->option_string_prop->str) == FALSE) { + GST_DEBUG_OBJECT (encoder, "Your option-string contains errors."); + goto unlock_and_return; + } + } + /* apply user-set options */ + if (encoder->option_string && encoder->option_string->len) { + GST_DEBUG_OBJECT (encoder, "Applying user-set options: %s", + encoder->option_string->str); + if (gst_x264_enc_parse_options (encoder, + encoder->option_string->str) == FALSE) { + GST_DEBUG_OBJECT (encoder, "Failed to parse internal option string. " + "This could be due to use of an old libx264 version. Option string " + "was: %s", encoder->option_string->str); + } + } + + /* set up encoder parameters */ + encoder->x264param.i_csp = + gst_x264_enc_gst_to_x264_video_format (info->finfo->format, NULL); + if (info->fps_d == 0 || info->fps_n == 0) { + /* No FPS so must use VFR + * This raises latency apparently see http://mewiki.project357.com/wiki/X264_Encoding_Suggestions */ + encoder->x264param.b_vfr_input = TRUE; + if (encoder->keyint_max) { /* NB the default is 250 setup by x264 itself */ + encoder->x264param.i_keyint_max = encoder->keyint_max; + } + } else { + /* FPS available so set it up */ + encoder->x264param.b_vfr_input = FALSE; + encoder->x264param.i_fps_num = info->fps_n; + encoder->x264param.i_fps_den = info->fps_d; + encoder->x264param.i_keyint_max = + encoder->keyint_max ? encoder->keyint_max : (10 * info->fps_n / + info->fps_d); + } + encoder->x264param.i_width = info->width; + encoder->x264param.i_height = info->height; + if (info->par_d > 0) { + encoder->x264param.vui.i_sar_width = info->par_n; + encoder->x264param.vui.i_sar_height = info->par_d; + } + + if ((((info->height == 576) && ((info->width == 720) + || (info->width == 704) || (info->width == 352))) + || ((info->height == 288) && (info->width == 352))) + && (info->fps_d == 1) && (info->fps_n == 25)) { + encoder->x264param.vui.i_vidformat = 1; /* PAL */ + } else if ((((info->height == 480) && ((info->width == 720) + || (info->width == 704) || (info->width == 352))) + || ((info->height == 240) && (info->width == 352))) + && (info->fps_d == 1001) && ((info->fps_n == 30000) + || (info->fps_n == 24000))) { + encoder->x264param.vui.i_vidformat = 2; /* NTSC */ + } else + encoder->x264param.vui.i_vidformat = 5; /* unspecified */ + + encoder->x264param.analyse.b_psnr = 0; + + switch (encoder->pass) { + case GST_X264_ENC_PASS_QUANT: + encoder->x264param.rc.i_rc_method = X264_RC_CQP; + encoder->x264param.rc.i_qp_constant = encoder->quantizer; + break; + case GST_X264_ENC_PASS_QUAL: + encoder->x264param.rc.i_rc_method = X264_RC_CRF; + encoder->x264param.rc.f_rf_constant = encoder->quantizer; + encoder->x264param.rc.i_vbv_max_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_buffer_size + = encoder->x264param.rc.i_vbv_max_bitrate + * encoder->vbv_buf_capacity / 1000; + break; + case GST_X264_ENC_PASS_CBR: + case GST_X264_ENC_PASS_PASS1: + case GST_X264_ENC_PASS_PASS2: + case GST_X264_ENC_PASS_PASS3: + default: + encoder->x264param.rc.i_rc_method = X264_RC_ABR; + encoder->x264param.rc.i_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_max_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_buffer_size = + encoder->x264param.rc.i_vbv_max_bitrate + * encoder->vbv_buf_capacity / 1000; + pass = encoder->pass & 0xF; + break; + } + + switch (pass) { + case 0: + encoder->x264param.rc.b_stat_read = 0; + encoder->x264param.rc.b_stat_write = 0; + break; + case 1: + encoder->x264param.rc.b_stat_read = 0; + encoder->x264param.rc.b_stat_write = 1; + x264_param_apply_fastfirstpass (&encoder->x264param); + encoder->x264param.i_frame_reference = 1; + encoder->x264param.analyse.b_transform_8x8 = 0; + encoder->x264param.analyse.inter = 0; + encoder->x264param.analyse.i_me_method = X264_ME_DIA; + encoder->x264param.analyse.i_subpel_refine = + MIN (2, encoder->x264param.analyse.i_subpel_refine); + encoder->x264param.analyse.i_trellis = 0; + encoder->x264param.analyse.b_fast_pskip = 1; + break; + case 2: + encoder->x264param.rc.b_stat_read = 1; + encoder->x264param.rc.b_stat_write = 0; + break; + case 3: + encoder->x264param.rc.b_stat_read = 1; + encoder->x264param.rc.b_stat_write = 1; + break; + } + + if (encoder->peer_profile) { + if (x264_param_apply_profile (&encoder->x264param, encoder->peer_profile)) + GST_WARNING_OBJECT (encoder, "Bad downstream profile name: %s", + encoder->peer_profile); + } + + /* If using an intra profile, all frames are intra frames */ + if (encoder->peer_intra_profile) + encoder->x264param.i_keyint_max = encoder->x264param.i_keyint_min = 1; + + /* Enforce level limits if they were in the caps */ + if (encoder->peer_level) { + encoder->x264param.i_level_idc = encoder->peer_level->level_idc; + + encoder->x264param.rc.i_bitrate = MIN (encoder->x264param.rc.i_bitrate, + encoder->peer_level->bitrate); + encoder->x264param.rc.i_vbv_max_bitrate = + MIN (encoder->x264param.rc.i_vbv_max_bitrate, + encoder->peer_level->bitrate); + encoder->x264param.rc.i_vbv_buffer_size = + MIN (encoder->x264param.rc.i_vbv_buffer_size, encoder->peer_level->cpb); + encoder->x264param.analyse.i_mv_range = + MIN (encoder->x264param.analyse.i_mv_range, + encoder->peer_level->mv_range); + + if (encoder->peer_level->frame_only) { + encoder->x264param.b_interlaced = FALSE; + encoder->x264param.b_fake_interlaced = FALSE; + } + } + + encoder->reconfig = FALSE; + /* good start, will be corrected if needed */ + encoder->dts_offset = 0; + + GST_OBJECT_UNLOCK (encoder); + + encoder->x264enc = x264_encoder_open (&encoder->x264param); + if (!encoder->x264enc) { + GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, + ("Can not initialize x264 encoder."), (NULL)); + return FALSE; + } + + return TRUE; + +unlock_and_return: + GST_OBJECT_UNLOCK (encoder); + return FALSE; +} + +/* gst_x264_enc_close_encoder + * @encoder: Encoder which should close. + * + * Close x264 encoder. + */ +static void +gst_x264_enc_close_encoder (GstX264Enc * encoder) +{ + if (encoder->x264enc != NULL) { + x264_encoder_close (encoder->x264enc); + encoder->x264enc = NULL; + } +} + +static gboolean +gst_x264_enc_set_profile_and_level (GstX264Enc * encoder, GstCaps * caps) +{ + x264_nal_t *nal; + int i_nal; + int header_return; + gint sps_ni = 0; + guint8 *sps; + GstStructure *s; + const gchar *profile; + GstCaps *allowed_caps; + GstStructure *s2; + const gchar *allowed_profile; + + header_return = x264_encoder_headers (encoder->x264enc, &nal, &i_nal); + if (header_return < 0) { + GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, ("Encode x264 header failed."), + ("x264_encoder_headers return code=%d", header_return)); + return FALSE; + } + + /* old x264 returns SEI, SPS and PPS, newer one has SEI last */ + if (i_nal == 3 && nal[sps_ni].i_type != 7) + sps_ni = 1; + + sps = nal[sps_ni].p_payload + 4; + /* skip NAL unit type */ + sps++; + + gst_codec_utils_h264_caps_set_level_and_profile (caps, sps, 3); + + /* Constrained baseline is a strict subset of baseline. If downstream + * wanted baseline and we produced constrained baseline, we can just + * set the profile to baseline in the caps to make negotiation happy. + * Same goes for baseline as subset of main profile and main as a subset + * of high profile. + */ + s = gst_caps_get_structure (caps, 0); + profile = gst_structure_get_string (s, "profile"); + + allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder)); + + if (allowed_caps == NULL) + goto no_peer; + + if (!gst_caps_can_intersect (allowed_caps, caps)) { + allowed_caps = gst_caps_make_writable (allowed_caps); + allowed_caps = gst_caps_truncate (allowed_caps); + s2 = gst_caps_get_structure (allowed_caps, 0); + gst_structure_fixate_field_string (s2, "profile", profile); + allowed_profile = gst_structure_get_string (s2, "profile"); + if (!strcmp (allowed_profile, "high")) { + if (!strcmp (profile, "constrained-baseline") + || !strcmp (profile, "baseline") || !strcmp (profile, "main")) { + gst_structure_set (s, "profile", G_TYPE_STRING, "high", NULL); + GST_INFO_OBJECT (encoder, "downstream requested high profile, but " + "encoder will now output %s profile (which is a subset), due " + "to how it's been configured", profile); + } + } else if (!strcmp (allowed_profile, "main")) { + if (!strcmp (profile, "constrained-baseline") + || !strcmp (profile, "baseline")) { + gst_structure_set (s, "profile", G_TYPE_STRING, "main", NULL); + GST_INFO_OBJECT (encoder, "downstream requested main profile, but " + "encoder will now output %s profile (which is a subset), due " + "to how it's been configured", profile); + } + } else if (!strcmp (allowed_profile, "baseline")) { + if (!strcmp (profile, "constrained-baseline")) + gst_structure_set (s, "profile", G_TYPE_STRING, "baseline", NULL); + } + } + gst_caps_unref (allowed_caps); + +no_peer: + + return TRUE; +} + +/* + * Returns: Buffer with the stream headers. + */ +static GstBuffer * +gst_x264_enc_header_buf (GstX264Enc * encoder) +{ + GstBuffer *buf; + x264_nal_t *nal; + int i_nal; + int header_return; + int i_size; + int nal_size; + guint8 *buffer, *sps; + gulong buffer_size; + gint sei_ni = 2, sps_ni = 0, pps_ni = 1; + + if (G_UNLIKELY (encoder->x264enc == NULL)) + return NULL; + + /* Create avcC header. */ + + header_return = x264_encoder_headers (encoder->x264enc, &nal, &i_nal); + if (header_return < 0) { + GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, ("Encode x264 header failed."), + ("x264_encoder_headers return code=%d", header_return)); + return NULL; + } + + /* old x264 returns SEI, SPS and PPS, newer one has SEI last */ + if (i_nal == 3 && nal[sps_ni].i_type != 7) { + sei_ni = 0; + sps_ni = 1; + pps_ni = 2; + } + + /* x264 is expected to return an SEI (some identification info), + * and SPS and PPS */ + if (i_nal != 3 || nal[sps_ni].i_type != 7 || nal[pps_ni].i_type != 8 || + nal[sps_ni].i_payload < 4 || nal[pps_ni].i_payload < 1) { + GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, (NULL), + ("Unexpected x264 header.")); + return NULL; + } + + GST_MEMDUMP ("SEI", nal[sei_ni].p_payload, nal[sei_ni].i_payload); + GST_MEMDUMP ("SPS", nal[sps_ni].p_payload, nal[sps_ni].i_payload); + GST_MEMDUMP ("PPS", nal[pps_ni].p_payload, nal[pps_ni].i_payload); + + /* nal payloads with emulation_prevention_three_byte, and some header data */ + buffer_size = (nal[sps_ni].i_payload + nal[pps_ni].i_payload) * 4 + 100; + buffer = g_malloc (buffer_size); + + sps = nal[sps_ni].p_payload + 4; + /* skip NAL unit type */ + sps++; + + buffer[0] = 1; /* AVC Decoder Configuration Record ver. 1 */ + buffer[1] = sps[0]; /* profile_idc */ + buffer[2] = sps[1]; /* profile_compability */ + buffer[3] = sps[2]; /* level_idc */ + buffer[4] = 0xfc | (4 - 1); /* nal_length_size_minus1 */ + + i_size = 5; + + buffer[i_size++] = 0xe0 | 1; /* number of SPSs */ + + nal_size = nal[sps_ni].i_payload - 4; + memcpy (buffer + i_size + 2, nal[sps_ni].p_payload + 4, nal_size); + + GST_WRITE_UINT16_BE (buffer + i_size, nal_size); + i_size += nal_size + 2; + + buffer[i_size++] = 1; /* number of PPSs */ + + nal_size = nal[pps_ni].i_payload - 4; + memcpy (buffer + i_size + 2, nal[pps_ni].p_payload + 4, nal_size); + + GST_WRITE_UINT16_BE (buffer + i_size, nal_size); + i_size += nal_size + 2; + + buf = gst_buffer_new_and_alloc (i_size); + gst_buffer_fill (buf, 0, buffer, i_size); + + GST_MEMDUMP ("header", buffer, i_size); + g_free (buffer); + + return buf; +} + +/* gst_x264_enc_set_src_caps + * Returns: TRUE on success. + */ +static gboolean +gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstCaps * caps) +{ + GstCaps *outcaps; + GstStructure *structure; + GstVideoCodecState *state; + GstTagList *tags; + + outcaps = gst_caps_new_empty_simple ("video/x-h264"); + structure = gst_caps_get_structure (outcaps, 0); + + if (encoder->current_byte_stream == GST_X264_ENC_STREAM_FORMAT_FROM_PROPERTY) { + if (encoder->byte_stream) { + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_BYTE_STREAM; + } else { + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_AVC; + } + } + if (encoder->current_byte_stream == GST_X264_ENC_STREAM_FORMAT_AVC) { + GstBuffer *buf = gst_x264_enc_header_buf (encoder); + if (buf != NULL) { + gst_caps_set_simple (outcaps, "codec_data", GST_TYPE_BUFFER, buf, NULL); + gst_buffer_unref (buf); + } + gst_structure_set (structure, "stream-format", G_TYPE_STRING, "avc", NULL); + } else { + gst_structure_set (structure, "stream-format", G_TYPE_STRING, "byte-stream", + NULL); + } + gst_structure_set (structure, "alignment", G_TYPE_STRING, "au", NULL); + + if (!gst_x264_enc_set_profile_and_level (encoder, outcaps)) { + gst_caps_unref (outcaps); + return FALSE; + } + + state = gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (encoder), + outcaps, encoder->input_state); + GST_DEBUG_OBJECT (encoder, "output caps: %" GST_PTR_FORMAT, state->caps); + gst_video_codec_state_unref (state); + + tags = gst_tag_list_new_empty (); + gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_ENCODER, "x264", + GST_TAG_ENCODER_VERSION, X264_BUILD, NULL); + gst_video_encoder_merge_tags (GST_VIDEO_ENCODER (encoder), tags, + GST_TAG_MERGE_REPLACE); + gst_tag_list_unref (tags); + + return TRUE; +} + +static void +gst_x264_enc_set_latency (GstX264Enc * encoder) +{ + GstVideoInfo *info = &encoder->input_state->info; + + if (info->fps_n) { + GstClockTime latency; + gint max_delayed_frames; + max_delayed_frames = x264_encoder_maximum_delayed_frames (encoder->x264enc); + latency = gst_util_uint64_scale_ceil (GST_SECOND * info->fps_d, + max_delayed_frames, info->fps_n); + + GST_INFO_OBJECT (encoder, + "Updating latency to %" GST_TIME_FORMAT " (%d frames)", + GST_TIME_ARGS (latency), max_delayed_frames); + + gst_video_encoder_set_latency (GST_VIDEO_ENCODER (encoder), latency, + latency); + } else { + /* We can't do live as we don't know our latency */ + gst_video_encoder_set_latency (GST_VIDEO_ENCODER (encoder), + 0, GST_CLOCK_TIME_NONE); + } +} + +static gboolean +gst_x264_enc_set_format (GstVideoEncoder * video_enc, + GstVideoCodecState * state) +{ + GstX264Enc *encoder = GST_X264_ENC (video_enc); + GstVideoInfo *info = &state->info; + GstCaps *template_caps; + GstCaps *allowed_caps = NULL; + gboolean level_ok = TRUE; + + /* If the encoder is initialized, do not reinitialize it again if not + * necessary */ + if (encoder->x264enc) { + GstVideoInfo *old = &encoder->input_state->info; + + if (info->finfo->format == old->finfo->format + && info->width == old->width && info->height == old->height + && info->fps_n == old->fps_n && info->fps_d == old->fps_d + && info->par_n == old->par_n && info->par_d == old->par_d) { + gst_video_codec_state_unref (encoder->input_state); + encoder->input_state = gst_video_codec_state_ref (state); + return TRUE; + } + + /* clear out pending frames */ + gst_x264_enc_flush_frames (encoder, TRUE); + + encoder->sps_id++; + } + + if (encoder->input_state) + gst_video_codec_state_unref (encoder->input_state); + encoder->input_state = gst_video_codec_state_ref (state); + + encoder->peer_profile = NULL; + encoder->peer_intra_profile = FALSE; + encoder->peer_level = NULL; + + template_caps = gst_static_pad_template_get_caps (&src_factory); + allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder)); + + /* Output byte-stream if downstream has ANY caps, it's what people expect, + * and it makes more sense too */ + if (allowed_caps == template_caps) { + GST_INFO_OBJECT (encoder, + "downstream has ANY caps, outputting byte-stream"); + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_BYTE_STREAM; + } else if (allowed_caps) { + GstStructure *s; + const gchar *profile; + const gchar *level; + const gchar *stream_format; + + if (gst_caps_is_empty (allowed_caps)) { + gst_caps_unref (allowed_caps); + gst_caps_unref (template_caps); + return FALSE; + } + + allowed_caps = gst_caps_make_writable (allowed_caps); + allowed_caps = gst_caps_fixate (allowed_caps); + s = gst_caps_get_structure (allowed_caps, 0); + + profile = gst_structure_get_string (s, "profile"); + if (profile) { + /* FIXME - if libx264 ever adds support for FMO, ASO or redundant slices + * make sure constrained profile has a separate case which disables + * those */ + if (g_str_has_suffix (profile, "-intra")) { + encoder->peer_intra_profile = TRUE; + } + if (!strcmp (profile, "constrained-baseline") || + !strcmp (profile, "baseline")) { + encoder->peer_profile = "baseline"; + } else if (g_str_has_prefix (profile, "high-10")) { + encoder->peer_profile = "high10"; + } else if (g_str_has_prefix (profile, "high-4:2:2")) { + encoder->peer_profile = "high422"; + } else if (g_str_has_prefix (profile, "high-4:4:4")) { + encoder->peer_profile = "high444"; + } else if (g_str_has_prefix (profile, "high")) { + encoder->peer_profile = "high"; + } else if (!strcmp (profile, "main")) { + encoder->peer_profile = "main"; + } else { + g_assert_not_reached (); + } + } + + level = gst_structure_get_string (s, "level"); + if (level) { + int level_idc = gst_codec_utils_h264_get_level_idc (level); + + if (level_idc) { + gint i; + + for (i = 0; x264_levels[i].level_idc; i++) { + if (level_idc == x264_levels[i].level_idc) { + int mb_width = (info->width + 15) / 16; + int mb_height = (info->height + 15) / 16; + int mbs = mb_width * mb_height; + + if (x264_levels[i].frame_size < mbs || + x264_levels[i].frame_size * 8 < mb_width * mb_width || + x264_levels[i].frame_size * 8 < mb_height * mb_height) { + GST_WARNING_OBJECT (encoder, + "Frame size larger than level %s allows", level); + level_ok = FALSE; + break; + } + + if (info->fps_d && x264_levels[i].mbps + < (gint64) mbs * info->fps_n / info->fps_d) { + GST_WARNING_OBJECT (encoder, + "Macroblock rate higher than level %s allows", level); + level_ok = FALSE; + break; + } + + encoder->peer_level = &x264_levels[i]; + break; + } + } + } + } + + stream_format = gst_structure_get_string (s, "stream-format"); + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_FROM_PROPERTY; + if (stream_format) { + if (!strcmp (stream_format, "avc")) { + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_AVC; + g_string_append_printf (encoder->option_string, ":annexb=0"); + } else if (!strcmp (stream_format, "byte-stream")) { + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_BYTE_STREAM; + g_string_append_printf (encoder->option_string, ":annexb=1"); + } else { + /* means we have both in caps and _FROM_PROPERTY should be the option */ + } + } + + gst_caps_unref (allowed_caps); + } + + gst_caps_unref (template_caps); + + if (!level_ok) + return FALSE; + + if (!gst_x264_enc_init_encoder (encoder)) + return FALSE; + + if (!gst_x264_enc_set_src_caps (encoder, state->caps)) { + gst_x264_enc_close_encoder (encoder); + return FALSE; + } + + gst_x264_enc_set_latency (encoder); + + return TRUE; +} + +static GstFlowReturn +gst_x264_enc_finish (GstVideoEncoder * encoder) +{ + gst_x264_enc_flush_frames (GST_X264_ENC (encoder), TRUE); + return GST_FLOW_OK; +} + +static gboolean +gst_x264_enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query) +{ + gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL); + + return GST_VIDEO_ENCODER_CLASS (parent_class)->propose_allocation (encoder, + query); +} + +/* chain function + * this function does the actual processing + */ +static GstFlowReturn +gst_x264_enc_handle_frame (GstVideoEncoder * video_enc, + GstVideoCodecFrame * frame) +{ + GstX264Enc *encoder = GST_X264_ENC (video_enc); + GstVideoInfo *info = &encoder->input_state->info; + GstFlowReturn ret; + x264_picture_t pic_in; + gint i_nal, i; + FrameData *fdata; + gint nplanes = 0; + + if (G_UNLIKELY (encoder->x264enc == NULL)) + goto not_inited; + + /* create x264_picture_t from the buffer */ + /* mostly taken from mplayer (file ve_x264.c) */ + + /* set up input picture */ + memset (&pic_in, 0, sizeof (pic_in)); + + fdata = gst_x264_enc_queue_frame (encoder, frame, info); + if (!fdata) + goto invalid_frame; + + pic_in.img.i_csp = + gst_x264_enc_gst_to_x264_video_format (info->finfo->format, &nplanes); + pic_in.img.i_plane = nplanes; + for (i = 0; i < nplanes; i++) { + pic_in.img.plane[i] = GST_VIDEO_FRAME_COMP_DATA (&fdata->vframe, i); + pic_in.img.i_stride[i] = GST_VIDEO_FRAME_COMP_STRIDE (&fdata->vframe, i); + } + + pic_in.i_type = X264_TYPE_AUTO; + pic_in.i_pts = frame->pts; + pic_in.i_dts = frame->dts; + pic_in.opaque = GINT_TO_POINTER (frame->system_frame_number); + + ret = gst_x264_enc_encode_frame (encoder, &pic_in, frame, &i_nal, TRUE); + + /* input buffer is released later on */ + return ret; + +/* ERRORS */ +not_inited: + { + GST_WARNING_OBJECT (encoder, "Got buffer before set_caps was called"); + return GST_FLOW_NOT_NEGOTIATED; + } +invalid_frame: + { + GST_ERROR_OBJECT (encoder, "Failed to map frame"); + return GST_FLOW_ERROR; + } +} + +static GstFlowReturn +gst_x264_enc_encode_frame (GstX264Enc * encoder, x264_picture_t * pic_in, + GstVideoCodecFrame * input_frame, int *i_nal, gboolean send) +{ + GstVideoCodecFrame *frame = NULL; + GstBuffer *out_buf = NULL; + x264_picture_t pic_out; + x264_nal_t *nal; + int i_size; + int encoder_return; + GstFlowReturn ret = GST_FLOW_OK; + guint8 *data; + gboolean update_latency = FALSE; + + if (G_UNLIKELY (encoder->x264enc == NULL)) { + if (input_frame) + gst_video_codec_frame_unref (input_frame); + return GST_FLOW_NOT_NEGOTIATED; + } + + GST_OBJECT_LOCK (encoder); + if (encoder->reconfig) { + encoder->reconfig = FALSE; + if (x264_encoder_reconfig (encoder->x264enc, &encoder->x264param) < 0) + GST_WARNING_OBJECT (encoder, "Could not reconfigure"); + update_latency = TRUE; + } + + if (pic_in && input_frame) { + if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (input_frame)) { + GST_INFO_OBJECT (encoder, "Forcing key frame"); + if (encoder->intra_refresh) + x264_encoder_intra_refresh (encoder->x264enc); + else + pic_in->i_type = X264_TYPE_IDR; + } + } + GST_OBJECT_UNLOCK (encoder); + + if (G_UNLIKELY (update_latency)) + gst_x264_enc_set_latency (encoder); + + encoder_return = x264_encoder_encode (encoder->x264enc, + &nal, i_nal, pic_in, &pic_out); + + if (encoder_return < 0) { + GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, ("Encode x264 frame failed."), + ("x264_encoder_encode return code=%d", encoder_return)); + ret = GST_FLOW_ERROR; + /* Make sure we finish this frame */ + frame = input_frame; + goto out; + } + + /* Input frame is now queued */ + if (input_frame) + gst_video_codec_frame_unref (input_frame); + + if (!*i_nal) { + ret = GST_FLOW_OK; + goto out; + } + + i_size = encoder_return; + data = nal[0].p_payload; + + frame = gst_video_encoder_get_frame (GST_VIDEO_ENCODER (encoder), + GPOINTER_TO_INT (pic_out.opaque)); + g_assert (frame || !send); + + if (!send || !frame) { + ret = GST_FLOW_OK; + goto out; + } + + out_buf = gst_buffer_new_allocate (NULL, i_size, NULL); + gst_buffer_fill (out_buf, 0, data, i_size); + frame->output_buffer = out_buf; + + GST_LOG_OBJECT (encoder, + "output: dts %" G_GINT64_FORMAT " pts %" G_GINT64_FORMAT, + (gint64) pic_out.i_dts, (gint64) pic_out.i_pts); + + /* we want to know if x264 is messing around with this */ + g_assert (frame->pts == pic_out.i_pts); + if (pic_out.b_keyframe) { + /* expect dts == pts, and also positive ts, + * so arrange for an offset if needed */ + if (pic_out.i_dts + encoder->dts_offset != pic_out.i_pts) { + encoder->dts_offset = pic_out.i_pts - pic_out.i_dts; + GST_DEBUG_OBJECT (encoder, "determined dts offset %" G_GINT64_FORMAT, + encoder->dts_offset); + } + } + + if (pic_out.i_dts + (gint64) encoder->dts_offset < 0) { + /* should be ok now, surprise if not */ + GST_WARNING_OBJECT (encoder, "negative dts after offset compensation"); + frame->dts = GST_CLOCK_TIME_NONE; + } else + frame->dts = pic_out.i_dts + encoder->dts_offset; + + + if (pic_out.b_keyframe) { + GST_DEBUG_OBJECT (encoder, "Output keyframe"); + GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame); + } + +out: + if (frame) { + gst_x264_enc_dequeue_frame (encoder, frame); + ret = gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (encoder), frame); + } + + return ret; +} + +static void +gst_x264_enc_flush_frames (GstX264Enc * encoder, gboolean send) +{ + GstFlowReturn flow_ret; + gint i_nal; + + /* first send the remaining frames */ + if (encoder->x264enc) + do { + flow_ret = gst_x264_enc_encode_frame (encoder, NULL, NULL, &i_nal, send); + } while (flow_ret == GST_FLOW_OK + && x264_encoder_delayed_frames (encoder->x264enc) > 0); +} + +static void +gst_x264_enc_reconfig (GstX264Enc * encoder) +{ + switch (encoder->pass) { + case GST_X264_ENC_PASS_QUAL: + encoder->x264param.rc.f_rf_constant = encoder->quantizer; + encoder->x264param.rc.i_vbv_max_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_buffer_size + = encoder->x264param.rc.i_vbv_max_bitrate + * encoder->vbv_buf_capacity / 1000; + break; + case GST_X264_ENC_PASS_CBR: + case GST_X264_ENC_PASS_PASS1: + case GST_X264_ENC_PASS_PASS2: + case GST_X264_ENC_PASS_PASS3: + default: + encoder->x264param.rc.i_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_max_bitrate = encoder->bitrate; + encoder->x264param.rc.i_vbv_buffer_size + = encoder->x264param.rc.i_vbv_max_bitrate + * encoder->vbv_buf_capacity / 1000; + break; + } + + encoder->reconfig = TRUE; +} + +static void +gst_x264_enc_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstX264Enc *encoder; + GstState state; + + const gchar *partitions = NULL; + + encoder = GST_X264_ENC (object); + + GST_OBJECT_LOCK (encoder); + /* state at least matters for sps, bytestream, pass, + * and so by extension ... */ + + state = GST_STATE (encoder); + if ((state != GST_STATE_READY && state != GST_STATE_NULL) && + !(pspec->flags & GST_PARAM_MUTABLE_PLAYING)) + goto wrong_state; + + switch (prop_id) { + case ARG_PASS: + encoder->pass = g_value_get_enum (value); + break; + case ARG_QUANTIZER: + encoder->quantizer = g_value_get_uint (value); + gst_x264_enc_reconfig (encoder); + break; + case ARG_BITRATE: + encoder->bitrate = g_value_get_uint (value); + gst_x264_enc_reconfig (encoder); + break; + case ARG_VBV_BUF_CAPACITY: + encoder->vbv_buf_capacity = g_value_get_uint (value); + gst_x264_enc_reconfig (encoder); + break; + case ARG_SPEED_PRESET: + encoder->speed_preset = g_value_get_enum (value); + break; + case ARG_PSY_TUNE: + encoder->psy_tune = g_value_get_enum (value); + break; + case ARG_TUNE: + encoder->tune = g_value_get_flags (value); + break; + case ARG_OPTION_STRING: + g_string_assign (encoder->option_string_prop, g_value_get_string (value)); + break; + case ARG_THREADS: + encoder->threads = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":threads=%d", + encoder->threads); + break; + case ARG_SLICED_THREADS: + encoder->sliced_threads = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":sliced-threads=%d", + encoder->sliced_threads); + break; + case ARG_SYNC_LOOKAHEAD: + encoder->sync_lookahead = g_value_get_int (value); + g_string_append_printf (encoder->option_string, ":sync-lookahead=%d", + encoder->sync_lookahead); + break; + case ARG_MULTIPASS_CACHE_FILE: + if (encoder->mp_cache_file) + g_free (encoder->mp_cache_file); + encoder->mp_cache_file = g_value_dup_string (value); + g_string_append_printf (encoder->option_string, ":stats=%s", + encoder->mp_cache_file); + break; + case ARG_BYTE_STREAM: + encoder->byte_stream = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":annexb=%d", + encoder->byte_stream); + break; + case ARG_INTRA_REFRESH: + encoder->intra_refresh = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":intra-refresh=%d", + encoder->intra_refresh); + break; + case ARG_ME: + encoder->me = g_value_get_enum (value); + g_string_append_printf (encoder->option_string, ":me=%s", + x264_motion_est_names[encoder->me]); + break; + case ARG_SUBME: + encoder->subme = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":subme=%d", + encoder->subme); + break; + case ARG_ANALYSE: + encoder->analyse = g_value_get_flags (value); + partitions = gst_x264_enc_build_partitions (encoder->analyse); + if (partitions) { + g_string_append_printf (encoder->option_string, ":partitions=%s", + partitions); + g_free ((gpointer) partitions); + } + break; + case ARG_DCT8x8: + encoder->dct8x8 = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":8x8dct=%d", + encoder->dct8x8); + break; + case ARG_REF: + encoder->ref = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":ref=%d", encoder->ref); + break; + case ARG_BFRAMES: + encoder->bframes = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":bframes=%d", + encoder->bframes); + break; + case ARG_B_ADAPT: + encoder->b_adapt = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":b-adapt=%d", + encoder->b_adapt); + break; + case ARG_B_PYRAMID: + encoder->b_pyramid = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":b-pyramid=%s", + x264_b_pyramid_names[encoder->b_pyramid]); + break; + case ARG_WEIGHTB: + encoder->weightb = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":weightb=%d", + encoder->weightb); + break; + case ARG_SPS_ID: + encoder->sps_id = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":sps-id=%d", + encoder->sps_id); + break; + case ARG_AU_NALU: + encoder->au_nalu = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":aud=%d", + encoder->au_nalu); + break; + case ARG_TRELLIS: + encoder->trellis = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":trellis=%d", + encoder->trellis); + break; + case ARG_KEYINT_MAX: + encoder->keyint_max = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":keyint=%d", + encoder->keyint_max); + break; + case ARG_CABAC: + encoder->cabac = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":cabac=%d", + encoder->cabac); + break; + case ARG_QP_MIN: + encoder->qp_min = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":qpmin=%d", + encoder->qp_min); + break; + case ARG_QP_MAX: + encoder->qp_max = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":qpmax=%d", + encoder->qp_max); + break; + case ARG_QP_STEP: + encoder->qp_step = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":qpstep=%d", + encoder->qp_step); + break; + case ARG_IP_FACTOR: + encoder->ip_factor = g_value_get_float (value); + g_string_append_printf (encoder->option_string, ":ip-factor=%f", + encoder->ip_factor); + break; + case ARG_PB_FACTOR: + encoder->pb_factor = g_value_get_float (value); + g_string_append_printf (encoder->option_string, ":pb-factor=%f", + encoder->pb_factor); + break; + case ARG_RC_MB_TREE: + encoder->mb_tree = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":mbtree=%d", + encoder->mb_tree); + break; + case ARG_RC_LOOKAHEAD: + encoder->rc_lookahead = g_value_get_int (value); + g_string_append_printf (encoder->option_string, ":rc-lookahead=%d", + encoder->rc_lookahead); + break; + case ARG_NR: + encoder->noise_reduction = g_value_get_uint (value); + g_string_append_printf (encoder->option_string, ":nr=%d", + encoder->noise_reduction); + break; + case ARG_INTERLACED: + encoder->interlaced = g_value_get_boolean (value); + g_string_append_printf (encoder->option_string, ":interlaced=%d", + encoder->interlaced); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + GST_OBJECT_UNLOCK (encoder); + return; + + /* ERROR */ +wrong_state: + { + GST_WARNING_OBJECT (encoder, "setting property in wrong state"); + GST_OBJECT_UNLOCK (encoder); + } +} + +static void +gst_x264_enc_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstX264Enc *encoder; + + encoder = GST_X264_ENC (object); + + GST_OBJECT_LOCK (encoder); + switch (prop_id) { + case ARG_THREADS: + g_value_set_uint (value, encoder->threads); + break; + case ARG_SLICED_THREADS: + g_value_set_boolean (value, encoder->sliced_threads); + break; + case ARG_SYNC_LOOKAHEAD: + g_value_set_int (value, encoder->sync_lookahead); + break; + case ARG_PASS: + g_value_set_enum (value, encoder->pass); + break; + case ARG_QUANTIZER: + g_value_set_uint (value, encoder->quantizer); + break; + case ARG_MULTIPASS_CACHE_FILE: + g_value_set_string (value, encoder->mp_cache_file); + break; + case ARG_BYTE_STREAM: + g_value_set_boolean (value, encoder->byte_stream); + break; + case ARG_BITRATE: + g_value_set_uint (value, encoder->bitrate); + break; + case ARG_INTRA_REFRESH: + g_value_set_boolean (value, encoder->intra_refresh); + break; + case ARG_VBV_BUF_CAPACITY: + g_value_set_uint (value, encoder->vbv_buf_capacity); + break; + case ARG_ME: + g_value_set_enum (value, encoder->me); + break; + case ARG_SUBME: + g_value_set_uint (value, encoder->subme); + break; + case ARG_ANALYSE: + g_value_set_flags (value, encoder->analyse); + break; + case ARG_DCT8x8: + g_value_set_boolean (value, encoder->dct8x8); + break; + case ARG_REF: + g_value_set_uint (value, encoder->ref); + break; + case ARG_BFRAMES: + g_value_set_uint (value, encoder->bframes); + break; + case ARG_B_ADAPT: + g_value_set_boolean (value, encoder->b_adapt); + break; + case ARG_B_PYRAMID: + g_value_set_boolean (value, encoder->b_pyramid); + break; + case ARG_WEIGHTB: + g_value_set_boolean (value, encoder->weightb); + break; + case ARG_SPS_ID: + g_value_set_uint (value, encoder->sps_id); + break; + case ARG_AU_NALU: + g_value_set_boolean (value, encoder->au_nalu); + break; + case ARG_TRELLIS: + g_value_set_boolean (value, encoder->trellis); + break; + case ARG_KEYINT_MAX: + g_value_set_uint (value, encoder->keyint_max); + break; + case ARG_QP_MIN: + g_value_set_uint (value, encoder->qp_min); + break; + case ARG_QP_MAX: + g_value_set_uint (value, encoder->qp_max); + break; + case ARG_QP_STEP: + g_value_set_uint (value, encoder->qp_step); + break; + case ARG_CABAC: + g_value_set_boolean (value, encoder->cabac); + break; + case ARG_IP_FACTOR: + g_value_set_float (value, encoder->ip_factor); + break; + case ARG_PB_FACTOR: + g_value_set_float (value, encoder->pb_factor); + break; + case ARG_RC_MB_TREE: + g_value_set_boolean (value, encoder->mb_tree); + break; + case ARG_RC_LOOKAHEAD: + g_value_set_int (value, encoder->rc_lookahead); + break; + case ARG_NR: + g_value_set_uint (value, encoder->noise_reduction); + break; + case ARG_INTERLACED: + g_value_set_boolean (value, encoder->interlaced); + break; + case ARG_SPEED_PRESET: + g_value_set_enum (value, encoder->speed_preset); + break; + case ARG_PSY_TUNE: + g_value_set_enum (value, encoder->psy_tune); + break; + case ARG_TUNE: + g_value_set_flags (value, encoder->tune); + break; + case ARG_OPTION_STRING: + g_value_set_string (value, encoder->option_string_prop->str); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + GST_OBJECT_UNLOCK (encoder); +} + +static gboolean +plugin_init (GstPlugin * plugin) +{ + GST_DEBUG_CATEGORY_INIT (x264_enc_debug, "x264enc", 0, + "h264 encoding element"); + + GST_INFO ("x264 build: %u", X264_BUILD); + + return gst_element_register (plugin, "x264enc", + GST_RANK_PRIMARY, GST_TYPE_X264_ENC); +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + x264, + "libx264-based H264 plugins", + plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/ext/x264/gstx264enc.h b/ext/x264/gstx264enc.h new file mode 100644 index 0000000..e234937 --- /dev/null +++ b/ext/x264/gstx264enc.h @@ -0,0 +1,122 @@ +/* GStreamer H264 encoder plugin + * Copyright (C) 2005 Michal Benes + * Copyright (C) 2005 Josef Zlomek + * + * 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_X264_ENC_H__ +#define __GST_X264_ENC_H__ + +#include +#include +#include +#include "_stdint.h" +#include + +G_BEGIN_DECLS + +#define GST_TYPE_X264_ENC \ + (gst_x264_enc_get_type()) +#define GST_X264_ENC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_X264_ENC,GstX264Enc)) +#define GST_X264_ENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_X264_ENC,GstX264EncClass)) +#define GST_IS_X264_ENC(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_X264_ENC)) +#define GST_IS_X264_ENC_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_X264_ENC)) + +typedef struct _GstX264Enc GstX264Enc; +typedef struct _GstX264EncClass GstX264EncClass; + +struct _GstX264Enc +{ + GstVideoEncoder element; + + /*< private >*/ + x264_t *x264enc; + x264_param_t x264param; + gint current_byte_stream; + GstClockTime dts_offset; + + /* List of frame/buffer mapping structs for + * pending frames */ + GList *pending_frames; + + /* properties */ + guint threads; + gboolean sliced_threads; + gint sync_lookahead; + gint pass; + guint quantizer; + gchar *mp_cache_file; + gboolean byte_stream; + guint bitrate; + gboolean intra_refresh; + gint me; + guint subme; + guint analyse; + gboolean dct8x8; + guint ref; + guint bframes; + gboolean b_adapt; + gboolean b_pyramid; + gboolean weightb; + guint sps_id; + gboolean au_nalu; + gboolean trellis; + guint vbv_buf_capacity; + guint keyint_max; + gboolean cabac; + gfloat ip_factor; + gfloat pb_factor; + guint qp_min; + guint qp_max; + guint qp_step; + gboolean mb_tree; + gint rc_lookahead; + guint noise_reduction; + gboolean interlaced; + gint speed_preset; + gint psy_tune; + guint tune; + GString *tunings; + GString *option_string_prop; /* option-string property */ + GString *option_string; /* used by set prop */ + + /* input description */ + GstVideoCodecState *input_state; + + /* configuration changed while playing */ + gboolean reconfig; + + /* from the downstream caps */ + const gchar *peer_profile; + gboolean peer_intra_profile; + const x264_level_t *peer_level; +}; + +struct _GstX264EncClass +{ + GstVideoEncoderClass parent_class; +}; + +GType gst_x264_enc_get_type (void); + +G_END_DECLS + +#endif /* __GST_X264_ENC_H__ */ -- cgit v1.2.3