gst_plugins_good/gst/wavparse/gstwavparse.h
changeset 0 0e761a78d257
child 8 4a7fac7dd34a
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /* GStreamer
       
     2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
       
     3  * Copyright (C) <2006> Nokia Corporation, Stefan Kost <stefan.kost@nokia.com>.
       
     4  *
       
     5  * This library is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Library General Public
       
     7  * License as published by the Free Software Foundation; either
       
     8  * version 2 of the License, or (at your option) any later version.
       
     9  *
       
    10  * This library is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13  * Library General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Library General Public
       
    16  * License along with this library; if not, write to the
       
    17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    18  * Boston, MA 02111-1307, USA.
       
    19  */
       
    20 
       
    21 
       
    22 #ifndef __GST_WAVPARSE_H__
       
    23 #define __GST_WAVPARSE_H__
       
    24 
       
    25 
       
    26 #include <gst/gst.h>
       
    27 #include <gst/gst_global.h>
       
    28 #include <gst/riff/riff-read.h>
       
    29 #include <gst/riff/riff-ids.h>
       
    30 #include <gst/riff/riff-media.h>
       
    31 
       
    32 #include <gst/base/gstadapter.h>
       
    33 
       
    34 G_BEGIN_DECLS
       
    35 
       
    36 #define GST_TYPE_WAVPARSE \
       
    37   (gst_wavparse_get_type())
       
    38 #define GST_WAVPARSE(obj) \
       
    39   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAVPARSE,GstWavParse))
       
    40 #define GST_WAVPARSE_CLASS(klass) \
       
    41   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAVPARSE,GstWavParseClass))
       
    42 #define GST_IS_WAVPARSE(obj) \
       
    43   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAVPARSE))
       
    44 #define GST_IS_WAVPARSE_CLASS(klass) \
       
    45   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAVPARSE))
       
    46 
       
    47 typedef enum {
       
    48   GST_WAVPARSE_START,
       
    49   GST_WAVPARSE_HEADER,
       
    50   GST_WAVPARSE_DATA,
       
    51 } GstWavParseState;
       
    52 
       
    53 typedef struct _GstWavParse GstWavParse;
       
    54 typedef struct _GstWavParseClass GstWavParseClass;
       
    55 
       
    56 /**
       
    57  * GstWavParse:
       
    58  *
       
    59  * Opaque data structure.
       
    60  */
       
    61 struct _GstWavParse {
       
    62   GstElement parent;
       
    63 
       
    64   /* pads */
       
    65   GstPad *sinkpad,*srcpad;
       
    66 
       
    67   /* for delayed source pad creation for when
       
    68    * we have the first chunk of data and know
       
    69    * the format for sure */
       
    70   GstCaps     *caps;
       
    71   GstTagList  *tags;
       
    72   GstEvent    *newsegment;
       
    73 
       
    74   /* WAVE decoding state */
       
    75   GstWavParseState state;
       
    76 
       
    77   /* format of audio, see defines below */
       
    78   gint format;
       
    79 
       
    80   /* useful audio data */
       
    81   guint16 depth;
       
    82   gint rate;
       
    83   guint16 channels;
       
    84   guint16 blockalign;
       
    85   guint16 width;
       
    86   guint32 bps;
       
    87 
       
    88   guint bytes_per_sample;
       
    89 
       
    90   /* position in data part */
       
    91   guint64	offset;
       
    92   guint64	end_offset;
       
    93   guint64 	dataleft;
       
    94   /* offset/length of data part */
       
    95   guint64 	datastart;
       
    96   guint64 	datasize;
       
    97   
       
    98   /* pending seek */
       
    99   GstEvent *seek_event;
       
   100 
       
   101   /* For streaming */
       
   102   GstAdapter *adapter;
       
   103   gboolean got_fmt;
       
   104   gboolean streaming;
       
   105 
       
   106   /* configured segment, start/stop expressed in time */
       
   107   GstSegment segment;
       
   108   gboolean segment_running;
       
   109   
       
   110   /* for late pad configuration */
       
   111   gboolean first;
       
   112 };
       
   113 
       
   114 struct _GstWavParseClass {
       
   115   GstElementClass parent_class;
       
   116 };
       
   117 
       
   118 GType gst_wavparse_get_type(void);
       
   119 
       
   120 G_END_DECLS
       
   121 
       
   122 #endif /* __GST_WAVPARSE_H__ */