summaryrefslogtreecommitdiffstats
path: root/gst/wavparse/gstriff.h
blob: 42959fe9c1faf0d2c898ee560aed8bfc00bbad7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* GStreamer
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 * 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.
 */


#ifndef __GST_RIFF_H__
#define __GST_RIFF_H__


#include <gst/gstbuffer.h>
#include <gst/gstplugin.h>


#define GST_RIFF_ENOTRIFF -1		/* not a RIFF file */


typedef struct _GstRiff GstRiff;
typedef struct _GstRiffChunk GstRiffChunk;

struct _GstRiff {
  guint32 form;

  /* list of chunks, most recent at the head */
  GList *chunks;

  /* parse state */
  gint state;
  guint32 curoffset;
  guint32 nextlikely;
};

struct _GstRiffChunk {
  gulong offset;

  guint32 id;
  guint32 size;
};


GstRiff *gst_riff_new();
gint gst_riff_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off);
GList *gst_riff_get_chunk_list(GstRiff *riff);
GstRiffChunk *gst_riff_get_chunk(GstRiff *riff,gchar *fourcc);
GstRiffChunk *gst_riff_get_chunk_number(GstRiff *riff,gint number);

gulong gst_riff_get_nextlikely(GstRiff *riff);

gulong gst_riff_fourcc_to_id(gchar *fourcc);
gchar *gst_riff_id_to_fourcc(gulong id);


#endif /* __GST_RIFF_H__ */