Commit cc6117d0 authored by James Zern's avatar James Zern

update nestegg

+ prune some unused files

https://github.com/kinetiknz/nestegg.git

commit f46223191d8116a36bf299b5b9793fcb798417b1
Merge: 0851279 4b0190a
Author:     Matthew Gregan <kinetik@flim.org>
AuthorDate: Wed Nov 27 13:50:43 2013 -0800
Commit:     Matthew Gregan <kinetik@flim.org>
CommitDate: Wed Nov 27 13:50:43 2013 -0800

    Merge pull request #15 from shadone/master

    Fix compiler warning.

Change-Id: I59eecdd68fced1ef61b67d446735539628d81484
parent b27207cf
*.lo
*.o
*.swp
*~
.deps
.dirstamp
.libs
Makefile
Makefile.in
_stdint.h
aclocal.m4
autom4te.cache
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
docs/Doxyfile
docs/doxygen-build.stamp
docs/html
install-sh
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
nestegg-uninstalled.pc
nestegg.pc
src/.dirstamp
src/libnestegg.la
stamp-h1
test/test
include/nestegg/nestegg-stdint.h
diff --git a/nestegg/halloc/src/halloc.c b/nestegg/halloc/src/halloc.c
index 5758fc0..837b3ff 100644
--- a/nestegg/halloc/src/halloc.c
+++ b/nestegg/halloc/src/halloc.c
@@ -15,7 +15,7 @@
#include <stdlib.h> /* realloc */
#include <string.h> /* memset & co */
-#include "halloc.h"
+#include "nestegg/halloc/halloc.h"
#include "align.h"
#include "hlist.h"
diff --git a/nestegg/include/nestegg/nestegg.h b/nestegg/include/nestegg/nestegg.h
index ff13728..c18d1d3 100644
--- a/nestegg/include/nestegg/nestegg.h
+++ b/nestegg/include/nestegg/nestegg.h
@@ -7,7 +7,7 @@
#if !defined(NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79)
#define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
-#include <nestegg/nestegg-stdint.h>
+#include "vpx/vpx_integer.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/nestegg/src/nestegg.c b/nestegg/src/nestegg.c
index daf1eed..4fb10e7 100644
--- a/nestegg/src/nestegg.c
+++ b/nestegg/src/nestegg.c
@@ -8,8 +8,8 @@
#include <stdlib.h>
#include <string.h>
-#include "halloc.h"
-#include "nestegg/nestegg.h"
+#include "nestegg/halloc/halloc.h"
+#include "nestegg/include/nestegg/nestegg.h"
/* EBML Elements */
#define ID_EBML 0x1a45dfa3
diff --git a/nestegg/src/nestegg.c b/nestegg/src/nestegg.c
index 4fb10e7..b6bc460 100644
--- a/nestegg/src/nestegg.c
+++ b/nestegg/src/nestegg.c
@@ -934,7 +934,7 @@ static int
ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
{
struct ebml_type * storage;
- int r;
+ int r = 0;
storage = (struct ebml_type *) (ctx->ancestor->data + desc->offset);
@@ -968,7 +968,6 @@ ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
case TYPE_MASTER:
case TYPE_UNKNOWN:
assert(0);
- r = 0;
break;
}
Matthew Gregan <kinetik@flim.org>
Steve Workman <sjhworkman@gmail.com>
Paul Adenot <paul@paul.cx>
AUTOMAKE_OPTIONS = foreign 1.11 no-dist-gzip dist-bzip2 subdir-objects
ACLOCAL_AMFLAGS = -I m4
INCLUDES = -I$(top_srcdir)/include -I. -I$(top_srcdir)/halloc
AM_CFLAGS = -ansi -pedantic -Wall -Wextra -Wno-long-long -O0 -g
SUBDIRS = docs
EXTRA_DIST = \
AUTHORS README LICENSE \
nestegg-uninstalled.pc.in \
m4/as-ac-expand.m4 \
m4/pkg.m4 \
m4/ax_create_stdint_h.m4 \
halloc/src/halloc.c \
halloc/halloc.h \
halloc/src/align.h \
halloc/src/hlist.h \
halloc/src/macros.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = nestegg.pc
nesteggincludedir = $(includedir)/nestegg
nestegginclude_HEADERS = include/nestegg/nestegg.h include/nestegg/nestegg-stdint.h
lib_LTLIBRARIES = src/libnestegg.la
src_libnestegg_la_SOURCES = \
src/nestegg.c \
halloc/src/halloc.c \
halloc/halloc.h \
halloc/src/align.h \
halloc/src/hlist.h \
halloc/src/macros.h
check_PROGRAMS = test/test
test_test_SOURCES = test/test.c
test_test_LDADD = src/libnestegg.la
DISTCLEANFILES = include/nestegg/nestegg-stdint.h
dist-hook:
find $(distdir) -type d -name '.git' | xargs rm -rf
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"
URL: https://github.com/kinetiknz/nestegg.git
Version: f46223191d8116a36bf299b5b9793fcb798417b1
License: ISC-style
License File: LICENSE
Description:
The source under the halloc/ directory is licensed under a BSD license. See
halloc/halloc.h for details.
Local Modifications:
- delete unnecessary docs and build files
- nestegg/0001-include-paths.diff
include path modifications for the libvpx build system
- 0002-ne_read_simple-uninitialized_variable.diff
fixes:
nestegg.c|975 col 6| warning: ‘r’ may be used uninitialized in this function [-Wuninitialized]
dnl ------------------------------------------------
dnl Initialization and Versioning
dnl ------------------------------------------------
AC_INIT(libnestegg,[0.1git])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([src/nestegg.c])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Library versioning
dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
NESTEGG_CURRENT=0
NESTEGG_REVISION=0
NESTEGG_AGE=1
AC_SUBST(NESTEGG_CURRENT)
AC_SUBST(NESTEGG_REVISION)
AC_SUBST(NESTEGG_AGE)
dnl --------------------------------------------------
dnl Check for programs
dnl --------------------------------------------------
dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
dnl if $CFLAGS is blank
cflags_save="$CFLAGS"
AC_PROG_CC
AC_PROG_CPP
CFLAGS="$cflags_save"
AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl Check for doxygen
AC_ARG_ENABLE([doc],
AS_HELP_STRING([--enable-doc], [Build API documentation]),
[ac_enable_doc=$enableval], [ac_enable_doc=auto])
if test "x$ac_enable_doc" != "xno"; then
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
if test "x$HAVE_DOXYGEN" = "xfalse" -a "x$ac_enable_doc" = "xyes"; then
AC_MSG_ERROR([*** API documentation explicitly requested but Doxygen not found])
fi
else
HAVE_DOXYGEN=false
fi
AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
if test $HAVE_DOXYGEN = "false"; then
AC_MSG_WARN([*** doxygen not found, API documentation will not be built])
fi
# Generate portable stdint.h replacement
AX_CREATE_STDINT_H(include/nestegg/nestegg-stdint.h)
# Test whenever ld supports -version-script
AC_PROG_LD
AC_PROG_LD_GNU
AC_MSG_CHECKING([how to control symbol export])
dnl --------------------------------------------------
dnl Do substitutions
dnl --------------------------------------------------
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_OUTPUT([
Makefile
docs/Makefile
docs/Doxyfile
nestegg.pc
nestegg-uninstalled.pc
])
AS_AC_EXPAND(LIBDIR, ${libdir})
AS_AC_EXPAND(INCLUDEDIR, ${includedir})
AS_AC_EXPAND(BINDIR, ${bindir})
AS_AC_EXPAND(DOCDIR, ${docdir})
if test $HAVE_DOXYGEN = "false"; then
doc_build="no"
else
doc_build="yes"
fi
AC_MSG_RESULT([
------------------------------------------------------------------------
$PACKAGE $VERSION: Automatic configuration OK.
General configuration:
API Documentation: .......... ${doc_build}
Installation paths:
libnestegg: .................. ${LIBDIR}
C header files: .............. ${INCLUDEDIR}/nestegg
Documentation: ............... ${DOCDIR}
Building:
Type 'make' to compile $PACKAGE.
Type 'make install' to install $PACKAGE.
Example programs will be built but not installed.
------------------------------------------------------------------------
])
This diff is collapsed.
doc_DATA = doxygen-build.stamp
EXTRA_DIST = Doxyfile.in
if HAVE_DOXYGEN
doxygen-build.stamp: Doxyfile
doxygen
touch doxygen-build.stamp
else
doxygen-build.stamp:
echo "*** Warning: Doxygen not found; documentation will not be built."
touch doxygen-build.stamp
endif
dist_docdir = $(distdir)/libnestegg
dist-hook:
if test -d html; then \
mkdir $(dist_docdir); \
echo -n "copying built documenation..."; \
cp -rp html $(dist_docdir)/html; \
echo "OK"; \
fi
install-data-local: doxygen-build.stamp
$(mkinstalldirs) $(DESTDIR)$(docdir)
if test -d html; then \
cp -rp html $(DESTDIR)$(docdir)/html; \
fi
uninstall-local:
rm -rf $(DESTDIR)$(docdir)
clean-local:
if test -d html; then rm -rf html; fi
if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi
......@@ -15,7 +15,7 @@
#include <stdlib.h> /* realloc */
#include <string.h> /* memset & co */
#include "../halloc.h"
#include "nestegg/halloc/halloc.h"
#include "align.h"
#include "hlist.h"
......
......@@ -4,12 +4,12 @@
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
#ifndef NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
#define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
#if !defined(NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79)
#define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
#include "vpx/vpx_integer.h"
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
......@@ -17,10 +17,10 @@ extern "C" {
@section intro Introduction
This is the documentation fot the <tt>libnestegg</tt> C API.
This is the documentation for the <tt>libnestegg</tt> C API.
<tt>libnestegg</tt> is a demultiplexing library for <a
href="http://www.matroska.org/">Matroska</a> and <a
href="http://www.webmproject.org/">WebMedia</a> media files.
href="http://www.webmproject.org/code/specs/container/">WebM</a>
media files.
@section example Example code
......@@ -68,6 +68,13 @@ extern "C" {
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_CODEC_VP9 2 /**< Track uses Google On2 VP9 codec. */
#define NESTEGG_CODEC_OPUS 3 /**< Track uses Xiph Opus codec. */
#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_BOTTOM_TOP 2 /**< Track is top-bottom stereo video. Right first. */
#define NESTEGG_VIDEO_STEREO_TOP_BOTTOM 3 /**< Track is top-bottom stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_RIGHT_LEFT 11 /**< Track is side-by-side stereo video. Right first. */
#define NESTEGG_SEEK_SET 0 /**< Seek offset relative to beginning of stream. */
#define NESTEGG_SEEK_CUR 1 /**< Seek offset relative to current position in stream. */
......@@ -114,6 +121,10 @@ typedef struct {
/** Parameters specific to a video track. */
typedef struct {
unsigned int stereo_mode; /**< Video mode. One of #NESTEGG_VIDEO_MONO,
#NESTEGG_VIDEO_STEREO_LEFT_RIGHT,
#NESTEGG_VIDEO_STEREO_BOTTOM_TOP, or
#NESTEGG_VIDEO_STEREO_TOP_BOTTOM. */
unsigned int width; /**< Width of the video frame in pixels. */
unsigned int height; /**< Height of the video frame in pixels. */
unsigned int display_width; /**< Display width of the video frame in pixels. */
......@@ -129,6 +140,8 @@ typedef struct {
double rate; /**< Sampling rate in Hz. */
unsigned int channels; /**< Number of audio channels. */
unsigned int depth; /**< Bits per sample. */
uint64_t codec_delay; /**< Nanoseconds that must be discarded from the start. */
uint64_t seek_preroll;/**< Nanoseconds that must be discarded after a seek. */
} nestegg_audio_params;
/** Logging callback function pointer. */
......@@ -140,9 +153,10 @@ typedef void (* nestegg_log)(nestegg * context, unsigned int severity, char cons
@param context Storage for the new nestegg context. @see nestegg_destroy
@param io User supplied IO context.
@param callback Optional logging callback function pointer. May be NULL.
@param max_offset Optional maximum offset to be read. Set -1 to ignore.
@retval 0 Success.
@retval -1 Error. */
int nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback);
int nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback, int64_t max_offset);
/** Destroy a nestegg context and free associated memory.
@param context #nestegg context to be freed. @see nestegg_init */
......@@ -171,6 +185,29 @@ int nestegg_tstamp_scale(nestegg * context, uint64_t * scale);
@retval -1 Error. */
int nestegg_track_count(nestegg * context, unsigned int * tracks);
/** Query the start and end offset for a particular cluster.
@param context Stream context initialized by #nestegg_init.
@param cluster_num Zero-based cluster number; order they appear in cues.
@param max_offset Optional maximum offset to be read. Set -1 to ignore.
@param start_pos Starting offset of the cluster. -1 means non-existant.
@param end_pos Starting offset of the cluster. -1 means non-existant or
final cluster.
@param tstamp Starting timestamp of the cluster.
@retval 0 Success.
@retval -1 Error. */
int nestegg_get_cue_point(nestegg * context, unsigned int cluster_num,
int64_t max_offset, int64_t * start_pos,
int64_t * end_pos, uint64_t * tstamp);
/** Seek to @a offset. Stream will seek directly to offset.
Should be used to seek to the start of a resync point, i.e. cluster; the
parser will not be able to understand other offsets.
@param context Stream context initialized by #nestegg_init.
@param offset Absolute offset in bytes.
@retval 0 Success.
@retval -1 Error. */
int nestegg_offset_seek(nestegg * context, uint64_t offset);
/** Seek @a track to @a tstamp. Stream seek will terminate at the earliest
key point in the stream at or before @a tstamp. Other tracks in the
stream will output packets with unspecified but nearby timestamps.
......@@ -286,7 +323,30 @@ int nestegg_packet_count(nestegg_packet * packet, unsigned int * count);
int nestegg_packet_data(nestegg_packet * packet, unsigned int item,
unsigned char ** data, size_t * length);
#ifdef __cplusplus
/** Returns discard_padding for given packet
@param packet Packet initialized by #nestegg_read_packet.
@param discard_padding pointer to store discard padding in.
@retval 0 Success.
@retval -1 Error. */
int nestegg_packet_discard_padding(nestegg_packet * packet,
int64_t * discard_padding);
/** Query the presence of cues.
@param context Stream context initialized by #nestegg_init.
@retval 0 The media has no cues.
@retval 1 The media has cues. */
int nestegg_has_cues(nestegg * context);
/**
* Try to determine if the buffer looks like the beginning of a WebM file.
*
* @param buffer A buffer containing the beginning of a media file.
* @param length The size of the buffer.
* @retval 0 The file is not a WebM file.
* @retval 1 The file is a WebM file. */
int nestegg_sniff(unsigned char const * buffer, size_t length);
#if defined(__cplusplus)
}
#endif
......
dnl as-ac-expand.m4 0.2.0
dnl autostars m4 macro for expanding directories using configure's prefix
dnl thomas@apestaart.org
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
This diff is collapsed.
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$PKG_CONFIG"; then
if test -n "$$1"; then
pkg_cv_[]$1="$$1"
else
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
fi
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],