summaryrefslogtreecommitdiffstats
path: root/ext/wavpack/gstwavpackcommon.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2007-06-08 20:20:34 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2007-06-08 20:20:34 +0000
commit6bd7199f3af8001036926261c4c2a22a725bee39 (patch)
treeedca90a176655aede72d4102513d7139cf325722 /ext/wavpack/gstwavpackcommon.c
parentdbf7acdf1d2218ba986021a3d6439cf848fd9162 (diff)
downloadgst-plugins-bad-6bd7199f3af8001036926261c4c2a22a725bee39.tar.gz
gst-plugins-bad-6bd7199f3af8001036926261c4c2a22a725bee39.tar.bz2
gst-plugins-bad-6bd7199f3af8001036926261c4c2a22a725bee39.zip
Move wavpack to good.
Original commit message from CVS: * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/gst-plugins-bad-plugins.hierarchy: * docs/plugins/inspect/plugin-wavpack.xml: * ext/Makefile.am: * ext/wavpack/Makefile.am: * ext/wavpack/gstwavpack.c: * ext/wavpack/gstwavpackcommon.c: * ext/wavpack/gstwavpackcommon.h: * ext/wavpack/gstwavpackdec.c: * ext/wavpack/gstwavpackdec.h: * ext/wavpack/gstwavpackenc.c: * ext/wavpack/gstwavpackenc.h: * ext/wavpack/gstwavpackparse.c: * ext/wavpack/gstwavpackparse.h: * ext/wavpack/gstwavpackstreamreader.c: * ext/wavpack/gstwavpackstreamreader.h: * ext/wavpack/md5.c: * ext/wavpack/md5.h: * tests/check/Makefile.am: * tests/check/elements/wavpackdec.c: * tests/check/elements/wavpackenc.c: * tests/check/elements/wavpackparse.c: Move wavpack to good.
Diffstat (limited to 'ext/wavpack/gstwavpackcommon.c')
-rw-r--r--ext/wavpack/gstwavpackcommon.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/ext/wavpack/gstwavpackcommon.c b/ext/wavpack/gstwavpackcommon.c
deleted file mode 100644
index ad161867..00000000
--- a/ext/wavpack/gstwavpackcommon.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* GStreamer Wavpack plugin
- * Copyright (c) 2005 Arwed v. Merkatz <v.merkatz@gmx.net>
- * Copyright (c) 1998 - 2005 Conifer Software
- * Copyright (c) 2006 Sebastian Dröge <slomo@circular-chaos.org>
- *
- * gstwavpackcommon.c: common helper functions
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "gstwavpackcommon.h"
-#include <string.h>
-
-GST_DEBUG_CATEGORY_EXTERN (wavpack_debug);
-#define GST_CAT_DEFAULT wavpack_debug
-
-gboolean
-gst_wavpack_read_header (WavpackHeader * header, guint8 * buf)
-{
- g_memmove (header, buf, sizeof (WavpackHeader));
-
-#ifndef WAVPACK_OLD_API
- WavpackLittleEndianToNative (header, WavpackHeaderFormat);
-#else
- little_endian_to_native (header, WavpackHeaderFormat);
-#endif
-
- return (memcmp (header->ckID, "wvpk", 4) == 0);
-}
-
-/* inspired by the original one in wavpack */
-gboolean
-gst_wavpack_read_metadata (GstWavpackMetadata * wpmd, guint8 * header_data,
- guint8 ** p_data)
-{
- WavpackHeader hdr;
- guint8 *end;
-
- gst_wavpack_read_header (&hdr, header_data);
- end = header_data + hdr.ckSize + 8;
-
- if (end - *p_data < 2)
- return FALSE;
-
- wpmd->id = GST_READ_UINT8 (*p_data);
- wpmd->byte_length = 2 * (guint) GST_READ_UINT8 (*p_data + 1);
-
- *p_data += 2;
-
- if ((wpmd->id & ID_LARGE) == ID_LARGE) {
- guint extra;
-
- wpmd->id &= ~ID_LARGE;
-
- if (end - *p_data < 2)
- return FALSE;
-
- extra = GST_READ_UINT16_LE (*p_data);
- wpmd->byte_length += (extra << 9);
- *p_data += 2;
- }
-
- if ((wpmd->id & ID_ODD_SIZE) == ID_ODD_SIZE) {
- wpmd->id &= ~ID_ODD_SIZE;
- --wpmd->byte_length;
- }
-
- if (wpmd->byte_length > 0) {
- if (end - *p_data < wpmd->byte_length + (wpmd->byte_length & 1)) {
- wpmd->data = NULL;
- return FALSE;
- }
-
- wpmd->data = *p_data;
- *p_data += wpmd->byte_length + (wpmd->byte_length & 1);
- } else {
- wpmd->data = NULL;
- }
-
- return TRUE;
-}