2003-11-24 04:08:48 +00:00
|
|
|
/* GStreamer
|
2005-03-31 09:43:49 +00:00
|
|
|
* Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
|
2003-11-24 04:08:48 +00:00
|
|
|
*
|
2004-01-23 13:22:17 +00:00
|
|
|
* gstoggdemux.c: ogg stream demuxer
|
2003-11-24 04:08:48 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <ogg/ogg.h>
|
2004-03-14 22:34:34 +00:00
|
|
|
#include <string.h>
|
2005-10-23 09:57:59 +00:00
|
|
|
#include <gst/gst-i18n-plugin.h>
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2006-05-25 09:32:31 +00:00
|
|
|
#include <gst/base/gsttypefindhelper.h>
|
|
|
|
|
2006-04-28 19:46:37 +00:00
|
|
|
static const GstElementDetails gst_ogg_demux_details =
|
2006-03-29 14:00:08 +00:00
|
|
|
GST_ELEMENT_DETAILS ("Ogg demuxer",
|
2006-03-24 10:42:11 +00:00
|
|
|
"Codec/Demuxer",
|
|
|
|
"demux ogg streams (info about ogg: http://xiph.org)",
|
|
|
|
"Wim Taymand <wim@fluendo.com>");
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
#define CHUNKSIZE (8500) /* this is out of vorbisfile */
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
#define SKELETON_FISHEAD_SIZE 64
|
|
|
|
#define SKELETON_FISBONE_MIN_SIZE 52
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
OV_EREAD = -1,
|
|
|
|
OV_EFAULT = -2,
|
|
|
|
OV_FALSE = -3,
|
|
|
|
OV_EOF = -4,
|
|
|
|
};
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_ogg_demux_debug);
|
2004-07-02 03:41:22 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_ogg_demux_setup_debug);
|
2003-11-24 04:08:48 +00:00
|
|
|
#define GST_CAT_DEFAULT gst_ogg_demux_debug
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
#define GST_TYPE_OGG_PAD (gst_ogg_pad_get_type())
|
|
|
|
#define GST_OGG_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OGG_PAD, GstOggPad))
|
|
|
|
#define GST_OGG_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OGG_PAD, GstOggPad))
|
|
|
|
#define GST_IS_OGG_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OGG_PAD))
|
|
|
|
#define GST_IS_OGG_PAD_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OGG_PAD))
|
|
|
|
|
|
|
|
typedef struct _GstOggPad GstOggPad;
|
|
|
|
typedef struct _GstOggPadClass GstOggPadClass;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
#define GST_TYPE_OGG_DEMUX (gst_ogg_demux_get_type())
|
2003-11-24 04:08:48 +00:00
|
|
|
#define GST_OGG_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OGG_DEMUX, GstOggDemux))
|
|
|
|
#define GST_OGG_DEMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OGG_DEMUX, GstOggDemux))
|
|
|
|
#define GST_IS_OGG_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OGG_DEMUX))
|
|
|
|
#define GST_IS_OGG_DEMUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OGG_DEMUX))
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static GType gst_ogg_demux_get_type (void);
|
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
typedef struct _GstOggDemux GstOggDemux;
|
|
|
|
typedef struct _GstOggDemuxClass GstOggDemuxClass;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* all information needed for one ogg chain (relevant for chained bitstreams) */
|
|
|
|
typedef struct _GstOggChain
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggDemux *ogg;
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 offset; /* starting offset of chain */
|
|
|
|
gint64 end_offset; /* end offset of chain */
|
|
|
|
gint64 bytes; /* number of bytes */
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean have_bos;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GArray *streams;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstClockTime total_time; /* the total time of this chain, this is the MAX of
|
|
|
|
the totals of all streams */
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GstClockTime begin_time; /* when this chain starts in the stream */
|
|
|
|
|
|
|
|
GstClockTime segment_start; /* the timestamp of the first sample, this is the MIN of
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
the start times of all streams. */
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GstClockTime segment_stop; /* the timestamp of the last page, this is the MAX of the
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
streams. */
|
2005-03-31 09:43:49 +00:00
|
|
|
} GstOggChain;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* different modes for the pad */
|
2004-03-14 22:34:34 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_OGG_PAD_MODE_INIT, /* we are feeding our internal decoder to get info */
|
|
|
|
GST_OGG_PAD_MODE_STREAMING, /* we are streaming buffers to the outside */
|
|
|
|
} GstOggPadMode;
|
2004-01-31 17:19:21 +00:00
|
|
|
|
2005-06-08 22:18:05 +00:00
|
|
|
#define PARENT GstPad
|
|
|
|
#define PARENTCLASS GstPadClass
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* all information needed for one ogg stream */
|
|
|
|
struct _GstOggPad
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
PARENT pad; /* subclass GstPad */
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gboolean have_type;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPadMode mode;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstPad *elem_pad; /* sinkpad of internal element */
|
|
|
|
GstElement *element; /* internal element */
|
|
|
|
GstPad *elem_out; /* our sinkpad to receive buffers form the internal element */
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggChain *chain; /* the chain we are part of */
|
|
|
|
GstOggDemux *ogg; /* the ogg demuxer we are part of */
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GList *headers;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
gboolean is_skeleton;
|
|
|
|
gboolean have_fisbone;
|
|
|
|
gint64 granulerate_n;
|
|
|
|
gint64 granulerate_d;
|
|
|
|
guint32 preroll;
|
|
|
|
guint granuleshift;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gint serialno;
|
|
|
|
gint64 packetno;
|
|
|
|
gint64 current_granule;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstClockTime start_time; /* the timestamp of the first sample */
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 first_granule; /* the granulepos of first page == first sample in next page */
|
|
|
|
GstClockTime first_time; /* the timestamp of the second page */
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg_stream_state stream;
|
2005-12-07 11:34:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
gboolean discont;
|
|
|
|
|
2005-12-07 11:34:37 +00:00
|
|
|
gboolean dynamic; /* True if the internal element had dynamic pads */
|
|
|
|
guint padaddedid; /* The signal id for element::pad-added */
|
2003-11-24 04:08:48 +00:00
|
|
|
};
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
struct _GstOggPadClass
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
PARENTCLASS parent_class;
|
2003-11-24 04:08:48 +00:00
|
|
|
};
|
|
|
|
|
2005-12-06 19:42:02 +00:00
|
|
|
#define GST_CHAIN_LOCK(ogg) g_mutex_lock((ogg)->chain_lock)
|
|
|
|
#define GST_CHAIN_UNLOCK(ogg) g_mutex_unlock((ogg)->chain_lock)
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
struct _GstOggDemux
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstElement element;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstPad *sinkpad;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 length;
|
|
|
|
gint64 offset;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean seekable;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gboolean running;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean need_chains;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* state */
|
|
|
|
GMutex *chain_lock; /* we need the lock to protect the chains */
|
|
|
|
GArray *chains; /* list of chains we know */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
GstClockTime total_time;
|
2006-04-10 19:13:30 +00:00
|
|
|
GstFlowReturn chain_error; /* error we received while finding chains */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggChain *current_chain;
|
|
|
|
GstOggChain *building_chain;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* playback start/stop positions */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
GstSegment segment;
|
|
|
|
gboolean segment_running;
|
|
|
|
|
|
|
|
GstEvent *event;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gint64 current_granule;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
/* annodex stuff */
|
|
|
|
gboolean have_fishead;
|
|
|
|
gint64 basetime;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* ogg stuff */
|
|
|
|
ogg_sync_state sync;
|
|
|
|
};
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
struct _GstOggDemuxClass
|
|
|
|
{
|
|
|
|
GstElementClass parent_class;
|
|
|
|
};
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/: Don't crap out when seeking back to position 0.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_sink_activate):
* ext/vorbis/vorbisdec.c: (vorbis_dec_convert),
(vorbis_dec_src_query), (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_handle_comment_packet),
(vorbis_handle_type_packet), (vorbis_handle_header_packet),
(copy_samples), (vorbis_handle_data_packet), (vorbis_dec_chain):
Don't crap out when seeking back to position 0.
2005-04-28 17:13:47 +00:00
|
|
|
static GstStaticPadTemplate internaltemplate =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("internal",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
static gboolean gst_ogg_demux_collect_chain_info (GstOggDemux * ogg,
|
|
|
|
GstOggChain * chain);
|
|
|
|
static gboolean gst_ogg_demux_activate_chain (GstOggDemux * ogg,
|
|
|
|
GstOggChain * chain, GstEvent * event);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
static gboolean gst_ogg_demux_perform_seek (GstOggDemux * ogg,
|
|
|
|
GstEvent * event);
|
2005-11-15 18:11:17 +00:00
|
|
|
static gboolean gst_ogg_demux_receive_event (GstElement * element,
|
|
|
|
GstEvent * event);
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static void gst_ogg_pad_class_init (GstOggPadClass * klass);
|
|
|
|
static void gst_ogg_pad_init (GstOggPad * pad);
|
|
|
|
static void gst_ogg_pad_dispose (GObject * object);
|
|
|
|
static void gst_ogg_pad_finalize (GObject * object);
|
2005-05-09 10:56:13 +00:00
|
|
|
|
|
|
|
#if 0
|
2005-03-31 09:43:49 +00:00
|
|
|
static const GstFormat *gst_ogg_pad_formats (GstPad * pad);
|
|
|
|
static const GstEventMask *gst_ogg_pad_event_masks (GstPad * pad);
|
2005-05-09 10:56:13 +00:00
|
|
|
#endif
|
2005-03-31 09:43:49 +00:00
|
|
|
static const GstQueryType *gst_ogg_pad_query_types (GstPad * pad);
|
2005-05-09 10:56:13 +00:00
|
|
|
static gboolean gst_ogg_pad_src_query (GstPad * pad, GstQuery * query);
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean gst_ogg_pad_event (GstPad * pad, GstEvent * event);
|
|
|
|
static GstCaps *gst_ogg_pad_getcaps (GstPad * pad);
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
static GstOggPad *gst_ogg_chain_get_stream (GstOggChain * chain,
|
|
|
|
glong serialno);
|
|
|
|
|
|
|
|
static gboolean gst_ogg_pad_query_convert (GstOggPad * pad,
|
|
|
|
GstFormat src_format, gint64 src_val,
|
|
|
|
GstFormat * dest_format, gint64 * dest_val);
|
|
|
|
static GstClockTime gst_annodex_granule_to_time (gint64 granulepos,
|
|
|
|
gint64 granulerate_n, gint64 granulerate_d, guint8 granuleshift);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
static GstPadClass *ogg_pad_parent_class = NULL;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
static GType
|
|
|
|
gst_ogg_pad_get_type (void)
|
|
|
|
{
|
|
|
|
static GType ogg_pad_type = 0;
|
|
|
|
|
|
|
|
if (!ogg_pad_type) {
|
|
|
|
static const GTypeInfo ogg_pad_info = {
|
|
|
|
sizeof (GstOggPadClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_ogg_pad_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstOggPad),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_ogg_pad_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
ogg_pad_type =
|
2005-06-08 22:18:05 +00:00
|
|
|
g_type_register_static (GST_TYPE_PAD, "GstOggPad", &ogg_pad_info, 0);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
return ogg_pad_type;
|
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static void
|
|
|
|
gst_ogg_pad_class_init (GstOggPadClass * klass)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GObjectClass *gobject_class;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2006-04-08 21:02:53 +00:00
|
|
|
ogg_pad_parent_class = g_type_class_peek_parent (klass);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class->dispose = gst_ogg_pad_dispose;
|
|
|
|
gobject_class->finalize = gst_ogg_pad_finalize;
|
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static void
|
|
|
|
gst_ogg_pad_init (GstOggPad * pad)
|
|
|
|
{
|
|
|
|
gst_pad_set_event_function (GST_PAD (pad),
|
|
|
|
GST_DEBUG_FUNCPTR (gst_ogg_pad_event));
|
|
|
|
gst_pad_set_getcaps_function (GST_PAD (pad),
|
|
|
|
GST_DEBUG_FUNCPTR (gst_ogg_pad_getcaps));
|
|
|
|
gst_pad_set_query_type_function (GST_PAD (pad),
|
|
|
|
GST_DEBUG_FUNCPTR (gst_ogg_pad_query_types));
|
|
|
|
gst_pad_set_query_function (GST_PAD (pad),
|
|
|
|
GST_DEBUG_FUNCPTR (gst_ogg_pad_src_query));
|
|
|
|
|
|
|
|
pad->mode = GST_OGG_PAD_MODE_INIT;
|
|
|
|
|
|
|
|
pad->first_granule = -1;
|
|
|
|
pad->current_granule = -1;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
pad->start_time = GST_CLOCK_TIME_NONE;
|
|
|
|
pad->first_time = GST_CLOCK_TIME_NONE;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
pad->have_type = FALSE;
|
2005-03-31 09:43:49 +00:00
|
|
|
pad->headers = NULL;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_dispose (GObject * object)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *pad = GST_OGG_PAD (object);
|
2006-03-21 14:26:01 +00:00
|
|
|
GstPad **elem_pad_p;
|
|
|
|
GstElement **element_p;
|
|
|
|
GstPad **elem_out_p;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-08-26 10:50:56 +00:00
|
|
|
if (pad->element)
|
|
|
|
gst_element_set_state (pad->element, GST_STATE_NULL);
|
|
|
|
|
2006-03-21 14:26:01 +00:00
|
|
|
elem_pad_p = &pad->elem_pad;
|
|
|
|
element_p = &pad->element;
|
|
|
|
elem_out_p = &pad->elem_out;
|
|
|
|
gst_object_replace ((GstObject **) elem_pad_p, NULL);
|
|
|
|
gst_object_replace ((GstObject **) element_p, NULL);
|
|
|
|
gst_object_replace ((GstObject **) elem_out_p, NULL);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
pad->chain = NULL;
|
|
|
|
pad->ogg = NULL;
|
|
|
|
|
Port from GstData to GstMiniObject.
Original commit message from CVS:
Port from GstData to GstMiniObject.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_set_header_on_caps),
(gst_ogg_mux_collected):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_comment_packet),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_set_header_on_caps), (theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_comment_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_set_header_on_caps):
* ext/vorbis/vorbisparse.c: (vorbis_parse_set_header_on_caps):
* gst-libs/gst/audio/gstaudiofilter.c: (gst_audiofilter_chain):
* gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_chain):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_get_buffer):
* gst/playback/gstdecodebin.c: (gst_decode_bin_class_init):
* gst/playback/gstplaybasebin.c: (check_queue), (probe_triggered),
(mute_stream), (silence_stream):
* gst/playback/gstplaybin.c: (gst_play_bin_class_init):
* gst/volume/gstvolume.c: (volume_transform):
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximage_buffer_init), (gst_ximage_buffer_class_init),
(gst_ximage_buffer_get_type), (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_imagepool_clear),
(gst_ximagesink_show_frame), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
2005-05-16 15:35:52 +00:00
|
|
|
g_list_foreach (pad->headers, (GFunc) gst_mini_object_unref, NULL);
|
2005-03-31 09:43:49 +00:00
|
|
|
g_list_free (pad->headers);
|
|
|
|
pad->headers = NULL;
|
|
|
|
|
|
|
|
ogg_stream_reset (&pad->stream);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (ogg_pad_parent_class)->dispose (object);
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_finalize (GObject * object)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *pad = GST_OGG_PAD (object);
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg_stream_clear (&pad->stream);
|
2004-11-01 10:38:30 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
G_OBJECT_CLASS (ogg_pad_parent_class)->finalize (object);
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
2005-05-09 10:56:13 +00:00
|
|
|
#if 0
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
static const GstFormat *
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_formats (GstPad * pad)
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
{
|
|
|
|
static GstFormat src_formats[] = {
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_FORMAT_DEFAULT, /* time */
|
|
|
|
GST_FORMAT_TIME, /* granulepos */
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
0
|
|
|
|
};
|
|
|
|
static GstFormat sink_formats[] = {
|
|
|
|
GST_FORMAT_BYTES,
|
|
|
|
GST_FORMAT_DEFAULT, /* bytes */
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
return (GST_PAD_IS_SRC (pad) ? src_formats : sink_formats);
|
|
|
|
}
|
2005-05-09 10:56:13 +00:00
|
|
|
#endif
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
|
2005-05-09 10:56:13 +00:00
|
|
|
#if 0
|
2004-03-14 22:34:34 +00:00
|
|
|
static const GstEventMask *
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_event_masks (GstPad * pad)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
static const GstEventMask src_event_masks[] = {
|
2004-03-14 22:34:34 +00:00
|
|
|
{GST_EVENT_SEEK, GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH},
|
|
|
|
{0,}
|
2003-11-24 04:08:48 +00:00
|
|
|
};
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return src_event_masks;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2005-05-09 10:56:13 +00:00
|
|
|
#endif
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static const GstQueryType *
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_query_types (GstPad * pad)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
static const GstQueryType query_types[] = {
|
2006-02-01 11:56:11 +00:00
|
|
|
GST_QUERY_DURATION,
|
2003-11-24 04:08:48 +00:00
|
|
|
0
|
|
|
|
};
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return query_types;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstCaps *
|
|
|
|
gst_ogg_pad_getcaps (GstPad * pad)
|
2004-01-29 02:50:20 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
return gst_caps_ref (GST_PAD_CAPS (pad));
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
2005-05-09 10:56:13 +00:00
|
|
|
gst_ogg_pad_src_query (GstPad * pad, GstQuery * query)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean res = TRUE;
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
GstOggDemux *ogg;
|
|
|
|
GstOggPad *cur;
|
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad));
|
2005-03-31 09:43:49 +00:00
|
|
|
cur = GST_OGG_PAD (pad);
|
2004-03-06 11:18:28 +00:00
|
|
|
|
2005-05-09 10:56:13 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
Query API update.
Original commit message from CVS:
* examples/seeking/seek.c: (make_avi_msmpeg4v3_mp3_pipeline),
(query_positions_elems), (query_positions_pads), (update_scale),
(do_seek), (set_update_scale), (message_received), (main):
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_find_chains),
(gst_ogg_demux_loop):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_sink_query):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_sink_event):
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_handle_data_packet):
* gst/adder/gstadder.c: (gst_adder_query):
* gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiotestsrc_src_query):
* gst/playback/test3.c: (update_scale):
* gst/playback/test5.c: (new_pad), (no_more_pads), (start_finding),
(dump_element_stats), (main):
* gst/playback/test6.c: (main):
* gst/sine/gstsinesrc.c: (gst_sinesrc_src_query):
Query API update.
2005-10-19 15:55:33 +00:00
|
|
|
case GST_QUERY_DURATION:
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
|
Query API update.
Original commit message from CVS:
* examples/seeking/seek.c: (make_avi_msmpeg4v3_mp3_pipeline),
(query_positions_elems), (query_positions_pads), (update_scale),
(do_seek), (set_update_scale), (message_received), (main):
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_find_chains),
(gst_ogg_demux_loop):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_sink_query):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_sink_event):
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_handle_data_packet):
* gst/adder/gstadder.c: (gst_adder_query):
* gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiotestsrc_src_query):
* gst/playback/test3.c: (update_scale):
* gst/playback/test5.c: (new_pad), (no_more_pads), (start_finding),
(dump_element_stats), (main):
* gst/playback/test6.c: (main):
* gst/sine/gstsinesrc.c: (gst_sinesrc_src_query):
Query API update.
2005-10-19 15:55:33 +00:00
|
|
|
gst_query_parse_duration (query, &format, NULL);
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
/* can only get position in time */
|
2006-04-10 19:13:30 +00:00
|
|
|
if (format != GST_FORMAT_TIME)
|
|
|
|
goto wrong_format;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
/* can only return the total time position */
|
2006-04-10 19:13:30 +00:00
|
|
|
/* FIXME, return time for this specific stream */
|
Query API update.
Original commit message from CVS:
* examples/seeking/seek.c: (make_avi_msmpeg4v3_mp3_pipeline),
(query_positions_elems), (query_positions_pads), (update_scale),
(do_seek), (set_update_scale), (message_received), (main):
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_find_chains),
(gst_ogg_demux_loop):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_sink_query):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_sink_event):
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_handle_data_packet):
* gst/adder/gstadder.c: (gst_adder_query):
* gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiotestsrc_src_query):
* gst/playback/test3.c: (update_scale):
* gst/playback/test5.c: (new_pad), (no_more_pads), (start_finding),
(dump_element_stats), (main):
* gst/playback/test6.c: (main):
* gst/sine/gstsinesrc.c: (gst_sinesrc_src_query):
Query API update.
2005-10-19 15:55:33 +00:00
|
|
|
gst_query_set_duration (query, GST_FORMAT_TIME, ogg->total_time);
|
2005-03-31 09:43:49 +00:00
|
|
|
break;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
default:
|
2006-02-01 11:56:11 +00:00
|
|
|
res = gst_pad_query_default (pad, query);
|
2003-11-24 04:08:48 +00:00
|
|
|
break;
|
|
|
|
}
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
done:
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_object_unref (ogg);
|
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
return res;
|
2006-04-10 19:13:30 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
wrong_format:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (ogg, "only query duration on TIME is supported");
|
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
2005-11-15 18:11:17 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_demux_receive_event (GstElement * element, GstEvent * event)
|
|
|
|
{
|
|
|
|
gboolean res;
|
|
|
|
GstOggDemux *ogg;
|
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (element);
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
|
|
|
/* can't seek if we are not seekable, FIXME could pass the
|
|
|
|
* seek query upstream after converting it to bytes using
|
|
|
|
* the average bitrate of the stream. */
|
|
|
|
if (!ogg->seekable) {
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "seek on non seekable stream");
|
2005-11-15 18:11:17 +00:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now do the seek */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
res = gst_ogg_demux_perform_seek (ogg, event);
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_event_unref (event);
|
2005-11-15 18:11:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "We only handle seek events here");
|
2005-11-15 18:11:17 +00:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
/* ERRORS */
|
2005-11-15 18:11:17 +00:00
|
|
|
error:
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (ogg, "error handling event");
|
|
|
|
gst_event_unref (event);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-11-15 18:11:17 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
static gboolean
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_event (GstPad * pad, GstEvent * event)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean res;
|
2003-11-24 04:08:48 +00:00
|
|
|
GstOggDemux *ogg;
|
2004-01-29 02:50:20 +00:00
|
|
|
GstOggPad *cur;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad));
|
2005-03-31 09:43:49 +00:00
|
|
|
cur = GST_OGG_PAD (pad);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-24 04:08:48 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* can't seek if we are not seekable, FIXME could pass the
|
|
|
|
* seek query upstream after converting it to bytes using
|
|
|
|
* the average bitrate of the stream. */
|
2005-03-31 09:43:49 +00:00
|
|
|
if (!ogg->seekable) {
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "seek on non seekable stream");
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
goto error;
|
2004-01-30 20:57:41 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* now do the seek */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
res = gst_ogg_demux_perform_seek (ogg, event);
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_event_unref (event);
|
2005-03-31 09:43:49 +00:00
|
|
|
break;
|
2003-11-24 04:08:48 +00:00
|
|
|
default:
|
2005-03-31 09:43:49 +00:00
|
|
|
res = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2006-04-10 19:13:30 +00:00
|
|
|
done:
|
|
|
|
gst_object_unref (ogg);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return res;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
/* ERRORS */
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
error:
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
{
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "error handling event");
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_event_unref (event);
|
2006-04-10 19:13:30 +00:00
|
|
|
res = FALSE;
|
|
|
|
goto done;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
}
|
ext/: More seeking fixes, oggdemux now supports seeking to time and uses the downstream element to convert granulepos...
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
(gst_ogg_demux_get_formats), (gst_ogg_demux_src_query),
(gst_ogg_demux_src_event), (gst_ogg_demux_src_convert),
(gst_ogg_demux_handle_event), (gst_ogg_demux_seek_before),
(_find_chain_get_unknown_part), (_find_streams_check),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/theora/theoradec.c: (theora_get_formats),
(theora_dec_src_convert), (theora_dec_sink_convert),
(theora_dec_src_query), (theora_dec_src_event), (theora_dec_event),
(theora_dec_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_get_formats),
(vorbis_dec_convert), (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_event):
More seeking fixes, oggdemux now supports seeking to time and
uses the downstream element to convert granulepos to time.
Seeking in theora-only ogg files now works.
2004-07-21 16:48:20 +00:00
|
|
|
}
|
|
|
|
|
2004-01-29 02:50:20 +00:00
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_reset (GstOggPad * pad)
|
2004-01-29 02:50:20 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg_stream_reset (&pad->stream);
|
|
|
|
/* FIXME: need a discont here */
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* the filter function for selecting the elements we can use in
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
* autoplugging */
|
2004-07-02 03:41:22 +00:00
|
|
|
static gboolean
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_factory_filter (GstPluginFeature * feature, GstCaps * caps)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
guint rank;
|
|
|
|
const gchar *klass;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* we only care about element factories */
|
|
|
|
if (!GST_IS_ELEMENT_FACTORY (feature))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
klass = gst_element_factory_get_klass (GST_ELEMENT_FACTORY (feature));
|
|
|
|
/* only demuxers and decoders can play */
|
|
|
|
if (strstr (klass, "Demux") == NULL &&
|
|
|
|
strstr (klass, "Decoder") == NULL && strstr (klass, "Parse") == NULL) {
|
|
|
|
return FALSE;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* only select elements with autoplugging rank */
|
|
|
|
rank = gst_plugin_feature_get_rank (feature);
|
|
|
|
if (rank < GST_RANK_MARGINAL)
|
|
|
|
return FALSE;
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_DEBUG ("checking factory %s", GST_PLUGIN_FEATURE_NAME (feature));
|
|
|
|
/* now see if it is compatible with the caps */
|
|
|
|
{
|
|
|
|
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
|
|
|
|
const GList *templates;
|
|
|
|
GList *walk;
|
|
|
|
|
|
|
|
/* get the templates from the element factory */
|
2005-04-12 15:00:57 +00:00
|
|
|
templates = gst_element_factory_get_static_pad_templates (factory);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
for (walk = (GList *) templates; walk; walk = g_list_next (walk)) {
|
2005-04-12 15:00:57 +00:00
|
|
|
GstStaticPadTemplate *templ = walk->data;
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* we only care about the sink templates */
|
|
|
|
if (templ->direction == GST_PAD_SINK) {
|
|
|
|
GstCaps *intersect;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GstCaps *scaps;
|
|
|
|
gboolean empty;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* try to intersect the caps with the caps of the template */
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
scaps = gst_static_caps_get (&templ->static_caps);
|
|
|
|
intersect = gst_caps_intersect (caps, scaps);
|
|
|
|
gst_caps_unref (scaps);
|
|
|
|
|
|
|
|
empty = gst_caps_is_empty (intersect);
|
|
|
|
gst_caps_unref (intersect);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
/* check if the intersection is empty */
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
if (!empty) {
|
2005-03-31 09:43:49 +00:00
|
|
|
/* non empty intersection, we can use this element */
|
|
|
|
goto found;
|
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
found:
|
|
|
|
return TRUE;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* function used to sort element features */
|
|
|
|
static gint
|
|
|
|
compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2)
|
2004-01-29 02:50:20 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
gint diff;
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1);
|
|
|
|
if (diff != 0)
|
|
|
|
return diff;
|
|
|
|
return strcmp (gst_plugin_feature_get_name (f2),
|
|
|
|
gst_plugin_feature_get_name (f1));
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
/* called when the skeleton fishead is found. Caller ensures the packet is
|
|
|
|
* precisely the correct size; we don't re-check this here. */
|
|
|
|
static void
|
|
|
|
gst_ogg_pad_parse_skeleton_fishead (GstOggPad * pad, ogg_packet * packet)
|
|
|
|
{
|
|
|
|
GstOggDemux *ogg = pad->ogg;
|
|
|
|
guint8 *data = packet->packet;
|
|
|
|
guint16 major, minor;
|
|
|
|
gint64 prestime_n, prestime_d;
|
|
|
|
gint64 basetime_n, basetime_d;
|
|
|
|
|
|
|
|
/* skip "fishead\0" */
|
|
|
|
data += 8;
|
|
|
|
major = GST_READ_UINT16_LE (data);
|
|
|
|
data += 2;
|
|
|
|
minor = GST_READ_UINT16_LE (data);
|
|
|
|
data += 2;
|
|
|
|
prestime_n = (gint64) GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
prestime_d = (gint64) GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
basetime_n = (gint64) GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
basetime_d = (gint64) GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
|
|
|
|
ogg->basetime = gst_util_uint64_scale (GST_SECOND, basetime_n, basetime_d);
|
|
|
|
ogg->have_fishead = TRUE;
|
|
|
|
pad->is_skeleton = TRUE;
|
|
|
|
pad->start_time = GST_CLOCK_TIME_NONE;
|
|
|
|
pad->first_granule = -1;
|
|
|
|
pad->first_time = GST_CLOCK_TIME_NONE;
|
|
|
|
GST_INFO_OBJECT (ogg, "skeleton fishead parsed (basetime: %"
|
|
|
|
GST_TIME_FORMAT ")", GST_TIME_ARGS (ogg->basetime));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* function called when a skeleton fisbone is found. Caller ensures that
|
|
|
|
* the packet length is sufficient */
|
|
|
|
static void
|
|
|
|
gst_ogg_pad_parse_skeleton_fisbone (GstOggPad * pad, ogg_packet * packet)
|
|
|
|
{
|
|
|
|
GstOggPad *fisbone_pad;
|
|
|
|
gint64 start_granule;
|
|
|
|
guint32 serialno;
|
|
|
|
guint8 *data = packet->packet;
|
|
|
|
|
|
|
|
/* skip "fisbone\0" */
|
|
|
|
data += 8;
|
|
|
|
/* skip headers offset */
|
|
|
|
data += 4;
|
|
|
|
serialno = GST_READ_UINT32_LE (data);
|
|
|
|
|
|
|
|
fisbone_pad = gst_ogg_chain_get_stream (pad->chain, serialno);
|
|
|
|
if (fisbone_pad) {
|
|
|
|
if (fisbone_pad->have_fisbone)
|
|
|
|
/* already parsed */
|
|
|
|
return;
|
|
|
|
|
|
|
|
fisbone_pad->have_fisbone = TRUE;
|
|
|
|
|
|
|
|
data += 4;
|
|
|
|
/* skip number of headers */
|
|
|
|
data += 4;
|
|
|
|
fisbone_pad->granulerate_n = GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
fisbone_pad->granulerate_d = GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
start_granule = GST_READ_UINT64_LE (data);
|
|
|
|
data += 8;
|
|
|
|
fisbone_pad->preroll = GST_READ_UINT32_LE (data);
|
|
|
|
data += 4;
|
|
|
|
fisbone_pad->granuleshift = GST_READ_UINT8 (data);
|
|
|
|
data += 1;
|
|
|
|
/* padding */
|
|
|
|
data += 3;
|
|
|
|
|
|
|
|
fisbone_pad->start_time = gst_annodex_granule_to_time (start_granule,
|
|
|
|
fisbone_pad->granulerate_n, fisbone_pad->granulerate_d,
|
|
|
|
fisbone_pad->granuleshift);
|
|
|
|
|
|
|
|
GST_INFO_OBJECT (pad->ogg, "skeleton fisbone parsed "
|
|
|
|
"(serialno: %" G_GUINT32_FORMAT " start time: %" GST_TIME_FORMAT
|
|
|
|
" granulerate_n: %" G_GINT64_FORMAT " granulerate_d: %" G_GINT64_FORMAT
|
|
|
|
" preroll: %" G_GUINT32_FORMAT " granuleshift: %d)",
|
|
|
|
serialno, GST_TIME_ARGS (fisbone_pad->start_time),
|
|
|
|
fisbone_pad->granulerate_n, fisbone_pad->granulerate_d,
|
|
|
|
fisbone_pad->preroll, fisbone_pad->granuleshift);
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (pad->ogg,
|
|
|
|
"found skeleton fisbone for an unknown stream %" G_GUINT32_FORMAT,
|
|
|
|
serialno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* function called to convert a granulepos to a timestamp */
|
|
|
|
static gboolean
|
|
|
|
gst_ogg_pad_query_convert (GstOggPad * pad, GstFormat src_format,
|
|
|
|
gint64 src_val, GstFormat * dest_format, gint64 * dest_val)
|
|
|
|
{
|
|
|
|
gboolean res;
|
|
|
|
|
|
|
|
if (src_val == -1) {
|
|
|
|
*dest_val = -1;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pad->have_fisbone && pad->elem_pad == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
switch (src_format) {
|
|
|
|
case GST_FORMAT_DEFAULT:
|
|
|
|
if (pad->have_fisbone && *dest_format == GST_FORMAT_TIME) {
|
|
|
|
*dest_val = gst_annodex_granule_to_time (src_val,
|
|
|
|
pad->granulerate_n, pad->granulerate_d, pad->granuleshift);
|
|
|
|
|
|
|
|
res = TRUE;
|
|
|
|
} else {
|
|
|
|
if (pad->elem_pad == NULL)
|
|
|
|
res = FALSE;
|
|
|
|
else
|
|
|
|
res = gst_pad_query_convert (pad->elem_pad, src_format, src_val,
|
|
|
|
dest_format, dest_val);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (pad->elem_pad == NULL)
|
|
|
|
res = FALSE;
|
|
|
|
else
|
|
|
|
res = gst_pad_query_convert (pad->elem_pad, src_format, src_val,
|
|
|
|
dest_format, dest_val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
/* function called by the internal decoder elements when it outputs
|
|
|
|
* a buffer. We use it to get the first timestamp of the stream
|
|
|
|
*/
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_pad_internal_chain (GstPad * pad, GstBuffer * buffer)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *oggpad;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
GstOggDemux *ogg;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstClockTime timestamp;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
oggpad = gst_pad_get_element_private (pad);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
ogg = GST_OGG_DEMUX (oggpad->ogg);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_DEBUG_OBJECT (oggpad, "received buffer from internal pad, TS=%"
|
|
|
|
GST_TIME_FORMAT "=%" G_GINT64_FORMAT, GST_TIME_ARGS (timestamp),
|
2005-03-31 09:43:49 +00:00
|
|
|
timestamp);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
if (oggpad->start_time == GST_CLOCK_TIME_NONE) {
|
2005-03-31 09:43:49 +00:00
|
|
|
oggpad->start_time = timestamp;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return GST_FLOW_OK;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
2005-12-07 11:34:37 +00:00
|
|
|
static void
|
|
|
|
internal_element_pad_added_cb (GstElement * element, GstPad * pad,
|
|
|
|
GstOggPad * oggpad)
|
|
|
|
{
|
|
|
|
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC) {
|
|
|
|
if (!(gst_pad_link (pad, oggpad->elem_out) == GST_PAD_LINK_OK)) {
|
|
|
|
GST_ERROR ("Really couldn't find a valid pad");
|
|
|
|
}
|
|
|
|
oggpad->dynamic = FALSE;
|
|
|
|
g_signal_handler_disconnect (element, oggpad->padaddedid);
|
|
|
|
oggpad->padaddedid = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* runs typefind on the packet, which is assumed to be the first
|
|
|
|
* packet in the stream.
|
|
|
|
*
|
|
|
|
* Based on the type returned from the typefind function, an element
|
|
|
|
* is created to help in conversion between granulepos and timestamps
|
|
|
|
* so that we can do decent seeking.
|
|
|
|
*/
|
|
|
|
static gboolean
|
|
|
|
gst_ogg_pad_typefind (GstOggPad * pad, ogg_packet * packet)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2006-05-25 09:32:31 +00:00
|
|
|
GstBuffer *buf;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
GstElement *element = NULL;
|
2006-02-03 17:45:44 +00:00
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggDemux *ogg = pad->ogg;
|
2006-02-03 17:45:44 +00:00
|
|
|
#endif
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (GST_PAD_CAPS (pad) != NULL)
|
|
|
|
return TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-05-25 09:32:31 +00:00
|
|
|
/* The ogg spec defines that the first packet of an ogg stream must identify
|
|
|
|
* the stream. Therefore ogg can use a simplified approach to typefinding
|
|
|
|
* and only needs to check the first packet */
|
|
|
|
buf = gst_buffer_new ();
|
|
|
|
GST_BUFFER_DATA (buf) = packet->packet;
|
|
|
|
GST_BUFFER_SIZE (buf) = packet->bytes;
|
|
|
|
GST_BUFFER_OFFSET (buf) = 0;
|
|
|
|
|
|
|
|
caps = gst_type_find_helper_for_buffer (GST_OBJECT (pad), buf, NULL);
|
|
|
|
gst_buffer_unref (buf);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (caps == NULL) {
|
|
|
|
GST_WARNING_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"couldn't find caps for stream with serial %08x", pad->serialno);
|
2005-03-31 09:43:49 +00:00
|
|
|
caps = gst_caps_new_simple ("application/octet-stream", NULL);
|
|
|
|
} else {
|
|
|
|
/* ogg requires you to use a decoder element to define the
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
* meaning of granulepos etc so we make one. We also do this if
|
|
|
|
* we are in the streaming mode to calculate the first timestamp. */
|
|
|
|
GList *factories;
|
|
|
|
|
2006-05-25 09:32:31 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "found caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* first filter out the interesting element factories */
|
2005-09-15 06:59:36 +00:00
|
|
|
factories = gst_default_registry_feature_filter (
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
(GstPluginFeatureFilter) gst_ogg_demux_factory_filter, FALSE, caps);
|
|
|
|
|
|
|
|
/* sort them according to their ranks */
|
|
|
|
factories = g_list_sort (factories, (GCompareFunc) compare_ranks);
|
|
|
|
|
|
|
|
/* then pick the first factory to create an element */
|
|
|
|
if (factories) {
|
|
|
|
element =
|
|
|
|
gst_element_factory_create (GST_ELEMENT_FACTORY (factories->data),
|
|
|
|
NULL);
|
|
|
|
if (element) {
|
2005-11-15 19:34:39 +00:00
|
|
|
GstPadTemplate *template;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* this is ours */
|
|
|
|
gst_object_ref (element);
|
|
|
|
gst_object_sink (GST_OBJECT (element));
|
|
|
|
|
|
|
|
/* FIXME, it might not be named "sink" */
|
|
|
|
pad->elem_pad = gst_element_get_pad (element, "sink");
|
|
|
|
gst_element_set_state (element, GST_STATE_PAUSED);
|
2005-11-15 19:34:39 +00:00
|
|
|
template = gst_static_pad_template_get (&internaltemplate);
|
|
|
|
pad->elem_out = gst_pad_new_from_template (template, "internal");
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gst_pad_set_chain_function (pad->elem_out, gst_ogg_pad_internal_chain);
|
|
|
|
gst_pad_set_element_private (pad->elem_out, pad);
|
|
|
|
gst_pad_set_active (pad->elem_out, TRUE);
|
2005-11-30 13:31:15 +00:00
|
|
|
gst_object_unref (template);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
/* and this pad may not be named src.. */
|
2005-12-07 11:34:37 +00:00
|
|
|
/* And it might also not exist at this time... */
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
{
|
|
|
|
GstPad *p;
|
|
|
|
|
|
|
|
p = gst_element_get_pad (element, "src");
|
2005-12-07 11:34:37 +00:00
|
|
|
if (p) {
|
|
|
|
gst_pad_link (p, pad->elem_out);
|
|
|
|
gst_object_unref (p);
|
|
|
|
} else {
|
|
|
|
pad->dynamic = TRUE;
|
|
|
|
pad->padaddedid = g_signal_connect (G_OBJECT (element),
|
|
|
|
"pad-added", G_CALLBACK (internal_element_pad_added_cb), pad);
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
g_list_free (factories);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
pad->element = element;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_pad_set_caps (GST_PAD (pad), caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
|
|
|
|
return TRUE;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* send packet to internal element */
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_demux_chain_elem_pad (GstOggPad * pad, ogg_packet * packet)
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
GstFlowReturn ret;
|
2006-02-03 17:45:44 +00:00
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GstOggDemux *ogg = pad->ogg;
|
2006-02-03 17:45:44 +00:00
|
|
|
#endif
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
/* initialize our internal decoder with packets */
|
|
|
|
if (!pad->elem_pad)
|
|
|
|
goto no_decoder;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "%p init decoder serial %08x", pad, pad->serialno);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
buf = gst_buffer_new_and_alloc (packet->bytes);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), packet->packet, packet->bytes);
|
|
|
|
gst_buffer_set_caps (buf, GST_PAD_CAPS (pad));
|
|
|
|
GST_BUFFER_OFFSET (buf) = -1;
|
|
|
|
GST_BUFFER_OFFSET_END (buf) = packet->granulepos;
|
|
|
|
|
|
|
|
ret = gst_pad_chain (pad->elem_pad, buf);
|
|
|
|
if (GST_FLOW_IS_FATAL (ret))
|
|
|
|
goto decoder_error;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
no_decoder:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"pad %08x does not have elem_pad, no decoder ?", pad);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
decoder_error:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg, "internal decoder error");
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* queue data */
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_demux_queue_data (GstOggPad * pad, ogg_packet * packet)
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
2006-02-03 17:45:44 +00:00
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GstOggDemux *ogg = pad->ogg;
|
2006-02-03 17:45:44 +00:00
|
|
|
#endif
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "%p queueing data serial %08x", pad, pad->serialno);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
buf = gst_buffer_new_and_alloc (packet->bytes);
|
|
|
|
memcpy (buf->data, packet->packet, packet->bytes);
|
|
|
|
GST_BUFFER_OFFSET (buf) = -1;
|
|
|
|
GST_BUFFER_OFFSET_END (buf) = packet->granulepos;
|
|
|
|
pad->headers = g_list_append (pad->headers, buf);
|
|
|
|
|
|
|
|
/* we are ok now */
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* send packet to internal element */
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
GstOggDemux *ogg = pad->ogg;
|
2006-04-11 14:42:33 +00:00
|
|
|
GstFormat format;
|
|
|
|
gint64 current_time;
|
|
|
|
GstOggChain *chain;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"%p streaming to peer serial %08x", pad, pad->serialno);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2005-12-05 13:02:12 +00:00
|
|
|
ret =
|
|
|
|
gst_pad_alloc_buffer_and_set_caps (GST_PAD (pad), GST_BUFFER_OFFSET_NONE,
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
packet->bytes, GST_PAD_CAPS (pad), &buf);
|
2006-04-11 14:42:33 +00:00
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
goto no_buffer;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
/* copy packet in buffer */
|
|
|
|
memcpy (buf->data, packet->packet, packet->bytes);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
GST_BUFFER_OFFSET (buf) = -1;
|
|
|
|
GST_BUFFER_OFFSET_END (buf) = packet->granulepos;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
/* Mark discont on the buffer */
|
|
|
|
if (pad->discont) {
|
|
|
|
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
|
|
|
pad->discont = FALSE;
|
|
|
|
}
|
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
ret = gst_pad_push (GST_PAD (pad), buf);
|
|
|
|
/* ignore not linked */
|
|
|
|
if (ret == GST_FLOW_NOT_LINKED)
|
|
|
|
ret = GST_FLOW_OK;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
/* we're done with skeleton stuff */
|
|
|
|
if (pad->is_skeleton)
|
|
|
|
goto done;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
/* check if valid granulepos, then we can calculate the current
|
|
|
|
* position */
|
|
|
|
if (packet->granulepos < 0)
|
|
|
|
goto done;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
/* store current granule pos */
|
|
|
|
ogg->current_granule = packet->granulepos;
|
|
|
|
|
|
|
|
/* convert to time */
|
|
|
|
format = GST_FORMAT_TIME;
|
|
|
|
if (!gst_ogg_pad_query_convert (pad,
|
|
|
|
GST_FORMAT_DEFAULT, packet->granulepos, &format,
|
|
|
|
(gint64 *) & current_time))
|
|
|
|
goto convert_failed;
|
|
|
|
|
|
|
|
/* convert to stream time */
|
|
|
|
if ((chain = pad->chain))
|
|
|
|
current_time = current_time - chain->segment_start + chain->begin_time;
|
|
|
|
|
|
|
|
/* and store as the current position */
|
|
|
|
gst_segment_set_last_stop (&ogg->segment, GST_FORMAT_TIME, current_time);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "ogg current time %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (current_time));
|
|
|
|
|
|
|
|
done:
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* special cases */
|
|
|
|
no_buffer:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"%p could not get buffer from peer %08x, %d (%s)", pad,
|
2006-04-11 14:42:33 +00:00
|
|
|
pad->serialno, ret, gst_flow_get_name (ret));
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
if (ret == GST_FLOW_NOT_LINKED)
|
|
|
|
ret = GST_FLOW_OK;
|
2006-04-11 14:42:33 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
convert_failed:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg, "could not convert granulepos to time");
|
|
|
|
return ret;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* submit a packet to the oggpad, this function will run the
|
|
|
|
* typefind code for the pad if this is the first packet for this
|
|
|
|
* stream
|
|
|
|
*/
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 granule;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GstFlowReturn ret;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
GstOggDemux *ogg = pad->ogg;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "%p submit packet serial %08x", pad, pad->serialno);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
if (!pad->have_type) {
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (!ogg->have_fishead && packet->bytes == SKELETON_FISHEAD_SIZE &&
|
|
|
|
!memcmp (packet->packet, "fishead\0", 8)) {
|
|
|
|
gst_ogg_pad_parse_skeleton_fishead (pad, packet);
|
|
|
|
}
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_pad_typefind (pad, packet);
|
|
|
|
pad->have_type = TRUE;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (ogg->have_fishead && packet->bytes >= SKELETON_FISBONE_MIN_SIZE &&
|
|
|
|
!memcmp (packet->packet, "fisbone\0", 8)) {
|
|
|
|
gst_ogg_pad_parse_skeleton_fisbone (pad, packet);
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
granule = packet->granulepos;
|
|
|
|
if (granule != -1) {
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "%p has granulepos %" G_GINT64_FORMAT, pad, granule);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
ogg->current_granule = granule;
|
2005-03-31 09:43:49 +00:00
|
|
|
pad->current_granule = granule;
|
2006-05-15 15:01:08 +00:00
|
|
|
/* granulepos 0 and -1 are considered header packets.
|
|
|
|
* Note that since theora is busted, it can create non-header
|
|
|
|
* packets with 0 granulepos. We will correct for this when our
|
|
|
|
* internal decoder produced a frame and we don't have a
|
|
|
|
* granulepos because in that case the granulpos must have been 0 */
|
2005-03-31 09:43:49 +00:00
|
|
|
if (pad->first_granule == -1 && granule != 0) {
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "%p found first granulepos %" G_GINT64_FORMAT, pad,
|
|
|
|
granule);
|
2005-03-31 09:43:49 +00:00
|
|
|
pad->first_granule = granule;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* no start time known, stream to internal plugin to
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
* get time. always stream to the skeleton decoder */
|
|
|
|
if (pad->start_time == GST_CLOCK_TIME_NONE || pad->is_skeleton) {
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
ret = gst_ogg_demux_chain_elem_pad (pad, packet);
|
|
|
|
}
|
|
|
|
/* we know the start_time of the pad data, see if we
|
|
|
|
* can activate the complete chain if this is a dynamic
|
|
|
|
* chain. */
|
|
|
|
if (pad->start_time != GST_CLOCK_TIME_NONE) {
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
GstOggChain *chain = pad->chain;
|
|
|
|
|
2006-05-15 15:01:08 +00:00
|
|
|
/* correction for busted ogg, if the internal decoder outputed
|
|
|
|
* a timestamp but we did not get a granulepos, it must have
|
|
|
|
* been 0 and the time is therefore also 0 */
|
|
|
|
if (pad->first_time == -1) {
|
|
|
|
GST_DEBUG_OBJECT (ogg, "%p found start time without granulepos", pad);
|
|
|
|
pad->first_granule = 0;
|
|
|
|
pad->first_time = 0;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* check if complete chain has start time */
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
if (chain == ogg->building_chain) {
|
|
|
|
|
|
|
|
/* see if we have enough info to activate the chain */
|
|
|
|
if (gst_ogg_demux_collect_chain_info (ogg, chain)) {
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GstEvent *event;
|
2006-04-26 17:17:39 +00:00
|
|
|
GstClockTime segment_start, segment_stop, segment_time;
|
2005-08-29 14:45:12 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "chain->begin_time: %" GST_TIME_FORMAT,
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_TIME_ARGS (chain->begin_time));
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "chain->segment_start: %" GST_TIME_FORMAT,
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_TIME_ARGS (chain->segment_start));
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "chain->segment_stop: %" GST_TIME_FORMAT,
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_TIME_ARGS (chain->segment_stop));
|
|
|
|
|
2005-08-29 14:45:12 +00:00
|
|
|
if (chain->begin_time != GST_CLOCK_TIME_NONE) {
|
2006-04-26 17:17:39 +00:00
|
|
|
segment_time = chain->begin_time;
|
2005-08-29 14:45:12 +00:00
|
|
|
segment_start = chain->segment_start - chain->begin_time;
|
2005-11-08 12:12:55 +00:00
|
|
|
if (chain->segment_stop != GST_CLOCK_TIME_NONE) {
|
|
|
|
segment_stop = chain->segment_stop - chain->begin_time;
|
|
|
|
} else {
|
|
|
|
segment_stop = GST_CLOCK_TIME_NONE;
|
|
|
|
}
|
2005-08-29 14:45:12 +00:00
|
|
|
} else {
|
|
|
|
segment_start = chain->segment_start;
|
|
|
|
segment_stop = chain->segment_stop;
|
2006-04-26 17:17:39 +00:00
|
|
|
segment_time = 0;
|
2005-08-29 14:45:12 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "segment_start: %" GST_TIME_FORMAT,
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_TIME_ARGS (segment_start));
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "segment_stop: %" GST_TIME_FORMAT,
|
2005-11-08 12:12:55 +00:00
|
|
|
GST_TIME_ARGS (segment_stop));
|
2006-04-26 17:17:39 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "segment_time: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (segment_time));
|
2005-11-08 12:12:55 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
/* create the newsegment event we are going to send out */
|
|
|
|
event = gst_event_new_new_segment (FALSE, ogg->segment.rate,
|
2006-04-26 17:17:39 +00:00
|
|
|
GST_FORMAT_TIME, segment_start, segment_stop, segment_time);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_demux_activate_chain (ogg, chain, event);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
ogg->building_chain = NULL;
|
2005-05-26 12:08:55 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
/* if we are building a chain, store buffer for when we activate
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
* it. This path is taken if we operate in streaming mode. */
|
|
|
|
if (ogg->building_chain) {
|
|
|
|
ret = gst_ogg_demux_queue_data (pad, packet);
|
2005-07-14 18:13:08 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* else we are completely streaming to the peer */
|
|
|
|
else {
|
|
|
|
ret = gst_ogg_demux_chain_peer (pad, packet);
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
return ret;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* submit a page to an oggpad, this function will then submit all
|
|
|
|
* the packets in the page.
|
|
|
|
*/
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_ogg_pad_submit_page (GstOggPad * pad, ogg_page * page)
|
|
|
|
{
|
|
|
|
ogg_packet packet;
|
|
|
|
int ret;
|
|
|
|
gboolean done = FALSE;
|
|
|
|
GstFlowReturn result = GST_FLOW_OK;
|
|
|
|
GstOggDemux *ogg;
|
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (GST_PAD_PARENT (pad));
|
|
|
|
|
2005-07-14 18:13:08 +00:00
|
|
|
if (ogg_stream_pagein (&pad->stream, page) != 0)
|
|
|
|
goto choked;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
while (!done) {
|
|
|
|
ret = ogg_stream_packetout (&pad->stream, &packet);
|
|
|
|
GST_LOG_OBJECT (ogg, "packetout gave %d", ret);
|
|
|
|
switch (ret) {
|
|
|
|
case 0:
|
|
|
|
done = TRUE;
|
|
|
|
break;
|
|
|
|
case -1:
|
|
|
|
/* out of sync, could call gst_ogg_pad_reset() here but ogg can decode
|
|
|
|
* the packet just fine. We should probably send a DISCONT though. */
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
result = gst_ogg_pad_submit_packet (pad, &packet);
|
2005-07-14 18:13:08 +00:00
|
|
|
if (GST_FLOW_IS_FATAL (result))
|
|
|
|
goto could_not_submit;
|
2005-03-31 09:43:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_WARNING_OBJECT (ogg,
|
|
|
|
"invalid return value %d for ogg_stream_packetout, resetting stream",
|
|
|
|
ret);
|
|
|
|
gst_ogg_pad_reset (pad);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
2005-07-14 18:13:08 +00:00
|
|
|
|
|
|
|
choked:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"ogg stream choked on page (serial %08x), resetting stream",
|
2005-07-14 18:13:08 +00:00
|
|
|
pad->serialno);
|
|
|
|
gst_ogg_pad_reset (pad);
|
|
|
|
/* we continue to recover */
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
could_not_submit:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg, "could not submit packet, error: %d", result);
|
|
|
|
gst_ogg_pad_reset (pad);
|
|
|
|
return result;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static GstOggChain *
|
|
|
|
gst_ogg_chain_new (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
GstOggChain *chain = g_new0 (GstOggChain, 1);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg, "creating new chain %p", chain);
|
|
|
|
chain->ogg = ogg;
|
|
|
|
chain->offset = -1;
|
|
|
|
chain->bytes = -1;
|
|
|
|
chain->have_bos = FALSE;
|
|
|
|
chain->streams = g_array_new (FALSE, TRUE, sizeof (GstOggPad *));
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
chain->begin_time = GST_CLOCK_TIME_NONE;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
chain->segment_start = GST_CLOCK_TIME_NONE;
|
2005-11-08 12:12:55 +00:00
|
|
|
chain->segment_stop = GST_CLOCK_TIME_NONE;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
chain->total_time = GST_CLOCK_TIME_NONE;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
return chain;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_ogg_chain_free (GstOggChain * chain)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
2005-06-28 10:16:13 +00:00
|
|
|
gst_object_unref (pad);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
g_array_free (chain->streams, TRUE);
|
2006-04-11 14:42:33 +00:00
|
|
|
g_free (chain);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
static void
|
|
|
|
gst_ogg_chain_mark_discont (GstOggChain * chain)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
|
|
|
pad->discont = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstOggPad *
|
|
|
|
gst_ogg_chain_new_stream (GstOggChain * chain, glong serialno)
|
|
|
|
{
|
|
|
|
GstOggPad *ret;
|
|
|
|
GstTagList *list;
|
|
|
|
gchar *name;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (chain->ogg, "creating new stream %08x in chain %p",
|
2005-03-31 09:43:49 +00:00
|
|
|
serialno, chain);
|
|
|
|
|
|
|
|
ret = g_object_new (GST_TYPE_OGG_PAD, NULL);
|
|
|
|
/* we own this one */
|
2005-06-28 10:16:13 +00:00
|
|
|
gst_object_ref (ret);
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_object_sink (GST_OBJECT (ret));
|
|
|
|
|
|
|
|
list = gst_tag_list_new ();
|
2006-05-30 16:04:14 +00:00
|
|
|
name = g_strdup_printf ("serial_%08lx", serialno);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
GST_PAD_DIRECTION (ret) = GST_PAD_SRC;
|
2005-03-31 09:43:49 +00:00
|
|
|
ret->chain = chain;
|
|
|
|
ret->ogg = chain->ogg;
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
ret->discont = TRUE;
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_object_set_name (GST_OBJECT (ret), name);
|
|
|
|
g_free (name);
|
|
|
|
|
|
|
|
ret->serialno = serialno;
|
|
|
|
if (ogg_stream_init (&ret->stream, serialno) != 0) {
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_ERROR ("Could not initialize ogg_stream struct for serial %08x.",
|
2005-03-31 09:43:49 +00:00
|
|
|
serialno);
|
2005-06-28 10:16:13 +00:00
|
|
|
gst_object_unref (ret);
|
2005-03-31 09:43:49 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_SERIAL, serialno,
|
|
|
|
NULL);
|
2005-08-20 20:40:25 +00:00
|
|
|
/* FIXME: either have it or remove it */
|
2005-03-31 09:43:49 +00:00
|
|
|
//gst_element_found_tags (GST_ELEMENT (ogg), list);
|
|
|
|
gst_tag_list_free (list);
|
|
|
|
|
2005-08-20 20:40:25 +00:00
|
|
|
GST_DEBUG_OBJECT (chain->ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"created new ogg src %p for stream with serial %08x", ret, serialno);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
g_array_append_val (chain->streams, ret);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstOggPad *
|
|
|
|
gst_ogg_chain_get_stream (GstOggChain * chain, glong serialno)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
|
|
|
if (pad->serialno == serialno)
|
|
|
|
return pad;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
return NULL;
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_chain_has_stream (GstOggChain * chain, glong serialno)
|
|
|
|
{
|
|
|
|
return gst_ogg_chain_get_stream (chain, serialno) != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CURRENT_CHAIN(ogg) (&g_array_index ((ogg)->chains, GstOggChain, (ogg)->current_chain))
|
|
|
|
|
|
|
|
/* signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0
|
|
|
|
/* FILL ME */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstStaticPadTemplate ogg_demux_src_template_factory =
|
2006-01-11 18:03:24 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("src_%d",
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_SOMETIMES,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate ogg_demux_sink_template_factory =
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
GST_STATIC_CAPS ("application/ogg; application/x-annodex")
|
2005-03-31 09:43:49 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static void gst_ogg_demux_finalize (GObject * object);
|
|
|
|
|
|
|
|
//static const GstEventMask *gst_ogg_demux_get_event_masks (GstPad * pad);
|
|
|
|
//static const GstQueryType *gst_ogg_demux_get_query_types (GstPad * pad);
|
|
|
|
static GstOggChain *gst_ogg_demux_read_chain (GstOggDemux * ogg);
|
|
|
|
static gint gst_ogg_demux_read_end_chain (GstOggDemux * ogg,
|
|
|
|
GstOggChain * chain);
|
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
static gboolean gst_ogg_demux_sink_event (GstPad * pad, GstEvent * event);
|
2005-03-31 09:43:49 +00:00
|
|
|
static void gst_ogg_demux_loop (GstOggPad * pad);
|
|
|
|
static GstFlowReturn gst_ogg_demux_chain (GstPad * pad, GstBuffer * buffer);
|
2005-06-27 18:41:22 +00:00
|
|
|
static gboolean gst_ogg_demux_sink_activate (GstPad * sinkpad);
|
|
|
|
static gboolean gst_ogg_demux_sink_activate_pull (GstPad * sinkpad,
|
|
|
|
gboolean active);
|
|
|
|
static gboolean gst_ogg_demux_sink_activate_push (GstPad * sinkpad,
|
|
|
|
gboolean active);
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn gst_ogg_demux_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
static void gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
static void gst_ogg_print (GstOggDemux * demux);
|
|
|
|
|
|
|
|
GST_BOILERPLATE (GstOggDemux, gst_ogg_demux, GstElement, GST_TYPE_ELEMENT);
|
|
|
|
|
2004-01-29 02:50:20 +00:00
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_base_init (gpointer g_class)
|
2004-01-29 02:50:20 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &gst_ogg_demux_details);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&ogg_demux_sink_template_factory));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&ogg_demux_src_template_factory));
|
|
|
|
}
|
|
|
|
static void
|
|
|
|
gst_ogg_demux_class_init (GstOggDemuxClass * klass)
|
|
|
|
{
|
|
|
|
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
gstelement_class->change_state = gst_ogg_demux_change_state;
|
2005-11-15 18:11:17 +00:00
|
|
|
gstelement_class->send_event = gst_ogg_demux_receive_event;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
gobject_class->finalize = gst_ogg_demux_finalize;
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
|
2004-07-02 03:41:22 +00:00
|
|
|
static void
|
2005-08-28 17:52:45 +00:00
|
|
|
gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
/* create the sink pad */
|
2005-11-16 18:21:46 +00:00
|
|
|
ogg->sinkpad =
|
|
|
|
gst_pad_new_from_static_template (&ogg_demux_sink_template_factory,
|
|
|
|
"sink");
|
2005-11-15 19:34:39 +00:00
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_pad_set_event_function (ogg->sinkpad, gst_ogg_demux_sink_event);
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_pad_set_chain_function (ogg->sinkpad, gst_ogg_demux_chain);
|
|
|
|
gst_pad_set_activate_function (ogg->sinkpad, gst_ogg_demux_sink_activate);
|
2005-06-27 18:41:22 +00:00
|
|
|
gst_pad_set_activatepull_function (ogg->sinkpad,
|
|
|
|
gst_ogg_demux_sink_activate_pull);
|
|
|
|
gst_pad_set_activatepush_function (ogg->sinkpad,
|
|
|
|
gst_ogg_demux_sink_activate_push);
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (ogg), ogg->sinkpad);
|
|
|
|
|
|
|
|
ogg->chain_lock = g_mutex_new ();
|
|
|
|
ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *));
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_ogg_demux_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstOggDemux *ogg;
|
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (object);
|
|
|
|
|
|
|
|
g_mutex_free (ogg->chain_lock);
|
|
|
|
ogg_sync_clear (&ogg->sync);
|
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_ogg_demux_sink_event (GstPad * pad, GstEvent * event)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
2006-04-10 19:13:30 +00:00
|
|
|
gboolean res;
|
|
|
|
GstOggDemux *ogg;
|
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad));
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:
|
2006-04-10 19:13:30 +00:00
|
|
|
/* FIXME */
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "got a new segment event");
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg_sync_reset (&ogg->sync);
|
|
|
|
gst_event_unref (event);
|
2006-04-10 19:13:30 +00:00
|
|
|
res = TRUE;
|
2005-03-31 09:43:49 +00:00
|
|
|
break;
|
2006-04-10 19:13:30 +00:00
|
|
|
case GST_EVENT_EOS:
|
2005-03-31 09:43:49 +00:00
|
|
|
default:
|
2006-04-10 19:13:30 +00:00
|
|
|
res = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2006-04-10 19:13:30 +00:00
|
|
|
gst_object_unref (ogg);
|
|
|
|
|
|
|
|
return res;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* submit the given buffer to the ogg sync.
|
|
|
|
*
|
|
|
|
* Returns the number of bytes submited.
|
2004-07-02 03:41:22 +00:00
|
|
|
*/
|
2005-03-31 09:43:49 +00:00
|
|
|
static gint
|
|
|
|
gst_ogg_demux_submit_buffer (GstOggDemux * ogg, GstBuffer * buffer)
|
|
|
|
{
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
gint size;
|
2005-03-31 09:43:49 +00:00
|
|
|
guint8 *data;
|
|
|
|
gchar *oggbuffer;
|
|
|
|
|
|
|
|
size = GST_BUFFER_SIZE (buffer);
|
|
|
|
data = GST_BUFFER_DATA (buffer);
|
|
|
|
|
|
|
|
oggbuffer = ogg_sync_buffer (&ogg->sync, size);
|
|
|
|
memcpy (oggbuffer, data, size);
|
|
|
|
ogg_sync_wrote (&ogg->sync, size);
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
gst_buffer_unref (buffer);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* in random access mode this code updates the current read position
|
|
|
|
* and resets the ogg sync buffer so that the next read will happen
|
|
|
|
* from this new location.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
gst_ogg_demux_seek (GstOggDemux * ogg, gint64 offset)
|
|
|
|
{
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "seeking to %" G_GINT64_FORMAT, offset);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
ogg->offset = offset;
|
|
|
|
ogg_sync_reset (&ogg->sync);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* read more data from the current offset and submit to
|
|
|
|
* the ogg sync layer.
|
|
|
|
*
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
* Return number of bytes written or 0 on EOS or -1 on error.
|
2005-03-31 09:43:49 +00:00
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
gst_ogg_demux_get_data (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
gint size;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "get data %" G_GINT64_FORMAT " %" G_GINT64_FORMAT,
|
|
|
|
ogg->offset, ogg->length);
|
2005-03-31 09:43:49 +00:00
|
|
|
if (ogg->offset == ogg->length)
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
goto eos;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
ret = gst_pad_pull_range (ogg->sinkpad, ogg->offset, CHUNKSIZE, &buffer);
|
|
|
|
if (ret != GST_FLOW_OK)
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
goto error;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
size = gst_ogg_demux_submit_buffer (ogg, buffer);
|
|
|
|
|
|
|
|
return size;
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
|
|
|
|
/* ERROR */
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
GST_LOG_OBJECT (ogg, "reached EOS");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
error:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (ogg, "got %d (%s) from pull range", ret,
|
|
|
|
gst_flow_get_name (ret));
|
2006-04-10 19:13:30 +00:00
|
|
|
ogg->chain_error = ret;
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Read the next page from the current offset.
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
* boundary: number of bytes ahead we allow looking for;
|
|
|
|
* -1 if no boundary
|
|
|
|
* returns the offset the next page starts at, or OV_FALSE if we couldn't
|
|
|
|
* find a new page within the boundary
|
2005-03-31 09:43:49 +00:00
|
|
|
*/
|
|
|
|
static gint64
|
|
|
|
gst_ogg_demux_get_next_page (GstOggDemux * ogg, ogg_page * og, gint64 boundary)
|
|
|
|
{
|
|
|
|
gint64 end_offset = 0;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg,
|
|
|
|
"get next page, current offset %" G_GINT64_FORMAT ", bytes boundary %"
|
|
|
|
G_GINT64_FORMAT, ogg->offset, boundary);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
if (boundary > 0)
|
|
|
|
end_offset = ogg->offset + boundary;
|
|
|
|
|
|
|
|
while (TRUE) {
|
|
|
|
glong more;
|
|
|
|
|
|
|
|
if (boundary > 0 && ogg->offset >= end_offset) {
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg,
|
|
|
|
"offset %" G_GINT64_FORMAT " >= end_offset %" G_GINT64_FORMAT,
|
|
|
|
ogg->offset, end_offset);
|
2005-03-31 09:43:49 +00:00
|
|
|
return OV_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
more = ogg_sync_pageseek (&ogg->sync, og);
|
|
|
|
|
|
|
|
if (more < 0) {
|
|
|
|
GST_LOG_OBJECT (ogg, "skipped %ld bytes", more);
|
|
|
|
/* skipped n bytes */
|
|
|
|
ogg->offset -= more;
|
|
|
|
} else if (more == 0) {
|
|
|
|
gint ret;
|
|
|
|
|
|
|
|
/* send more paramedics */
|
|
|
|
if (boundary == 0)
|
|
|
|
return OV_FALSE;
|
|
|
|
|
|
|
|
ret = gst_ogg_demux_get_data (ogg);
|
|
|
|
if (ret == 0)
|
|
|
|
return OV_EOF;
|
|
|
|
if (ret < 0)
|
|
|
|
return OV_EREAD;
|
|
|
|
} else {
|
|
|
|
/* got a page. Return the offset at the page beginning,
|
|
|
|
advance the internal offset past the page end */
|
|
|
|
gint64 ret = ogg->offset;
|
|
|
|
|
|
|
|
ogg->offset += more;
|
|
|
|
/* need to reset as we do not keep track of the bytes we
|
|
|
|
* sent to the sync layer */
|
|
|
|
ogg_sync_reset (&ogg->sync);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"got page at %" G_GINT64_FORMAT ", serial %08x, end at %"
|
|
|
|
G_GINT64_FORMAT ", granule %" G_GINT64_FORMAT, ret,
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg_page_serialno (og), ogg->offset, ogg_page_granulepos (og));
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* from the current offset, find the previous page, seeking backwards
|
|
|
|
* until we find the page. */
|
|
|
|
static gint
|
|
|
|
gst_ogg_demux_get_prev_page (GstOggDemux * ogg, ogg_page * og)
|
|
|
|
{
|
|
|
|
gint64 begin = ogg->offset;
|
|
|
|
gint64 end = begin;
|
|
|
|
gint64 ret;
|
|
|
|
gint64 offset = -1;
|
|
|
|
|
|
|
|
while (offset == -1) {
|
|
|
|
begin -= CHUNKSIZE;
|
|
|
|
if (begin < 0)
|
|
|
|
begin = 0;
|
|
|
|
|
|
|
|
gst_ogg_demux_seek (ogg, begin);
|
|
|
|
|
|
|
|
/* now continue reading until we run out of data, if we find a page
|
|
|
|
* start, we save it. It might not be the final page as there could be
|
|
|
|
* another page after this one. */
|
|
|
|
while (ogg->offset < end) {
|
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, og, end - ogg->offset);
|
|
|
|
if (ret == OV_EREAD)
|
|
|
|
return OV_EREAD;
|
|
|
|
if (ret < 0) {
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
offset = ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we have the offset. Actually snork and hold the page now */
|
|
|
|
gst_ogg_demux_seek (ogg, offset);
|
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, og, CHUNKSIZE);
|
|
|
|
if (ret < 0)
|
|
|
|
/* this shouldn't be possible */
|
|
|
|
return OV_EFAULT;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2004-07-02 03:41:22 +00:00
|
|
|
static gboolean
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_deactivate_current_chain (GstOggDemux * ogg)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
gint i;
|
|
|
|
GstOggChain *chain = ogg->current_chain;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (chain == NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "deactivating chain %p", chain);
|
2005-12-18 15:04:21 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* send EOS on all the pads */
|
2005-03-31 09:43:49 +00:00
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_pad_push_event (GST_PAD_CAST (pad), gst_event_new_eos ());
|
2005-12-18 15:04:21 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg, "removing pad %" GST_PTR_FORMAT, pad);
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
|
|
|
|
/* deactivate first */
|
|
|
|
gst_pad_set_active (GST_PAD_CAST (pad), FALSE);
|
|
|
|
|
|
|
|
gst_element_remove_pad (GST_ELEMENT (ogg), GST_PAD_CAST (pad));
|
2004-07-13 10:38:25 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* if we cannot seek back to the chain, we can destroy the chain
|
|
|
|
* completely */
|
2005-03-31 09:43:49 +00:00
|
|
|
if (!ogg->seekable) {
|
|
|
|
gst_ogg_chain_free (chain);
|
|
|
|
}
|
|
|
|
ogg->current_chain = NULL;
|
2004-07-13 10:38:25 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2004-07-13 10:38:25 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
|
|
|
|
GstEvent * event)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
if (chain == ogg->current_chain) {
|
|
|
|
if (event)
|
|
|
|
gst_event_unref (event);
|
2005-03-31 09:43:49 +00:00
|
|
|
return TRUE;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
gst_ogg_demux_deactivate_current_chain (ogg);
|
|
|
|
|
2006-03-09 17:45:39 +00:00
|
|
|
/* FIXME, should not be called with NULL */
|
|
|
|
if (chain == NULL) {
|
|
|
|
ogg->current_chain = chain;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "activating chain %p", chain);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2005-07-14 18:13:08 +00:00
|
|
|
/* first add the pads */
|
2005-03-31 09:43:49 +00:00
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GstOggPad *pad;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
pad = g_array_index (chain->streams, GstOggPad *, i);
|
2005-12-18 15:04:21 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "adding pad %" GST_PTR_FORMAT, pad);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
/* mark discont */
|
|
|
|
pad->discont = TRUE;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
/* activate first */
|
|
|
|
gst_pad_set_active (GST_PAD_CAST (pad), TRUE);
|
|
|
|
|
|
|
|
gst_element_add_pad (GST_ELEMENT (ogg), GST_PAD_CAST (pad));
|
2005-07-14 18:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gst_element_no_more_pads (GST_ELEMENT (ogg));
|
|
|
|
ogg->current_chain = chain;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
if (event)
|
|
|
|
gst_ogg_demux_send_event (ogg, event);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "starting chain");
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* then send out any queued buffers */
|
2005-07-14 18:13:08 +00:00
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GList *headers;
|
|
|
|
GstOggPad *pad;
|
|
|
|
|
2005-07-14 18:13:08 +00:00
|
|
|
pad = g_array_index (chain->streams, GstOggPad *, i);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
for (headers = pad->headers; headers; headers = g_list_next (headers)) {
|
|
|
|
GstBuffer *buffer = GST_BUFFER (headers->data);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
if (pad->discont) {
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
|
|
|
|
pad->discont = FALSE;
|
|
|
|
}
|
|
|
|
|
2005-07-14 18:13:08 +00:00
|
|
|
/* we don't care about the return value here */
|
|
|
|
gst_pad_push (GST_PAD_CAST (pad), buffer);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2005-07-14 18:13:08 +00:00
|
|
|
/* and free the headers */
|
|
|
|
g_list_free (pad->headers);
|
|
|
|
pad->headers = NULL;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
/*
|
|
|
|
* do seek to time @position, return FALSE or chain and TRUE
|
|
|
|
*/
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_ogg_demux_do_seek (GstOggDemux * ogg, gint64 position, gboolean accurate,
|
|
|
|
GstOggChain ** rchain)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
|
|
|
GstOggChain *chain = NULL;
|
|
|
|
gint64 begin, end;
|
|
|
|
gint64 begintime, endtime;
|
|
|
|
gint64 target;
|
|
|
|
gint64 best;
|
|
|
|
gint64 total;
|
|
|
|
gint64 result = 0;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* first find the chain to search in */
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
total = ogg->total_time;
|
2005-10-18 13:20:29 +00:00
|
|
|
if (ogg->chains->len == 0)
|
|
|
|
goto no_chains;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
for (i = ogg->chains->len - 1; i >= 0; i--) {
|
|
|
|
chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
total -= chain->total_time;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
if (position >= total)
|
2005-03-31 09:43:49 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
begin = chain->offset;
|
|
|
|
end = chain->end_offset;
|
|
|
|
begintime = chain->begin_time;
|
|
|
|
endtime = chain->begin_time + chain->total_time;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
target = position - total + begintime;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
if (accurate) {
|
|
|
|
/* FIXME, seek 4 seconds early to catch keyframes, better implement
|
|
|
|
* keyframe detection. */
|
|
|
|
target = target - (gint64) 4 *GST_SECOND;
|
|
|
|
}
|
|
|
|
target = MAX (target, 0);
|
2005-03-31 09:43:49 +00:00
|
|
|
best = begin;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
"seeking to %" GST_TIME_FORMAT " in chain %p",
|
|
|
|
GST_TIME_ARGS (position), chain);
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg,
|
|
|
|
"chain offset %" G_GINT64_FORMAT ", end offset %" G_GINT64_FORMAT, begin,
|
|
|
|
end);
|
|
|
|
GST_DEBUG_OBJECT (ogg,
|
|
|
|
"chain begin time %" GST_TIME_FORMAT ", end time %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (begintime), GST_TIME_ARGS (endtime));
|
|
|
|
GST_DEBUG_OBJECT (ogg, "target %" GST_TIME_FORMAT, GST_TIME_ARGS (target));
|
|
|
|
|
|
|
|
/* perform the seek */
|
|
|
|
while (begin < end) {
|
|
|
|
gint64 bisect;
|
|
|
|
|
|
|
|
if ((end - begin < CHUNKSIZE) || (endtime == begintime)) {
|
|
|
|
bisect = begin;
|
|
|
|
} else {
|
|
|
|
/* take a (pretty decent) guess, avoiding overflow */
|
|
|
|
gint64 rate = (end - begin) * GST_MSECOND / (endtime - begintime);
|
|
|
|
|
|
|
|
bisect = (target - begintime) / GST_MSECOND * rate + begin - CHUNKSIZE;
|
|
|
|
|
|
|
|
if (bisect <= begin)
|
ext/: Don't crap out when seeking back to position 0.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_sink_activate):
* ext/vorbis/vorbisdec.c: (vorbis_dec_convert),
(vorbis_dec_src_query), (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_handle_comment_packet),
(vorbis_handle_type_packet), (vorbis_handle_header_packet),
(copy_samples), (vorbis_handle_data_packet), (vorbis_dec_chain):
Don't crap out when seeking back to position 0.
2005-04-28 17:13:47 +00:00
|
|
|
bisect = begin;
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "Initial guess: %" G_GINT64_FORMAT, bisect);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
gst_ogg_demux_seek (ogg, bisect);
|
|
|
|
|
|
|
|
while (begin < end) {
|
|
|
|
ogg_page og;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg,
|
|
|
|
"after seek, bisect %" G_GINT64_FORMAT ", begin %" G_GINT64_FORMAT
|
|
|
|
", end %" G_GINT64_FORMAT, bisect, begin, end);
|
|
|
|
|
|
|
|
result = gst_ogg_demux_get_next_page (ogg, &og, end - ogg->offset);
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "looking for next page returned %" G_GINT64_FORMAT,
|
|
|
|
result);
|
2005-03-31 09:43:49 +00:00
|
|
|
if (result == OV_EREAD) {
|
|
|
|
goto seek_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result < 0) {
|
|
|
|
if (bisect <= begin + 1) {
|
|
|
|
end = begin; /* found it */
|
|
|
|
} else {
|
|
|
|
if (bisect == 0)
|
|
|
|
goto seek_error;
|
|
|
|
|
|
|
|
bisect -= CHUNKSIZE;
|
|
|
|
if (bisect <= begin)
|
|
|
|
bisect = begin + 1;
|
|
|
|
|
|
|
|
gst_ogg_demux_seek (ogg, bisect);
|
|
|
|
}
|
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
/* found offset of next ogg page */
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 granulepos;
|
|
|
|
GstClockTime granuletime;
|
2005-05-09 10:56:13 +00:00
|
|
|
GstFormat format;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *pad;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "found next ogg page at %" G_GINT64_FORMAT,
|
|
|
|
result);
|
2005-03-31 09:43:49 +00:00
|
|
|
granulepos = ogg_page_granulepos (&og);
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
if (granulepos == -1) {
|
|
|
|
GST_LOG_OBJECT (ogg, "granulepos of next page is -1");
|
2005-03-31 09:43:49 +00:00
|
|
|
continue;
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
pad = gst_ogg_chain_get_stream (chain, ogg_page_serialno (&og));
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (pad == NULL || pad->is_skeleton)
|
2005-03-31 09:43:49 +00:00
|
|
|
continue;
|
|
|
|
|
2005-05-09 10:56:13 +00:00
|
|
|
format = GST_FORMAT_TIME;
|
2005-10-29 13:39:23 +00:00
|
|
|
if (!gst_ogg_pad_query_convert (pad,
|
2005-05-09 10:56:13 +00:00
|
|
|
GST_FORMAT_DEFAULT, granulepos, &format,
|
|
|
|
(gint64 *) & granuletime)) {
|
2005-11-25 17:15:46 +00:00
|
|
|
GST_WARNING_OBJECT (ogg, "could not convert granulepos to time");
|
2005-05-09 10:56:13 +00:00
|
|
|
granuletime = target;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (granuletime < pad->first_time)
|
|
|
|
continue;
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "granulepos %" G_GINT64_FORMAT "maps to time %"
|
|
|
|
GST_TIME_FORMAT, granulepos, GST_TIME_ARGS (granuletime));
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
granuletime -= pad->first_time;
|
2005-05-09 10:56:13 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg,
|
|
|
|
"found page with granule %" G_GINT64_FORMAT " and time %"
|
|
|
|
GST_TIME_FORMAT, granulepos, GST_TIME_ARGS (granuletime));
|
|
|
|
|
|
|
|
if (granuletime < target) {
|
|
|
|
best = result; /* raw offset of packet with granulepos */
|
|
|
|
begin = ogg->offset; /* raw offset of next page */
|
|
|
|
begintime = granuletime;
|
|
|
|
|
|
|
|
if (target - begintime > GST_SECOND)
|
|
|
|
break;
|
|
|
|
|
|
|
|
bisect = begin; /* *not* begin + 1 */
|
|
|
|
} else {
|
|
|
|
if (bisect <= begin + 1) {
|
|
|
|
end = begin; /* found it */
|
|
|
|
} else {
|
|
|
|
if (end == ogg->offset) { /* we're pretty close - we'd be stuck in */
|
|
|
|
end = result;
|
|
|
|
bisect -= CHUNKSIZE; /* an endless loop otherwise. */
|
|
|
|
if (bisect <= begin)
|
|
|
|
bisect = begin + 1;
|
|
|
|
gst_ogg_demux_seek (ogg, bisect);
|
|
|
|
} else {
|
|
|
|
end = result;
|
|
|
|
endtime = granuletime;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ogg->offset = best;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
*rchain = chain;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
no_chains:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (ogg, "no chains");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
seek_error:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (ogg, "got a seek error");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-10 19:13:30 +00:00
|
|
|
/* does not take ownership of the event */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_demux_perform_seek (GstOggDemux * ogg, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstOggChain *chain = NULL;
|
|
|
|
gboolean res;
|
|
|
|
gboolean flush, accurate;
|
|
|
|
GstFormat format;
|
|
|
|
gdouble rate;
|
|
|
|
GstSeekFlags flags;
|
|
|
|
GstSeekType cur_type, stop_type;
|
|
|
|
gint64 cur, stop;
|
|
|
|
gboolean update;
|
|
|
|
|
|
|
|
if (event) {
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "seek with event");
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_event_parse_seek (event, &rate, &format, &flags,
|
|
|
|
&cur_type, &cur, &stop_type, &stop);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
/* we can only seek on time */
|
|
|
|
if (format != GST_FORMAT_TIME) {
|
|
|
|
GST_DEBUG_OBJECT (ogg, "can only seek on TIME");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
/* cannot yet do backwards playback */
|
|
|
|
if (rate <= 0.0) {
|
|
|
|
GST_DEBUG_OBJECT (ogg, "can only seek with positive rate, not %lf", rate);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "seek without event");
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
flags = 0;
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
rate = 1.0;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ogg, "seek, rate %g", rate);
|
|
|
|
|
|
|
|
flush = flags & GST_SEEK_FLAG_FLUSH;
|
|
|
|
accurate = flags & GST_SEEK_FLAG_ACCURATE;
|
|
|
|
|
|
|
|
/* first step is to unlock the streaming thread if it is
|
|
|
|
* blocked in a chain call, we do this by starting the flush. because
|
|
|
|
* we cannot yet hold any streaming lock, we have to protect the chains
|
|
|
|
* with their own lock. */
|
|
|
|
if (flush) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
gst_pad_push_event (ogg->sinkpad, gst_event_new_flush_start ());
|
|
|
|
|
|
|
|
GST_CHAIN_LOCK (ogg);
|
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
gint j;
|
|
|
|
|
|
|
|
for (j = 0; j < chain->streams->len; j++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, j);
|
|
|
|
|
|
|
|
gst_pad_push_event (GST_PAD (pad), gst_event_new_flush_start ());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GST_CHAIN_UNLOCK (ogg);
|
|
|
|
} else {
|
|
|
|
gst_pad_pause_task (ogg->sinkpad);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now grab the stream lock so that streaming cannot continue, for
|
|
|
|
* non flushing seeks when the element is in PAUSED this could block
|
|
|
|
* forever. */
|
|
|
|
GST_PAD_STREAM_LOCK (ogg->sinkpad);
|
|
|
|
|
|
|
|
if (ogg->segment_running && !flush) {
|
2006-04-26 17:17:39 +00:00
|
|
|
/* create the segment event to close the current segment */
|
|
|
|
if ((chain = ogg->current_chain)) {
|
|
|
|
GstEvent *newseg;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
|
2006-04-26 17:17:39 +00:00
|
|
|
newseg = gst_event_new_new_segment (TRUE, ogg->segment.rate,
|
|
|
|
GST_FORMAT_TIME, ogg->segment.start + chain->segment_start,
|
|
|
|
ogg->segment.last_stop + chain->segment_start, ogg->segment.time);
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
|
2006-04-26 17:17:39 +00:00
|
|
|
/* send segment on old chain */
|
|
|
|
gst_ogg_demux_send_event (ogg, newseg);
|
|
|
|
}
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (event) {
|
|
|
|
gst_segment_set_seek (&ogg->segment, rate, format, flags,
|
|
|
|
cur_type, cur, stop_type, stop, &update);
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "segment positions set to %" GST_TIME_FORMAT "-%"
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
GST_TIME_FORMAT, GST_TIME_ARGS (ogg->segment.start),
|
|
|
|
GST_TIME_ARGS (ogg->segment.stop));
|
|
|
|
|
|
|
|
/* we need to stop flushing on the srcpad as we're going to use it
|
|
|
|
* next. We can do this as we have the STREAM lock now. */
|
|
|
|
gst_pad_push_event (ogg->sinkpad, gst_event_new_flush_stop ());
|
|
|
|
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* reset all ogg streams now, need to do this from within the lock to
|
|
|
|
* make sure the streaming thread is not messing with the stream */
|
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
gint j;
|
|
|
|
|
|
|
|
for (j = 0; j < chain->streams->len; j++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, j);
|
|
|
|
|
|
|
|
ogg_stream_reset (&pad->stream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
res = gst_ogg_demux_do_seek (ogg, ogg->segment.last_stop, accurate, &chain);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* now we have a new position, prepare for streaming again */
|
|
|
|
{
|
|
|
|
GstEvent *event;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gint64 stop;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
/* we have to send the flush to the old chain, not the new one */
|
|
|
|
if (flush)
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
gst_ogg_demux_send_event (ogg, gst_event_new_flush_stop ());
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
if ((stop = ogg->segment.stop) == -1)
|
|
|
|
stop = ogg->segment.duration;
|
|
|
|
|
2006-04-26 17:17:39 +00:00
|
|
|
if (stop != -1)
|
|
|
|
stop += chain->segment_start;
|
|
|
|
|
|
|
|
/* create the segment event we are going to send out */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
event = gst_event_new_new_segment (FALSE, ogg->segment.rate,
|
2006-04-26 17:17:39 +00:00
|
|
|
ogg->segment.format,
|
|
|
|
ogg->segment.last_stop + chain->segment_start, stop, ogg->segment.time);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
if (chain != ogg->current_chain) {
|
2006-04-26 17:17:39 +00:00
|
|
|
/* switch to different chain, send segment on new chain */
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_demux_activate_chain (ogg, chain, event);
|
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: Mark buffers with DISCONT after seek and after activating new chains.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain_peer),
(gst_ogg_chain_mark_discont), (gst_ogg_chain_new_stream),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek):
Mark buffers with DISCONT after seek and after activating new
chains.
* ext/theora/gsttheoradec.h:
* ext/theora/theoradec.c: (gst_theora_dec_reset),
(theora_get_query_types), (theora_dec_sink_event),
(theora_dec_push), (theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Fix frame counter.
Detect and mark DISCONT buffers.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_push), (vorbis_dec_chain),
(vorbis_dec_change_state):
* ext/vorbis/vorbisdec.h:
Use GstSegment.
Detect and mark DISCONT buffers.
Don't crash on 0 sized buffers.
2006-05-03 15:34:48 +00:00
|
|
|
/* mark discont and send segment on current chain */
|
|
|
|
gst_ogg_chain_mark_discont (chain);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_demux_send_event (ogg, event);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
/* notify start of new segment */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
if (ogg->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gst_element_post_message (GST_ELEMENT (ogg),
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_message_new_segment_start (GST_OBJECT (ogg),
|
|
|
|
GST_FORMAT_TIME, ogg->segment.last_stop));
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
|
|
|
|
ogg->segment_running = TRUE;
|
2005-03-31 09:43:49 +00:00
|
|
|
/* restart our task since it might have been stopped when we did the
|
|
|
|
* flush. */
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
gst_pad_start_task (ogg->sinkpad, (GstTaskFunction) gst_ogg_demux_loop,
|
|
|
|
ogg->sinkpad);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* streaming can continue now */
|
2005-11-21 17:29:00 +00:00
|
|
|
GST_PAD_STREAM_UNLOCK (ogg->sinkpad);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
error:
|
2005-10-18 13:20:29 +00:00
|
|
|
{
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "seek failed");
|
2005-10-18 13:20:29 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* finds each bitstream link one at a time using a bisection search
|
|
|
|
* (has to begin by knowing the offset of the lb's initial page).
|
|
|
|
* Recurses for each link so it can alloc the link storage after
|
|
|
|
* finding them all, then unroll and fill the cache at the same time
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
gst_ogg_demux_bisect_forward_serialno (GstOggDemux * ogg,
|
|
|
|
gint64 begin, gint64 searched, gint64 end, GstOggChain * chain, glong m)
|
|
|
|
{
|
|
|
|
gint64 endsearched = end;
|
|
|
|
gint64 next = end;
|
|
|
|
ogg_page og;
|
|
|
|
gint64 ret;
|
|
|
|
GstOggChain *nextchain;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"bisect begin: %" G_GINT64_FORMAT ", searched: %" G_GINT64_FORMAT
|
|
|
|
", end %" G_GINT64_FORMAT ", chain: %p", begin, searched, end, chain);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
/* the below guards against garbage seperating the last and
|
|
|
|
* first pages of two links. */
|
|
|
|
while (searched < endsearched) {
|
|
|
|
gint64 bisect;
|
|
|
|
|
|
|
|
if (endsearched - searched < CHUNKSIZE) {
|
|
|
|
bisect = searched;
|
|
|
|
} else {
|
|
|
|
bisect = (searched + endsearched) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_ogg_demux_seek (ogg, bisect);
|
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, &og, -1);
|
|
|
|
if (ret == OV_EREAD) {
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "OV_EREAD");
|
2005-03-31 09:43:49 +00:00
|
|
|
return OV_EREAD;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret < 0) {
|
|
|
|
endsearched = bisect;
|
|
|
|
} else {
|
|
|
|
glong serial = ogg_page_serialno (&og);
|
|
|
|
|
|
|
|
if (!gst_ogg_chain_has_stream (chain, serial)) {
|
|
|
|
endsearched = bisect;
|
|
|
|
next = ret;
|
|
|
|
} else {
|
|
|
|
searched = ret + og.header_len + og.body_len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "current chain ends at %" G_GINT64_FORMAT, searched);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
chain->end_offset = searched;
|
|
|
|
gst_ogg_demux_read_end_chain (ogg, chain);
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "found begin at %" G_GINT64_FORMAT, next);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
gst_ogg_demux_seek (ogg, next);
|
|
|
|
nextchain = gst_ogg_demux_read_chain (ogg);
|
|
|
|
|
|
|
|
if (searched < end && nextchain != NULL) {
|
|
|
|
ret = gst_ogg_demux_bisect_forward_serialno (ogg, next, ogg->offset,
|
|
|
|
end, nextchain, m + 1);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (ret == OV_EREAD) {
|
|
|
|
GST_LOG_OBJECT (ogg, "OV_READ");
|
|
|
|
return OV_EREAD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_array_insert_val (ogg->chains, 0, chain);
|
|
|
|
|
|
|
|
return 0;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* read a chain from the ogg file. This code will
|
|
|
|
* read all BOS pages and will create and return a GstOggChain
|
|
|
|
* structure with the results.
|
|
|
|
*
|
|
|
|
* This function will also read N pages from each stream in the
|
|
|
|
* chain and submit them to the decoders. When the decoder has
|
|
|
|
* decoded the first buffer, we know the timestamp of the first
|
|
|
|
* page in the chain.
|
|
|
|
*/
|
|
|
|
static GstOggChain *
|
|
|
|
gst_ogg_demux_read_chain (GstOggDemux * ogg)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggChain *chain = NULL;
|
|
|
|
gint64 offset = ogg->offset;
|
|
|
|
ogg_page op;
|
|
|
|
gboolean done;
|
|
|
|
gint i;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "reading chain at %" G_GINT64_FORMAT, offset);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* first read the BOS pages, do typefind on them, create
|
|
|
|
* the decoders, send data to the decoders. */
|
|
|
|
while (TRUE) {
|
2004-07-02 03:41:22 +00:00
|
|
|
GstOggPad *pad;
|
2005-03-31 09:43:49 +00:00
|
|
|
glong serial;
|
|
|
|
gint ret;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, &op, -1);
|
|
|
|
if (ret < 0 || !ogg_page_bos (&op))
|
|
|
|
break;
|
2004-10-18 15:23:41 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (chain == NULL) {
|
|
|
|
chain = gst_ogg_chain_new (ogg);
|
|
|
|
chain->offset = offset;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
2004-10-18 15:23:41 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
serial = ogg_page_serialno (&op);
|
|
|
|
pad = gst_ogg_chain_new_stream (chain, serial);
|
|
|
|
gst_ogg_pad_submit_page (pad, &op);
|
|
|
|
}
|
|
|
|
if (chain == NULL) {
|
|
|
|
GST_WARNING_OBJECT (ogg, "failed to read chain");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
chain->have_bos = TRUE;
|
|
|
|
GST_LOG_OBJECT (ogg, "read bos pages, init decoder now");
|
|
|
|
|
|
|
|
/* now read pages until we receive a buffer from each of the
|
|
|
|
* stream decoders, this will tell us the timestamp of the
|
|
|
|
* first packet in the chain then */
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
|
|
|
|
/* save the offset to the first non bos page in the chain: if searching for
|
|
|
|
* pad->first_time we read past the end of the chain, we'll seek back to this
|
|
|
|
* position
|
|
|
|
*/
|
|
|
|
offset = ogg->offset;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
done = FALSE;
|
|
|
|
while (!done) {
|
|
|
|
glong serial;
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
gboolean known_serial = FALSE;
|
2005-03-31 09:43:49 +00:00
|
|
|
gint ret;
|
|
|
|
|
|
|
|
serial = ogg_page_serialno (&op);
|
|
|
|
done = TRUE;
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
|
|
|
if (pad->serialno == serial) {
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
known_serial = TRUE;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (!pad->is_skeleton && pad->start_time == -1 && ogg_page_eos (&op)) {
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
/* got EOS on a pad before we could find its start_time.
|
|
|
|
* We have no chance of finding a start_time for every pad so
|
|
|
|
* stop searching for the other start_time(s).
|
|
|
|
*/
|
|
|
|
done = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_pad_submit_page (pad, &op);
|
2004-10-18 15:23:41 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
/* the timestamp will be filled in when we submit the pages */
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
done &= (pad->start_time != GST_CLOCK_TIME_NONE);
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "done %08x now %d", serial, done);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2004-10-18 15:23:41 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
/* we read a page not belonging to the current chain: seek back to the
|
|
|
|
* beginning of the chain
|
|
|
|
*/
|
|
|
|
if (!known_serial) {
|
|
|
|
gst_ogg_demux_seek (ogg, offset);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (!done) {
|
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, &op, -1);
|
|
|
|
if (ret < 0)
|
|
|
|
break;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "done reading chain");
|
|
|
|
/* now we can fill in the missing info using queries */
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
2005-05-09 10:56:13 +00:00
|
|
|
GstFormat target;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (pad->is_skeleton)
|
|
|
|
continue;
|
|
|
|
|
2005-05-09 10:56:13 +00:00
|
|
|
target = GST_FORMAT_TIME;
|
2005-10-29 13:39:23 +00:00
|
|
|
if (!gst_ogg_pad_query_convert (pad,
|
2005-05-09 10:56:13 +00:00
|
|
|
GST_FORMAT_DEFAULT, pad->first_granule, &target,
|
|
|
|
(gint64 *) & pad->first_time)) {
|
2005-11-25 17:15:46 +00:00
|
|
|
GST_WARNING_OBJECT (ogg, "could not convert granulepos to time");
|
2005-05-09 10:56:13 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
pad->mode = GST_OGG_PAD_MODE_STREAMING;
|
|
|
|
}
|
|
|
|
return chain;
|
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
/* read the last pages from the ogg stream to get the final
|
2005-03-31 09:43:49 +00:00
|
|
|
* page end_offsets.
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain)
|
|
|
|
{
|
|
|
|
gint64 begin = chain->end_offset;
|
|
|
|
gint64 end = begin;
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
gint64 last_granule = -1;
|
|
|
|
GstOggPad *last_pad = NULL;
|
|
|
|
GstFormat target;
|
2005-03-31 09:43:49 +00:00
|
|
|
gint64 ret;
|
|
|
|
gboolean done = FALSE;
|
|
|
|
ogg_page og;
|
|
|
|
gint i;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
while (!done) {
|
|
|
|
begin -= CHUNKSIZE;
|
|
|
|
if (begin < 0)
|
|
|
|
begin = 0;
|
|
|
|
|
|
|
|
gst_ogg_demux_seek (ogg, begin);
|
|
|
|
|
|
|
|
/* now continue reading until we run out of data, if we find a page
|
|
|
|
* start, we save it. It might not be the final page as there could be
|
|
|
|
* another page after this one. */
|
|
|
|
while (ogg->offset < end) {
|
|
|
|
ret = gst_ogg_demux_get_next_page (ogg, &og, end - ogg->offset);
|
|
|
|
if (ret == OV_EREAD)
|
|
|
|
return OV_EREAD;
|
|
|
|
if (ret < 0) {
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (pad->is_skeleton)
|
|
|
|
continue;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
if (pad->serialno == ogg_page_serialno (&og)) {
|
|
|
|
gint64 granulepos = ogg_page_granulepos (&og);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
if (last_granule < granulepos) {
|
|
|
|
last_granule = granulepos;
|
|
|
|
last_pad = pad;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
|
|
|
|
done = TRUE;
|
|
|
|
break;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
target = GST_FORMAT_TIME;
|
|
|
|
if (last_granule == -1 || !gst_ogg_pad_query_convert (last_pad,
|
|
|
|
GST_FORMAT_DEFAULT, last_granule, &target,
|
|
|
|
(gint64 *) & chain->segment_stop)) {
|
2005-11-25 17:15:46 +00:00
|
|
|
GST_WARNING_OBJECT (ogg, "could not convert granulepos to time");
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
chain->segment_stop = GST_CLOCK_TIME_NONE;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return 0;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* find a pad with a given serial number
|
|
|
|
*/
|
|
|
|
static GstOggPad *
|
|
|
|
gst_ogg_demux_find_pad (GstOggDemux * ogg, int serialno)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *pad;
|
|
|
|
gint i;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* first look in building chain if any */
|
|
|
|
if (ogg->building_chain) {
|
|
|
|
pad = gst_ogg_chain_get_stream (ogg->building_chain, serialno);
|
|
|
|
if (pad)
|
|
|
|
return pad;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* then look in current chain if any */
|
2005-03-31 09:43:49 +00:00
|
|
|
if (ogg->current_chain) {
|
|
|
|
pad = gst_ogg_chain_get_stream (ogg->current_chain, serialno);
|
|
|
|
if (pad)
|
|
|
|
return pad;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
|
|
|
|
pad = gst_ogg_chain_get_stream (chain, serialno);
|
|
|
|
if (pad)
|
|
|
|
return pad;
|
|
|
|
}
|
|
|
|
return NULL;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* find a chain with a given serial number
|
|
|
|
*/
|
|
|
|
static GstOggChain *
|
|
|
|
gst_ogg_demux_find_chain (GstOggDemux * ogg, int serialno)
|
2004-07-02 03:41:22 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggPad *pad;
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
pad = gst_ogg_demux_find_pad (ogg, serialno);
|
|
|
|
if (pad) {
|
|
|
|
return pad->chain;
|
|
|
|
}
|
|
|
|
return NULL;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_demux_collect_chain_info (GstOggDemux * ogg, GstOggChain * chain)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
chain->total_time = GST_CLOCK_TIME_NONE;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
chain->segment_start = G_MAXINT64;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
if (pad->is_skeleton)
|
|
|
|
continue;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* can do this if the pad start time is not defined */
|
|
|
|
if (pad->start_time == GST_CLOCK_TIME_NONE)
|
|
|
|
goto no_start_time;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
chain->segment_start = MIN (chain->segment_start, pad->start_time);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Make oggdemux only find the final time in a chain, not per-pad, since the per-pad information ...
Original commit message from CVS:
2005-10-31 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init),
(gst_ogg_demux_read_chain), (gst_ogg_demux_read_end_chain),
(gst_ogg_demux_collect_chain_info), (gst_ogg_print):
Patch from Alessandro Decina <alessandro@nnva.org>.
Make oggdemux only find the final time in a chain, not per-pad,
since the per-pad information can be very expensive to locate, and
it isn't used anywhere. This makes reading a file containing
OggSkeleton reasonably fast.
Also, make chain finding work when there are logical bitstreams that
can't be decoded. Fixes #319110.
2005-10-31 18:35:45 +00:00
|
|
|
|
|
|
|
if (chain->segment_stop != GST_CLOCK_TIME_NONE)
|
|
|
|
chain->total_time = chain->segment_stop - chain->segment_start;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERROR */
|
|
|
|
no_start_time:
|
|
|
|
{
|
|
|
|
chain->total_time = GST_CLOCK_TIME_NONE;
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
chain->segment_start = GST_CLOCK_TIME_NONE;
|
|
|
|
chain->segment_stop = GST_CLOCK_TIME_NONE;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
chain->begin_time = GST_CLOCK_TIME_NONE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_ogg_demux_collect_info (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* collect all info */
|
|
|
|
ogg->total_time = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
|
|
|
|
chain->begin_time = ogg->total_time;
|
|
|
|
|
|
|
|
gst_ogg_demux_collect_chain_info (ogg, chain);
|
|
|
|
|
|
|
|
ogg->total_time += chain->total_time;
|
|
|
|
}
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_segment_set_duration (&ogg->segment, GST_FORMAT_TIME, ogg->total_time);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* find all the chains in the ogg file, this reads the first and
|
|
|
|
* last page of the ogg stream, if they match then the ogg file has
|
|
|
|
* just one chain, else we do a binary search for all chains.
|
|
|
|
*/
|
2004-07-02 03:41:22 +00:00
|
|
|
static gboolean
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_find_chains (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
ogg_page og;
|
|
|
|
GstPad *peer;
|
|
|
|
GstFormat format;
|
|
|
|
gboolean res;
|
|
|
|
gulong serialno;
|
|
|
|
GstOggChain *chain;
|
|
|
|
|
|
|
|
/* get peer to figure out length */
|
|
|
|
if ((peer = gst_pad_get_peer (ogg->sinkpad)) == NULL)
|
|
|
|
goto no_peer;
|
|
|
|
|
|
|
|
/* find length to read last page, we store this for later use. */
|
|
|
|
format = GST_FORMAT_BYTES;
|
Query API update.
Original commit message from CVS:
* examples/seeking/seek.c: (make_avi_msmpeg4v3_mp3_pipeline),
(query_positions_elems), (query_positions_pads), (update_scale),
(do_seek), (set_update_scale), (message_received), (main):
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_find_chains),
(gst_ogg_demux_loop):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_sink_query):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_sink_event):
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_handle_data_packet):
* gst/adder/gstadder.c: (gst_adder_query):
* gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiotestsrc_src_query):
* gst/playback/test3.c: (update_scale):
* gst/playback/test5.c: (new_pad), (no_more_pads), (start_finding),
(dump_element_stats), (main):
* gst/playback/test6.c: (main):
* gst/sine/gstsinesrc.c: (gst_sinesrc_src_query):
Query API update.
2005-10-19 15:55:33 +00:00
|
|
|
res = gst_pad_query_duration (peer, &format, &ogg->length);
|
2005-06-28 10:16:13 +00:00
|
|
|
gst_object_unref (peer);
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
if (!res || ogg->length <= 0)
|
2005-03-31 09:43:49 +00:00
|
|
|
goto no_length;
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "file length %" G_GINT64_FORMAT, ogg->length);
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* read chain from offset 0, this is the first chain of the
|
|
|
|
* ogg file. */
|
|
|
|
gst_ogg_demux_seek (ogg, 0);
|
|
|
|
chain = gst_ogg_demux_read_chain (ogg);
|
|
|
|
if (chain == NULL)
|
|
|
|
goto no_first_chain;
|
|
|
|
|
|
|
|
/* read page from end offset, we use this page to check if its serial
|
|
|
|
* number is contained in the first chain. If this is the case then
|
|
|
|
* this ogg is not a chained ogg and we can skip the scanning. */
|
|
|
|
gst_ogg_demux_seek (ogg, ogg->length);
|
|
|
|
gst_ogg_demux_get_prev_page (ogg, &og);
|
|
|
|
serialno = ogg_page_serialno (&og);
|
|
|
|
|
|
|
|
if (!gst_ogg_chain_has_stream (chain, serialno)) {
|
|
|
|
/* the last page is not in the first stream, this means we should
|
|
|
|
* find all the chains in this chained ogg. */
|
|
|
|
gst_ogg_demux_bisect_forward_serialno (ogg, 0, 0, ogg->length, chain, 0);
|
2004-07-02 03:41:22 +00:00
|
|
|
} else {
|
2005-03-31 09:43:49 +00:00
|
|
|
/* we still call this function here but with an empty range so that
|
|
|
|
* we can reuse the setup code in this routine. */
|
|
|
|
gst_ogg_demux_bisect_forward_serialno (ogg, 0, ogg->length, ogg->length,
|
|
|
|
chain, 0);
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gst_ogg_demux_collect_info (ogg);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* dump our chains and streams */
|
|
|
|
gst_ogg_print (ogg);
|
2004-07-02 03:41:22 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/*** error cases ***/
|
|
|
|
no_peer:
|
|
|
|
{
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "we don't have a peer");
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_length:
|
|
|
|
{
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "can't get file length");
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_first_chain:
|
|
|
|
{
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "can't get first chain");
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
2004-07-02 03:41:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* streaming mode, receive a buffer, parse it, create pads for
|
|
|
|
* the serialno, submit pages and packets to the oggpads
|
|
|
|
*/
|
|
|
|
static GstFlowReturn
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
gst_ogg_demux_chain (GstPad * pad, GstBuffer * buffer)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
|
|
|
GstOggDemux *ogg;
|
2005-03-31 09:43:49 +00:00
|
|
|
gint ret = -1;
|
|
|
|
GstFlowReturn result = GST_FLOW_OK;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
guint serialno;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (pad));
|
2003-11-24 04:08:48 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "chain");
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_submit_buffer (ogg, buffer);
|
|
|
|
|
|
|
|
while (ret != 0 && result == GST_FLOW_OK) {
|
2003-11-24 04:08:48 +00:00
|
|
|
ogg_page page;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ret = ogg_sync_pageout (&ogg->sync, &page);
|
|
|
|
if (ret == 0)
|
|
|
|
/* need more data */
|
|
|
|
break;
|
|
|
|
if (ret == -1) {
|
|
|
|
/* discontinuity in the pages */
|
|
|
|
} else {
|
|
|
|
GstOggPad *pad;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gint64 granule;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
serialno = ogg_page_serialno (&page);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
granule = ogg_page_granulepos (&page);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (ogg,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
"processing ogg page (serial %08x, pageno %ld, granulepos %"
|
|
|
|
G_GINT64_FORMAT ", bos %d)",
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
serialno, ogg_page_pageno (&page), granule, ogg_page_bos (&page));
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
if (ogg_page_bos (&page)) {
|
|
|
|
GstOggChain *chain;
|
|
|
|
|
|
|
|
/* first page */
|
|
|
|
/* see if we know about the chain already */
|
|
|
|
chain = gst_ogg_demux_find_chain (ogg, serialno);
|
|
|
|
if (chain) {
|
2005-05-26 12:08:55 +00:00
|
|
|
/* we do, activate it as it means we have a non-header */
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
gst_ogg_demux_activate_chain (ogg, chain, NULL);
|
2005-03-31 09:43:49 +00:00
|
|
|
pad = gst_ogg_demux_find_pad (ogg, serialno);
|
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
GstClockTime chain_time;
|
|
|
|
GstOggChain *current_chain;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gint64 current_time;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
|
|
|
/* this can only happen in non-seekabe mode */
|
|
|
|
if (ogg->seekable)
|
|
|
|
goto unknown_chain;
|
|
|
|
|
|
|
|
current_chain = ogg->current_chain;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
current_time = ogg->segment.last_stop;
|
|
|
|
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
if (current_chain) {
|
|
|
|
GstClockTime duration;
|
|
|
|
|
|
|
|
/* this was the duration of the previous chain */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
duration = current_time - current_chain->segment_start;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
/* the new chain time starts at duration + begin_time */
|
|
|
|
chain_time = duration + current_chain->begin_time;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* remove existing pads */
|
|
|
|
gst_ogg_demux_deactivate_current_chain (ogg);
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
} else {
|
|
|
|
/* non previous chain, start at configured current time */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
chain_time = current_time;
|
2004-03-15 19:32:28 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
if (ogg->building_chain == NULL) {
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
GstOggChain *newchain;
|
|
|
|
|
|
|
|
newchain = gst_ogg_chain_new (ogg);
|
|
|
|
newchain->offset = 0;
|
|
|
|
/* set new chain begin time aligned with end time of old chain */
|
|
|
|
newchain->begin_time = chain_time;
|
ext/ogg/gstoggdemux.c: Add some more debugging.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_demux_receive_event), (gst_ogg_pad_event),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain):
Add some more debugging.
2006-04-10 15:17:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "new chain, begin time %" GST_TIME_FORMAT,
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
GST_TIME_ARGS (chain_time));
|
|
|
|
|
|
|
|
/* and this is the one we are building now */
|
|
|
|
ogg->building_chain = newchain;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
pad = gst_ogg_chain_new_stream (ogg->building_chain, serialno);
|
2004-03-15 19:32:28 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
} else {
|
|
|
|
pad = gst_ogg_demux_find_pad (ogg, serialno);
|
|
|
|
}
|
|
|
|
if (pad) {
|
|
|
|
result = gst_ogg_pad_submit_page (pad, &page);
|
|
|
|
} else {
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
/* no pad, this is pretty fatal. This means an ogg page without bos
|
|
|
|
* has been seen for this serialno. could just ignore it too... */
|
|
|
|
goto unknown_pad;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
return result;
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
|
|
|
|
unknown_chain:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (ogg, STREAM, DECODE,
|
2005-08-20 20:40:25 +00:00
|
|
|
(NULL), ("unknown ogg chain for serial %08x detected", serialno));
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_demux_send_event (ogg, gst_event_new_eos ());
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
unknown_pad:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (ogg, STREAM, DECODE,
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
(NULL), ("unknown ogg pad for serial %08x detected", serialno));
|
ext/ogg/gstoggdemux.c: Generate correct disconts for live chained oggs.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_collect_info), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop):
Generate correct disconts for live chained oggs.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_render),
(gst_base_audio_sink_create_ringbuffer),
(gst_base_audio_sink_change_state):
Handle discont math correctly.
* gst/playback/gstplaybin.c: (add_sink):
Some small debug cleanup.
2005-07-21 17:25:40 +00:00
|
|
|
gst_ogg_demux_send_event (ogg, gst_event_new_eos ());
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
|
|
|
GstOggChain *chain = ogg->current_chain;
|
|
|
|
|
|
|
|
if (chain) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < chain->streams->len; i++) {
|
|
|
|
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
|
|
|
|
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
gst_event_ref (event);
|
2005-11-25 17:15:46 +00:00
|
|
|
GST_DEBUG_OBJECT (ogg, "Pushing event on pad %p", pad);
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
gst_pad_push_event (GST_PAD (pad), event);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
gst_event_unref (event);
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
/* random access code
|
2005-03-31 09:43:49 +00:00
|
|
|
*
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
* - first find all the chains and streams by scanning the file.
|
|
|
|
* - then get and chain buffers, just like the streaming case.
|
|
|
|
* - when seeking, we can use the chain info to perform the seek.
|
2005-03-31 09:43:49 +00:00
|
|
|
*/
|
2003-11-24 04:08:48 +00:00
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_ogg_demux_loop (GstOggPad * pad)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggDemux *ogg;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
GstBuffer *buffer;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
GstEvent *event;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (pad));
|
|
|
|
|
|
|
|
if (ogg->need_chains) {
|
|
|
|
gboolean got_chains;
|
|
|
|
|
|
|
|
/* this is the only place where we write chains */
|
|
|
|
GST_CHAIN_LOCK (ogg);
|
2006-04-10 19:13:30 +00:00
|
|
|
ogg->chain_error = GST_FLOW_OK;
|
2005-03-31 09:43:49 +00:00
|
|
|
got_chains = gst_ogg_demux_find_chains (ogg);
|
|
|
|
GST_CHAIN_UNLOCK (ogg);
|
2005-07-14 18:13:08 +00:00
|
|
|
if (!got_chains)
|
|
|
|
goto chain_read_failed;
|
Updated seek example.
Original commit message from CVS:
* docs/libs/tmpl/gstringbuffer.sgml:
* examples/seeking/seek.c: (make_vorbis_theora_pipeline),
(query_rates), (query_positions_elems), (query_positions_pads),
(update_scale), (do_seek):
Updated seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_demux_activate_chain),
(gst_ogg_demux_find_chains), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
Push out correct discont values.
* ext/theora/theoradec.c: (theora_dec_src_convert),
(theora_dec_sink_convert), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_handle_type_packet),
(theora_handle_header_packet), (theora_dec_push),
(theora_handle_data_packet), (theora_dec_chain),
(theora_dec_change_state):
Better timestamping.
* ext/vorbis/vorbisdec.c: (gst_vorbis_dec_init),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet), (vorbis_dec_chain):
* ext/vorbis/vorbisdec.h:
Better timestamping.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_get_time), (gst_base_audio_sink_get_times),
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Handle syncing on timestamps instead of sample offsets. Make
use of DISCONT values as described in design docs.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_get_time):
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_acquire),
(gst_ring_buffer_set_sample), (gst_ring_buffer_commit),
(gst_ring_buffer_read):
* gst-libs/gst/audio/gstringbuffer.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Correcly convert buffer timestamp to stream time.
2005-07-16 14:47:27 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg->need_chains = FALSE;
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
2005-11-21 16:35:24 +00:00
|
|
|
GST_OBJECT_LOCK (ogg);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
ogg->running = TRUE;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
event = ogg->event;
|
|
|
|
ogg->event = NULL;
|
2005-11-21 16:35:24 +00:00
|
|
|
GST_OBJECT_UNLOCK (ogg);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
|
|
|
|
/* and seek to configured positions without FLUSH */
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
gst_ogg_demux_perform_seek (ogg, event);
|
2006-04-10 19:13:30 +00:00
|
|
|
if (event)
|
|
|
|
gst_event_unref (event);
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-11-23 15:24:28 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "pull data %" G_GINT64_FORMAT, ogg->offset);
|
2006-04-11 14:42:33 +00:00
|
|
|
if (ogg->offset == ogg->length)
|
|
|
|
goto eos;
|
2004-10-29 15:59:37 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ret = gst_pad_pull_range (ogg->sinkpad, ogg->offset, CHUNKSIZE, &buffer);
|
2005-11-25 17:15:46 +00:00
|
|
|
if (ret != GST_FLOW_OK) {
|
|
|
|
GST_LOG_OBJECT (ogg, "Failed pull_range");
|
2005-03-31 09:43:49 +00:00
|
|
|
goto pause;
|
2005-11-25 17:15:46 +00:00
|
|
|
}
|
2004-10-26 14:41:06 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg->offset += GST_BUFFER_SIZE (buffer);
|
2004-10-26 14:41:06 +00:00
|
|
|
|
ext/: Remove STREAM locks as they are taken in core now.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose),
(gst_ogg_pad_typefind), (gst_ogg_pad_submit_packet),
(gst_ogg_chain_new_stream), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_chain), (gst_ogg_demux_loop),
(gst_ogg_demux_sink_activate):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_handle_comment_packet), (theora_dec_chain),
(theora_dec_change_state):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet), (vorbis_dec_chain),
(vorbis_dec_change_state):
Remove STREAM locks as they are taken in core now.
Never set bogus granulepos on vorbis/theora.
Fix leaks in theoradec tag parsing.
2005-05-25 12:04:37 +00:00
|
|
|
ret = gst_ogg_demux_chain (ogg->sinkpad, buffer);
|
2005-11-25 17:15:46 +00:00
|
|
|
if (ret != GST_FLOW_OK) {
|
|
|
|
GST_LOG_OBJECT (ogg, "Failed demux_chain");
|
2005-03-31 09:43:49 +00:00
|
|
|
goto pause;
|
2005-11-25 17:15:46 +00:00
|
|
|
}
|
2005-07-14 18:13:08 +00:00
|
|
|
|
2006-04-11 14:42:33 +00:00
|
|
|
/* check for the end of the segment */
|
|
|
|
if (ogg->segment.stop != -1 && ogg->segment.last_stop != -1)
|
|
|
|
if (ogg->segment.last_stop > ogg->segment.stop)
|
|
|
|
goto eos;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return;
|
|
|
|
|
2005-07-14 18:13:08 +00:00
|
|
|
/* ERRORS */
|
|
|
|
chain_read_failed:
|
|
|
|
{
|
2005-08-20 20:40:25 +00:00
|
|
|
GST_ELEMENT_ERROR (ogg, STREAM, DEMUX, (NULL), ("could not read chains"));
|
2006-04-10 19:13:30 +00:00
|
|
|
ret = ogg->chain_error;
|
2005-07-14 18:13:08 +00:00
|
|
|
goto pause;
|
2006-04-11 14:42:33 +00:00
|
|
|
}
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
ret = GST_FLOW_OK;
|
|
|
|
/* segment playback just posts a segment end message instead of
|
|
|
|
* pushing out EOS. */
|
|
|
|
ogg->segment_running = FALSE;
|
|
|
|
if (ogg->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
|
|
|
gint64 stop;
|
|
|
|
|
|
|
|
if ((stop = ogg->segment.stop) == -1)
|
|
|
|
stop = ogg->segment.duration;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (ogg, "Sending segment done, at end of segment");
|
|
|
|
gst_element_post_message (GST_ELEMENT (ogg),
|
|
|
|
gst_message_new_segment_done (GST_OBJECT (ogg), GST_FORMAT_TIME,
|
|
|
|
stop));
|
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (ogg, "Sending EOS, at end of stream");
|
|
|
|
gst_ogg_demux_send_event (ogg, gst_event_new_eos ());
|
|
|
|
}
|
|
|
|
goto pause;
|
2005-07-14 18:13:08 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
pause:
|
2005-07-14 18:13:08 +00:00
|
|
|
{
|
2005-10-06 13:11:55 +00:00
|
|
|
GST_LOG_OBJECT (ogg, "pausing task, reason %s", gst_flow_get_name (ret));
|
2005-07-14 18:13:08 +00:00
|
|
|
gst_pad_pause_task (ogg->sinkpad);
|
|
|
|
if (GST_FLOW_IS_FATAL (ret)) {
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
gst_ogg_demux_send_event (ogg, gst_event_new_eos ());
|
2005-10-23 09:57:59 +00:00
|
|
|
GST_ELEMENT_ERROR (ogg, STREAM, FAILED,
|
|
|
|
(_("Internal data stream error.")),
|
|
|
|
("stream stopped, reason %s", gst_flow_get_name (ret)));
|
2005-07-14 18:13:08 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
OGM text support, Matroska UTF-8 text support, deadlock fixes all over the place, subtitle awareness in decodebin/pla...
Original commit message from CVS:
* configure.ac:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_new):
* ext/ogg/gstogmparse.c: (gst_ogm_text_parse_get_type),
(gst_ogm_text_parse_base_init), (gst_ogm_text_parse_init),
(gst_ogm_parse_get_sink_querytypes), (gst_ogm_parse_sink_convert),
(gst_ogm_parse_sink_query), (gst_ogm_parse_chain),
(gst_ogm_parse_plugin_init):
* ext/pango/gsttextoverlay.c: (gst_textoverlay_linkedpads),
(gst_textoverlay_link), (gst_textoverlay_getcaps),
(gst_textoverlay_event), (gst_textoverlay_video_chain),
(gst_textoverlay_loop), (gst_textoverlay_init), (plugin_init):
* ext/pango/gsttextoverlay.h:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
(gst_matroska_demux_handle_seek_event),
(gst_matroska_demux_sync_streams),
(gst_matroska_demux_parse_blockgroup),
(gst_matroska_demux_subtitle_caps),
(gst_matroska_demux_plugin_init):
* gst/matroska/matroska-ids.h:
* gst/playback/gstdecodebin.c: (close_pad_link):
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_init),
(gen_preroll_element), (remove_groups), (add_stream),
(new_decoded_pad), (setup_subtitles), (gen_source_element),
(setup_source):
* gst/playback/gstplaybasebin.h:
* gst/playback/gstplaybin.c: (gen_text_element), (setup_sinks):
* gst/subparse/Makefile.am:
* gst/subparse/gstsubparse.c: (gst_subparse_get_type),
(gst_subparse_base_init), (gst_subparse_class_init),
(gst_subparse_init), (gst_subparse_formats),
(gst_subparse_eventmask), (gst_subparse_event),
(gst_subparse_handle_event), (convert_encoding), (get_next_line),
(parse_mdvdsub), (parse_mdvdsub_init), (parse_subrip),
(parse_subrip_deinit), (parse_subrip_init), (parse_mpsub),
(parse_mpsub_deinit), (parse_mpsub_init),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_format_autodetect), (gst_subparse_loop),
(gst_subparse_change_state), (gst_subparse_type_find),
(plugin_init):
* gst/subparse/gstsubparse.h:
* gst/typefind/gsttypefindfunctions.c: (ogmtext_type_find),
(plugin_init):
Add subtitle support, .sub parser (supports SRT and MPsub),
OGM text support, Matroska UTF-8 text support, deadlock fixes
all over the place, subtitle awareness in decodebin/playbin
and some fixes to textoverlay to handle subtitles in a stream
correctly. Fixes #100931.
2005-01-08 18:22:41 +00:00
|
|
|
}
|
|
|
|
|
2005-05-26 12:08:55 +00:00
|
|
|
static void
|
|
|
|
gst_ogg_demux_clear_chains (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
gst_ogg_demux_deactivate_current_chain (ogg);
|
|
|
|
|
|
|
|
GST_CHAIN_LOCK (ogg);
|
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
|
|
|
|
gst_ogg_chain_free (chain);
|
|
|
|
}
|
|
|
|
ogg->chains = g_array_set_size (ogg->chains, 0);
|
|
|
|
GST_CHAIN_UNLOCK (ogg);
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* this function is called when the pad is activated and should start
|
|
|
|
* processing data.
|
|
|
|
*
|
|
|
|
* We check if we can do random access to decide if we work push or
|
|
|
|
* pull based.
|
|
|
|
*/
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
2005-06-27 18:41:22 +00:00
|
|
|
gst_ogg_demux_sink_activate (GstPad * sinkpad)
|
|
|
|
{
|
|
|
|
if (gst_pad_check_pull_range (sinkpad)) {
|
|
|
|
return gst_pad_activate_pull (sinkpad, TRUE);
|
|
|
|
} else {
|
|
|
|
return gst_pad_activate_push (sinkpad, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* this function gets called when we activate ourselves in push mode.
|
|
|
|
* We cannot seek (ourselves) in the stream */
|
2005-06-27 18:41:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_demux_sink_activate_push (GstPad * sinkpad, gboolean active)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GstOggDemux *ogg;
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (sinkpad));
|
2004-10-20 16:24:18 +00:00
|
|
|
|
2005-06-27 18:41:22 +00:00
|
|
|
ogg->seekable = FALSE;
|
2004-01-29 02:50:20 +00:00
|
|
|
|
2005-06-27 18:41:22 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
/* this function gets called when we activate ourselves in pull mode.
|
|
|
|
* We can perform random access to the resource and we start a task
|
|
|
|
* to start reading */
|
2005-06-27 18:41:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, gboolean active)
|
|
|
|
{
|
|
|
|
GstOggDemux *ogg;
|
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (GST_OBJECT_PARENT (sinkpad));
|
|
|
|
|
|
|
|
if (active) {
|
|
|
|
ogg->need_chains = TRUE;
|
|
|
|
ogg->seekable = TRUE;
|
|
|
|
|
|
|
|
return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_ogg_demux_loop,
|
|
|
|
sinkpad);
|
|
|
|
} else {
|
|
|
|
return gst_pad_stop_task (sinkpad);
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_ogg_demux_change_state (GstElement * element, GstStateChange transition)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
|
|
|
GstOggDemux *ogg;
|
2005-09-02 15:43:18 +00:00
|
|
|
GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
|
2003-11-24 04:08:48 +00:00
|
|
|
|
|
|
|
ogg = GST_OGG_DEMUX (element);
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
ogg->basetime = 0;
|
|
|
|
ogg->have_fishead = FALSE;
|
2003-11-24 04:08:48 +00:00
|
|
|
ogg_sync_init (&ogg->sync);
|
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2003-11-24 04:08:48 +00:00
|
|
|
ogg_sync_reset (&ogg->sync);
|
2005-11-10 18:01:28 +00:00
|
|
|
ogg->current_granule = -1;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
ogg->running = FALSE;
|
|
|
|
ogg->segment_running = FALSE;
|
|
|
|
gst_segment_init (&ogg->segment, GST_FORMAT_TIME);
|
2003-11-24 04:08:48 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
|
|
|
break;
|
|
|
|
default:
|
2003-11-24 04:08:48 +00:00
|
|
|
break;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
result = parent_class->change_state (element, transition);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2003-11-24 04:08:48 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2005-05-26 12:08:55 +00:00
|
|
|
gst_ogg_demux_clear_chains (ogg);
|
2005-11-21 16:35:24 +00:00
|
|
|
GST_OBJECT_LOCK (ogg);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
ogg->running = FALSE;
|
ext/ogg/gstoggdemux.c: Use GstSegment infrastructure to remove duplicated code and handle more seek cases correctly.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),
(gst_ogg_pad_event), (gst_ogg_pad_internal_chain),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_do_seek),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_loop), (gst_ogg_demux_change_state):
Use GstSegment infrastructure to remove duplicated code
and handle more seek cases correctly.
2006-02-28 11:04:47 +00:00
|
|
|
ogg->segment_running = FALSE;
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
ogg->have_fishead = FALSE;
|
2005-11-21 16:35:24 +00:00
|
|
|
GST_OBJECT_UNLOCK (ogg);
|
2003-11-24 04:08:48 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2003-11-24 04:08:48 +00:00
|
|
|
ogg_sync_clear (&ogg->sync);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
return result;
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
ext/ogg/gstoggdemux.c: Annodex support in ogg demuxer. Doesn't do very much without the other annodex patches (to come).
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone), (gst_ogg_pad_query_convert),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_read_chain),
(gst_ogg_demux_read_end_chain), (gst_ogg_demux_collect_chain_info),
(gst_ogg_demux_change_state), (gst_annodex_granule_to_time):
Annodex support in ogg demuxer. Doesn't do very much without the
other annodex patches (to come).
2006-02-24 17:31:53 +00:00
|
|
|
static GstClockTime
|
|
|
|
gst_annodex_granule_to_time (gint64 granulepos, gint64 granulerate_n,
|
|
|
|
gint64 granulerate_d, guint8 granuleshift)
|
|
|
|
{
|
|
|
|
gint64 keyindex, keyoffset;
|
|
|
|
gint64 granulerate;
|
|
|
|
GstClockTime res;
|
|
|
|
|
|
|
|
if (granulepos == 0 || granulerate_n == 0 || granulerate_d == 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (granuleshift != 0) {
|
|
|
|
keyindex = granulepos >> granuleshift;
|
|
|
|
keyoffset = granulepos - (keyindex << granuleshift);
|
|
|
|
granulepos = keyindex + keyoffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GST_SECOND / (granulerate_n / granulerate_d) */
|
|
|
|
granulerate = gst_util_uint64_scale (GST_SECOND,
|
|
|
|
granulerate_d, granulerate_n);
|
|
|
|
res = gst_util_uint64_scale (granulepos, granulerate, 1);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
ext/ogg/: Added an ogg muxer.
Original commit message from CVS:
* ext/ogg/gstogg.c: (plugin_init):
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_plugin_init),
(gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_get_type),
(gst_ogg_mux_base_init), (gst_ogg_mux_class_init),
(gst_ogg_mux_get_sink_event_masks), (gst_ogg_mux_init),
(gst_ogg_mux_sinkconnect), (gst_ogg_mux_pad_link),
(gst_ogg_mux_pad_unlink), (gst_ogg_mux_request_new_pad),
(gst_ogg_mux_handle_src_event), (gst_ogg_mux_next_buffer),
(gst_ogg_mux_push_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_loop),
(gst_ogg_mux_get_property), (gst_ogg_mux_set_property),
(gst_ogg_mux_change_state), (gst_ogg_mux_plugin_init):
Added an ogg muxer.
Small typo fixes in the demuxer.
2004-05-10 13:34:57 +00:00
|
|
|
gboolean
|
|
|
|
gst_ogg_demux_plugin_init (GstPlugin * plugin)
|
2003-11-24 04:08:48 +00:00
|
|
|
{
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_ogg_demux_debug, "oggdemux", 0, "ogg demuxer");
|
2004-07-02 03:41:22 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_ogg_demux_setup_debug, "oggdemux_setup", 0,
|
|
|
|
"ogg demuxer setup stage when parsing pipeline");
|
2003-11-24 04:08:48 +00:00
|
|
|
|
2006-01-27 01:06:29 +00:00
|
|
|
#if ENABLE_NLS
|
|
|
|
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
|
|
|
|
LOCALEDIR);
|
|
|
|
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
|
|
|
#endif
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
return gst_element_register (plugin, "oggdemux", GST_RANK_PRIMARY,
|
|
|
|
GST_TYPE_OGG_DEMUX);
|
2003-11-24 04:08:48 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-29 02:50:20 +00:00
|
|
|
/* prints all info about the element */
|
2004-07-02 03:41:22 +00:00
|
|
|
#undef GST_CAT_DEFAULT
|
|
|
|
#define GST_CAT_DEFAULT gst_ogg_demux_setup_debug
|
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_get_volume),
(gst_alsa_mixer_set_volume), (gst_alsa_mixer_set_mute),
(gst_alsa_mixer_set_record), (gst_alsa_mixer_set_option),
(gst_alsa_mixer_get_option):
* ext/dvdnav/dvdnavsrc.c: (dvdnav_get_event_name),
(dvdnavsrc_print_event):
* ext/ogg/gstoggdemux.c: (_find_chain_process), (gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_pad_link),
(gst_ogg_mux_pad_unlink):
* gst/multipart/multipartmux.c: (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink):
* gst/videofilter/gstvideobalance.c:
(gst_videobalance_colorbalance_set_value):
* gst/videomixer/videomixer.c: (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink):
* po/uk.po:
* sys/oss/gstossmixer.c:
* sys/v4l/gstv4lcolorbalance.c:
* sys/v4l/gstv4ltuner.c:
* sys/v4l/v4lsrc_calls.c:
* sys/v4l2/gstv4l2colorbalance.c:
* sys/v4l2/gstv4l2tuner.c:
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
2004-08-03 16:06:08 +00:00
|
|
|
|
|
|
|
#ifdef GST_DISABLE_GST_DEBUG
|
|
|
|
|
ext/ogg/: Added an ogg muxer.
Original commit message from CVS:
* ext/ogg/gstogg.c: (plugin_init):
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_plugin_init),
(gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_get_type),
(gst_ogg_mux_base_init), (gst_ogg_mux_class_init),
(gst_ogg_mux_get_sink_event_masks), (gst_ogg_mux_init),
(gst_ogg_mux_sinkconnect), (gst_ogg_mux_pad_link),
(gst_ogg_mux_pad_unlink), (gst_ogg_mux_request_new_pad),
(gst_ogg_mux_handle_src_event), (gst_ogg_mux_next_buffer),
(gst_ogg_mux_push_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_loop),
(gst_ogg_mux_get_property), (gst_ogg_mux_set_property),
(gst_ogg_mux_change_state), (gst_ogg_mux_plugin_init):
Added an ogg muxer.
Small typo fixes in the demuxer.
2004-05-10 13:34:57 +00:00
|
|
|
static void
|
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_get_volume),
(gst_alsa_mixer_set_volume), (gst_alsa_mixer_set_mute),
(gst_alsa_mixer_set_record), (gst_alsa_mixer_set_option),
(gst_alsa_mixer_get_option):
* ext/dvdnav/dvdnavsrc.c: (dvdnav_get_event_name),
(dvdnavsrc_print_event):
* ext/ogg/gstoggdemux.c: (_find_chain_process), (gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_pad_link),
(gst_ogg_mux_pad_unlink):
* gst/multipart/multipartmux.c: (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink):
* gst/videofilter/gstvideobalance.c:
(gst_videobalance_colorbalance_set_value):
* gst/videomixer/videomixer.c: (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink):
* po/uk.po:
* sys/oss/gstossmixer.c:
* sys/v4l/gstv4lcolorbalance.c:
* sys/v4l/gstv4ltuner.c:
* sys/v4l/v4lsrc_calls.c:
* sys/v4l2/gstv4l2colorbalance.c:
* sys/v4l2/gstv4l2tuner.c:
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
2004-08-03 16:06:08 +00:00
|
|
|
gst_ogg_print (GstOggDemux * ogg)
|
|
|
|
{
|
|
|
|
/* NOP */
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* !GST_DISABLE_GST_DEBUG */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_ogg_print (GstOggDemux * ogg)
|
2004-01-29 02:50:20 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
guint j, i;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GST_INFO_OBJECT (ogg, "%u chains", ogg->chains->len);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " total time: %" GST_TIME_FORMAT,
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GST_TIME_ARGS (ogg->total_time));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
for (i = 0; i < ogg->chains->len; i++) {
|
|
|
|
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
|
|
|
|
|
|
|
|
GST_INFO_OBJECT (ogg, " chain %d (%u streams):", i, chain->streams->len);
|
|
|
|
GST_INFO_OBJECT (ogg, " offset: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT,
|
|
|
|
chain->offset, chain->end_offset);
|
ext/ogg/gstoggdemux.c: Reorganize code to send the right disconts when in streaming mode.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_init), (gst_ogg_pad_event),
(gst_ogg_pad_internal_chain), (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_pad),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_find_chains), (gst_ogg_demux_chain),
(gst_ogg_demux_send_event), (gst_ogg_demux_loop),
(gst_ogg_demux_change_state), (gst_ogg_print):
Reorganize code to send the right disconts when in streaming
mode.
2005-07-21 12:17:37 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " begin time: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (chain->begin_time));
|
ext/ogg/gstoggdemux.c: Parse seeking events better.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),
(gst_ogg_pad_event), (gst_ogg_demux_factory_filter),
(gst_ogg_pad_submit_packet), (gst_ogg_chain_new),
(gst_ogg_demux_init), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
Parse seeking events better.
Unref static caps.
Generate correct newsegment events, fixes seeking in live oggs.
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_dec_src_event), (theora_dec_src_getcaps),
(theora_dec_sink_event), (theora_dec_push), (theora_dec_chain):
Use newsegment values to report correct play time.
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_sink_event):
* ext/vorbis/vorbisdec.h:
Parse and use newsegment values to report correct play time.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_event), (gst_base_audio_sink_render):
Clear ringbuffer on flush.
Use newsegment values to calculate playback time.
* sys/ximage/ximagesink.c: (gst_ximagesink_get_times):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_times):
Basesink does newsegment calculations for us now.
2005-08-24 18:04:45 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " total time: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (chain->total_time));
|
|
|
|
GST_INFO_OBJECT (ogg, " segment start: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (chain->segment_start));
|
|
|
|
GST_INFO_OBJECT (ogg, " segment stop: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (chain->segment_stop));
|
2005-03-31 09:43:49 +00:00
|
|
|
|
|
|
|
for (j = 0; j < chain->streams->len; j++) {
|
|
|
|
GstOggPad *stream = g_array_index (chain->streams, GstOggPad *, j);
|
|
|
|
|
ext/ogg/gstoggdemux.c: add more debugging clean up printf formats for granulepos and serialno
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_demux_chain_elem_pad), (gst_ogg_demux_queue_data),
(gst_ogg_demux_chain_peer), (gst_ogg_pad_submit_packet),
(gst_ogg_pad_submit_page), (gst_ogg_chain_new_stream),
(gst_ogg_demux_seek), (gst_ogg_demux_get_data),
(gst_ogg_demux_get_next_page), (gst_ogg_demux_do_seek),
(gst_ogg_demux_bisect_forward_serialno),
(gst_ogg_demux_read_chain), (gst_ogg_demux_find_chains),
(gst_ogg_demux_chain), (gst_ogg_demux_loop), (gst_ogg_print):
add more debugging
clean up printf formats for granulepos and serialno
2006-05-30 14:59:24 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " stream %08x:", stream->serialno);
|
ext/ogg/: Ported ogg muxer.
Original commit message from CVS:
* ext/ogg/Makefile.am:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_pad_submit_packet), (gst_ogg_demux_sink_activate),
(gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_init),
(gst_ogg_mux_request_new_pad), (gst_ogg_mux_next_buffer),
(gst_ogg_mux_push_page), (gst_ogg_mux_queue_pads),
(gst_ogg_mux_get_headers), (gst_ogg_mux_set_header_on_caps),
(gst_ogg_mux_send_headers), (gst_ogg_mux_collected),
(gst_ogg_mux_change_state):
Ported ogg muxer.
2005-05-05 09:39:35 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " start time: %" GST_TIME_FORMAT,
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_TIME_ARGS (stream->start_time));
|
ext/ogg/: Ported ogg muxer.
Original commit message from CVS:
* ext/ogg/Makefile.am:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_pad_submit_packet), (gst_ogg_demux_sink_activate),
(gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_init),
(gst_ogg_mux_request_new_pad), (gst_ogg_mux_next_buffer),
(gst_ogg_mux_push_page), (gst_ogg_mux_queue_pads),
(gst_ogg_mux_get_headers), (gst_ogg_mux_set_header_on_caps),
(gst_ogg_mux_send_headers), (gst_ogg_mux_collected),
(gst_ogg_mux_change_state):
Ported ogg muxer.
2005-05-05 09:39:35 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " first granulepos: %" G_GINT64_FORMAT,
|
2005-03-31 09:43:49 +00:00
|
|
|
stream->first_granule);
|
ext/ogg/: Ported ogg muxer.
Original commit message from CVS:
* ext/ogg/Makefile.am:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind),
(gst_ogg_pad_submit_packet), (gst_ogg_demux_sink_activate),
(gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_init),
(gst_ogg_mux_request_new_pad), (gst_ogg_mux_next_buffer),
(gst_ogg_mux_push_page), (gst_ogg_mux_queue_pads),
(gst_ogg_mux_get_headers), (gst_ogg_mux_set_header_on_caps),
(gst_ogg_mux_send_headers), (gst_ogg_mux_collected),
(gst_ogg_mux_change_state):
Ported ogg muxer.
2005-05-05 09:39:35 +00:00
|
|
|
GST_INFO_OBJECT (ogg, " first time: %" GST_TIME_FORMAT,
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_TIME_ARGS (stream->first_time));
|
2004-01-29 02:50:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_get_volume),
(gst_alsa_mixer_set_volume), (gst_alsa_mixer_set_mute),
(gst_alsa_mixer_set_record), (gst_alsa_mixer_set_option),
(gst_alsa_mixer_get_option):
* ext/dvdnav/dvdnavsrc.c: (dvdnav_get_event_name),
(dvdnavsrc_print_event):
* ext/ogg/gstoggdemux.c: (_find_chain_process), (gst_ogg_print):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_pad_link),
(gst_ogg_mux_pad_unlink):
* gst/multipart/multipartmux.c: (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink):
* gst/videofilter/gstvideobalance.c:
(gst_videobalance_colorbalance_set_value):
* gst/videomixer/videomixer.c: (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink):
* po/uk.po:
* sys/oss/gstossmixer.c:
* sys/v4l/gstv4lcolorbalance.c:
* sys/v4l/gstv4ltuner.c:
* sys/v4l/v4lsrc_calls.c:
* sys/v4l2/gstv4l2colorbalance.c:
* sys/v4l2/gstv4l2tuner.c:
compile fixes for --disable-gst-debug, G_DISABLE_ASSERT and friends
2004-08-03 16:06:08 +00:00
|
|
|
#endif /* GST_DISABLE_GST_DEBUG */
|