2003-10-29 23:50:00 +00:00
|
|
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
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.
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* SECTION:element-wavparse
|
|
|
|
*
|
2006-05-02 13:01:50 +00:00
|
|
|
* Parse a .wav file into raw or compressed audio.
|
2009-01-28 10:29:42 +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
|
|
|
* Wavparse supports both push and pull mode operations, making it possible to
|
|
|
|
* stream from a network source.
|
2009-01-28 10:29:42 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
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
|
|
|
* <title>Example launch line</title>
|
2009-01-28 10:29:42 +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
|
|
|
* gst-launch filesrc location=sine.wav ! wavparse ! audioconvert ! alsasink
|
2009-01-28 10:29:42 +00:00
|
|
|
* ]| Read a wav file and output to the soundcard using the ALSA element. The
|
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
|
|
|
* wav file is assumed to contain raw uncompressed samples.
|
2009-01-28 10:29:42 +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
|
|
|
* gst-launch gnomevfssrc location=http://www.example.org/sine.wav ! queue ! wavparse ! audioconvert ! alsasink
|
2009-01-28 10:29:42 +00:00
|
|
|
* ]| Stream data from a network url.
|
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
|
|
|
* </refsect2>
|
|
|
|
*
|
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
|
|
|
* Last reviewed on 2007-02-14 (0.10.6)
|
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
|
|
|
*/
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
/*
|
|
|
|
* TODO:
|
|
|
|
* http://replaygain.hydrogenaudio.org/file_format_wav.html
|
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2011-12-12 02:52:13 +00:00
|
|
|
|
2001-12-22 23:27:31 +00:00
|
|
|
#include <string.h>
|
2007-04-13 06:20:28 +00:00
|
|
|
#include <math.h>
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2004-07-27 21:51:32 +00:00
|
|
|
#include "gstwavparse.h"
|
2004-05-08 00:33:39 +00:00
|
|
|
#include "gst/riff/riff-ids.h"
|
|
|
|
#include "gst/riff/riff-media.h"
|
2010-06-11 19:50:23 +00:00
|
|
|
#include <gst/base/gsttypefindhelper.h>
|
2005-10-23 11:07:10 +00:00
|
|
|
#include <gst/gst-i18n-plugin.h>
|
2001-12-22 23:27:31 +00:00
|
|
|
|
configure.ac: Check for optional dependency on zlib for id3demux
Original commit message from CVS:
* configure.ac:
Check for optional dependency on zlib for id3demux
* gst/id3demux/Makefile.am:
* gst/id3demux/gstid3demux.c: (gst_gst_id3demux_get_type),
(gst_id3demux_base_init), (gst_id3demux_class_init),
(gst_id3demux_reset), (gst_id3demux_init), (gst_id3demux_dispose),
(gst_id3demux_add_srcpad), (gst_id3demux_remove_srcpad),
(gst_id3demux_trim_buffer), (gst_id3demux_chain),
(gst_id3demux_set_property), (gst_id3demux_get_property),
(id3demux_get_upstream_size), (gst_id3demux_srcpad_event),
(gst_id3demux_read_id3v1), (gst_id3demux_read_id3v2),
(gst_id3demux_sink_activate), (gst_id3demux_src_activate_pull),
(gst_id3demux_src_checkgetrange), (gst_id3demux_read_range),
(gst_id3demux_src_getrange), (gst_id3demux_change_state),
(gst_id3demux_pad_query), (gst_id3demux_get_query_types),
(simple_find_peek), (simple_find_suggest),
(gst_id3demux_do_typefind), (gst_id3demux_send_tag_event),
(plugin_init):
* gst/id3demux/gstid3demux.h:
* gst/id3demux/id3tags.c: (read_synch_uint),
(id3demux_read_id3v1_tag), (id3demux_read_id3v2_tag),
(id3demux_id3v2_frame_hdr_size), (convert_fid_to_v240),
(id3demux_id3v2_frames_to_tag_list):
* gst/id3demux/id3tags.h:
* gst/id3demux/id3v2.4.0-frames.txt:
* gst/id3demux/id3v2.4.0-structure.txt:
* gst/id3demux/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_comment_frame), (parse_text_identification_frame),
(id3v2_tag_to_taglist), (parse_split_strings):
All new LGPL id3 demuxer. Can use zlib for compressed frames,
otherwise it discards them. Works on my test files.
* gst/wavparse/gstwavparse.c: (gst_wavparse_loop):
Don't send EOS to a non-existing srcpad
The debug category can be static
2005-12-18 15:14:44 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (wavparse_debug);
|
2004-10-01 16:01:51 +00:00
|
|
|
#define GST_CAT_DEFAULT (wavparse_debug)
|
|
|
|
|
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
|
|
|
static void gst_wavparse_dispose (GObject * object);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2011-11-18 12:57:20 +00:00
|
|
|
static gboolean gst_wavparse_sink_activate (GstPad * sinkpad,
|
|
|
|
GstObject * parent);
|
2011-11-21 12:37:01 +00:00
|
|
|
static gboolean gst_wavparse_sink_activate_mode (GstPad * sinkpad,
|
|
|
|
GstObject * parent, GstPadMode mode, gboolean active);
|
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
|
|
|
static gboolean gst_wavparse_send_event (GstElement * element,
|
|
|
|
GstEvent * event);
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn gst_wavparse_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2011-11-16 16:27:13 +00:00
|
|
|
static gboolean gst_wavparse_pad_query (GstPad * pad, GstObject * parent,
|
|
|
|
GstQuery * query);
|
|
|
|
static gboolean gst_wavparse_pad_convert (GstPad * pad, GstFormat src_format,
|
2004-03-14 22:34:33 +00:00
|
|
|
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
|
|
|
|
|
2011-11-17 14:02:55 +00:00
|
|
|
static GstFlowReturn gst_wavparse_chain (GstPad * pad, GstObject * parent,
|
|
|
|
GstBuffer * buf);
|
|
|
|
static gboolean gst_wavparse_sink_event (GstPad * pad, GstObject * parent,
|
|
|
|
GstEvent * event);
|
2005-07-20 11:26:05 +00:00
|
|
|
static void gst_wavparse_loop (GstPad * pad);
|
2011-11-17 14:02:55 +00:00
|
|
|
static gboolean gst_wavparse_srcpad_event (GstPad * pad, GstObject * parent,
|
|
|
|
GstEvent * event);
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2011-12-12 16:49:19 +00:00
|
|
|
static void gst_wavparse_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_wavparse_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
|
|
|
#define DEFAULT_IGNORE_LENGTH FALSE
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_IGNORE_LENGTH,
|
|
|
|
};
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate sink_template_factory =
|
2011-07-06 14:31:18 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-wav")
|
|
|
|
);
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
#define DEBUG_INIT \
|
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_DEBUG_CATEGORY_INIT (wavparse_debug, "wavparse", 0, "WAV parser");
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
#define gst_wavparse_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstWavParse, gst_wavparse, GST_TYPE_ELEMENT,
|
|
|
|
DEBUG_INIT);
|
2004-05-08 00:33:39 +00:00
|
|
|
|
2001-12-22 23:27:31 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_wavparse_class_init (GstWavParseClass * klass)
|
2001-12-22 23:27:31 +00:00
|
|
|
{
|
|
|
|
GstElementClass *gstelement_class;
|
2003-10-17 00:29:44 +00:00
|
|
|
GObjectClass *object_class;
|
2011-07-06 14:10:34 +00:00
|
|
|
GstPadTemplate *src_template;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2003-10-17 00:29:44 +00:00
|
|
|
object_class = (GObjectClass *) klass;
|
2004-03-14 22:34:33 +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
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2003-06-13 22:11:56 +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
|
|
|
object_class->dispose = gst_wavparse_dispose;
|
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
|
|
|
|
2011-12-12 16:49:19 +00:00
|
|
|
object_class->set_property = gst_wavparse_set_property;
|
|
|
|
object_class->get_property = gst_wavparse_get_property;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstWavParse:ignore-length
|
|
|
|
*
|
|
|
|
* This selects whether the length found in a data chunk
|
|
|
|
* should be ignored. This may be useful for streamed audio
|
|
|
|
* where the length is unknown until the end of streaming,
|
|
|
|
* and various software/hardware just puts some random value
|
|
|
|
* in there and hopes it doesn't break too much.
|
|
|
|
*
|
|
|
|
* Since: 0.10.36
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class, PROP_IGNORE_LENGTH,
|
|
|
|
g_param_spec_boolean ("ignore-length",
|
|
|
|
"Ignore length",
|
|
|
|
"Ignore length from the Wave header",
|
|
|
|
DEFAULT_IGNORE_LENGTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
|
|
|
);
|
|
|
|
|
2003-06-13 22:11:56 +00:00
|
|
|
gstelement_class->change_state = gst_wavparse_change_state;
|
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
|
|
|
gstelement_class->send_event = gst_wavparse_send_event;
|
2011-07-06 14:10:34 +00:00
|
|
|
|
|
|
|
/* register pads */
|
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&sink_template_factory));
|
|
|
|
|
2011-07-06 14:31:18 +00:00
|
|
|
src_template = gst_pad_template_new ("src", GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS, gst_riff_create_audio_template_caps ());
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_element_class_add_pad_template (gstelement_class, src_template);
|
|
|
|
|
2012-04-09 23:51:41 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class, "WAV audio demuxer",
|
2011-07-06 14:10:34 +00:00
|
|
|
"Codec/Demuxer/Audio",
|
|
|
|
"Parse a .wav file into raw audio",
|
|
|
|
"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
|
|
|
}
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +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
|
|
|
static void
|
2008-08-05 14:16:32 +00:00
|
|
|
gst_wavparse_reset (GstWavParse * wav)
|
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
|
|
|
{
|
2008-08-05 14:16:32 +00:00
|
|
|
wav->state = GST_WAVPARSE_START;
|
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
|
|
|
|
2008-08-05 14:16:32 +00:00
|
|
|
/* These will all be set correctly in the fmt chunk */
|
|
|
|
wav->depth = 0;
|
|
|
|
wav->rate = 0;
|
|
|
|
wav->width = 0;
|
|
|
|
wav->channels = 0;
|
|
|
|
wav->blockalign = 0;
|
|
|
|
wav->bps = 0;
|
|
|
|
wav->fact = 0;
|
|
|
|
wav->offset = 0;
|
|
|
|
wav->end_offset = 0;
|
|
|
|
wav->dataleft = 0;
|
|
|
|
wav->datasize = 0;
|
|
|
|
wav->datastart = 0;
|
|
|
|
wav->duration = 0;
|
|
|
|
wav->got_fmt = FALSE;
|
|
|
|
wav->first = TRUE;
|
|
|
|
|
|
|
|
if (wav->seek_event)
|
|
|
|
gst_event_unref (wav->seek_event);
|
|
|
|
wav->seek_event = NULL;
|
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
|
|
|
if (wav->adapter) {
|
2008-08-05 14:16:32 +00:00
|
|
|
gst_adapter_clear (wav->adapter);
|
2008-12-13 15:34:01 +00:00
|
|
|
g_object_unref (wav->adapter);
|
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
|
|
|
wav->adapter = NULL;
|
|
|
|
}
|
2008-08-05 14:16:32 +00:00
|
|
|
if (wav->tags)
|
|
|
|
gst_tag_list_free (wav->tags);
|
|
|
|
wav->tags = NULL;
|
2009-08-11 11:56:43 +00:00
|
|
|
if (wav->caps)
|
|
|
|
gst_caps_unref (wav->caps);
|
|
|
|
wav->caps = NULL;
|
|
|
|
if (wav->start_segment)
|
|
|
|
gst_event_unref (wav->start_segment);
|
|
|
|
wav->start_segment = NULL;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
2008-08-05 14:16:32 +00:00
|
|
|
gst_wavparse_dispose (GObject * object)
|
2001-12-22 23:27:31 +00:00
|
|
|
{
|
2008-08-05 14:16:32 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (object);
|
2004-05-08 00:33:39 +00:00
|
|
|
|
2008-08-05 14:16:32 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "WAV: Dispose");
|
|
|
|
gst_wavparse_reset (wav);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_wavparse_init (GstWavParse * wavparse)
|
2005-07-20 11:26:05 +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
|
|
|
gst_wavparse_reset (wavparse);
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
/* sink */
|
|
|
|
wavparse->sinkpad =
|
2006-03-15 16:17:12 +00:00
|
|
|
gst_pad_new_from_static_template (&sink_template_factory, "sink");
|
2005-11-21 17:23:46 +00:00
|
|
|
gst_pad_set_activate_function (wavparse->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_sink_activate));
|
2011-11-21 12:37:01 +00:00
|
|
|
gst_pad_set_activatemode_function (wavparse->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_sink_activate_mode));
|
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
|
|
|
gst_pad_set_chain_function (wavparse->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_chain));
|
2009-02-27 12:29:41 +00:00
|
|
|
gst_pad_set_event_function (wavparse->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_sink_event));
|
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_element_add_pad (GST_ELEMENT_CAST (wavparse), wavparse->sinkpad);
|
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
|
|
|
|
2011-07-06 14:31:18 +00:00
|
|
|
/* src */
|
|
|
|
wavparse->srcpad =
|
|
|
|
gst_pad_new_from_template (gst_element_class_get_pad_template
|
|
|
|
(GST_ELEMENT_GET_CLASS (wavparse), "src"), "src");
|
|
|
|
gst_pad_use_fixed_caps (wavparse->srcpad);
|
|
|
|
gst_pad_set_query_function (wavparse->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_pad_query));
|
|
|
|
gst_pad_set_event_function (wavparse->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_wavparse_srcpad_event));
|
|
|
|
gst_element_add_pad (GST_ELEMENT_CAST (wavparse), wavparse->srcpad);
|
2001-12-22 23:27:31 +00:00
|
|
|
}
|
|
|
|
|
2008-08-05 14:16:32 +00:00
|
|
|
/* FIXME: why is that not in use? */
|
2003-12-22 01:47:09 +00:00
|
|
|
#if 0
|
2003-10-17 00:29:44 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_wavparse_parse_adtl (GstWavParse * wavparse, int len)
|
2003-10-17 00:29:44 +00:00
|
|
|
{
|
2003-10-29 23:50:00 +00:00
|
|
|
guint32 got_bytes;
|
|
|
|
GstByteStream *bs = wavparse->bs;
|
2003-10-17 00:29:44 +00:00
|
|
|
gst_riff_chunk *temp_chunk, chunk;
|
2003-10-29 23:50:00 +00:00
|
|
|
guint8 *tempdata;
|
|
|
|
struct _gst_riff_labl labl, *temp_labl;
|
|
|
|
struct _gst_riff_ltxt ltxt, *temp_ltxt;
|
|
|
|
struct _gst_riff_note note, *temp_note;
|
|
|
|
char *label_name;
|
2003-10-17 00:29:44 +00:00
|
|
|
GstProps *props;
|
2003-10-29 23:50:00 +00:00
|
|
|
GstPropsEntry *entry;
|
|
|
|
GstCaps *new_caps;
|
|
|
|
GList *caps = NULL;
|
2003-10-17 00:29:44 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
props = wavparse->metadata->properties;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
while (len > 0) {
|
2004-03-14 22:34:33 +00:00
|
|
|
got_bytes =
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_peek_bytes (bs, &tempdata, sizeof (gst_riff_chunk));
|
2003-10-29 23:50:00 +00:00
|
|
|
if (got_bytes != sizeof (gst_riff_chunk)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
temp_chunk = (gst_riff_chunk *) tempdata;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
chunk.id = GUINT32_FROM_LE (temp_chunk->id);
|
|
|
|
chunk.size = GUINT32_FROM_LE (temp_chunk->size);
|
|
|
|
|
|
|
|
if (chunk.size == 0) {
|
|
|
|
gst_bytestream_flush (bs, sizeof (gst_riff_chunk));
|
|
|
|
len -= sizeof (gst_riff_chunk);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
switch (chunk.id) {
|
|
|
|
case GST_RIFF_adtl_labl:
|
2004-03-15 19:32:27 +00:00
|
|
|
got_bytes =
|
|
|
|
gst_bytestream_peek_bytes (bs, &tempdata,
|
|
|
|
sizeof (struct _gst_riff_labl));
|
|
|
|
if (got_bytes != sizeof (struct _gst_riff_labl)) {
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
temp_labl = (struct _gst_riff_labl *) tempdata;
|
|
|
|
labl.id = GUINT32_FROM_LE (temp_labl->id);
|
|
|
|
labl.size = GUINT32_FROM_LE (temp_labl->size);
|
|
|
|
labl.identifier = GUINT32_FROM_LE (temp_labl->identifier);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_flush (bs, sizeof (struct _gst_riff_labl));
|
|
|
|
len -= sizeof (struct _gst_riff_labl);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
got_bytes = gst_bytestream_peek_bytes (bs, &tempdata, labl.size - 4);
|
|
|
|
if (got_bytes != labl.size - 4) {
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
label_name = (char *) tempdata;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_flush (bs, ((labl.size - 4) + 1) & ~1);
|
|
|
|
len -= (((labl.size - 4) + 1) & ~1);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
new_caps = gst_caps_new ("label",
|
|
|
|
"application/x-gst-metadata",
|
|
|
|
gst_props_new ("identifier", G_TYPE_INT (labl.identifier),
|
|
|
|
"name", G_TYPE_STRING (label_name), NULL));
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
if (gst_props_get (props, "labels", &caps, NULL)) {
|
|
|
|
caps = g_list_append (caps, new_caps);
|
|
|
|
} else {
|
|
|
|
caps = g_list_append (NULL, new_caps);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
entry = gst_props_entry_new ("labels", GST_PROPS_GLIST (caps));
|
|
|
|
gst_props_add_entry (props, entry);
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
case GST_RIFF_adtl_ltxt:
|
2004-03-15 19:32:27 +00:00
|
|
|
got_bytes =
|
|
|
|
gst_bytestream_peek_bytes (bs, &tempdata,
|
|
|
|
sizeof (struct _gst_riff_ltxt));
|
|
|
|
if (got_bytes != sizeof (struct _gst_riff_ltxt)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
temp_ltxt = (struct _gst_riff_ltxt *) tempdata;
|
|
|
|
ltxt.id = GUINT32_FROM_LE (temp_ltxt->id);
|
|
|
|
ltxt.size = GUINT32_FROM_LE (temp_ltxt->size);
|
|
|
|
ltxt.identifier = GUINT32_FROM_LE (temp_ltxt->identifier);
|
|
|
|
ltxt.length = GUINT32_FROM_LE (temp_ltxt->length);
|
|
|
|
ltxt.purpose = GUINT32_FROM_LE (temp_ltxt->purpose);
|
|
|
|
ltxt.country = GUINT16_FROM_LE (temp_ltxt->country);
|
|
|
|
ltxt.language = GUINT16_FROM_LE (temp_ltxt->language);
|
|
|
|
ltxt.dialect = GUINT16_FROM_LE (temp_ltxt->dialect);
|
|
|
|
ltxt.codepage = GUINT16_FROM_LE (temp_ltxt->codepage);
|
|
|
|
|
|
|
|
gst_bytestream_flush (bs, sizeof (struct _gst_riff_ltxt));
|
|
|
|
len -= sizeof (struct _gst_riff_ltxt);
|
|
|
|
|
|
|
|
if (ltxt.size - 20 > 0) {
|
|
|
|
got_bytes = gst_bytestream_peek_bytes (bs, &tempdata, ltxt.size - 20);
|
|
|
|
if (got_bytes != ltxt.size - 20) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_bytestream_flush (bs, ((ltxt.size - 20) + 1) & ~1);
|
|
|
|
len -= (((ltxt.size - 20) + 1) & ~1);
|
|
|
|
|
|
|
|
label_name = (char *) tempdata;
|
|
|
|
} else {
|
|
|
|
label_name = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
new_caps = gst_caps_new ("ltxt",
|
|
|
|
"application/x-gst-metadata",
|
|
|
|
gst_props_new ("identifier", G_TYPE_INT (ltxt.identifier),
|
|
|
|
"name", G_TYPE_STRING (label_name),
|
|
|
|
"length", G_TYPE_INT (ltxt.length), NULL));
|
|
|
|
|
|
|
|
if (gst_props_get (props, "ltxts", &caps, NULL)) {
|
|
|
|
caps = g_list_append (caps, new_caps);
|
|
|
|
} else {
|
|
|
|
caps = g_list_append (NULL, new_caps);
|
|
|
|
|
|
|
|
entry = gst_props_entry_new ("ltxts", GST_PROPS_GLIST (caps));
|
|
|
|
gst_props_add_entry (props, entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
case GST_RIFF_adtl_note:
|
2004-03-15 19:32:27 +00:00
|
|
|
got_bytes =
|
|
|
|
gst_bytestream_peek_bytes (bs, &tempdata,
|
|
|
|
sizeof (struct _gst_riff_note));
|
|
|
|
if (got_bytes != sizeof (struct _gst_riff_note)) {
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
temp_note = (struct _gst_riff_note *) tempdata;
|
|
|
|
note.id = GUINT32_FROM_LE (temp_note->id);
|
|
|
|
note.size = GUINT32_FROM_LE (temp_note->size);
|
|
|
|
note.identifier = GUINT32_FROM_LE (temp_note->identifier);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_flush (bs, sizeof (struct _gst_riff_note));
|
|
|
|
len -= sizeof (struct _gst_riff_note);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
got_bytes = gst_bytestream_peek_bytes (bs, &tempdata, note.size - 4);
|
|
|
|
if (got_bytes != note.size - 4) {
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_flush (bs, ((note.size - 4) + 1) & ~1);
|
|
|
|
len -= (((note.size - 4) + 1) & ~1);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
label_name = (char *) tempdata;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
new_caps = gst_caps_new ("note",
|
|
|
|
"application/x-gst-metadata",
|
|
|
|
gst_props_new ("identifier", G_TYPE_INT (note.identifier),
|
|
|
|
"name", G_TYPE_STRING (label_name), NULL));
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
if (gst_props_get (props, "notes", &caps, NULL)) {
|
|
|
|
caps = g_list_append (caps, new_caps);
|
|
|
|
} else {
|
|
|
|
caps = g_list_append (NULL, new_caps);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
entry = gst_props_entry_new ("notes", GST_PROPS_GLIST (caps));
|
|
|
|
gst_props_add_entry (props, entry);
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
default:
|
2005-11-21 13:38:24 +00:00
|
|
|
g_print ("Unknown chunk: %" GST_FOURCC_FORMAT "\n",
|
2004-03-15 19:32:27 +00:00
|
|
|
GST_FOURCC_ARGS (chunk.id));
|
|
|
|
return;
|
2003-10-29 23:50:00 +00:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 15:02:42 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (wavparse), "metadata");
|
2003-10-29 23:50:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_wavparse_parse_cues (GstWavParse * wavparse, int len)
|
2003-08-13 06:41:09 +00:00
|
|
|
{
|
2003-10-29 23:50:00 +00:00
|
|
|
guint32 got_bytes;
|
|
|
|
GstByteStream *bs = wavparse->bs;
|
|
|
|
struct _gst_riff_cue *temp_cue, cue;
|
|
|
|
struct _gst_riff_cuepoints *points;
|
|
|
|
guint8 *tempdata;
|
|
|
|
int i;
|
|
|
|
GList *cues = NULL;
|
|
|
|
GstPropsEntry *entry;
|
2003-08-13 06:41:09 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
while (len > 0) {
|
2003-11-14 15:02:42 +00:00
|
|
|
int required;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
got_bytes =
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_bytestream_peek_bytes (bs, &tempdata,
|
|
|
|
sizeof (struct _gst_riff_cue));
|
2003-10-29 23:50:00 +00:00
|
|
|
temp_cue = (struct _gst_riff_cue *) tempdata;
|
2003-08-13 06:41:09 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
/* fixup for our big endian friends */
|
|
|
|
cue.id = GUINT32_FROM_LE (temp_cue->id);
|
|
|
|
cue.size = GUINT32_FROM_LE (temp_cue->size);
|
|
|
|
cue.cuepoints = GUINT32_FROM_LE (temp_cue->cuepoints);
|
|
|
|
|
|
|
|
gst_bytestream_flush (bs, sizeof (struct _gst_riff_cue));
|
|
|
|
if (got_bytes != sizeof (struct _gst_riff_cue)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
len -= sizeof (struct _gst_riff_cue);
|
|
|
|
|
|
|
|
/* -4 because cue.size contains the cuepoints size
|
|
|
|
and we've already flushed that out of the system */
|
2003-11-14 15:02:42 +00:00
|
|
|
required = cue.size - 4;
|
|
|
|
got_bytes = gst_bytestream_peek_bytes (bs, &tempdata, required);
|
|
|
|
gst_bytestream_flush (bs, ((required) + 1) & ~1);
|
|
|
|
if (got_bytes != required) {
|
2003-10-29 23:50:00 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
len -= (((cue.size - 4) + 1) & ~1);
|
2003-10-29 23:50:00 +00:00
|
|
|
|
|
|
|
/* now we have an array of struct _gst_riff_cuepoints in tempdata */
|
|
|
|
points = (struct _gst_riff_cuepoints *) tempdata;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
for (i = 0; i < cue.cuepoints; i++) {
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = gst_caps_new ("cues",
|
2004-03-15 19:32:27 +00:00
|
|
|
"application/x-gst-metadata",
|
|
|
|
gst_props_new ("identifier", G_TYPE_INT (points[i].identifier),
|
|
|
|
"position", G_TYPE_INT (points[i].offset), NULL));
|
2003-10-29 23:50:00 +00:00
|
|
|
cues = g_list_append (cues, caps);
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
entry = gst_props_entry_new ("cues", GST_PROPS_GLIST (cues));
|
|
|
|
gst_props_add_entry (wavparse->metadata->properties, entry);
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-10-29 23:50:00 +00:00
|
|
|
g_object_notify (G_OBJECT (wavparse), "metadata");
|
|
|
|
}
|
gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
/* Read 'fmt ' header */
|
|
|
|
static gboolean
|
|
|
|
gst_wavparse_fmt (GstWavParse * wav)
|
|
|
|
{
|
2004-10-01 11:53:19 +00:00
|
|
|
gst_riff_strf_auds *header = NULL;
|
2004-05-08 00:33:39 +00:00
|
|
|
GstCaps *caps;
|
2004-03-14 22:34:33 +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
|
|
|
if (!gst_riff_read_strf_auds (wav, &header))
|
|
|
|
goto no_fmt;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
wav->format = header->format;
|
|
|
|
wav->rate = header->rate;
|
|
|
|
wav->channels = header->channels;
|
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
|
|
|
if (wav->channels == 0)
|
|
|
|
goto no_channels;
|
|
|
|
|
2004-10-01 16:01:51 +00:00
|
|
|
wav->blockalign = header->blockalign;
|
2004-05-08 00:33:39 +00:00
|
|
|
wav->width = (header->blockalign * 8) / header->channels;
|
|
|
|
wav->depth = header->size;
|
2004-05-16 20:06:35 +00:00
|
|
|
wav->bps = header->av_bps;
|
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
|
|
|
if (wav->bps <= 0)
|
|
|
|
goto no_bps;
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2006-05-12 17:44:15 +00:00
|
|
|
/* Note: gst_riff_create_audio_caps might need to fix values in
|
2005-07-20 11:26:05 +00:00
|
|
|
* the header header depending on the format, so call it first */
|
2012-01-04 11:06:12 +00:00
|
|
|
/* FIXME: Need to handle the channel reorder map */
|
|
|
|
caps = gst_riff_create_audio_caps (header->format, NULL, header, NULL, NULL);
|
2004-10-29 11:57:35 +00:00
|
|
|
g_free (header);
|
2003-10-29 23:50:00 +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
|
|
|
if (caps == NULL)
|
|
|
|
goto no_caps;
|
|
|
|
|
|
|
|
gst_wavparse_create_sourcepad (wav);
|
|
|
|
gst_pad_use_fixed_caps (wav->srcpad);
|
|
|
|
gst_pad_set_active (wav->srcpad, TRUE);
|
|
|
|
gst_pad_set_caps (wav->srcpad, caps);
|
|
|
|
gst_caps_free (caps);
|
|
|
|
gst_element_add_pad (GST_ELEMENT_CAST (wav), wav->srcpad);
|
|
|
|
gst_element_no_more_pads (GST_ELEMENT_CAST (wav));
|
|
|
|
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG ("frequency %u, channels %u", wav->rate, wav->channels);
|
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
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_fmt:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, TYPE_NOT_FOUND, (NULL),
|
|
|
|
("No FMT tag found"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_channels:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
|
|
|
("Stream claims to contain zero channels - invalid data"));
|
|
|
|
g_free (header);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_bps:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
|
|
|
("Stream claims to bitrate of <= zero - invalid data"));
|
|
|
|
g_free (header);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_caps:
|
|
|
|
{
|
2004-10-01 12:39:08 +00:00
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
|
|
|
|
return FALSE;
|
2004-05-08 00:33:39 +00:00
|
|
|
}
|
|
|
|
}
|
2003-10-29 23:50:00 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
static gboolean
|
|
|
|
gst_wavparse_other (GstWavParse * wav)
|
|
|
|
{
|
|
|
|
guint32 tag, length;
|
2003-10-29 23:50:00 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_peek_head (wav, &tag, &length, NULL)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not peek head");
|
2004-05-08 00:33:39 +00:00
|
|
|
return FALSE;
|
2003-11-14 15:02:42 +00:00
|
|
|
}
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "got tag (%08x) %4.4s, length %u", tag,
|
|
|
|
(const gchar *) &tag, length);
|
2003-10-29 23:50:00 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
switch (tag) {
|
|
|
|
case GST_RIFF_TAG_LIST:
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!(tag = gst_riff_peek_list (wav))) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not peek list");
|
2004-05-08 00:33:39 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
switch (tag) {
|
|
|
|
case GST_RIFF_LIST_INFO:
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_read_list (wav, &tag) || !gst_riff_read_info (wav)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not read list");
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
2003-10-29 23:50:00 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
case GST_RIFF_LIST_adtl:
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_read_skip (wav)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not read skip");
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "skipping tag (%08x) %4.4s", tag,
|
|
|
|
(gchar *) & tag);
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_read_skip (wav)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not read skip");
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
2003-03-01 18:34:38 +00:00
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
2003-03-01 18:34:38 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
case GST_RIFF_TAG_data:
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_bytestream_flush (wav->bs, 8)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not flush 8 bytes");
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "switching to data mode");
|
2004-05-08 00:33:39 +00:00
|
|
|
wav->state = GST_WAVPARSE_DATA;
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->datastart = gst_bytestream_tell (wav->bs);
|
2004-10-01 16:01:51 +00:00
|
|
|
if (length == 0) {
|
|
|
|
guint64 file_length;
|
|
|
|
|
|
|
|
/* length is 0, data probably stretches to the end
|
|
|
|
* of file */
|
|
|
|
GST_DEBUG_OBJECT (wav, "length is 0 trying to find length");
|
|
|
|
/* get length of file */
|
2005-07-20 11:26:05 +00:00
|
|
|
file_length = gst_bytestream_length (wav->bs);
|
2004-10-01 16:01:51 +00:00
|
|
|
if (file_length == -1) {
|
|
|
|
GST_DEBUG_OBJECT (wav,
|
|
|
|
"could not get file length, assuming data to eof");
|
|
|
|
/* could not get length, assuming till eof */
|
|
|
|
length = G_MAXUINT32;
|
|
|
|
}
|
|
|
|
if (file_length > G_MAXUINT32) {
|
2010-06-29 19:14:53 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "file length %" G_GUINT64_FORMAT
|
|
|
|
", clipping to 32 bits", file_length);
|
2004-10-01 16:01:51 +00:00
|
|
|
/* could not get length, assuming till eof */
|
|
|
|
length = G_MAXUINT32;
|
|
|
|
} else {
|
2010-06-29 19:14:53 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "file length %" G_GUINT64_FORMAT
|
|
|
|
", datalength %u", file_length, length);
|
2004-10-01 16:01:51 +00:00
|
|
|
/* substract offset of datastart from length */
|
|
|
|
length = file_length - wav->datastart;
|
2010-06-29 19:14:53 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "datalength %u", length);
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
|
|
|
}
|
2005-12-16 19:32:53 +00:00
|
|
|
wav->datasize = (guint64) length;
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "datasize = %ld", length)
|
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
case GST_RIFF_TAG_cue:
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_read_skip (wav)) {
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_WARNING_OBJECT (wav, "could not read skip");
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-10-01 16:01:51 +00:00
|
|
|
}
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
default:
|
2004-10-01 16:01:51 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "skipping tag (%08x) %4.4s", tag, (gchar *) & tag);
|
2005-07-20 11:26:05 +00:00
|
|
|
if (!gst_riff_read_skip (wav))
|
2004-05-16 20:06:35 +00:00
|
|
|
return FALSE;
|
2004-05-08 00:33:39 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
#endif
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2007-09-04 14:37:22 +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
|
|
|
static gboolean
|
|
|
|
gst_wavparse_parse_file_header (GstElement * element, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
guint32 doctype;
|
|
|
|
|
|
|
|
if (!gst_riff_parse_file_header (element, buf, &doctype))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (doctype != GST_RIFF_RIFF_WAVE)
|
|
|
|
goto not_wav;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
not_wav:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, (NULL),
|
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
|
|
|
("File is not a WAVE file: %" GST_FOURCC_FORMAT,
|
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
|
|
|
GST_FOURCC_ARGS (doctype)));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_wavparse_stream_init (GstWavParse * wav)
|
|
|
|
{
|
|
|
|
GstFlowReturn res;
|
|
|
|
GstBuffer *buf = NULL;
|
|
|
|
|
|
|
|
if ((res = gst_pad_pull_range (wav->sinkpad,
|
|
|
|
wav->offset, 12, &buf)) != GST_FLOW_OK)
|
|
|
|
return res;
|
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
|
|
|
else if (!gst_wavparse_parse_file_header (GST_ELEMENT_CAST (wav), buf))
|
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
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
|
|
|
|
wav->offset += 12;
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
static gboolean
|
|
|
|
gst_wavparse_time_to_bytepos (GstWavParse * wav, gint64 ts, gint64 * bytepos)
|
|
|
|
{
|
|
|
|
/* -1 always maps to -1 */
|
|
|
|
if (ts == -1) {
|
|
|
|
*bytepos = -1;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 0 always maps to 0 */
|
|
|
|
if (ts == 0) {
|
|
|
|
*bytepos = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wav->bps > 0) {
|
2011-12-24 09:57:42 +00:00
|
|
|
*bytepos = gst_util_uint64_scale_ceil (ts, (guint64) wav->bps, GST_SECOND);
|
2009-02-27 12:29:41 +00:00
|
|
|
return TRUE;
|
|
|
|
} else if (wav->fact) {
|
|
|
|
guint64 bps =
|
|
|
|
gst_util_uint64_scale_int (wav->datasize, wav->rate, wav->fact);
|
2011-12-24 09:57:42 +00:00
|
|
|
*bytepos = gst_util_uint64_scale_ceil (ts, bps, GST_SECOND);
|
2009-02-27 12:29:41 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is used to perform seeks on the element.
|
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
|
|
|
*
|
|
|
|
* It also works when event is NULL, in which case it will just
|
|
|
|
* start from the last configured segment. This technique is
|
|
|
|
* used when activating the element and to perform the seek in
|
|
|
|
* READY.
|
|
|
|
*/
|
2004-05-16 20:06:35 +00:00
|
|
|
static gboolean
|
2005-12-16 19:32:53 +00:00
|
|
|
gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
|
2004-05-16 20:06:35 +00:00
|
|
|
{
|
2005-12-16 19:32:53 +00:00
|
|
|
gboolean res;
|
|
|
|
gdouble rate;
|
2006-06-18 12:37:12 +00:00
|
|
|
GstFormat format, bformat;
|
2005-12-16 19:32:53 +00:00
|
|
|
GstSeekFlags flags;
|
2006-05-12 17:44:15 +00:00
|
|
|
GstSeekType cur_type = GST_SEEK_TYPE_NONE, stop_type;
|
2006-06-18 12:37:12 +00:00
|
|
|
gint64 cur, stop, upstream_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
|
|
|
gboolean flush;
|
2005-12-16 19:32:53 +00:00
|
|
|
gboolean update;
|
2006-07-24 13:40:56 +00:00
|
|
|
GstSegment seeksegment = { 0, };
|
2007-05-02 18:25:09 +00:00
|
|
|
gint64 last_stop;
|
2005-12-16 19:32:53 +00:00
|
|
|
|
|
|
|
if (event) {
|
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
|
|
|
GST_DEBUG_OBJECT (wav, "doing seek with event");
|
|
|
|
|
2005-12-16 19:32:53 +00:00
|
|
|
gst_event_parse_seek (event, &rate, &format, &flags,
|
|
|
|
&cur_type, &cur, &stop_type, &stop);
|
|
|
|
|
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
|
|
|
/* no negative rates yet */
|
|
|
|
if (rate < 0.0)
|
|
|
|
goto negative_rate;
|
|
|
|
|
|
|
|
if (format != wav->segment.format) {
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "converting seek-event from %s to %s",
|
|
|
|
gst_format_get_name (format),
|
|
|
|
gst_format_get_name (wav->segment.format));
|
2005-12-16 19:32:53 +00:00
|
|
|
res = TRUE;
|
|
|
|
if (cur_type != GST_SEEK_TYPE_NONE)
|
2007-09-04 14:37:22 +00:00
|
|
|
res =
|
|
|
|
gst_pad_query_convert (wav->srcpad, format, cur,
|
2011-07-28 09:54:38 +00:00
|
|
|
wav->segment.format, &cur);
|
2005-12-16 19:32:53 +00:00
|
|
|
if (res && stop_type != GST_SEEK_TYPE_NONE)
|
2007-09-04 14:37:22 +00:00
|
|
|
res =
|
|
|
|
gst_pad_query_convert (wav->srcpad, format, stop,
|
2011-07-28 09:54:38 +00:00
|
|
|
wav->segment.format, &stop);
|
2005-12-16 19:32:53 +00:00
|
|
|
if (!res)
|
|
|
|
goto no_format;
|
|
|
|
|
2007-09-04 14:37:22 +00:00
|
|
|
format = wav->segment.format;
|
2005-12-16 19:32:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
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
|
|
|
GST_DEBUG_OBJECT (wav, "doing seek without event");
|
2005-12-16 19:32:53 +00:00
|
|
|
flags = 0;
|
2007-09-04 07:58:36 +00:00
|
|
|
rate = 1.0;
|
2006-10-18 14:00:44 +00:00
|
|
|
cur_type = GST_SEEK_TYPE_SET;
|
|
|
|
stop_type = GST_SEEK_TYPE_SET;
|
2005-12-16 19:32:53 +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
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
/* in push mode, we must delegate to upstream */
|
|
|
|
if (wav->streaming) {
|
|
|
|
gboolean res = FALSE;
|
|
|
|
|
|
|
|
/* if streaming not yet started; only prepare initial newsegment */
|
|
|
|
if (!event || wav->state != GST_WAVPARSE_DATA) {
|
|
|
|
if (wav->start_segment)
|
|
|
|
gst_event_unref (wav->start_segment);
|
2011-07-06 14:10:34 +00:00
|
|
|
// TODO
|
|
|
|
/* wav->start_segment =
|
2009-02-27 12:29:41 +00:00
|
|
|
gst_event_new_new_segment (FALSE, wav->segment.rate,
|
|
|
|
wav->segment.format, wav->segment.last_stop, wav->segment.duration,
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->segment.last_stop);*/
|
2009-02-27 12:29:41 +00:00
|
|
|
res = TRUE;
|
|
|
|
} else {
|
|
|
|
/* convert seek positions to byte positions in data sections */
|
|
|
|
if (format == GST_FORMAT_TIME) {
|
|
|
|
/* should not fail */
|
|
|
|
if (!gst_wavparse_time_to_bytepos (wav, cur, &cur))
|
|
|
|
goto no_position;
|
|
|
|
if (!gst_wavparse_time_to_bytepos (wav, stop, &stop))
|
|
|
|
goto no_position;
|
|
|
|
}
|
|
|
|
/* mind sample boundary and header */
|
|
|
|
if (cur >= 0) {
|
|
|
|
cur -= (cur % wav->bytes_per_sample);
|
|
|
|
cur += wav->datastart;
|
|
|
|
}
|
|
|
|
if (stop >= 0) {
|
|
|
|
stop -= (stop % wav->bytes_per_sample);
|
|
|
|
stop += wav->datastart;
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (wav, "Pushing BYTE seek rate %g, "
|
|
|
|
"start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, rate, cur,
|
|
|
|
stop);
|
|
|
|
/* BYTE seek event */
|
|
|
|
event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, cur_type, cur,
|
|
|
|
stop_type, stop);
|
|
|
|
res = gst_pad_push_event (wav->sinkpad, event);
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* get flush flag */
|
2005-12-16 19:32:53 +00:00
|
|
|
flush = flags & GST_SEEK_FLAG_FLUSH;
|
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.*: 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
|
|
|
/* now we need to make sure the streaming thread is stopped. We do this by
|
|
|
|
* either sending a FLUSH_START event downstream which will cause the
|
|
|
|
* streaming thread to stop with a WRONG_STATE.
|
|
|
|
* For a non-flushing seek we simply pause the task, which will happen as soon
|
|
|
|
* as it completes one iteration (and thus might block when the sink is
|
|
|
|
* blocking in preroll). */
|
|
|
|
if (flush) {
|
2011-12-19 09:48:54 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "sending flush start");
|
|
|
|
gst_pad_push_event (wav->srcpad, gst_event_new_flush_start ());
|
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
|
|
|
} else {
|
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_pad_pause_task (wav->sinkpad);
|
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
|
|
|
}
|
2004-05-16 20:06:35 +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
|
|
|
/* we should now be able to grab the streaming thread because we stopped it
|
|
|
|
* with the above flush/pause code */
|
2005-11-21 18:09:02 +00:00
|
|
|
GST_PAD_STREAM_LOCK (wav->sinkpad);
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2007-05-02 18:25:09 +00:00
|
|
|
/* save current position */
|
2011-07-06 14:10:34 +00:00
|
|
|
last_stop = wav->segment.position;
|
2007-05-02 18:25:09 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (wav, "stopped streaming at %" G_GINT64_FORMAT, last_stop);
|
|
|
|
|
2005-12-16 19:32:53 +00:00
|
|
|
/* copy segment, we need this because we still need the old
|
|
|
|
* segment when we close the current segment. */
|
|
|
|
memcpy (&seeksegment, &wav->segment, sizeof (GstSegment));
|
|
|
|
|
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
|
|
|
/* configure the seek parameters in the seeksegment. We will then have the
|
|
|
|
* right values in the segment to perform the seek */
|
2005-12-16 19:32:53 +00:00
|
|
|
if (event) {
|
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
|
|
|
GST_DEBUG_OBJECT (wav, "configuring seek");
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_segment_do_seek (&seeksegment, rate, format, flags,
|
2005-12-16 19:32:53 +00:00
|
|
|
cur_type, cur, stop_type, stop, &update);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* figure out the last position we need to play. If it's configured (stop !=
|
|
|
|
* -1), use that, else we play until the total duration of the file */
|
|
|
|
if ((stop = seeksegment.stop) == -1)
|
2005-12-16 19:32:53 +00:00
|
|
|
stop = seeksegment.duration;
|
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "cur_type =%d", cur_type);
|
2006-10-18 14:00:44 +00:00
|
|
|
if ((cur_type != GST_SEEK_TYPE_NONE)) {
|
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
|
|
|
/* bring offset to bytes, if the bps is 0, we have the segment in BYTES and
|
|
|
|
* we can just copy the last_stop. If not, we use the bps to convert TIME to
|
|
|
|
* bytes. */
|
2011-07-06 14:10:34 +00:00
|
|
|
if (!gst_wavparse_time_to_bytepos (wav, seeksegment.position,
|
2009-02-27 12:29:41 +00:00
|
|
|
(gint64 *) & wav->offset))
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->offset = seeksegment.position;
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_LOG_OBJECT (wav, "offset=%" G_GUINT64_FORMAT, wav->offset);
|
|
|
|
wav->offset -= (wav->offset % wav->bytes_per_sample);
|
|
|
|
GST_LOG_OBJECT (wav, "offset=%" G_GUINT64_FORMAT, wav->offset);
|
2006-03-21 13:07:31 +00:00
|
|
|
wav->offset += wav->datastart;
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_LOG_OBJECT (wav, "offset=%" G_GUINT64_FORMAT, wav->offset);
|
|
|
|
} else {
|
2006-10-18 14:00:44 +00:00
|
|
|
GST_LOG_OBJECT (wav, "continue from offset=%" G_GUINT64_FORMAT,
|
|
|
|
wav->offset);
|
2005-12-16 19:32:53 +00:00
|
|
|
}
|
|
|
|
|
2006-10-18 14:00:44 +00:00
|
|
|
if (stop_type != GST_SEEK_TYPE_NONE) {
|
2009-02-27 12:29:41 +00:00
|
|
|
if (!gst_wavparse_time_to_bytepos (wav, stop, (gint64 *) & wav->end_offset))
|
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
|
|
|
wav->end_offset = stop;
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_LOG_OBJECT (wav, "end_offset=%" G_GUINT64_FORMAT, wav->end_offset);
|
|
|
|
wav->end_offset -= (wav->end_offset % wav->bytes_per_sample);
|
|
|
|
GST_LOG_OBJECT (wav, "end_offset=%" G_GUINT64_FORMAT, wav->end_offset);
|
2006-03-21 13:07:31 +00:00
|
|
|
wav->end_offset += wav->datastart;
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_LOG_OBJECT (wav, "end_offset=%" G_GUINT64_FORMAT, wav->end_offset);
|
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
|
|
|
} else {
|
2006-10-18 14:00:44 +00:00
|
|
|
GST_LOG_OBJECT (wav, "continue to end_offset=%" G_GUINT64_FORMAT,
|
|
|
|
wav->end_offset);
|
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
|
|
|
}
|
2006-06-18 12:37:12 +00:00
|
|
|
|
|
|
|
/* make sure filesize is not exceeded due to rounding errors or so,
|
|
|
|
* same precaution as in _stream_headers */
|
|
|
|
bformat = GST_FORMAT_BYTES;
|
2011-11-15 17:01:16 +00:00
|
|
|
if (gst_pad_peer_query_duration (wav->sinkpad, bformat, &upstream_size))
|
2006-06-18 12:37:12 +00:00
|
|
|
wav->end_offset = MIN (wav->end_offset, upstream_size);
|
|
|
|
|
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
|
|
|
/* this is the range of bytes we will use for playback */
|
2005-12-16 19:32:53 +00:00
|
|
|
wav->offset = MIN (wav->offset, wav->end_offset);
|
|
|
|
wav->dataleft = wav->end_offset - wav->offset;
|
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
|
|
|
|
2006-02-28 10:29:16 +00:00
|
|
|
GST_DEBUG_OBJECT (wav,
|
2007-09-04 07:58:36 +00:00
|
|
|
"seek: rate %lf, offset %" G_GUINT64_FORMAT ", end %" G_GUINT64_FORMAT
|
|
|
|
", segment %" GST_TIME_FORMAT " -- %" GST_TIME_FORMAT, rate, wav->offset,
|
|
|
|
wav->end_offset, GST_TIME_ARGS (seeksegment.start), GST_TIME_ARGS (stop));
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2005-12-16 19:32:53 +00:00
|
|
|
/* prepare for streaming again */
|
2011-12-19 09:48:54 +00:00
|
|
|
if (flush) {
|
|
|
|
/* if we sent a FLUSH_START, we now send a FLUSH_STOP */
|
|
|
|
GST_DEBUG_OBJECT (wav, "sending flush stop");
|
|
|
|
gst_pad_push_event (wav->srcpad, gst_event_new_flush_stop (TRUE));
|
2005-12-16 19:32:53 +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
|
|
|
|
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
|
|
|
/* now we did the seek and can activate the new segment values */
|
2005-12-16 19:32:53 +00:00
|
|
|
memcpy (&wav->segment, &seeksegment, sizeof (GstSegment));
|
|
|
|
|
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
|
|
|
/* if we're doing a segment seek, post a SEGMENT_START message */
|
2005-12-16 19:32:53 +00:00
|
|
|
if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
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_element_post_message (GST_ELEMENT_CAST (wav),
|
|
|
|
gst_message_new_segment_start (GST_OBJECT_CAST (wav),
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->segment.format, wav->segment.position));
|
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
|
|
|
}
|
2004-05-16 20:06:35 +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
|
|
|
/* now create the newsegment */
|
|
|
|
GST_DEBUG_OBJECT (wav, "Creating newsegment from %" G_GINT64_FORMAT
|
2011-07-06 14:10:34 +00:00
|
|
|
" to %" G_GINT64_FORMAT, wav->segment.position, stop);
|
2005-12-16 19:32:53 +00:00
|
|
|
|
2006-08-10 14:10:28 +00:00
|
|
|
/* store the newsegment event so it can be sent from the streaming thread. */
|
2007-05-02 17:19:36 +00:00
|
|
|
if (wav->start_segment)
|
|
|
|
gst_event_unref (wav->start_segment);
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->start_segment = gst_event_new_segment (&wav->segment);
|
2006-03-23 15:36:27 +00:00
|
|
|
|
2007-05-02 18:25:09 +00:00
|
|
|
/* mark discont if we are going to stream from another position. */
|
2011-07-06 14:10:34 +00:00
|
|
|
if (last_stop != wav->segment.position) {
|
2007-05-02 18:25:09 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "mark DISCONT, we did a seek to another position");
|
|
|
|
wav->discont = TRUE;
|
|
|
|
}
|
2007-04-26 08:39:49 +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
|
|
|
/* and start the streaming task again */
|
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
|
|
|
if (!wav->streaming) {
|
|
|
|
gst_pad_start_task (wav->sinkpad, (GstTaskFunction) gst_wavparse_loop,
|
|
|
|
wav->sinkpad);
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2005-11-21 18:09:02 +00:00
|
|
|
GST_PAD_STREAM_UNLOCK (wav->sinkpad);
|
2005-07-20 11:26:05 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
2005-12-16 19:32:53 +00:00
|
|
|
/* ERRORS */
|
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
|
|
|
negative_rate:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (wav, "negative playback rates are not supported yet.");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-12-16 19:32:53 +00:00
|
|
|
no_format:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (wav, "unsupported format given, seek aborted.");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-02-27 12:29:41 +00:00
|
|
|
no_position:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (wav,
|
|
|
|
"Could not determine byte position for desired time");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-07-20 11:26:05 +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
|
|
|
/*
|
|
|
|
* gst_wavparse_peek_chunk_info:
|
|
|
|
* @wav Wavparse object
|
|
|
|
* @tag holder for tag
|
|
|
|
* @size holder for tag size
|
2007-04-10 12:01:33 +00:00
|
|
|
*
|
|
|
|
* Peek next chunk info (tag and size)
|
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
|
|
|
*
|
2008-08-05 14:16:32 +00:00
|
|
|
* Returns: %TRUE when the chunk info (header) is available
|
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
|
|
|
*/
|
|
|
|
static gboolean
|
|
|
|
gst_wavparse_peek_chunk_info (GstWavParse * wav, guint32 * tag, guint32 * size)
|
|
|
|
{
|
|
|
|
const guint8 *data = NULL;
|
|
|
|
|
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
|
|
|
if (gst_adapter_available (wav->adapter) < 8)
|
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
|
|
|
return FALSE;
|
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
data = gst_adapter_map (wav->adapter, 8);
|
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
|
|
|
*tag = GST_READ_UINT32_LE (data);
|
|
|
|
*size = GST_READ_UINT32_LE (data + 4);
|
2011-11-10 17:32:58 +00:00
|
|
|
gst_adapter_unmap (wav->adapter);
|
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
|
|
|
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG ("Next chunk size is %u bytes, type %" GST_FOURCC_FORMAT, *size,
|
2006-06-14 08:06:43 +00:00
|
|
|
GST_FOURCC_ARGS (*tag));
|
|
|
|
|
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
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gst_wavparse_peek_chunk:
|
|
|
|
* @wav Wavparse object
|
|
|
|
* @tag holder for tag
|
|
|
|
* @size holder for tag size
|
|
|
|
*
|
|
|
|
* Peek enough data for one full chunk
|
|
|
|
*
|
2008-08-05 14:16:32 +00:00
|
|
|
* Returns: %TRUE when the full chunk is available
|
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
|
|
|
*/
|
|
|
|
static gboolean
|
|
|
|
gst_wavparse_peek_chunk (GstWavParse * wav, guint32 * tag, guint32 * size)
|
|
|
|
{
|
|
|
|
guint32 peek_size = 0;
|
2006-06-14 08:06:43 +00:00
|
|
|
guint available;
|
|
|
|
|
|
|
|
if (!gst_wavparse_peek_chunk_info (wav, tag, size))
|
|
|
|
return FALSE;
|
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
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
/* size 0 -> empty data buffer would surprise most callers,
|
|
|
|
* large size -> do not bother trying to squeeze that into adapter,
|
|
|
|
* so we throw poor man's exception, which can be caught if caller really
|
|
|
|
* wants to handle 0 size chunk */
|
|
|
|
if (!(*size) || (*size) >= (1 << 30)) {
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_INFO ("Invalid/unexpected chunk size %u for tag %" GST_FOURCC_FORMAT,
|
2009-08-10 14:19:03 +00:00
|
|
|
*size, GST_FOURCC_ARGS (*tag));
|
|
|
|
/* chain should give up */
|
|
|
|
wav->abort_buffering = TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
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
|
|
|
peek_size = (*size + 1) & ~1;
|
2006-06-14 08:06:43 +00:00
|
|
|
available = gst_adapter_available (wav->adapter);
|
2009-08-10 14:19:03 +00:00
|
|
|
|
2006-06-14 08:06:43 +00:00
|
|
|
if (available >= (8 + peek_size)) {
|
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
|
|
|
return TRUE;
|
|
|
|
} else {
|
2006-06-14 08:06:43 +00:00
|
|
|
GST_LOG ("but only %u bytes available now", available);
|
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
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-04 07:58:36 +00:00
|
|
|
/*
|
|
|
|
* gst_wavparse_calculate_duration:
|
2007-11-08 15:00:40 +00:00
|
|
|
* @wav: wavparse object
|
2007-09-04 07:58:36 +00:00
|
|
|
*
|
|
|
|
* Calculate duration on demand and store in @wav. Prefer bps, but use fact as a
|
|
|
|
* fallback.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if duration is available.
|
|
|
|
*/
|
2006-07-24 13:40:56 +00:00
|
|
|
static gboolean
|
2007-09-04 07:58:36 +00:00
|
|
|
gst_wavparse_calculate_duration (GstWavParse * wav)
|
2006-07-24 13:40:56 +00:00
|
|
|
{
|
2007-09-04 07:58:36 +00:00
|
|
|
if (wav->duration > 0)
|
|
|
|
return TRUE;
|
2006-07-24 13:40:56 +00:00
|
|
|
|
2007-09-04 07:58:36 +00:00
|
|
|
if (wav->bps > 0) {
|
2008-11-20 20:07:26 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Got datasize %" G_GUINT64_FORMAT, wav->datasize);
|
2007-09-04 07:58:36 +00:00
|
|
|
wav->duration =
|
2011-12-24 09:57:42 +00:00
|
|
|
gst_util_uint64_scale_ceil (wav->datasize, GST_SECOND,
|
|
|
|
(guint64) wav->bps);
|
2007-09-04 07:58:36 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Got duration (bps) %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (wav->duration));
|
|
|
|
return TRUE;
|
|
|
|
} else if (wav->fact) {
|
2011-12-24 09:57:42 +00:00
|
|
|
wav->duration =
|
|
|
|
gst_util_uint64_scale_int_ceil (GST_SECOND, wav->fact, wav->rate);
|
2007-09-04 07:58:36 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Got duration (fact) %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (wav->duration));
|
|
|
|
return TRUE;
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
2007-09-04 07:58:36 +00:00
|
|
|
return FALSE;
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
2006-03-23 16:50:32 +00:00
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
static gboolean
|
2008-08-05 14:16:32 +00:00
|
|
|
gst_waveparse_ignore_chunk (GstWavParse * wav, GstBuffer * buf, guint32 tag,
|
|
|
|
guint32 size)
|
|
|
|
{
|
|
|
|
guint flush;
|
|
|
|
|
|
|
|
if (wav->streaming) {
|
|
|
|
if (!gst_wavparse_peek_chunk (wav, &tag, &size))
|
2009-08-10 14:19:03 +00:00
|
|
|
return FALSE;
|
2008-08-05 14:16:32 +00:00
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (wav, "Ignoring tag %" GST_FOURCC_FORMAT,
|
|
|
|
GST_FOURCC_ARGS (tag));
|
|
|
|
flush = 8 + ((size + 1) & ~1);
|
|
|
|
wav->offset += flush;
|
|
|
|
if (wav->streaming) {
|
|
|
|
gst_adapter_flush (wav->adapter, flush);
|
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
2009-08-10 14:19:03 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2008-08-05 14:16:32 +00:00
|
|
|
}
|
|
|
|
|
2011-02-23 15:50:43 +00:00
|
|
|
#define MAX_BUFFER_SIZE 4096
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_wavparse_stream_headers (GstWavParse * wav)
|
|
|
|
{
|
2009-08-11 11:56:43 +00:00
|
|
|
GstFlowReturn res = GST_FLOW_OK;
|
2010-06-15 18:00:28 +00:00
|
|
|
GstBuffer *buf = NULL;
|
2005-07-20 11:26:05 +00:00
|
|
|
gst_riff_strf_auds *header = NULL;
|
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
|
|
|
guint32 tag, size;
|
2005-07-20 11:26:05 +00:00
|
|
|
gboolean gotdata = FALSE;
|
2009-08-11 11:56:43 +00:00
|
|
|
GstCaps *caps = NULL;
|
2006-02-16 20:30:13 +00:00
|
|
|
gchar *codec_name = NULL;
|
2006-03-21 14:53:36 +00:00
|
|
|
GstEvent **event_p;
|
2007-09-04 07:58:36 +00:00
|
|
|
gint64 upstream_size = 0;
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2008-08-05 14:16:32 +00:00
|
|
|
/* search for "_fmt" chunk, which should be first */
|
2006-06-14 08:06:43 +00:00
|
|
|
while (!wav->got_fmt) {
|
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
|
|
|
GstBuffer *extra;
|
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
|
|
|
|
2006-06-14 08:06:43 +00:00
|
|
|
/* The header starts with a 'fmt ' tag */
|
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
|
|
|
if (wav->streaming) {
|
|
|
|
if (!gst_wavparse_peek_chunk (wav, &tag, &size))
|
2009-08-11 11:56:43 +00:00
|
|
|
return res;
|
2004-05-16 20:06:35 +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
|
|
|
gst_adapter_flush (wav->adapter, 8);
|
|
|
|
wav->offset += 8;
|
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
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
if (size) {
|
|
|
|
buf = gst_adapter_take_buffer (wav->adapter, size);
|
|
|
|
if (size & 1)
|
|
|
|
gst_adapter_flush (wav->adapter, 1);
|
|
|
|
wav->offset += GST_ROUND_UP_2 (size);
|
|
|
|
} else {
|
|
|
|
buf = gst_buffer_new ();
|
|
|
|
}
|
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
|
|
|
} else {
|
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
|
|
|
if ((res = gst_riff_read_chunk (GST_ELEMENT_CAST (wav), wav->sinkpad,
|
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
|
|
|
&wav->offset, &tag, &buf)) != GST_FLOW_OK)
|
|
|
|
return res;
|
|
|
|
}
|
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
|
|
|
|
2010-02-01 12:43:04 +00:00
|
|
|
if (tag == GST_RIFF_TAG_JUNK || tag == GST_RIFF_TAG_JUNQ ||
|
|
|
|
tag == GST_RIFF_TAG_bext || tag == GST_RIFF_TAG_BEXT ||
|
2011-09-27 15:49:45 +00:00
|
|
|
tag == GST_RIFF_TAG_LIST || tag == GST_RIFF_TAG_ID32 ||
|
|
|
|
tag == GST_RIFF_TAG_IDVX) {
|
2006-06-14 08:06:43 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "skipping %" GST_FOURCC_FORMAT " chunk",
|
|
|
|
GST_FOURCC_ARGS (tag));
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
buf = NULL;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
if (tag != GST_RIFF_TAG_fmt)
|
|
|
|
goto invalid_wav;
|
2006-03-23 16:50:32 +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
|
|
|
if (!(gst_riff_parse_strf_auds (GST_ELEMENT_CAST (wav), buf, &header,
|
|
|
|
&extra)))
|
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
|
|
|
goto parse_header_error;
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2007-03-19 10:29:19 +00:00
|
|
|
buf = NULL; /* parse_strf_auds() took ownership of buffer */
|
2006-02-16 20:30:13 +00:00
|
|
|
|
2007-04-13 06:20:28 +00:00
|
|
|
/* do sanity checks of header fields */
|
2007-04-10 12:01:33 +00:00
|
|
|
if (header->channels == 0)
|
|
|
|
goto no_channels;
|
2007-04-13 06:20:28 +00:00
|
|
|
if (header->rate == 0)
|
|
|
|
goto no_rate;
|
2007-04-10 12:01:33 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (wav, "creating the caps");
|
|
|
|
|
2006-05-12 17:44:15 +00:00
|
|
|
/* Note: gst_riff_create_audio_caps might need to fix values in
|
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
|
|
|
* the header header depending on the format, so call it first */
|
2012-01-04 11:06:12 +00:00
|
|
|
/* FIXME: Need to handle the channel reorder map */
|
2006-07-24 13:40:56 +00:00
|
|
|
caps = gst_riff_create_audio_caps (header->format, NULL, header, extra,
|
2012-01-04 11:06:12 +00:00
|
|
|
NULL, &codec_name, NULL);
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
|
2006-04-29 16:14:20 +00:00
|
|
|
if (extra)
|
|
|
|
gst_buffer_unref (extra);
|
|
|
|
|
2007-04-10 12:01:33 +00:00
|
|
|
if (!caps)
|
|
|
|
goto unknown_format;
|
|
|
|
|
2007-04-13 06:20:28 +00:00
|
|
|
/* do more sanity checks of header fields
|
|
|
|
* (these can be sanitized by gst_riff_create_audio_caps()
|
|
|
|
*/
|
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
|
|
|
wav->format = header->format;
|
|
|
|
wav->rate = header->rate;
|
|
|
|
wav->channels = header->channels;
|
|
|
|
wav->blockalign = header->blockalign;
|
|
|
|
wav->depth = header->size;
|
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
|
|
|
wav->av_bps = header->av_bps;
|
2007-05-02 17:19:36 +00:00
|
|
|
wav->vbr = FALSE;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
g_free (header);
|
2008-01-19 14:53:58 +00:00
|
|
|
header = NULL;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +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
|
|
|
/* do format specific handling */
|
|
|
|
switch (wav->format) {
|
|
|
|
case GST_RIFF_WAVE_FORMAT_MPEGL12:
|
|
|
|
case GST_RIFF_WAVE_FORMAT_MPEGL3:
|
|
|
|
{
|
|
|
|
/* Note: workaround for mp2/mp3 embedded in wav, that relies on the
|
|
|
|
* bitrate inside the mpeg stream */
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_INFO ("resetting bps from %u to 0 for mp2/3", wav->av_bps);
|
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
|
|
|
wav->bps = 0;
|
|
|
|
break;
|
|
|
|
}
|
2007-04-25 06:52:09 +00:00
|
|
|
case GST_RIFF_WAVE_FORMAT_PCM:
|
2011-12-13 11:46:43 +00:00
|
|
|
if (wav->blockalign > wav->channels * ((wav->depth + 7) / 8))
|
2007-04-25 06:52:09 +00:00
|
|
|
goto invalid_blockalign;
|
|
|
|
/* fall through */
|
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
|
|
|
default:
|
2007-04-13 06:20:28 +00:00
|
|
|
if (wav->av_bps > wav->blockalign * wav->rate)
|
|
|
|
goto invalid_bps;
|
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
|
|
|
/* use the configured bps */
|
|
|
|
wav->bps = wav->av_bps;
|
|
|
|
break;
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
wav->width = (wav->blockalign * 8) / wav->channels;
|
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
|
|
|
wav->bytes_per_sample = wav->channels * wav->width / 8;
|
2006-07-24 13:40:56 +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
|
|
|
if (wav->bytes_per_sample <= 0)
|
|
|
|
goto no_bytes_per_sample;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +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
|
|
|
GST_DEBUG_OBJECT (wav, "blockalign = %u", (guint) wav->blockalign);
|
|
|
|
GST_DEBUG_OBJECT (wav, "width = %u", (guint) wav->width);
|
|
|
|
GST_DEBUG_OBJECT (wav, "depth = %u", (guint) wav->depth);
|
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_DEBUG_OBJECT (wav, "av_bps = %u", (guint) wav->av_bps);
|
2007-04-13 06:20:28 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "frequency = %u", (guint) wav->rate);
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "channels = %u", (guint) wav->channels);
|
|
|
|
GST_DEBUG_OBJECT (wav, "bytes_per_sample = %u", wav->bytes_per_sample);
|
|
|
|
|
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
|
|
|
/* bps can be 0 when we don't have a valid bitrate (mostly for compressed
|
|
|
|
* formats). This will make the element output a BYTE format segment and
|
|
|
|
* will not timestamp the outgoing buffers.
|
|
|
|
*/
|
|
|
|
GST_DEBUG_OBJECT (wav, "bps = %u", (guint) wav->bps);
|
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "caps = %" GST_PTR_FORMAT, caps);
|
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
|
|
|
|
|
|
|
/* create pad later so we can sniff the first few bytes
|
|
|
|
* of the real data and correct our caps if necessary */
|
|
|
|
gst_caps_replace (&wav->caps, caps);
|
|
|
|
gst_caps_replace (&caps, NULL);
|
|
|
|
|
|
|
|
wav->got_fmt = TRUE;
|
2005-07-20 11:26:05 +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
|
|
|
if (codec_name) {
|
2011-10-30 11:44:53 +00:00
|
|
|
wav->tags = gst_tag_list_new_empty ();
|
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
|
|
|
|
|
|
|
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_AUDIO_CODEC, codec_name, NULL);
|
|
|
|
|
|
|
|
g_free (codec_name);
|
|
|
|
codec_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
|
2011-11-15 17:01:16 +00:00
|
|
|
gst_pad_peer_query_duration (wav->sinkpad, GST_FORMAT_BYTES, &upstream_size);
|
2007-09-04 07:58:36 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "upstream size %" G_GUINT64_FORMAT, upstream_size);
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
/* loop headers until we get data */
|
|
|
|
while (!gotdata) {
|
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
|
|
|
if (wav->streaming) {
|
|
|
|
if (!gst_wavparse_peek_chunk_info (wav, &tag, &size))
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
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
|
|
|
} else {
|
2012-01-24 13:38:58 +00:00
|
|
|
GstMapInfo map;
|
2011-07-06 14:10:34 +00:00
|
|
|
|
2012-03-16 20:47:21 +00:00
|
|
|
buf = NULL;
|
2009-06-07 11:24:45 +00:00
|
|
|
if ((res =
|
|
|
|
gst_pad_pull_range (wav->sinkpad, wav->offset, 8,
|
|
|
|
&buf)) != GST_FLOW_OK)
|
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
|
|
|
goto header_read_error;
|
2012-01-24 13:38:58 +00:00
|
|
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
|
|
|
tag = GST_READ_UINT32_LE (map.data);
|
|
|
|
size = GST_READ_UINT32_LE (map.data + 4);
|
|
|
|
gst_buffer_unmap (buf, &map);
|
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
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav,
|
|
|
|
"Got TAG: %" GST_FOURCC_FORMAT ", offset %" G_GUINT64_FORMAT,
|
|
|
|
GST_FOURCC_ARGS (tag), wav->offset);
|
2007-04-26 08:39:49 +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
|
|
|
/* wav is a st00pid format, we don't know for sure where data starts.
|
|
|
|
* So we have to go bit by bit until we find the 'data' header
|
2005-07-20 11:26:05 +00:00
|
|
|
*/
|
|
|
|
switch (tag) {
|
2006-03-23 16:50:32 +00:00
|
|
|
case GST_RIFF_TAG_data:{
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "Got 'data' TAG, size : %u", size);
|
2011-12-12 16:49:19 +00:00
|
|
|
if (wav->ignore_length) {
|
|
|
|
GST_DEBUG_OBJECT (wav, "Ignoring length");
|
|
|
|
size = 0;
|
|
|
|
}
|
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
|
|
|
if (wav->streaming) {
|
|
|
|
gst_adapter_flush (wav->adapter, 8);
|
2006-07-24 13:40:56 +00:00
|
|
|
gotdata = TRUE;
|
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
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->offset += 8;
|
|
|
|
wav->datastart = wav->offset;
|
2009-09-11 20:32:39 +00:00
|
|
|
/* If size is zero, then the data chunk probably actually extends to
|
|
|
|
the end of the file */
|
|
|
|
if (size == 0 && upstream_size) {
|
|
|
|
size = upstream_size - wav->datastart;
|
|
|
|
}
|
|
|
|
/* Or the file might be truncated */
|
|
|
|
else if (upstream_size) {
|
2006-03-23 16:50:32 +00:00
|
|
|
size = MIN (size, (upstream_size - wav->datastart));
|
|
|
|
}
|
2006-07-24 13:40:56 +00:00
|
|
|
wav->datasize = (guint64) size;
|
|
|
|
wav->dataleft = (guint64) size;
|
2005-12-16 19:32:53 +00:00
|
|
|
wav->end_offset = size + wav->datastart;
|
2006-07-24 13:40:56 +00:00
|
|
|
if (!wav->streaming) {
|
|
|
|
/* We will continue parsing tags 'till end */
|
|
|
|
wav->offset += size;
|
|
|
|
}
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "datasize = %u", size);
|
2006-07-24 13:40:56 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-08-05 14:16:32 +00:00
|
|
|
case GST_RIFF_TAG_fact:{
|
2007-11-08 15:00:40 +00:00
|
|
|
if (wav->format != GST_RIFF_WAVE_FORMAT_MPEGL12 &&
|
|
|
|
wav->format != GST_RIFF_WAVE_FORMAT_MPEGL3) {
|
2008-08-05 14:16:32 +00:00
|
|
|
const guint data_size = 4;
|
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Have fact chunk");
|
|
|
|
if (size < data_size) {
|
|
|
|
if (!gst_waveparse_ignore_chunk (wav, buf, tag, size)) {
|
|
|
|
/* need more data */
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2009-08-10 14:19:03 +00:00
|
|
|
}
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "need %u, available %u; ignoring chunk",
|
2009-08-10 14:19:03 +00:00
|
|
|
data_size, size);
|
|
|
|
break;
|
|
|
|
}
|
2007-11-08 15:00:40 +00:00
|
|
|
/* number of samples (for compressed formats) */
|
|
|
|
if (wav->streaming) {
|
|
|
|
const guint8 *data = NULL;
|
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_wavparse_peek_chunk (wav, &tag, &size)) {
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2007-11-08 15:00:40 +00:00
|
|
|
}
|
|
|
|
gst_adapter_flush (wav->adapter, 8);
|
2011-07-06 14:10:34 +00:00
|
|
|
data = gst_adapter_map (wav->adapter, data_size);
|
2007-11-08 15:00:40 +00:00
|
|
|
wav->fact = GST_READ_UINT32_LE (data);
|
2011-11-10 17:32:58 +00:00
|
|
|
gst_adapter_unmap (wav->adapter);
|
|
|
|
gst_adapter_flush (wav->adapter, GST_ROUND_UP_2 (size));
|
2007-11-08 15:00:40 +00:00
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
2012-03-16 20:47:21 +00:00
|
|
|
buf = NULL;
|
2009-06-07 11:24:45 +00:00
|
|
|
if ((res =
|
|
|
|
gst_pad_pull_range (wav->sinkpad, wav->offset + 8,
|
|
|
|
data_size, &buf)) != GST_FLOW_OK)
|
2007-11-08 15:00:40 +00:00
|
|
|
goto header_read_error;
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_buffer_extract (buf, 0, &wav->fact, 4);
|
|
|
|
wav->fact = GUINT32_FROM_LE (wav->fact);
|
2007-11-08 15:00:40 +00:00
|
|
|
gst_buffer_unref (buf);
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
2007-11-08 15:00:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "have fact %u", wav->fact);
|
2009-08-10 14:19:03 +00:00
|
|
|
wav->offset += 8 + GST_ROUND_UP_2 (size);
|
2007-11-08 15:00:40 +00:00
|
|
|
break;
|
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
|
|
|
} else {
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_waveparse_ignore_chunk (wav, buf, tag, size)) {
|
|
|
|
/* need more data */
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2009-08-10 14:19:03 +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
|
|
|
}
|
2008-08-05 14:16:32 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-08-05 14:22:12 +00:00
|
|
|
case GST_RIFF_TAG_acid:{
|
|
|
|
const gst_riff_acid *acid = NULL;
|
|
|
|
const guint data_size = sizeof (gst_riff_acid);
|
2011-07-06 14:10:34 +00:00
|
|
|
gfloat tempo;
|
2008-08-05 14:22:12 +00:00
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Have acid chunk");
|
|
|
|
if (size < data_size) {
|
|
|
|
if (!gst_waveparse_ignore_chunk (wav, buf, tag, size)) {
|
|
|
|
/* need more data */
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2009-08-10 14:19:03 +00:00
|
|
|
}
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "need %u, available %u; ignoring chunk",
|
2009-08-10 14:19:03 +00:00
|
|
|
data_size, size);
|
|
|
|
break;
|
|
|
|
}
|
2008-08-05 14:22:12 +00:00
|
|
|
if (wav->streaming) {
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_wavparse_peek_chunk (wav, &tag, &size)) {
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2008-08-05 14:22:12 +00:00
|
|
|
}
|
|
|
|
gst_adapter_flush (wav->adapter, 8);
|
2011-07-06 14:10:34 +00:00
|
|
|
acid = (const gst_riff_acid *) gst_adapter_map (wav->adapter,
|
2008-08-05 14:22:12 +00:00
|
|
|
data_size);
|
2011-07-06 14:10:34 +00:00
|
|
|
tempo = acid->tempo;
|
2011-11-10 17:32:58 +00:00
|
|
|
gst_adapter_unmap (wav->adapter);
|
2008-08-05 14:22:12 +00:00
|
|
|
} else {
|
2012-01-24 13:38:58 +00:00
|
|
|
GstMapInfo map;
|
2008-08-05 14:22:12 +00:00
|
|
|
gst_buffer_unref (buf);
|
2012-03-16 20:47:21 +00:00
|
|
|
buf = NULL;
|
2009-06-07 11:24:45 +00:00
|
|
|
if ((res =
|
|
|
|
gst_pad_pull_range (wav->sinkpad, wav->offset + 8,
|
2009-08-10 14:19:03 +00:00
|
|
|
size, &buf)) != GST_FLOW_OK)
|
2008-08-05 14:22:12 +00:00
|
|
|
goto header_read_error;
|
2012-01-24 13:38:58 +00:00
|
|
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
|
|
|
acid = (const gst_riff_acid *) map.data;
|
2011-07-06 14:10:34 +00:00
|
|
|
tempo = acid->tempo;
|
2012-01-24 13:38:58 +00:00
|
|
|
gst_buffer_unmap (buf, &map);
|
2008-08-05 14:22:12 +00:00
|
|
|
}
|
|
|
|
/* send data as tags */
|
|
|
|
if (!wav->tags)
|
2011-10-30 11:44:53 +00:00
|
|
|
wav->tags = gst_tag_list_new_empty ();
|
2008-08-05 14:22:12 +00:00
|
|
|
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
|
2011-07-06 14:10:34 +00:00
|
|
|
GST_TAG_BEATS_PER_MINUTE, tempo, NULL);
|
2008-08-05 14:22:12 +00:00
|
|
|
|
2009-08-10 14:19:03 +00:00
|
|
|
size = GST_ROUND_UP_2 (size);
|
2008-08-05 14:22:12 +00:00
|
|
|
if (wav->streaming) {
|
2009-08-10 14:19:03 +00:00
|
|
|
gst_adapter_flush (wav->adapter, size);
|
2008-08-05 14:22:12 +00:00
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
2009-08-10 14:19:03 +00:00
|
|
|
wav->offset += 8 + size;
|
2008-08-05 14:22:12 +00:00
|
|
|
break;
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
|
|
|
/* FIXME: all list tags after data are ignored in streaming mode */
|
|
|
|
case GST_RIFF_TAG_LIST:{
|
|
|
|
guint32 ltag;
|
|
|
|
|
|
|
|
if (wav->streaming) {
|
|
|
|
const guint8 *data = NULL;
|
|
|
|
|
|
|
|
if (gst_adapter_available (wav->adapter) < 12) {
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
2011-07-06 14:10:34 +00:00
|
|
|
data = gst_adapter_map (wav->adapter, 12);
|
2008-08-05 15:05:44 +00:00
|
|
|
ltag = GST_READ_UINT32_LE (data + 8);
|
2011-11-10 17:32:58 +00:00
|
|
|
gst_adapter_unmap (wav->adapter);
|
2008-08-05 15:05:44 +00:00
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
2012-03-16 20:47:21 +00:00
|
|
|
buf = NULL;
|
2009-06-07 11:24:45 +00:00
|
|
|
if ((res =
|
|
|
|
gst_pad_pull_range (wav->sinkpad, wav->offset, 12,
|
|
|
|
&buf)) != GST_FLOW_OK)
|
2008-08-05 15:05:44 +00:00
|
|
|
goto header_read_error;
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_buffer_extract (buf, 8, <ag, 4);
|
|
|
|
ltag = GUINT32_FROM_LE (ltag);
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
|
|
|
switch (ltag) {
|
|
|
|
case GST_RIFF_LIST_INFO:{
|
2009-08-10 14:19:03 +00:00
|
|
|
const gint data_size = size - 4;
|
2008-08-05 15:05:44 +00:00
|
|
|
GstTagList *new;
|
|
|
|
|
2009-06-07 11:37:04 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Have LIST chunk INFO size %u", data_size);
|
2008-08-05 15:05:44 +00:00
|
|
|
if (wav->streaming) {
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_wavparse_peek_chunk (wav, &tag, &size)) {
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
2009-08-10 14:19:03 +00:00
|
|
|
gst_adapter_flush (wav->adapter, 12);
|
|
|
|
wav->offset += 12;
|
|
|
|
if (data_size > 0) {
|
2009-06-07 11:37:04 +00:00
|
|
|
buf = gst_adapter_take_buffer (wav->adapter, data_size);
|
2009-08-10 14:19:03 +00:00
|
|
|
if (data_size & 1)
|
|
|
|
gst_adapter_flush (wav->adapter, 1);
|
|
|
|
}
|
2008-08-05 15:05:44 +00:00
|
|
|
} else {
|
|
|
|
wav->offset += 12;
|
|
|
|
gst_buffer_unref (buf);
|
2012-03-16 20:47:21 +00:00
|
|
|
buf = NULL;
|
2009-06-07 11:37:04 +00:00
|
|
|
if (data_size > 0) {
|
|
|
|
if ((res =
|
|
|
|
gst_pad_pull_range (wav->sinkpad, wav->offset,
|
|
|
|
data_size, &buf)) != GST_FLOW_OK)
|
|
|
|
goto header_read_error;
|
|
|
|
}
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
2009-06-07 11:37:04 +00:00
|
|
|
if (data_size > 0) {
|
|
|
|
/* parse tags */
|
|
|
|
gst_riff_parse_info (GST_ELEMENT (wav), buf, &new);
|
|
|
|
if (new) {
|
|
|
|
GstTagList *old = wav->tags;
|
|
|
|
wav->tags =
|
|
|
|
gst_tag_list_merge (old, new, GST_TAG_MERGE_REPLACE);
|
|
|
|
if (old)
|
|
|
|
gst_tag_list_free (old);
|
|
|
|
gst_tag_list_free (new);
|
|
|
|
}
|
2009-08-10 14:19:03 +00:00
|
|
|
gst_buffer_unref (buf);
|
|
|
|
wav->offset += GST_ROUND_UP_2 (data_size);
|
2008-08-05 15:05:44 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
GST_INFO_OBJECT (wav, "Ignoring LIST chunk %" GST_FOURCC_FORMAT,
|
|
|
|
GST_FOURCC_ARGS (ltag));
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_waveparse_ignore_chunk (wav, buf, tag, size))
|
|
|
|
/* need more data */
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2008-08-05 15:05:44 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2008-08-05 14:22:12 +00:00
|
|
|
}
|
2008-08-05 14:16:32 +00:00
|
|
|
default:
|
2009-08-10 14:19:03 +00:00
|
|
|
if (!gst_waveparse_ignore_chunk (wav, buf, tag, size))
|
|
|
|
/* need more data */
|
2009-08-11 11:56:43 +00:00
|
|
|
goto exit;
|
2009-08-10 14:19:03 +00:00
|
|
|
break;
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
2006-07-24 13:40:56 +00:00
|
|
|
|
|
|
|
if (upstream_size && (wav->offset >= upstream_size)) {
|
|
|
|
/* Now we are gone through the whole file */
|
|
|
|
gotdata = TRUE;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
|
|
|
|
2006-02-28 10:29:16 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "Finished parsing headers");
|
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
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
if (wav->bps <= 0 && wav->fact) {
|
2007-09-04 07:58:36 +00:00
|
|
|
#if 0
|
|
|
|
/* not a good idea, as for embedded mp2/mp3 we set bps to 0 earlier */
|
2006-07-24 13:40:56 +00:00
|
|
|
wav->bps =
|
|
|
|
(guint32) gst_util_uint64_scale ((guint64) wav->rate, wav->datasize,
|
|
|
|
(guint64) wav->fact);
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_INFO_OBJECT (wav, "calculated bps : %u, enabling VBR", wav->bps);
|
2007-09-04 07:58:36 +00:00
|
|
|
#endif
|
2007-05-02 17:19:36 +00:00
|
|
|
wav->vbr = TRUE;
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
|
|
|
|
2007-09-04 07:58:36 +00:00
|
|
|
if (gst_wavparse_calculate_duration (wav)) {
|
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_segment_init (&wav->segment, GST_FORMAT_TIME);
|
2011-12-12 16:49:19 +00:00
|
|
|
if (!wav->ignore_length)
|
2012-01-10 13:32:32 +00:00
|
|
|
wav->segment.duration = wav->duration;
|
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
|
|
|
} else {
|
|
|
|
/* no bitrate, let downstream peer do the math, we'll feed it bytes. */
|
|
|
|
gst_segment_init (&wav->segment, GST_FORMAT_BYTES);
|
2011-12-12 16:49:19 +00:00
|
|
|
if (!wav->ignore_length)
|
2012-01-10 13:32:32 +00:00
|
|
|
wav->segment.duration = wav->datasize;
|
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
|
|
|
|
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
|
|
|
/* now we have all the info to perform a pending seek if any, if no
|
|
|
|
* event, this will still do the right thing and it will also send
|
|
|
|
* the right newsegment event downstream. */
|
|
|
|
gst_wavparse_perform_seek (wav, wav->seek_event);
|
|
|
|
/* remove pending event */
|
2006-03-21 14:53:36 +00:00
|
|
|
event_p = &wav->seek_event;
|
|
|
|
gst_event_replace (event_p, NULL);
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2007-05-02 18:25:09 +00:00
|
|
|
/* we just started, we are discont */
|
|
|
|
wav->discont = TRUE;
|
|
|
|
|
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
|
|
|
wav->state = GST_WAVPARSE_DATA;
|
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
|
|
|
|
2011-02-23 15:50:43 +00:00
|
|
|
/* determine reasonable max buffer size,
|
|
|
|
* that is, buffers not too small either size or time wise
|
|
|
|
* so we do not end up with too many of them */
|
|
|
|
/* var abuse */
|
|
|
|
upstream_size = 0;
|
|
|
|
gst_wavparse_time_to_bytepos (wav, 40 * GST_MSECOND, &upstream_size);
|
|
|
|
wav->max_buf_size = upstream_size;
|
|
|
|
wav->max_buf_size = MAX (wav->max_buf_size, MAX_BUFFER_SIZE);
|
|
|
|
if (wav->blockalign > 0)
|
|
|
|
wav->max_buf_size -= (wav->max_buf_size % wav->blockalign);
|
|
|
|
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "max buffer size %u", wav->max_buf_size);
|
2011-02-23 15:50:43 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
return GST_FLOW_OK;
|
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
|
|
|
|
|
|
|
/* ERROR */
|
2009-08-11 11:56:43 +00:00
|
|
|
exit:
|
|
|
|
{
|
|
|
|
if (codec_name)
|
|
|
|
g_free (codec_name);
|
|
|
|
if (header)
|
|
|
|
g_free (header);
|
|
|
|
if (caps)
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
fail:
|
|
|
|
{
|
|
|
|
res = GST_FLOW_ERROR;
|
|
|
|
goto exit;
|
|
|
|
}
|
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
|
|
|
invalid_wav:
|
|
|
|
{
|
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_ELEMENT_ERROR (wav, STREAM, TYPE_NOT_FOUND, (NULL),
|
2005-11-21 13:38:24 +00:00
|
|
|
("Invalid WAV header (no fmt at start): %"
|
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_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
|
|
|
parse_header_error:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, DEMUX, (NULL),
|
|
|
|
("Couldn't parse audio header"));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
|
|
|
no_channels:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
|
|
|
("Stream claims to contain no channels - invalid data"));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
2007-04-13 06:20:28 +00:00
|
|
|
no_rate:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
|
|
|
("Stream with sample_rate == 0 - invalid data"));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
2007-04-13 06:20:28 +00:00
|
|
|
}
|
|
|
|
invalid_blockalign:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
|
|
|
("Stream claims blockalign = %u, which is more than %u - invalid data",
|
2011-12-13 11:46:43 +00:00
|
|
|
wav->blockalign, wav->channels * ((wav->depth + 7) / 8)));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
2007-04-13 06:20:28 +00:00
|
|
|
}
|
|
|
|
invalid_bps:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
2007-04-17 10:14:43 +00:00
|
|
|
("Stream claims av_bsp = %u, which is more than %u - invalid data",
|
2007-04-13 06:20:28 +00:00
|
|
|
wav->av_bps, wav->blockalign * wav->rate));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
2007-04-13 06:20:28 +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
|
|
|
no_bytes_per_sample:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED, (NULL),
|
2007-04-13 06:20:28 +00:00
|
|
|
("Could not caluclate bytes per sample - invalid data"));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
|
|
|
unknown_format:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, TYPE_NOT_FOUND, (NULL),
|
2011-12-13 11:42:40 +00:00
|
|
|
("No caps found for format 0x%x, %u channels, %u Hz",
|
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
|
|
|
wav->format, wav->channels, wav->rate));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
|
|
|
header_read_error:
|
|
|
|
{
|
2009-06-07 11:37:04 +00:00
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, DEMUX, (NULL),
|
|
|
|
("Couldn't read in header %d (%s)", res, gst_flow_get_name (res)));
|
2009-08-11 11:56:43 +00:00
|
|
|
goto fail;
|
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
|
|
|
}
|
2004-05-16 20:06:35 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 12:01:33 +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
|
|
|
* Read WAV file tag when streaming
|
|
|
|
*/
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_wavparse_parse_stream_init (GstWavParse * wav)
|
|
|
|
{
|
|
|
|
if (gst_adapter_available (wav->adapter) >= 12) {
|
2007-02-12 23:27:31 +00:00
|
|
|
GstBuffer *tmp;
|
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
|
|
|
|
|
|
|
/* _take flushes the data */
|
2007-02-12 23:27:31 +00:00
|
|
|
tmp = gst_adapter_take_buffer (wav->adapter, 12);
|
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.*: 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
|
|
|
GST_DEBUG ("Parsing wav header");
|
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
|
|
|
if (!gst_wavparse_parse_file_header (GST_ELEMENT_CAST (wav), tmp))
|
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
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
|
|
|
|
wav->offset += 12;
|
|
|
|
/* Go to next state */
|
|
|
|
wav->state = GST_WAVPARSE_HEADER;
|
|
|
|
}
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* handle an event sent directly to the element.
|
|
|
|
*
|
|
|
|
* This event can be sent either in the READY state or the
|
|
|
|
* >READY state. The only event of interest really is the seek
|
|
|
|
* event.
|
|
|
|
*
|
|
|
|
* In the READY state we can only store the event and try to
|
|
|
|
* respect it when going to PAUSED. We assume we are in the
|
|
|
|
* READY state when our parsing state != GST_WAVPARSE_DATA.
|
|
|
|
*
|
|
|
|
* When we are steaming, we can simply perform the seek right
|
|
|
|
* away.
|
|
|
|
*/
|
|
|
|
static gboolean
|
|
|
|
gst_wavparse_send_event (GstElement * element, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstWavParse *wav = GST_WAVPARSE (element);
|
|
|
|
gboolean res = FALSE;
|
2006-03-21 14:53:36 +00:00
|
|
|
GstEvent **event_p;
|
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
|
|
|
|
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
|
|
|
GST_DEBUG_OBJECT (wav, "received event %s", GST_EVENT_TYPE_NAME (event));
|
|
|
|
|
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
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
|
|
|
if (wav->state == GST_WAVPARSE_DATA) {
|
|
|
|
/* we can handle the seek directly when streaming data */
|
|
|
|
res = gst_wavparse_perform_seek (wav, event);
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (wav, "queuing seek for later");
|
|
|
|
|
2006-03-21 14:53:36 +00:00
|
|
|
event_p = &wav->seek_event;
|
|
|
|
gst_event_replace (event_p, event);
|
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
|
|
|
|
|
|
|
/* we always return true */
|
|
|
|
res = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_event_unref (event);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-12-03 00:22:48 +00:00
|
|
|
static gboolean
|
|
|
|
gst_wavparse_have_dts_caps (const GstCaps * caps, GstTypeFindProbability prob)
|
|
|
|
{
|
|
|
|
GstStructure *s;
|
|
|
|
|
|
|
|
s = gst_caps_get_structure (caps, 0);
|
|
|
|
if (!gst_structure_has_name (s, "audio/x-dts"))
|
|
|
|
return FALSE;
|
|
|
|
if (prob >= GST_TYPE_FIND_LIKELY)
|
|
|
|
return TRUE;
|
|
|
|
/* DTS at non-0 offsets and without second sync may yield POSSIBLE .. */
|
|
|
|
if (prob < GST_TYPE_FIND_POSSIBLE)
|
|
|
|
return FALSE;
|
|
|
|
/* .. in which case we want at least a valid-looking rate and channels */
|
|
|
|
if (!gst_structure_has_field (s, "channels"))
|
|
|
|
return FALSE;
|
|
|
|
/* and for extra assurance we could also check the rate from the DTS frame
|
|
|
|
* against the one in the wav header, but for now let's not do that */
|
|
|
|
return gst_structure_has_field (s, "rate");
|
|
|
|
}
|
|
|
|
|
2006-03-23 15:36:27 +00:00
|
|
|
static void
|
|
|
|
gst_wavparse_add_src_pad (GstWavParse * wav, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GstStructure *s;
|
|
|
|
|
2007-04-10 12:01:33 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "adding src pad");
|
|
|
|
|
|
|
|
if (wav->caps) {
|
|
|
|
s = gst_caps_get_structure (wav->caps, 0);
|
2011-09-06 11:16:27 +00:00
|
|
|
if (s && gst_structure_has_name (s, "audio/x-raw") && buf != NULL) {
|
2010-06-11 19:50:23 +00:00
|
|
|
GstTypeFindProbability prob;
|
|
|
|
GstCaps *tf_caps;
|
|
|
|
|
|
|
|
tf_caps = gst_type_find_helper_for_buffer (GST_OBJECT (wav), buf, &prob);
|
|
|
|
if (tf_caps != NULL) {
|
2010-12-03 00:22:48 +00:00
|
|
|
GST_LOG ("typefind caps = %" GST_PTR_FORMAT ", P=%d", tf_caps, prob);
|
|
|
|
if (gst_wavparse_have_dts_caps (tf_caps, prob)) {
|
2010-06-11 19:50:23 +00:00
|
|
|
GST_INFO_OBJECT (wav, "Found DTS marker in file marked as raw PCM");
|
|
|
|
gst_caps_unref (wav->caps);
|
|
|
|
wav->caps = tf_caps;
|
|
|
|
|
|
|
|
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_AUDIO_CODEC, "dts", NULL);
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (wav, "found caps %" GST_PTR_FORMAT " for stream "
|
|
|
|
"marked as raw PCM audio, but ignoring for now", tf_caps);
|
|
|
|
gst_caps_unref (tf_caps);
|
|
|
|
}
|
|
|
|
}
|
2007-04-10 12:01:33 +00:00
|
|
|
}
|
2006-03-23 15:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gst_pad_set_caps (wav->srcpad, wav->caps);
|
|
|
|
gst_caps_replace (&wav->caps, NULL);
|
|
|
|
|
2007-05-02 17:19:36 +00:00
|
|
|
if (wav->start_segment) {
|
|
|
|
GST_DEBUG_OBJECT (wav, "Send start segment event on newpad");
|
|
|
|
gst_pad_push_event (wav->srcpad, wav->start_segment);
|
|
|
|
wav->start_segment = NULL;
|
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
|
|
|
}
|
2006-03-23 15:36:27 +00:00
|
|
|
|
|
|
|
if (wav->tags) {
|
2011-11-02 11:09:20 +00:00
|
|
|
gst_pad_push_event (wav->srcpad, gst_event_new_tag (wav->tags));
|
2006-03-23 15:36:27 +00:00
|
|
|
wav->tags = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
static GstFlowReturn
|
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
|
|
|
gst_wavparse_stream_data (GstWavParse * wav)
|
2004-05-08 00:33:39 +00:00
|
|
|
{
|
2005-07-20 11:26:05 +00:00
|
|
|
GstBuffer *buf = NULL;
|
|
|
|
GstFlowReturn res = GST_FLOW_OK;
|
|
|
|
guint64 desired, obtained;
|
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
|
|
|
GstClockTime timestamp, next_timestamp, duration;
|
2005-12-16 19:32:53 +00:00
|
|
|
guint64 pos, nextpos;
|
2005-07-20 11:26:05 +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
|
|
|
iterate_adapter:
|
|
|
|
GST_LOG_OBJECT (wav,
|
|
|
|
"offset: %" G_GINT64_FORMAT " , end: %" G_GINT64_FORMAT " , dataleft: %"
|
|
|
|
G_GINT64_FORMAT, wav->offset, wav->end_offset, wav->dataleft);
|
2004-03-15 19:32:27 +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
|
|
|
/* Get the next n bytes and output them */
|
2006-03-23 16:50:32 +00:00
|
|
|
if (wav->dataleft == 0 || wav->dataleft < wav->blockalign)
|
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
|
|
|
goto found_eos;
|
|
|
|
|
2006-02-28 10:29:16 +00:00
|
|
|
/* scale the amount of data by the segment rate so we get equal
|
|
|
|
* amounts of data regardless of the playback rate */
|
2006-03-30 23:37:16 +00:00
|
|
|
desired =
|
|
|
|
MIN (gst_guint64_to_gdouble (wav->dataleft),
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->max_buf_size * ABS (wav->segment.rate));
|
2006-10-18 14:00:44 +00:00
|
|
|
|
2005-08-10 12:12:31 +00:00
|
|
|
if (desired >= wav->blockalign && wav->blockalign > 0)
|
|
|
|
desired -= (desired % wav->blockalign);
|
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
|
|
|
|
2006-03-23 15:36:27 +00:00
|
|
|
GST_LOG_OBJECT (wav, "Fetching %" G_GINT64_FORMAT " bytes of data "
|
|
|
|
"from the sinkpad", desired);
|
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
|
|
|
if (wav->streaming) {
|
|
|
|
guint avail = gst_adapter_available (wav->adapter);
|
2009-02-27 12:29:41 +00:00
|
|
|
guint extra;
|
|
|
|
|
|
|
|
/* flush some bytes if evil upstream sends segment that starts
|
|
|
|
* before data or does is not send sample aligned segment */
|
|
|
|
if (G_LIKELY (wav->offset >= wav->datastart)) {
|
|
|
|
extra = (wav->offset - wav->datastart) % wav->bytes_per_sample;
|
|
|
|
} else {
|
|
|
|
extra = wav->datastart - wav->offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (G_UNLIKELY (extra)) {
|
|
|
|
extra = wav->bytes_per_sample - extra;
|
|
|
|
if (extra <= avail) {
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "flushing %u bytes to sample boundary", extra);
|
2009-02-27 12:29:41 +00:00
|
|
|
gst_adapter_flush (wav->adapter, extra);
|
|
|
|
wav->offset += extra;
|
|
|
|
wav->dataleft -= extra;
|
|
|
|
goto iterate_adapter;
|
|
|
|
} else {
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "flushing %u bytes", avail);
|
2009-02-27 12:29:41 +00:00
|
|
|
gst_adapter_clear (wav->adapter);
|
|
|
|
wav->offset += avail;
|
|
|
|
wav->dataleft -= avail;
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +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
|
|
|
if (avail < desired) {
|
2011-12-13 11:42:40 +00:00
|
|
|
GST_LOG_OBJECT (wav, "Got only %u bytes of data from the sinkpad", avail);
|
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
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
2007-02-12 23:27:31 +00:00
|
|
|
buf = gst_adapter_take_buffer (wav->adapter, desired);
|
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
|
|
|
} else {
|
|
|
|
if ((res = gst_pad_pull_range (wav->sinkpad, wav->offset,
|
|
|
|
desired, &buf)) != GST_FLOW_OK)
|
|
|
|
goto pull_error;
|
2010-05-25 13:34:11 +00:00
|
|
|
|
|
|
|
/* we may get a short buffer at the end of the file */
|
2011-07-06 14:10:34 +00:00
|
|
|
if (gst_buffer_get_size (buf) < desired) {
|
|
|
|
gsize size = gst_buffer_get_size (buf);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (wav, "Got only %" G_GSIZE_FORMAT " bytes of data", size);
|
|
|
|
if (size >= wav->blockalign) {
|
|
|
|
buf = gst_buffer_make_writable (buf);
|
|
|
|
gst_buffer_resize (buf, 0, size - (size % wav->blockalign));
|
2010-05-25 13:34:11 +00:00
|
|
|
} else {
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
goto found_eos;
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
}
|
2004-10-01 16:01:51 +00:00
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
obtained = gst_buffer_get_size (buf);
|
2010-06-11 19:47:22 +00:00
|
|
|
|
|
|
|
/* our positions in bytes */
|
|
|
|
pos = wav->offset - wav->datastart;
|
|
|
|
nextpos = pos + obtained;
|
|
|
|
|
|
|
|
/* update offsets, does not overflow. */
|
2011-07-06 14:10:34 +00:00
|
|
|
buf = gst_buffer_make_writable (buf);
|
2010-06-11 19:47:22 +00:00
|
|
|
GST_BUFFER_OFFSET (buf) = pos / wav->bytes_per_sample;
|
|
|
|
GST_BUFFER_OFFSET_END (buf) = nextpos / wav->bytes_per_sample;
|
|
|
|
|
2006-03-23 15:36:27 +00:00
|
|
|
/* first chunk of data? create the source pad. We do this only here so
|
|
|
|
* we can detect broken .wav files with dts disguised as raw PCM (sigh) */
|
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
|
|
|
if (G_UNLIKELY (wav->first)) {
|
|
|
|
wav->first = FALSE;
|
2007-05-02 17:19:36 +00:00
|
|
|
/* this will also push the segment events */
|
2006-03-23 15:36:27 +00:00
|
|
|
gst_wavparse_add_src_pad (wav, buf);
|
2007-05-02 17:19:36 +00:00
|
|
|
} else {
|
2011-07-06 14:10:34 +00:00
|
|
|
/* If we have a pending start segment, send it now. */
|
2007-05-02 17:19:36 +00:00
|
|
|
if (G_UNLIKELY (wav->start_segment != NULL)) {
|
|
|
|
gst_pad_push_event (wav->srcpad, wav->start_segment);
|
|
|
|
wav->start_segment = NULL;
|
|
|
|
}
|
2006-08-10 14:10:28 +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
|
|
|
if (wav->bps > 0) {
|
2007-09-04 07:58:36 +00:00
|
|
|
/* and timestamps if we have a bitrate, be careful for overflows */
|
2011-12-24 09:57:42 +00:00
|
|
|
timestamp =
|
|
|
|
gst_util_uint64_scale_ceil (pos, GST_SECOND, (guint64) wav->bps);
|
2007-09-04 07:58:36 +00:00
|
|
|
next_timestamp =
|
2011-12-24 09:57:42 +00:00
|
|
|
gst_util_uint64_scale_ceil (nextpos, GST_SECOND, (guint64) wav->bps);
|
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
|
|
|
duration = next_timestamp - timestamp;
|
2005-12-16 19:32:53 +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
|
|
|
/* update current running segment position */
|
2010-06-22 13:22:44 +00:00
|
|
|
if (G_LIKELY (next_timestamp >= wav->segment.start))
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->segment.position = next_timestamp;
|
2007-09-04 07:58:36 +00:00
|
|
|
} else if (wav->fact) {
|
|
|
|
guint64 bps =
|
|
|
|
gst_util_uint64_scale_int (wav->datasize, wav->rate, wav->fact);
|
|
|
|
/* and timestamps if we have a bitrate, be careful for overflows */
|
2011-12-24 09:57:42 +00:00
|
|
|
timestamp = gst_util_uint64_scale_ceil (pos, GST_SECOND, bps);
|
|
|
|
next_timestamp = gst_util_uint64_scale_ceil (nextpos, GST_SECOND, bps);
|
2007-09-04 07:58:36 +00:00
|
|
|
duration = next_timestamp - timestamp;
|
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
|
|
|
} else {
|
2007-04-26 08:39:49 +00:00
|
|
|
/* no bitrate, all we know is that the first sample has timestamp 0, all
|
|
|
|
* other positions and durations have unknown timestamp. */
|
|
|
|
if (pos == 0)
|
|
|
|
timestamp = 0;
|
|
|
|
else
|
|
|
|
timestamp = GST_CLOCK_TIME_NONE;
|
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
|
|
|
duration = GST_CLOCK_TIME_NONE;
|
|
|
|
/* update current running segment position with byte offset */
|
2010-06-22 13:22:44 +00:00
|
|
|
if (G_LIKELY (nextpos >= wav->segment.start))
|
2011-07-06 14:10:34 +00:00
|
|
|
wav->segment.position = nextpos;
|
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
|
|
|
}
|
2007-09-04 07:58:36 +00:00
|
|
|
if ((pos > 0) && wav->vbr) {
|
|
|
|
/* don't set timestamps for VBR files if it's not the first buffer */
|
|
|
|
timestamp = GST_CLOCK_TIME_NONE;
|
|
|
|
duration = GST_CLOCK_TIME_NONE;
|
|
|
|
}
|
|
|
|
if (wav->discont) {
|
|
|
|
GST_DEBUG_OBJECT (wav, "marking DISCONT");
|
|
|
|
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
|
|
|
wav->discont = FALSE;
|
|
|
|
}
|
2005-12-16 19:32:53 +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
|
|
|
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
|
|
|
GST_BUFFER_DURATION (buf) = duration;
|
2005-12-16 19:32:53 +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
|
|
|
GST_LOG_OBJECT (wav,
|
2006-02-28 10:29:16 +00:00
|
|
|
"Got buffer. timestamp:%" GST_TIME_FORMAT " , duration:%" GST_TIME_FORMAT
|
2011-11-21 19:31:31 +00:00
|
|
|
", size:%" G_GSIZE_FORMAT, GST_TIME_ARGS (timestamp),
|
|
|
|
GST_TIME_ARGS (duration), gst_buffer_get_size (buf));
|
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.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
if ((res = gst_pad_push (wav->srcpad, buf)) != GST_FLOW_OK)
|
|
|
|
goto push_error;
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
if (obtained < wav->dataleft) {
|
2007-09-04 14:37:22 +00:00
|
|
|
wav->offset += obtained;
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->dataleft -= obtained;
|
|
|
|
} else {
|
2007-09-04 14:37:22 +00:00
|
|
|
wav->offset += wav->dataleft;
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->dataleft = 0;
|
2004-05-08 00:33:39 +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
|
|
|
|
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
|
|
|
/* Iterate until need more data, so adapter size won't grow */
|
|
|
|
if (wav->streaming) {
|
|
|
|
GST_LOG_OBJECT (wav,
|
|
|
|
"offset: %" G_GINT64_FORMAT " , end: %" G_GINT64_FORMAT, wav->offset,
|
|
|
|
wav->end_offset);
|
|
|
|
goto iterate_adapter;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
return res;
|
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
|
|
|
|
|
|
|
/* ERROR */
|
|
|
|
found_eos:
|
|
|
|
{
|
2006-02-28 10:29:16 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "found EOS");
|
2012-01-03 14:26:21 +00:00
|
|
|
return GST_FLOW_EOS;
|
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
|
|
|
}
|
|
|
|
pull_error:
|
|
|
|
{
|
2006-06-13 17:05:25 +00:00
|
|
|
/* check if we got EOS */
|
2012-01-03 14:26:21 +00:00
|
|
|
if (res == GST_FLOW_EOS)
|
2006-06-13 17:05:25 +00:00
|
|
|
goto found_eos;
|
|
|
|
|
2006-07-24 13:40:56 +00:00
|
|
|
GST_WARNING_OBJECT (wav,
|
|
|
|
"Error getting %" G_GINT64_FORMAT " bytes from the "
|
2006-03-23 16:50:32 +00:00
|
|
|
"sinkpad (dataleft = %" G_GINT64_FORMAT ")", desired, wav->dataleft);
|
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
|
|
|
return res;
|
|
|
|
}
|
|
|
|
push_error:
|
|
|
|
{
|
2007-09-04 07:58:36 +00:00
|
|
|
GST_INFO_OBJECT (wav,
|
|
|
|
"Error pushing on srcpad %s:%s, reason %s, is linked? = %d",
|
|
|
|
GST_DEBUG_PAD_NAME (wav->srcpad), gst_flow_get_name (res),
|
|
|
|
gst_pad_is_linked (wav->srcpad));
|
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
|
|
|
return res;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_wavparse_loop (GstPad * pad)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
GstWavParse *wav = GST_WAVPARSE (GST_PAD_PARENT (pad));
|
|
|
|
|
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
|
|
|
GST_LOG_OBJECT (wav, "process data");
|
|
|
|
|
2004-05-08 00:33:39 +00:00
|
|
|
switch (wav->state) {
|
|
|
|
case GST_WAVPARSE_START:
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_START");
|
2005-07-20 11:26:05 +00:00
|
|
|
if ((ret = gst_wavparse_stream_init (wav)) != GST_FLOW_OK)
|
|
|
|
goto pause;
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->state = GST_WAVPARSE_HEADER;
|
2004-05-08 00:33:39 +00:00
|
|
|
/* fall-through */
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
case GST_WAVPARSE_HEADER:
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_HEADER");
|
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
|
|
|
if ((ret = gst_wavparse_stream_headers (wav)) != GST_FLOW_OK)
|
2005-07-20 11:26:05 +00:00
|
|
|
goto pause;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
wav->state = GST_WAVPARSE_DATA;
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_DATA");
|
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
|
|
|
/* fall-through */
|
|
|
|
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
case GST_WAVPARSE_DATA:
|
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
|
|
|
if ((ret = gst_wavparse_stream_data (wav)) != GST_FLOW_OK)
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
goto pause;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
return;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
|
gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
/* ERRORS */
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
pause:
|
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
|
|
|
{
|
|
|
|
const gchar *reason = gst_flow_get_name (ret);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (wav, "pausing task, reason %s", reason);
|
|
|
|
gst_pad_pause_task (pad);
|
|
|
|
|
2012-01-03 14:26:21 +00:00
|
|
|
if (ret == GST_FLOW_EOS) {
|
2011-07-06 14:10:34 +00:00
|
|
|
/* handle end-of-stream/segment */
|
|
|
|
/* so align our position with the end of it, if there is one
|
|
|
|
* this ensures a subsequent will arrive at correct base/acc time */
|
|
|
|
if (wav->segment.format == GST_FORMAT_TIME) {
|
|
|
|
if (wav->segment.rate > 0.0 &&
|
|
|
|
GST_CLOCK_TIME_IS_VALID (wav->segment.stop))
|
|
|
|
wav->segment.position = wav->segment.stop;
|
|
|
|
else if (wav->segment.rate < 0.0)
|
|
|
|
wav->segment.position = wav->segment.start;
|
|
|
|
}
|
2010-08-27 15:47:22 +00:00
|
|
|
/* add pad before we perform EOS */
|
|
|
|
if (G_UNLIKELY (wav->first)) {
|
|
|
|
wav->first = FALSE;
|
|
|
|
gst_wavparse_add_src_pad (wav, NULL);
|
|
|
|
}
|
2010-08-19 10:23:16 +00:00
|
|
|
|
2010-08-27 15:47:22 +00:00
|
|
|
if (wav->state == GST_WAVPARSE_START)
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, WRONG_TYPE,
|
|
|
|
("No valid input found before end of stream"), (NULL));
|
2010-08-19 10:23:16 +00:00
|
|
|
|
2010-08-27 15:47:22 +00:00
|
|
|
/* perform EOS logic */
|
|
|
|
if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
|
|
|
GstClockTime stop;
|
2007-09-14 09:40:49 +00:00
|
|
|
|
2010-08-27 15:47:22 +00:00
|
|
|
if ((stop = wav->segment.stop) == -1)
|
|
|
|
stop = wav->segment.duration;
|
2007-09-14 09:40:49 +00:00
|
|
|
|
2010-08-27 15:47:22 +00:00
|
|
|
gst_element_post_message (GST_ELEMENT_CAST (wav),
|
|
|
|
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
|
|
|
|
wav->segment.format, stop));
|
2007-09-14 09:40:49 +00:00
|
|
|
} else {
|
2011-12-19 09:48:54 +00:00
|
|
|
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
2007-09-14 09:40:49 +00:00
|
|
|
}
|
2012-01-03 14:26:21 +00:00
|
|
|
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
2010-08-27 15:47:22 +00:00
|
|
|
/* for fatal errors we post an error message, post the error
|
|
|
|
* first so the app knows about the error first. */
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, FAILED,
|
|
|
|
(_("Internal data flow error.")),
|
|
|
|
("streaming task paused, reason %s (%d)", reason, ret));
|
2011-12-19 09:48:54 +00:00
|
|
|
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
2007-09-14 09:40:49 +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
|
|
|
return;
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_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_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +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
|
|
|
static GstFlowReturn
|
2011-11-17 14:02:55 +00:00
|
|
|
gst_wavparse_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
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
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
2011-11-17 14:02:55 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (parent);
|
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
|
|
|
|
2011-11-21 19:31:31 +00:00
|
|
|
GST_LOG_OBJECT (wav, "adapter_push %" G_GSIZE_FORMAT " bytes",
|
|
|
|
gst_buffer_get_size (buf));
|
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
|
|
|
|
|
|
|
gst_adapter_push (wav->adapter, buf);
|
|
|
|
|
|
|
|
switch (wav->state) {
|
|
|
|
case GST_WAVPARSE_START:
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_START");
|
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
|
|
|
if ((ret = gst_wavparse_parse_stream_init (wav)) != GST_FLOW_OK)
|
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
|
|
|
goto done;
|
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
|
|
|
|
2006-06-14 08:06:43 +00:00
|
|
|
if (wav->state != GST_WAVPARSE_HEADER)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* otherwise fall-through */
|
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
|
|
|
case GST_WAVPARSE_HEADER:
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_HEADER");
|
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
|
|
|
if ((ret = gst_wavparse_stream_headers (wav)) != GST_FLOW_OK)
|
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
|
|
|
goto done;
|
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
|
|
|
|
2006-06-14 08:06:43 +00:00
|
|
|
if (!wav->got_fmt || wav->datastart == 0)
|
|
|
|
break;
|
|
|
|
|
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
|
|
|
wav->state = GST_WAVPARSE_DATA;
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "GST_WAVPARSE_DATA");
|
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
|
|
|
|
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
|
|
|
/* fall-through */
|
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
|
|
|
case GST_WAVPARSE_DATA:
|
2009-02-27 12:29:41 +00:00
|
|
|
if (buf && GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT))
|
|
|
|
wav->discont = TRUE;
|
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
|
|
|
if ((ret = gst_wavparse_stream_data (wav)) != GST_FLOW_OK)
|
2007-09-14 09:40:49 +00:00
|
|
|
goto done;
|
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
|
|
|
break;
|
|
|
|
default:
|
2007-12-26 16:03:57 +00:00
|
|
|
g_return_val_if_reached (GST_FLOW_ERROR);
|
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
|
|
|
}
|
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
|
|
|
done:
|
2009-08-10 14:19:03 +00:00
|
|
|
if (G_UNLIKELY (wav->abort_buffering)) {
|
|
|
|
wav->abort_buffering = FALSE;
|
|
|
|
ret = GST_FLOW_ERROR;
|
|
|
|
/* sort of demux/parse error */
|
2009-10-08 09:20:09 +00:00
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, DEMUX, (NULL), ("unhandled buffer size"));
|
2009-08-10 14:19:03 +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
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_wavparse_flush_data (GstWavParse * wav)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
|
|
|
guint av;
|
|
|
|
|
|
|
|
if ((av = gst_adapter_available (wav->adapter)) > 0) {
|
|
|
|
wav->dataleft = av;
|
|
|
|
wav->end_offset = wav->offset + av;
|
|
|
|
ret = gst_wavparse_stream_data (wav);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-17 14:02:55 +00:00
|
|
|
gst_wavparse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
2009-02-27 12:29:41 +00:00
|
|
|
{
|
2011-11-17 14:02:55 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (parent);
|
2009-02-27 12:29:41 +00:00
|
|
|
gboolean ret = TRUE;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (wav, "handling %s event", GST_EVENT_TYPE_NAME (event));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2011-07-06 14:31:18 +00:00
|
|
|
case GST_EVENT_CAPS:
|
|
|
|
{
|
|
|
|
/* discard, we'll come up with proper src caps */
|
|
|
|
gst_event_unref (event);
|
|
|
|
break;
|
|
|
|
}
|
2011-07-06 14:10:34 +00:00
|
|
|
case GST_EVENT_SEGMENT:
|
2009-02-27 12:29:41 +00:00
|
|
|
{
|
2011-07-06 14:10:34 +00:00
|
|
|
gint64 start, stop, offset = 0, end_offset = -1;
|
2009-02-27 12:29:41 +00:00
|
|
|
GstSegment segment;
|
|
|
|
|
|
|
|
/* some debug output */
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_event_copy_segment (event, &segment);
|
|
|
|
GST_DEBUG_OBJECT (wav, "received newsegment %" GST_SEGMENT_FORMAT,
|
2009-02-27 12:29:41 +00:00
|
|
|
&segment);
|
|
|
|
|
|
|
|
if (wav->state != GST_WAVPARSE_DATA) {
|
|
|
|
GST_DEBUG_OBJECT (wav, "still starting, eating event");
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we are either committed to TIME or BYTE format,
|
|
|
|
* and we only expect a BYTE segment, e.g. following a seek */
|
2011-07-06 14:10:34 +00:00
|
|
|
if (segment.format == GST_FORMAT_BYTES) {
|
|
|
|
/* handle (un)signed issues */
|
|
|
|
start = segment.start;
|
|
|
|
stop = segment.stop;
|
2009-02-27 12:29:41 +00:00
|
|
|
if (start > 0) {
|
|
|
|
offset = start;
|
|
|
|
start -= wav->datastart;
|
|
|
|
start = MAX (start, 0);
|
|
|
|
}
|
|
|
|
if (stop > 0) {
|
|
|
|
end_offset = stop;
|
2011-07-06 14:10:34 +00:00
|
|
|
segment.stop -= wav->datastart;
|
|
|
|
segment.stop = MAX (stop, 0);
|
2009-02-27 12:29:41 +00:00
|
|
|
}
|
|
|
|
if (wav->segment.format == GST_FORMAT_TIME) {
|
|
|
|
guint64 bps = wav->bps;
|
|
|
|
|
|
|
|
/* operating in format TIME, so we can convert */
|
|
|
|
if (!bps && wav->fact)
|
|
|
|
bps =
|
|
|
|
gst_util_uint64_scale_int (wav->datasize, wav->rate, wav->fact);
|
|
|
|
if (bps) {
|
|
|
|
if (start >= 0)
|
|
|
|
start =
|
2011-12-24 09:57:42 +00:00
|
|
|
gst_util_uint64_scale_ceil (start, GST_SECOND,
|
|
|
|
(guint64) wav->bps);
|
2009-02-27 12:29:41 +00:00
|
|
|
if (stop >= 0)
|
|
|
|
stop =
|
2011-12-24 09:57:42 +00:00
|
|
|
gst_util_uint64_scale_ceil (stop, GST_SECOND,
|
|
|
|
(guint64) wav->bps);
|
2009-02-27 12:29:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (wav, "unsupported segment format, ignoring");
|
|
|
|
goto exit;
|
|
|
|
}
|
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
segment.start = start;
|
|
|
|
segment.stop = stop;
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
/* accept upstream's notion of segment and distribute along */
|
2011-07-06 14:10:34 +00:00
|
|
|
segment.time = segment.start = segment.position;
|
|
|
|
segment.duration = wav->segment.duration;
|
|
|
|
segment.base = gst_segment_to_running_time (&wav->segment,
|
|
|
|
GST_FORMAT_TIME, wav->segment.position);
|
|
|
|
|
|
|
|
gst_segment_copy_into (&segment, &wav->segment);
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
/* also store the newsegment event for the streaming thread */
|
|
|
|
if (wav->start_segment)
|
|
|
|
gst_event_unref (wav->start_segment);
|
2011-07-06 14:10:34 +00:00
|
|
|
GST_DEBUG_OBJECT (wav, "Storing newseg %" GST_SEGMENT_FORMAT, &segment);
|
|
|
|
wav->start_segment = gst_event_new_segment (&segment);
|
2009-02-27 12:29:41 +00:00
|
|
|
|
|
|
|
/* stream leftover data in current segment */
|
|
|
|
gst_wavparse_flush_data (wav);
|
|
|
|
/* and set up streaming thread for next one */
|
|
|
|
wav->offset = offset;
|
|
|
|
wav->end_offset = end_offset;
|
|
|
|
if (wav->end_offset > 0) {
|
|
|
|
wav->dataleft = wav->end_offset - wav->offset;
|
|
|
|
} else {
|
|
|
|
/* infinity; upstream will EOS when done */
|
|
|
|
wav->dataleft = G_MAXUINT64;
|
|
|
|
}
|
|
|
|
exit:
|
|
|
|
gst_event_unref (event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_EVENT_EOS:
|
2009-08-11 11:54:56 +00:00
|
|
|
/* add pad if needed so EOS is seen downstream */
|
|
|
|
if (G_UNLIKELY (wav->first)) {
|
|
|
|
wav->first = FALSE;
|
|
|
|
gst_wavparse_add_src_pad (wav, NULL);
|
|
|
|
} else {
|
|
|
|
/* stream leftover data in current segment */
|
|
|
|
gst_wavparse_flush_data (wav);
|
|
|
|
}
|
2010-08-19 10:23:16 +00:00
|
|
|
|
|
|
|
if (wav->state == GST_WAVPARSE_START)
|
|
|
|
GST_ELEMENT_ERROR (wav, STREAM, WRONG_TYPE,
|
|
|
|
("No valid input found before end of stream"), (NULL));
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
/* fall-through */
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
2011-07-06 14:10:34 +00:00
|
|
|
{
|
|
|
|
GstClockTime dur;
|
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
gst_adapter_clear (wav->adapter);
|
|
|
|
wav->discont = TRUE;
|
2011-07-06 14:10:34 +00:00
|
|
|
dur = wav->segment.duration;
|
|
|
|
gst_segment_init (&wav->segment, wav->segment.format);
|
|
|
|
wav->segment.duration = dur;
|
2009-02-27 12:29:41 +00:00
|
|
|
/* fall-through */
|
2011-07-06 14:10:34 +00:00
|
|
|
}
|
2009-02-27 12:29:41 +00:00
|
|
|
default:
|
2011-11-17 14:02:55 +00:00
|
|
|
ret = gst_pad_event_default (wav->sinkpad, parent, event);
|
2009-02-27 12:29:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
#if 0
|
2002-11-03 13:59:35 +00:00
|
|
|
/* convert and query stuff */
|
|
|
|
static const GstFormat *
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_wavparse_get_formats (GstPad * pad)
|
2002-11-03 13:59:35 +00:00
|
|
|
{
|
|
|
|
static GstFormat formats[] = {
|
|
|
|
GST_FORMAT_TIME,
|
|
|
|
GST_FORMAT_BYTES,
|
2004-03-15 19:32:27 +00:00
|
|
|
GST_FORMAT_DEFAULT, /* a "frame", ie a set of samples per Hz */
|
2002-11-03 13:59:35 +00:00
|
|
|
0
|
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2002-11-03 13:59:35 +00:00
|
|
|
return formats;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
#endif
|
2002-11-03 13:59:35 +00:00
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_wavparse_pad_convert (GstPad * pad,
|
|
|
|
GstFormat src_format, gint64 src_value,
|
|
|
|
GstFormat * dest_format, gint64 * dest_value)
|
2002-11-03 13:59:35 +00:00
|
|
|
{
|
|
|
|
GstWavParse *wavparse;
|
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
|
|
|
gboolean res = TRUE;
|
2002-11-03 13:59:35 +00:00
|
|
|
|
2007-11-13 06:23:51 +00:00
|
|
|
wavparse = GST_WAVPARSE (GST_PAD_PARENT (pad));
|
2004-03-14 22:34:33 +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
|
|
|
if (*dest_format == src_format) {
|
|
|
|
*dest_value = src_value;
|
|
|
|
return TRUE;
|
|
|
|
}
|
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
|
|
|
|
2007-09-04 07:58:36 +00:00
|
|
|
if ((wavparse->bps == 0) && !wavparse->fact)
|
|
|
|
goto no_bps_fact;
|
2002-11-03 13:59:35 +00:00
|
|
|
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wavparse, "converting value from %s to %s",
|
|
|
|
gst_format_get_name (src_format), gst_format_get_name (*dest_format));
|
|
|
|
|
2002-11-03 13:59:35 +00:00
|
|
|
switch (src_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
2004-05-16 20:06:35 +00:00
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_DEFAULT:
|
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
|
|
|
*dest_value = src_value / wavparse->bytes_per_sample;
|
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
|
|
|
/* make sure we end up on a sample boundary */
|
|
|
|
*dest_value -= *dest_value % wavparse->bytes_per_sample;
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
2007-09-04 14:37:22 +00:00
|
|
|
/* src_value + datastart = offset */
|
|
|
|
GST_INFO_OBJECT (wavparse,
|
|
|
|
"src=%" G_GINT64_FORMAT ", offset=%" G_GINT64_FORMAT, src_value,
|
|
|
|
wavparse->offset);
|
2007-09-04 07:58:36 +00:00
|
|
|
if (wavparse->bps > 0)
|
2011-12-24 09:57:42 +00:00
|
|
|
*dest_value = gst_util_uint64_scale_ceil (src_value, GST_SECOND,
|
2007-09-04 07:58:36 +00:00
|
|
|
(guint64) wavparse->bps);
|
2007-11-08 15:00:40 +00:00
|
|
|
else if (wavparse->fact) {
|
2011-12-24 09:57:42 +00:00
|
|
|
guint64 bps = gst_util_uint64_scale_int_ceil (wavparse->datasize,
|
2007-09-04 07:58:36 +00:00
|
|
|
wavparse->rate, wavparse->fact);
|
|
|
|
|
2011-12-24 09:57:42 +00:00
|
|
|
*dest_value =
|
|
|
|
gst_util_uint64_scale_int_ceil (src_value, GST_SECOND, bps);
|
2007-11-08 15:00:40 +00:00
|
|
|
} else {
|
|
|
|
res = FALSE;
|
2007-09-04 07:58:36 +00:00
|
|
|
}
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
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
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
2004-03-06 00:13:19 +00:00
|
|
|
}
|
2002-11-03 13:59:35 +00:00
|
|
|
break;
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2003-05-24 10:41:21 +00:00
|
|
|
case GST_FORMAT_DEFAULT:
|
2004-05-16 20:06:35 +00:00
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
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
|
|
|
*dest_value = src_value * wavparse->bytes_per_sample;
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
2007-09-04 07:58:36 +00:00
|
|
|
*dest_value = gst_util_uint64_scale (src_value, GST_SECOND,
|
|
|
|
(guint64) wavparse->rate);
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
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
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
2004-03-06 00:13:19 +00:00
|
|
|
}
|
2002-11-03 13:59:35 +00:00
|
|
|
break;
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2002-11-03 13:59:35 +00:00
|
|
|
case GST_FORMAT_TIME:
|
2004-05-16 20:06:35 +00:00
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
2007-09-04 07:58:36 +00:00
|
|
|
if (wavparse->bps > 0)
|
|
|
|
*dest_value = gst_util_uint64_scale (src_value,
|
|
|
|
(guint64) wavparse->bps, GST_SECOND);
|
|
|
|
else {
|
|
|
|
guint64 bps = gst_util_uint64_scale_int (wavparse->datasize,
|
|
|
|
wavparse->rate, wavparse->fact);
|
|
|
|
|
|
|
|
*dest_value = gst_util_uint64_scale (src_value, bps, GST_SECOND);
|
|
|
|
}
|
2004-10-01 16:01:51 +00:00
|
|
|
/* make sure we end up on a sample boundary */
|
2006-01-18 19:08:08 +00:00
|
|
|
*dest_value -= *dest_value % wavparse->blockalign;
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
case GST_FORMAT_DEFAULT:
|
2007-09-04 07:58:36 +00:00
|
|
|
*dest_value = gst_util_uint64_scale (src_value,
|
|
|
|
(guint64) wavparse->rate, GST_SECOND);
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
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
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
2004-03-06 00:13:19 +00:00
|
|
|
}
|
2002-11-03 13:59:35 +00:00
|
|
|
break;
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2002-11-03 13:59:35 +00:00
|
|
|
default:
|
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
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
2002-11-03 13:59:35 +00:00
|
|
|
}
|
2004-05-16 20:06:35 +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
|
|
|
done:
|
|
|
|
return res;
|
|
|
|
|
|
|
|
/* ERRORS */
|
2007-09-04 07:58:36 +00:00
|
|
|
no_bps_fact:
|
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
|
|
|
{
|
2007-09-04 07:58:36 +00:00
|
|
|
GST_DEBUG_OBJECT (wavparse, "bps 0 or no fact chunk, cannot convert");
|
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
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
|
|
|
}
|
2002-11-03 13:59:35 +00:00
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-11-03 13:59:35 +00:00
|
|
|
/* handle queries for location and length in requested format */
|
|
|
|
static gboolean
|
2011-11-16 16:27:13 +00:00
|
|
|
gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
2002-11-03 13:59:35 +00:00
|
|
|
{
|
2005-07-20 11:26:05 +00:00
|
|
|
gboolean res = TRUE;
|
2011-11-16 16:27:13 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (parent);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-05-16 20:06:35 +00:00
|
|
|
/* only if we know */
|
2007-11-13 06:55:28 +00:00
|
|
|
if (wav->state != GST_WAVPARSE_DATA) {
|
2002-11-03 13:59:35 +00:00
|
|
|
return FALSE;
|
2007-11-13 06:55:28 +00:00
|
|
|
}
|
2004-05-16 20:06:35 +00:00
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
GST_LOG_OBJECT (pad, "%s query", GST_QUERY_TYPE_NAME (query));
|
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
2004-05-16 20:06:35 +00:00
|
|
|
case GST_QUERY_POSITION:
|
2005-07-20 11:26:05 +00:00
|
|
|
{
|
2005-10-19 15:57:04 +00:00
|
|
|
gint64 curb;
|
|
|
|
gint64 cur;
|
2005-07-20 11:26:05 +00:00
|
|
|
GstFormat format;
|
|
|
|
|
2007-09-04 14:37:22 +00:00
|
|
|
/* this is not very precise, as we have pushed severla buffer upstream for prerolling */
|
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
|
|
|
curb = wav->offset - wav->datastart;
|
2005-10-19 15:57:04 +00:00
|
|
|
gst_query_parse_position (query, &format, NULL);
|
2007-09-04 14:37:22 +00:00
|
|
|
GST_INFO_OBJECT (wav, "pos query at %" G_GINT64_FORMAT, curb);
|
2005-07-20 11:26:05 +00:00
|
|
|
|
|
|
|
switch (format) {
|
|
|
|
case GST_FORMAT_TIME:
|
2007-09-04 07:58:36 +00:00
|
|
|
res = gst_wavparse_pad_convert (pad, GST_FORMAT_BYTES, curb,
|
2005-07-20 11:26:05 +00:00
|
|
|
&format, &cur);
|
2005-10-19 15:57:04 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
format = GST_FORMAT_BYTES;
|
|
|
|
cur = curb;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (res)
|
|
|
|
gst_query_set_position (query, format, cur);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_QUERY_DURATION:
|
|
|
|
{
|
2007-11-08 15:00:40 +00:00
|
|
|
gint64 duration = 0;
|
2005-10-19 15:57:04 +00:00
|
|
|
GstFormat format;
|
|
|
|
|
2011-12-12 16:49:19 +00:00
|
|
|
if (wav->ignore_length) {
|
|
|
|
res = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-10-19 15:57:04 +00:00
|
|
|
gst_query_parse_duration (query, &format, NULL);
|
|
|
|
|
|
|
|
switch (format) {
|
2006-07-24 13:40:56 +00:00
|
|
|
case GST_FORMAT_TIME:{
|
2007-11-08 15:00:40 +00:00
|
|
|
if ((res = gst_wavparse_calculate_duration (wav))) {
|
2007-09-04 07:58:36 +00:00
|
|
|
duration = wav->duration;
|
2006-07-24 13:40:56 +00:00
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
break;
|
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
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
default:
|
|
|
|
format = GST_FORMAT_BYTES;
|
2007-09-04 07:58:36 +00:00
|
|
|
duration = wav->datasize;
|
2005-07-20 11:26:05 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-09-04 07:58:36 +00:00
|
|
|
gst_query_set_duration (query, format, duration);
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
|
|
|
case GST_QUERY_CONVERT:
|
|
|
|
{
|
|
|
|
gint64 srcvalue, dstvalue;
|
|
|
|
GstFormat srcformat, dstformat;
|
|
|
|
|
|
|
|
gst_query_parse_convert (query, &srcformat, &srcvalue,
|
|
|
|
&dstformat, &dstvalue);
|
2007-09-04 14:37:22 +00:00
|
|
|
res = gst_wavparse_pad_convert (pad, srcformat, srcvalue,
|
2005-07-20 11:26:05 +00:00
|
|
|
&dstformat, &dstvalue);
|
|
|
|
if (res)
|
|
|
|
gst_query_set_convert (query, srcformat, srcvalue, dstformat, dstvalue);
|
2004-05-16 20:06:35 +00:00
|
|
|
break;
|
2007-09-04 07:58:36 +00:00
|
|
|
}
|
|
|
|
case GST_QUERY_SEEKING:{
|
|
|
|
GstFormat fmt;
|
2009-02-27 12:29:41 +00:00
|
|
|
gboolean seekable = FALSE;
|
2007-09-04 07:58:36 +00:00
|
|
|
|
|
|
|
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
2009-02-27 12:29:41 +00:00
|
|
|
if (fmt == wav->segment.format) {
|
|
|
|
if (wav->streaming) {
|
|
|
|
GstQuery *q;
|
2007-09-04 07:58:36 +00:00
|
|
|
|
2009-02-27 12:29:41 +00:00
|
|
|
q = gst_query_new_seeking (GST_FORMAT_BYTES);
|
|
|
|
if ((res = gst_pad_peer_query (wav->sinkpad, q))) {
|
|
|
|
gst_query_parse_seeking (q, &fmt, &seekable, NULL, NULL);
|
|
|
|
GST_LOG_OBJECT (wav, "upstream BYTE seekable %d", seekable);
|
|
|
|
}
|
|
|
|
gst_query_unref (q);
|
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (wav, "looping => seekable");
|
|
|
|
seekable = TRUE;
|
|
|
|
res = TRUE;
|
2007-09-04 07:58:36 +00:00
|
|
|
}
|
2009-02-27 12:29:41 +00:00
|
|
|
} else if (fmt == GST_FORMAT_TIME) {
|
2007-09-04 07:58:36 +00:00
|
|
|
res = TRUE;
|
|
|
|
}
|
2009-02-27 12:29:41 +00:00
|
|
|
if (res) {
|
|
|
|
gst_query_set_seeking (query, fmt, seekable, 0, wav->segment.duration);
|
|
|
|
}
|
2007-09-04 07:58:36 +00:00
|
|
|
break;
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
2004-05-16 20:06:35 +00:00
|
|
|
default:
|
2011-11-16 16:27:13 +00:00
|
|
|
res = gst_pad_query_default (pad, parent, query);
|
2005-07-20 11:26:05 +00:00
|
|
|
break;
|
2002-11-03 13:59:35 +00:00
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
return res;
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
2003-03-01 18:34:38 +00:00
|
|
|
|
|
|
|
static gboolean
|
2011-11-17 14:02:55 +00:00
|
|
|
gst_wavparse_srcpad_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
2003-03-01 18:34:38 +00:00
|
|
|
{
|
2011-11-17 14:02:55 +00:00
|
|
|
GstWavParse *wavparse = GST_WAVPARSE (parent);
|
2007-11-13 06:23:51 +00:00
|
|
|
gboolean res = FALSE;
|
2003-03-01 18:34:38 +00:00
|
|
|
|
2007-12-06 11:46:22 +00:00
|
|
|
GST_DEBUG_OBJECT (wavparse, "%s event", GST_EVENT_TYPE_NAME (event));
|
2003-03-01 18:34:38 +00:00
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
2007-11-13 06:23:51 +00:00
|
|
|
/* can only handle events when we are in the data state */
|
2007-12-06 11:46:22 +00:00
|
|
|
if (wavparse->state == GST_WAVPARSE_DATA) {
|
2007-11-13 06:23:51 +00:00
|
|
|
res = gst_wavparse_perform_seek (wavparse, event);
|
|
|
|
}
|
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_event_unref (event);
|
2003-03-01 18:34:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
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
|
|
|
res = gst_pad_push_event (wavparse->sinkpad, event);
|
2003-03-01 18:34:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
2001-12-22 23:27:31 +00:00
|
|
|
|
2005-07-20 11:26:05 +00:00
|
|
|
static gboolean
|
2011-11-18 12:57:20 +00:00
|
|
|
gst_wavparse_sink_activate (GstPad * sinkpad, GstObject * parent)
|
2005-07-20 11:26:05 +00:00
|
|
|
{
|
2011-11-18 12:57:20 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (parent);
|
2011-07-06 14:10:34 +00:00
|
|
|
GstQuery *query;
|
|
|
|
gboolean pull_mode;
|
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
|
|
|
|
2009-08-31 12:38:08 +00:00
|
|
|
if (wav->adapter) {
|
|
|
|
gst_adapter_clear (wav->adapter);
|
2009-08-31 12:07:53 +00:00
|
|
|
g_object_unref (wav->adapter);
|
2009-08-31 12:38:08 +00:00
|
|
|
wav->adapter = NULL;
|
|
|
|
}
|
Fix a bunch of leaks shown by the newly-added states test.
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flac_enc_finalize):
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_class_init),
(gst_gconf_audio_sink_dispose), (gst_gconf_audio_sink_finalize):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init),
(gst_gconf_audio_src_class_init), (gst_gconf_audio_src_dispose),
(gst_gconf_audio_src_finalize), (do_toggle_element):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init),
(gst_gconf_video_sink_class_init), (gst_gconf_video_sink_finalize),
(do_toggle_element):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init),
(gst_gconf_video_src_class_init), (gst_gconf_video_src_dispose),
(gst_gconf_video_src_finalize), (do_toggle_element):
* ext/gconf/gstswitchsink.c: (gst_switch_sink_class_init),
(gst_switch_sink_reset), (gst_switch_sink_set_child):
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/shout2/gstshout2.c: (gst_shout2send_class_init),
(gst_shout2send_init), (gst_shout2send_finalize):
* gst/debug/testplugin.c: (gst_test_class_init),
(gst_test_finalize):
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(gst_flxdec_dispose):
* gst/multipart/multipartmux.c: (gst_multipart_mux_finalize):
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize):
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init),
(gst_rtspsrc_finalize):
* gst/rtsp/rtspextwms.c: (rtsp_ext_wms_free_context):
* gst/rtsp/rtspextwms.h:
* gst/smpte/gstsmpte.c: (gst_smpte_class_init),
(gst_smpte_finalize):
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_finalize):
* gst/udp/gstudpsink.c: (gst_udpsink_class_init),
(gst_udpsink_finalize):
* gst/wavparse/gstwavparse.c: (gst_wavparse_dispose),
(gst_wavparse_sink_activate):
* sys/oss/gstosssink.c: (gst_oss_sink_finalise):
* sys/oss/gstosssrc.c: (gst_oss_src_class_init),
(gst_oss_src_finalize):
* sys/v4l2/gstv4l2object.c: (gst_v4l2_object_destroy):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_finalize):
* sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get):
Fix a bunch of leaks shown by the newly-added states test.
2007-03-04 13:52:03 +00:00
|
|
|
|
2011-07-06 14:10:34 +00:00
|
|
|
query = gst_query_new_scheduling ();
|
|
|
|
|
|
|
|
if (!gst_pad_peer_query (sinkpad, query)) {
|
|
|
|
gst_query_unref (query);
|
|
|
|
goto activate_push;
|
|
|
|
}
|
|
|
|
|
2011-11-18 16:59:16 +00:00
|
|
|
pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL);
|
2011-07-06 14:10:34 +00:00
|
|
|
gst_query_unref (query);
|
|
|
|
|
|
|
|
if (!pull_mode)
|
|
|
|
goto activate_push;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (sinkpad, "activating pull");
|
|
|
|
wav->streaming = FALSE;
|
2011-11-21 12:37:01 +00:00
|
|
|
return gst_pad_activate_mode (sinkpad, GST_PAD_MODE_PULL, TRUE);
|
2011-07-06 14:10:34 +00:00
|
|
|
|
|
|
|
activate_push:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (sinkpad, "activating push");
|
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
|
|
|
wav->streaming = TRUE;
|
2009-08-31 12:38:08 +00:00
|
|
|
wav->adapter = gst_adapter_new ();
|
2011-11-21 12:37:01 +00:00
|
|
|
return gst_pad_activate_mode (sinkpad, GST_PAD_MODE_PUSH, TRUE);
|
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
|
|
|
}
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2011-11-21 12:37:01 +00:00
|
|
|
gst_wavparse_sink_activate_mode (GstPad * sinkpad, GstObject * parent,
|
|
|
|
GstPadMode mode, gboolean active)
|
2005-07-20 11:26:05 +00:00
|
|
|
{
|
2011-11-21 12:37:01 +00:00
|
|
|
gboolean res;
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
case GST_PAD_MODE_PUSH:
|
|
|
|
res = TRUE;
|
|
|
|
break;
|
|
|
|
case GST_PAD_MODE_PULL:
|
|
|
|
if (active) {
|
|
|
|
/* if we have a scheduler we can start the task */
|
|
|
|
res = gst_pad_start_task (sinkpad, (GstTaskFunction) gst_wavparse_loop,
|
|
|
|
sinkpad);
|
|
|
|
} else {
|
|
|
|
res = gst_pad_stop_task (sinkpad);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
res = FALSE;
|
|
|
|
break;
|
2005-07-20 11:26:05 +00:00
|
|
|
}
|
2011-11-21 12:37:01 +00:00
|
|
|
return res;
|
|
|
|
}
|
2005-07-20 11:26:05 +00:00
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_wavparse_change_state (GstElement * element, GstStateChange transition)
|
2003-06-13 22:11:56 +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
|
|
|
GstStateChangeReturn ret;
|
2004-05-08 00:33:39 +00:00
|
|
|
GstWavParse *wav = GST_WAVPARSE (element);
|
2003-06-13 22:11:56 +00:00
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2003-06-13 22:11:56 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
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
|
|
|
gst_wavparse_reset (wav);
|
2003-06-13 22:11:56 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2003-06-13 22:11:56 +00:00
|
|
|
break;
|
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
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
2004-05-08 00:33:39 +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
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2003-06-13 22:11:56 +00:00
|
|
|
break;
|
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
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2006-03-13 18:28:18 +00:00
|
|
|
gst_wavparse_reset (wav);
|
gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(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_add_src_pad),
(gst_wavparse_stream_data), (gst_wavparse_loop),
(gst_wavparse_srcpad_event), (gst_wavparse_sink_activate),
(gst_wavparse_sink_activate_pull), (gst_wavparse_change_state),
(plugin_init):
* gst/wavparse/gstwavparse.h:
reverted patch #337625 for the price of 1 hour sleep
2006-04-26 21:29:45 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2003-06-13 22:11:56 +00:00
|
|
|
break;
|
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
|
|
|
default:
|
|
|
|
break;
|
2003-06-13 22:11:56 +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
|
|
|
return ret;
|
2003-06-13 22:11:56 +00:00
|
|
|
}
|
|
|
|
|
2011-12-12 16:49:19 +00:00
|
|
|
static void
|
|
|
|
gst_wavparse_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstWavParse *self;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_WAVPARSE (object));
|
|
|
|
self = GST_WAVPARSE (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_IGNORE_LENGTH:
|
|
|
|
self->ignore_length = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_wavparse_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstWavParse *self;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_WAVPARSE (object));
|
|
|
|
self = GST_WAVPARSE (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_IGNORE_LENGTH:
|
|
|
|
g_value_set_boolean (value, self->ignore_length);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-22 23:27:31 +00:00
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2001-12-22 23:27:31 +00:00
|
|
|
{
|
2005-07-20 11:26:05 +00:00
|
|
|
gst_riff_init ();
|
2003-08-13 04:48:51 +00:00
|
|
|
|
2004-07-15 23:56:05 +00:00
|
|
|
return gst_element_register (plugin, "wavparse", GST_RANK_PRIMARY,
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_TYPE_WAVPARSE);
|
2001-12-22 23:27:31 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
2012-04-05 15:36:38 +00:00
|
|
|
wavparse,
|
2004-03-14 22:34:33 +00:00
|
|
|
"Parse a .wav file into raw audio",
|
2005-11-14 02:13:35 +00:00
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|