2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-22 23:27:31 +00:00
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
gst/wavparse/gstwavparse.*: Add push (streaming) mode to wavparse (fixes #337625)
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_adtl),
(gst_wavparse_parse_cues), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_peek_chunk_info), (gst_wavparse_peek_chunk),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_send_event), (gst_wavparse_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state), (plugin_init):
* gst/wavparse/gstwavparse.h:
Add push (streaming) mode to wavparse (fixes #337625)
2006-04-28 23:09:17 +00:00
|
|
|
* Copyright (C) <2006> Nokia Corporation, Stefan Kost <stefan.kost@nokia.com>.
|
2001-12-22 23:27:31 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-01-30 10:20:58 +00:00
|
|
|
#ifndef __GST_WAVPARSE_H__
|
|
|
|
#define __GST_WAVPARSE_H__
|
2001-12-22 23:27:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2004-05-08 00:33:39 +00:00
|
|
|
#include "gst/riff/riff-ids.h"
|
|
|
|
#include "gst/riff/riff-read.h"
|
gst/wavparse/gstwavparse.*: Add push (streaming) mode to wavparse (fixes #337625)
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_adtl),
(gst_wavparse_parse_cues), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_peek_chunk_info), (gst_wavparse_peek_chunk),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_send_event), (gst_wavparse_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state), (plugin_init):
* gst/wavparse/gstwavparse.h:
Add push (streaming) mode to wavparse (fixes #337625)
2006-04-28 23:09:17 +00:00
|
|
|
#include <gst/base/gstadapter.h>
|
2001-12-22 23:27:31 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: Fix wavparse some more.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_init), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_handle_seek),
(gst_wavparse_stream_headers), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_pad_convert),
(gst_wavparse_pad_query), (gst_wavparse_srcpad_event),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Fix wavparse some more.
2005-09-19 16:26:30 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2002-01-30 10:20:58 +00:00
|
|
|
#define GST_TYPE_WAVPARSE \
|
|
|
|
(gst_wavparse_get_type())
|
|
|
|
#define GST_WAVPARSE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAVPARSE,GstWavParse))
|
|
|
|
#define GST_WAVPARSE_CLASS(klass) \
|
2006-03-23 15:36:27 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAVPARSE,GstWavParseClass))
|
2002-01-30 10:20:58 +00:00
|
|
|
#define GST_IS_WAVPARSE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAVPARSE))
|
2006-03-23 15:36:27 +00:00
|
|
|
#define GST_IS_WAVPARSE_CLASS(klass) \
|
2002-01-30 10:20:58 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAVPARSE))
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_WAVPARSE_START,
|
2005-07-20 11:26:05 +00:00
|
|
|
GST_WAVPARSE_HEADER,
|
2006-06-14 08:06:43 +00:00
|
|
|
GST_WAVPARSE_DATA
|
2004-05-08 00:33:39 +00:00
|
|
|
} GstWavParseState;
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstWavParse GstWavParse;
|
|
|
|
typedef struct _GstWavParseClass GstWavParseClass;
|
|
|
|
|
docs/plugins/: Added wavparse docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added wavparse docs.
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_stream_headers), (gst_wavparse_send_event),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Implement seek in READY (fixes #327658)
Added docs and did some cleanups.
2006-03-03 18:36:53 +00:00
|
|
|
/**
|
|
|
|
* GstWavParse:
|
|
|
|
*
|
|
|
|
* Opaque data structure.
|
|
|
|
*/
|
2004-03-15 16:32:54 +00:00
|
|
|
struct _GstWavParse {
|
2005-07-20 11:26:05 +00:00
|
|
|
GstElement parent;
|
2004-03-15 16:32:54 +00:00
|
|
|
|
|
|
|
/* pads */
|
|
|
|
GstPad *sinkpad,*srcpad;
|
|
|
|
|
2006-03-23 15:36:27 +00:00
|
|
|
/* for delayed source pad creation for when
|
|
|
|
* we have the first chunk of data and know
|
|
|
|
* the format for sure */
|
|
|
|
GstCaps *caps;
|
|
|
|
GstTagList *tags;
|
2007-05-02 17:19:36 +00:00
|
|
|
GstEvent *close_segment;
|
|
|
|
GstEvent *start_segment;
|
2006-03-23 15:36:27 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
/* WAVE decoding state */
|
2004-05-08 00:33:39 +00:00
|
|
|
GstWavParseState state;
|
2009-08-10 14:19:03 +00:00
|
|
|
gboolean abort_buffering;
|
2004-03-15 16:32:54 +00:00
|
|
|
|
|
|
|
/* format of audio, see defines below */
|
|
|
|
gint format;
|
|
|
|
|
|
|
|
/* useful audio data */
|
2004-05-08 00:33:39 +00:00
|
|
|
guint16 depth;
|
2007-04-13 06:20:28 +00:00
|
|
|
guint32 rate;
|
2004-05-08 00:33:39 +00:00
|
|
|
guint16 channels;
|
2004-10-01 16:01:51 +00:00
|
|
|
guint16 blockalign;
|
2004-05-08 00:33:39 +00:00
|
|
|
guint16 width;
|
gst/wavparse/gstwavparse.*: Update docs.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_destroy_sourcepad), (gst_wavparse_fmt),
(gst_wavparse_parse_file_header), (gst_wavparse_stream_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_chain),
(gst_wavparse_pad_convert), (gst_wavparse_pad_query),
(gst_wavparse_srcpad_event), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
Update docs.
Use boilerplate.
Various code cleanups.
When the bitrate is not known (bps == 0 or compressed formats) let
downstream element guestimate the duration and position and don't
generate timestamps or durations. Fixes #405213.
Fix EOS and ERROR conditions in chain mode, we just need to forward the
error flowreturn upstream.
2007-02-14 09:55:47 +00:00
|
|
|
guint32 av_bps;
|
2006-07-24 13:40:56 +00:00
|
|
|
guint32 fact;
|
2004-03-15 16:32:54 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: Update docs.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_destroy_sourcepad), (gst_wavparse_fmt),
(gst_wavparse_parse_file_header), (gst_wavparse_stream_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_chain),
(gst_wavparse_pad_convert), (gst_wavparse_pad_query),
(gst_wavparse_srcpad_event), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
Update docs.
Use boilerplate.
Various code cleanups.
When the bitrate is not known (bps == 0 or compressed formats) let
downstream element guestimate the duration and position and don't
generate timestamps or durations. Fixes #405213.
Fix EOS and ERROR conditions in chain mode, we just need to forward the
error flowreturn upstream.
2007-02-14 09:55:47 +00:00
|
|
|
/* real bps used or 0 when no bitrate is known */
|
|
|
|
guint32 bps;
|
2007-05-02 17:19:36 +00:00
|
|
|
gboolean vbr;
|
gst/wavparse/gstwavparse.*: Update docs.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_destroy_sourcepad), (gst_wavparse_fmt),
(gst_wavparse_parse_file_header), (gst_wavparse_stream_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_chain),
(gst_wavparse_pad_convert), (gst_wavparse_pad_query),
(gst_wavparse_srcpad_event), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
Update docs.
Use boilerplate.
Various code cleanups.
When the bitrate is not known (bps == 0 or compressed formats) let
downstream element guestimate the duration and position and don't
generate timestamps or durations. Fixes #405213.
Fix EOS and ERROR conditions in chain mode, we just need to forward the
error flowreturn upstream.
2007-02-14 09:55:47 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: Fix wavparse some more.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_init), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_handle_seek),
(gst_wavparse_stream_headers), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_pad_convert),
(gst_wavparse_pad_query), (gst_wavparse_srcpad_event),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Fix wavparse some more.
2005-09-19 16:26:30 +00:00
|
|
|
guint bytes_per_sample;
|
2011-02-23 15:50:43 +00:00
|
|
|
guint max_buf_size;
|
gst/wavparse/gstwavparse.*: Fix wavparse some more.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_init), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_handle_seek),
(gst_wavparse_stream_headers), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_pad_convert),
(gst_wavparse_pad_query), (gst_wavparse_srcpad_event),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Fix wavparse some more.
2005-09-19 16:26:30 +00:00
|
|
|
|
2005-12-16 19:32:53 +00:00
|
|
|
/* position in data part */
|
|
|
|
guint64 offset;
|
|
|
|
guint64 end_offset;
|
|
|
|
guint64 dataleft;
|
|
|
|
/* offset/length of data part */
|
|
|
|
guint64 datastart;
|
|
|
|
guint64 datasize;
|
2007-09-04 07:58:36 +00:00
|
|
|
/* duration in time */
|
|
|
|
guint64 duration;
|
2007-04-13 06:20:28 +00:00
|
|
|
|
docs/plugins/: Added wavparse docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added wavparse docs.
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_stream_headers), (gst_wavparse_send_event),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Implement seek in READY (fixes #327658)
Added docs and did some cleanups.
2006-03-03 18:36:53 +00:00
|
|
|
/* pending seek */
|
2005-07-20 11:26:05 +00:00
|
|
|
GstEvent *seek_event;
|
gst/wavparse/gstwavparse.*: Fix wavparse some more.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_init), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_handle_seek),
(gst_wavparse_stream_headers), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_pad_convert),
(gst_wavparse_pad_query), (gst_wavparse_srcpad_event),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Fix wavparse some more.
2005-09-19 16:26:30 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: Add push (streaming) mode to wavparse (fixes #337625)
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_adtl),
(gst_wavparse_parse_cues), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_peek_chunk_info), (gst_wavparse_peek_chunk),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_send_event), (gst_wavparse_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state), (plugin_init):
* gst/wavparse/gstwavparse.h:
Add push (streaming) mode to wavparse (fixes #337625)
2006-04-28 23:09:17 +00:00
|
|
|
/* For streaming */
|
|
|
|
GstAdapter *adapter;
|
|
|
|
gboolean got_fmt;
|
|
|
|
gboolean streaming;
|
|
|
|
|
docs/plugins/: Added wavparse docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added wavparse docs.
* gst/wavparse/gstwavparse.c: (gst_wavparse_class_init),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_stream_headers), (gst_wavparse_send_event),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Implement seek in READY (fixes #327658)
Added docs and did some cleanups.
2006-03-03 18:36:53 +00:00
|
|
|
/* configured segment, start/stop expressed in time */
|
2005-12-16 19:32:53 +00:00
|
|
|
GstSegment segment;
|
|
|
|
gboolean segment_running;
|
2007-04-13 06:20:28 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: Add push (streaming) mode to wavparse (fixes #337625)
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_create_sourcepad), (gst_wavparse_parse_adtl),
(gst_wavparse_parse_cues), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_perform_seek),
(gst_wavparse_peek_chunk_info), (gst_wavparse_peek_chunk),
(gst_wavparse_stream_headers), (gst_wavparse_parse_stream_init),
(gst_wavparse_send_event), (gst_wavparse_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state), (plugin_init):
* gst/wavparse/gstwavparse.h:
Add push (streaming) mode to wavparse (fixes #337625)
2006-04-28 23:09:17 +00:00
|
|
|
/* for late pad configuration */
|
|
|
|
gboolean first;
|
2007-04-26 08:39:49 +00:00
|
|
|
/* discont after seek */
|
|
|
|
gboolean discont;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstWavParseClass {
|
2005-07-20 11:26:05 +00:00
|
|
|
GstElementClass parent_class;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_wavparse_get_type(void);
|
|
|
|
|
gst/wavparse/gstwavparse.*: Fix wavparse some more.
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_init), (gst_wavparse_parse_file_header),
(gst_wavparse_stream_init), (gst_wavparse_handle_seek),
(gst_wavparse_stream_headers), (gst_wavparse_stream_data),
(gst_wavparse_loop), (gst_wavparse_pad_convert),
(gst_wavparse_pad_query), (gst_wavparse_srcpad_event),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
Fix wavparse some more.
2005-09-19 16:26:30 +00:00
|
|
|
G_END_DECLS
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
#endif /* __GST_WAVPARSE_H__ */
|