mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 13:32:29 +00:00
flac debug cleanup m4 for ffmpeg
Original commit message from CVS: flac debug cleanup m4 for ffmpeg
This commit is contained in:
parent
999fda13e6
commit
ab5a4110e2
5 changed files with 125 additions and 9 deletions
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 1ca7d9a20180cab830f4383cde5ba932338e50b1
|
Subproject commit f2d9b99515c73da09bfe307d273d320f79a226da
|
|
@ -504,6 +504,12 @@ GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
|
||||||
AC_SUBST(FLAC_LIBS)
|
AC_SUBST(FLAC_LIBS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl *** FFMPEG ***
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_FFMPEG, true)
|
||||||
|
GST_CHECK_FEATURE(FFMPEG, [ffmpeg plug-ins], ffmpeg, [
|
||||||
|
AM_PATH_FFMPEG(0.4.6, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
|
||||||
|
])
|
||||||
|
|
||||||
dnl *** Gnome VFS ***
|
dnl *** Gnome VFS ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
|
||||||
GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
|
GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
|
||||||
|
|
|
@ -76,6 +76,12 @@ else
|
||||||
GSM_DIR=
|
GSM_DIR=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if USE_FFMPEG
|
||||||
|
FFMPEG_DIR=ffmpeg
|
||||||
|
else
|
||||||
|
FFMPEG_DIR=
|
||||||
|
endif
|
||||||
|
|
||||||
if USE_FLAC
|
if USE_FLAC
|
||||||
FLAC_DIR=flac
|
FLAC_DIR=flac
|
||||||
else
|
else
|
||||||
|
@ -142,12 +148,6 @@ else
|
||||||
LIBFAME_DIR=
|
LIBFAME_DIR=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_LIBPNG
|
|
||||||
LIBPNG_DIR=libpng
|
|
||||||
else
|
|
||||||
LIBPNG_DIR=
|
|
||||||
endif
|
|
||||||
|
|
||||||
if USE_MAD
|
if USE_MAD
|
||||||
MAD_DIR=mad
|
MAD_DIR=mad
|
||||||
else
|
else
|
||||||
|
@ -242,7 +242,7 @@ SUBDIRS=$(A52DEC_DIR) $(AALIB_DIR) $(ALSA_DIR) \
|
||||||
$(ARTS_DIR) $(ARTSC_DIR) $(AUDIOFILE_DIR) \
|
$(ARTS_DIR) $(ARTSC_DIR) $(AUDIOFILE_DIR) \
|
||||||
$(AVIFILE_DIR) $(CDPARANOIA_DIR) \
|
$(AVIFILE_DIR) $(CDPARANOIA_DIR) \
|
||||||
$(DVDREAD_DIR) $(DVDNAV_DIR) $(ESD_DIR) \
|
$(DVDREAD_DIR) $(DVDNAV_DIR) $(ESD_DIR) \
|
||||||
$(FLAC_DIR) $(GNOMEVFS_DIR) $(GSM_DIR) \
|
$(FFMPEG_DIR) $(FLAC_DIR) $(GNOMEVFS_DIR) $(GSM_DIR) \
|
||||||
$(HERMES_DIR) $(HTTP_DIR) $(JACK_DIR) $(JPEG_DIR) \
|
$(HERMES_DIR) $(HTTP_DIR) $(JACK_DIR) $(JPEG_DIR) \
|
||||||
$(LADSPA_DIR) $(LAME_DIR) $(LCS_DIR) $(LIBDV_DIR) $(LIBFAME_DIR) \
|
$(LADSPA_DIR) $(LAME_DIR) $(LCS_DIR) $(LIBDV_DIR) $(LIBFAME_DIR) \
|
||||||
$(MAD_DIR) $(MIKMOD_DIR) $(MJPEGTOOLS_DIR) $(MPEG2DEC_DIR) \
|
$(MAD_DIR) $(MIKMOD_DIR) $(MJPEGTOOLS_DIR) $(MPEG2DEC_DIR) \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "media-info.h"
|
#include "media-info.h"
|
||||||
|
|
||||||
static gboolean _gst_media_info_debug = FALSE;
|
static gboolean _gst_media_info_debug = TRUE;
|
||||||
#define GMI_DEBUG(format, args...) \
|
#define GMI_DEBUG(format, args...) \
|
||||||
{ if (_gst_media_info_debug) { g_print ( format , ## args ); }}
|
{ if (_gst_media_info_debug) { g_print ( format , ## args ); }}
|
||||||
|
|
||||||
|
@ -262,6 +262,16 @@ gst_media_info_get_property (GObject *object, guint prop_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GstMediaInfo *
|
||||||
|
gst_media_info_new (const gchar *source_element)
|
||||||
|
{
|
||||||
|
GstMediaInfo *info = g_object_new (GST_MEDIA_INFO_TYPE, NULL);
|
||||||
|
if (source_element)
|
||||||
|
g_object_set (G_OBJECT (info), "source", source_element);
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* private functions
|
* private functions
|
||||||
*/
|
*/
|
||||||
|
@ -631,6 +641,7 @@ gst_media_info_find_streaminfo (GstMediaInfo *info)
|
||||||
/* substract to get the length */
|
/* substract to get the length */
|
||||||
GMI_DEBUG("DEBUG: start %lld, end %lld\n", value_start, value_end);
|
GMI_DEBUG("DEBUG: start %lld, end %lld\n", value_start, value_end);
|
||||||
value_end -= value_start;
|
value_end -= value_start;
|
||||||
|
g_print ("DEBUG: length: %d\n", (int) value_end);
|
||||||
length = gst_props_entry_new ("length", GST_PROPS_INT ((int) value_end));
|
length = gst_props_entry_new ("length", GST_PROPS_INT ((int) value_end));
|
||||||
gst_props_add_entry (gst_caps_get_props (streaminfo), length);
|
gst_props_add_entry (gst_caps_get_props (streaminfo), length);
|
||||||
}
|
}
|
||||||
|
|
99
m4/as-ffmpeg.m4
Normal file
99
m4/as-ffmpeg.m4
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
# CFLAGS and library paths for FFMPEG
|
||||||
|
# taken from Autostar Sandbox, http://autostars.sourceforge.net/
|
||||||
|
|
||||||
|
dnl Usage:
|
||||||
|
dnl AM_PATH_FFMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||||
|
dnl FIXME: version checking does not work currently
|
||||||
|
dnl
|
||||||
|
dnl Example:
|
||||||
|
dnl AM_PATH_FFMPEG(0.4.6, , AC_MSG_ERROR([*** FFMPEG >= 0.4.6 not installed))
|
||||||
|
dnl
|
||||||
|
dnl Defines FFMPEG_LIBS
|
||||||
|
dnl FIXME: should define FFMPEG_VERSION
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_DEFUN(AM_PATH_FFMPEG,
|
||||||
|
[
|
||||||
|
dnl allow for specification of a source path (for uninstalled)
|
||||||
|
AC_ARG_WITH(ffmpeg-source,
|
||||||
|
AC_HELP_STRING([--with-ffmpeg-source=DIR],
|
||||||
|
[Directory where FFmpeg source is (optional)]),
|
||||||
|
ffmpeg_source="$withval", ffmpeg_source="")
|
||||||
|
|
||||||
|
dnl save CFLAGS and LIBS here
|
||||||
|
CFLAGS_save=$CFLAGS
|
||||||
|
LIBS_save=$LIBS
|
||||||
|
if test "x$ffmpeg_source" != "x"; then
|
||||||
|
dnl uninstalled FFmpeg copy
|
||||||
|
AC_MSG_NOTICE([Looking for FFmpeg source in $ffmpeg_source])
|
||||||
|
CFLAGS="-I$ffmpeg_source/libav -I$ffmpeg_source/libavcodec"
|
||||||
|
LIBS="-L$ffmpeg_source/libav -L$ffmpeg_source/libavcodec"
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED, 1,
|
||||||
|
[defined if we compile against uninstalled FFmpeg])
|
||||||
|
FFMPEG_COMMON_INCLUDE="#include <common.h>"
|
||||||
|
else
|
||||||
|
FFMPEG_COMMON_INCLUDE="#include <ffmpeg/common.h>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl check for libavcodec
|
||||||
|
AC_CHECK_LIB(avcodec, avcodec_init, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
|
||||||
|
|
||||||
|
dnl check for avcodec.h and avformat.h
|
||||||
|
if test "x$ffmpeg_source" != "x"; then
|
||||||
|
dnl uninstalled
|
||||||
|
AC_CHECK_HEADER(avcodec.h, , HAVE_FFMPEG=no, [/* only compile */])
|
||||||
|
AC_CHECK_HEADER(avformat.h, , HAVE_FFMPEG=no, [/* only compile */])
|
||||||
|
else
|
||||||
|
AC_CHECK_HEADER(ffmpeg/avcodec.h, , HAVE_FFMPEG=no)
|
||||||
|
AC_CHECK_HEADER(ffmpeg/avformat.h, , HAVE_FFMPEG=no)
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl now check if it's sufficiently new
|
||||||
|
|
||||||
|
AC_LANG_SAVE()
|
||||||
|
AC_LANG_C()
|
||||||
|
|
||||||
|
dnl FIXME: we use strcmp, which we know is going to break if ffmpeg ever uses
|
||||||
|
dnl two digits for any of their version numbers. It makes the test so much
|
||||||
|
dnl easier though so let's ignore that
|
||||||
|
AC_TRY_RUN([
|
||||||
|
$FFMPEG_COMMON_INCLUDE
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if (strcmp (FFMPEG_VERSION, "$1") == -1)
|
||||||
|
{
|
||||||
|
fprintf (stderr,
|
||||||
|
"ERROR: your copy of ffmpeg is too old (%s)\n", FFMPEG_VERSION);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
], , HAVE_FFMPEG=no)
|
||||||
|
|
||||||
|
dnl now do the actual "do we have it ?" test
|
||||||
|
if test "x$HAVE_FFMPEG" = "xyes"; then
|
||||||
|
FFMPEG_LIBS="$LIBS -lavcodec -lavformat"
|
||||||
|
FFMPEG_CFLAGS="$CFLAGS"
|
||||||
|
AC_MSG_NOTICE(we have ffmpeg)
|
||||||
|
dnl execute what we have to because it's found
|
||||||
|
ifelse([$2], , :, [$2])
|
||||||
|
else
|
||||||
|
FFMPEG_LIBS=""
|
||||||
|
FFMPEG_CFLAGS=""
|
||||||
|
dnl execute what we have to because it's not found
|
||||||
|
ifelse([$3], , :, [$3])
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl make variables available
|
||||||
|
AC_SUBST(FFMPEG_LIBS)
|
||||||
|
AC_SUBST(FFMPEG_CFLAGS)
|
||||||
|
AC_SUBST(HAVE_FFMPEG)
|
||||||
|
AC_LANG_RESTORE()
|
||||||
|
CFLAGS=$CFLAGS_save
|
||||||
|
LIBS=$LIBS_save
|
||||||
|
])
|
Loading…
Reference in a new issue