2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
23 /*#define debug(format,args...) g_print(format,##args) */
25 #ifdef G_HAVE_ISO_VARARGS
29 #elif defined(G_HAVE_GNUC_VARARGS)
31 #define debug(format,args...)
35 gulong gst_riff_fourcc_to_id(gchar *fourcc) {
36 g_return_val_if_fail(fourcc != NULL, 0);
38 return GUINT32_FROM_LE((gulong)(fourcc[0] << 0) | (fourcc[1] << 8) |
39 (fourcc[2] << 16) | (fourcc[3] << 24));
42 gchar *gst_riff_id_to_fourcc(gulong id) {
43 static gchar fourcc[5];
45 g_return_val_if_fail(fourcc != NULL, NULL);
47 id = GUINT32_FROM_LE(id);
48 fourcc[0] = (id >> 0) & 0xff;
49 fourcc[1] = (id >> 8) & 0xff;
50 fourcc[2] = (id >> 16) & 0xff;
51 fourcc[3] = (id >> 24) & 0xff;