2004-03-27 22:45:41 +00:00
|
|
|
/* GStreamer
|
2005-11-24 13:52:49 +00:00
|
|
|
* Copyright (C) 2005 Martin Soto <martinsoto@users.sourceforge.net>
|
2004-03-27 22:45:41 +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 <string.h>
|
|
|
|
|
2004-07-27 21:51:28 +00:00
|
|
|
#include "gstdvddemux.h"
|
2004-03-27 22:45:41 +00:00
|
|
|
|
ext/a52dec/gsta52dec.c: Add some debug output. Check that a discont has a valid time associated.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_event), (gst_a52dec_chain):
Add some debug output. Check that a discont has a valid
time associated.
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event),
(gst_alsa_sink_loop):
Ignore TAG events. A little extra debug for broken timestamps.
* ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_init), (dvdnavsrc_loop),
(dvdnavsrc_change_state):
Ensure we send a discont to engage the link before we send any
other events.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_init),
(dvdreadsrc_finalize), (_close), (_open), (_seek_title),
(_seek_chapter), (seek_sector), (dvdreadsrc_get),
(dvdreadsrc_uri_get_uri), (dvdreadsrc_uri_set_uri):
Handle URI of the form dvd://title[,chapter[,angle]]. Currently only
dvd://title works in totem because typefinding sends a seek that ends
up going back to chapter 1 regardless.
* ext/mpeg2dec/gstmpeg2dec.c:
* ext/mpeg2dec/gstmpeg2dec.h:
Output correct timestamps and handle disconts.
* ext/ogg/gstoggdemux.c: (get_relative):
Small guard against a null dereference.
* ext/pango/gsttextoverlay.c: (gst_textoverlay_finalize),
(gst_textoverlay_set_property):
Free memory when done. Don't call gst_event_filler_get_duration on
EOS events. Use GST_LOG and GST_WARNING instead of g_message and
g_warning.
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init),
(draw_line), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain):
Draw solid lines, prettier colours.
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
Add a default palette that'll work for some movies.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_init),
(gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_send_discont),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_parse_syshead), (gst_mpeg_demux_parse_pes):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_parse_packhead):
* gst/mpegstream/gstmpegparse.h:
Use PTM/NAV events when for timestamp adjustment when connected to
dvdnavsrc. Don't use many discont events where one suffices.
* gst/playback/gstplaybasebin.c: (group_destroy),
(gen_preroll_element), (gst_play_base_bin_add_element):
* gst/playback/gstplaybasebin.h:
Make sure we remove subtitles from the same bin we put them in.
* gst/subparse/gstsubparse.c: (convert_encoding), (parse_subrip),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_change_state):
Fix some memleaks and invalid accesses.
* gst/typefind/gsttypefindfunctions.c: (ogganx_type_find),
(oggskel_type_find), (cmml_type_find), (plugin_init):
Some typefind functions for Annodex v3.0 files
* gst/wavparse/gstwavparse.h:
GstRiffReadClass is the correct parent class.
2005-01-25 15:34:08 +00:00
|
|
|
/*
|
2005-11-14 21:20:21 +00:00
|
|
|
* Move PTM discont back by 0.3 seconds to allow for strange audio
|
ext/a52dec/gsta52dec.c: Add some debug output. Check that a discont has a valid time associated.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_event), (gst_a52dec_chain):
Add some debug output. Check that a discont has a valid
time associated.
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event),
(gst_alsa_sink_loop):
Ignore TAG events. A little extra debug for broken timestamps.
* ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_init), (dvdnavsrc_loop),
(dvdnavsrc_change_state):
Ensure we send a discont to engage the link before we send any
other events.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_init),
(dvdreadsrc_finalize), (_close), (_open), (_seek_title),
(_seek_chapter), (seek_sector), (dvdreadsrc_get),
(dvdreadsrc_uri_get_uri), (dvdreadsrc_uri_set_uri):
Handle URI of the form dvd://title[,chapter[,angle]]. Currently only
dvd://title works in totem because typefinding sends a seek that ends
up going back to chapter 1 regardless.
* ext/mpeg2dec/gstmpeg2dec.c:
* ext/mpeg2dec/gstmpeg2dec.h:
Output correct timestamps and handle disconts.
* ext/ogg/gstoggdemux.c: (get_relative):
Small guard against a null dereference.
* ext/pango/gsttextoverlay.c: (gst_textoverlay_finalize),
(gst_textoverlay_set_property):
Free memory when done. Don't call gst_event_filler_get_duration on
EOS events. Use GST_LOG and GST_WARNING instead of g_message and
g_warning.
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init),
(draw_line), (gst_smoothwave_dispose), (gst_sw_sinklink),
(gst_sw_srclink), (gst_smoothwave_chain):
Draw solid lines, prettier colours.
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
Add a default palette that'll work for some movies.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_init),
(gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_send_discont),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_parse_syshead), (gst_mpeg_demux_parse_pes):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_parse_packhead):
* gst/mpegstream/gstmpegparse.h:
Use PTM/NAV events when for timestamp adjustment when connected to
dvdnavsrc. Don't use many discont events where one suffices.
* gst/playback/gstplaybasebin.c: (group_destroy),
(gen_preroll_element), (gst_play_base_bin_add_element):
* gst/playback/gstplaybasebin.h:
Make sure we remove subtitles from the same bin we put them in.
* gst/subparse/gstsubparse.c: (convert_encoding), (parse_subrip),
(gst_subparse_buffer_format_autodetect),
(gst_subparse_change_state):
Fix some memleaks and invalid accesses.
* gst/typefind/gsttypefindfunctions.c: (ogganx_type_find),
(oggskel_type_find), (cmml_type_find), (plugin_init):
Some typefind functions for Annodex v3.0 files
* gst/wavparse/gstwavparse.h:
GstRiffReadClass is the correct parent class.
2005-01-25 15:34:08 +00:00
|
|
|
* timestamps when audio crosses a VOBU
|
|
|
|
*/
|
2005-11-14 21:20:21 +00:00
|
|
|
#define PTM_DISCONT_ADJUST (0.3 * GST_SECOND)
|
|
|
|
#define INITIAL_END_PTM (-1)
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (gstdvddemux_debug);
|
|
|
|
#define GST_CAT_DEFAULT (gstdvddemux_debug)
|
|
|
|
|
|
|
|
|
|
|
|
#define PARSE_CLASS(o) GST_MPEG_PARSE_CLASS (G_OBJECT_GET_CLASS (o))
|
|
|
|
#define DEMUX_CLASS(o) GST_MPEG_DEMUX_CLASS (G_OBJECT_GET_CLASS (o))
|
|
|
|
#define CLASS(o) GST_DVD_DEMUX_CLASS (G_OBJECT_GET_CLASS (o))
|
|
|
|
|
|
|
|
|
|
|
|
/* Element factory information */
|
|
|
|
static GstElementDetails dvd_demux_details = {
|
|
|
|
"DVD Demuxer",
|
|
|
|
"Codec/Demuxer",
|
|
|
|
"Demultiplexes DVD (VOB) MPEG2 streams",
|
2005-11-24 13:52:49 +00:00
|
|
|
"Martin Soto <martinsoto@users.sourceforge.net>"
|
2004-03-27 22:45:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* DVDDemux signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2004-05-21 22:39:29 +00:00
|
|
|
ARG_0
|
|
|
|
/* FILL ME */
|
2004-03-27 22:45:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Define the capabilities separately, to be able to reuse them. */
|
|
|
|
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/mpeg, "
|
|
|
|
"mpegversion = (int) 2, " "systemstream = (boolean) TRUE")
|
|
|
|
);
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
#define VIDEO_CAPS \
|
|
|
|
GST_STATIC_CAPS ("video/mpeg, " \
|
|
|
|
"mpegversion = (int) { 1, 2 }, " \
|
|
|
|
"systemstream = (boolean) FALSE" \
|
|
|
|
)
|
|
|
|
|
|
|
|
#define AUDIO_CAPS \
|
|
|
|
GST_STATIC_CAPS ( \
|
|
|
|
"audio/mpeg, " \
|
|
|
|
"mpegversion = (int) 1;" \
|
2005-12-27 19:06:08 +00:00
|
|
|
"audio/x-lpcm, " \
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
"width = (int) { 16, 20, 24 }, " \
|
2004-03-27 22:45:41 +00:00
|
|
|
"rate = (int) { 48000, 96000 }, " \
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
"channels = (int) [ 1, 8 ], " \
|
|
|
|
"dynamic_range = (int) [ 0, 255 ], " \
|
|
|
|
"emphasis = (boolean) { FALSE, TRUE }, " \
|
|
|
|
"mute = (boolean) { FALSE, TRUE }; " \
|
2005-01-31 18:39:33 +00:00
|
|
|
"audio/x-ac3;" \
|
|
|
|
"audio/x-dts" \
|
2004-03-27 22:45:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
#define SUBPICTURE_CAPS \
|
|
|
|
GST_STATIC_CAPS ("video/x-dvd-subpicture")
|
|
|
|
|
|
|
|
static GstStaticPadTemplate cur_video_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("current_video",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
VIDEO_CAPS);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate audio_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("dvd_audio_%02d",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_SOMETIMES,
|
|
|
|
AUDIO_CAPS);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate cur_audio_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("current_audio",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
AUDIO_CAPS);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate subpicture_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("subpicture_%d",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_SOMETIMES,
|
|
|
|
SUBPICTURE_CAPS);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate cur_subpicture_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("current_subpicture",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
SUBPICTURE_CAPS);
|
|
|
|
|
2005-11-24 13:52:49 +00:00
|
|
|
#define _do_init(bla) \
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gstdvddemux_debug, "dvddemux", 0, \
|
|
|
|
"DVD (VOB) demultiplexer element");
|
|
|
|
|
|
|
|
GST_BOILERPLATE_FULL (GstDVDDemux, gst_dvd_demux, GstMPEGDemux,
|
|
|
|
GST_TYPE_MPEG_DEMUX, _do_init);
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
static void gst_dvd_demux_class_init (GstDVDDemuxClass * klass);
|
2005-11-24 13:52:49 +00:00
|
|
|
static void gst_dvd_demux_base_init (gpointer klass);
|
|
|
|
static void gst_dvd_demux_init (GstDVDDemux * dvd_demux,
|
|
|
|
GstDVDDemuxClass * klass);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
static GstFlowReturn gst_dvd_demux_send_buffer (GstMPEGParse * mpeg_parse,
|
|
|
|
GstBuffer * buffer, GstClockTime time);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static gboolean gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse,
|
2005-12-19 17:26:47 +00:00
|
|
|
GstEvent * event);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static gboolean gst_dvd_demux_handle_dvd_event
|
2004-03-27 22:45:41 +00:00
|
|
|
(GstDVDDemux * dvd_demux, GstEvent * event);
|
|
|
|
|
2004-07-28 13:47:59 +00:00
|
|
|
static GstMPEGStream *gst_dvd_demux_get_video_stream
|
|
|
|
(GstMPEGDemux * mpeg_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info);
|
2004-03-27 22:45:41 +00:00
|
|
|
static GstMPEGStream *gst_dvd_demux_get_audio_stream
|
|
|
|
(GstMPEGDemux * dvd_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info);
|
|
|
|
static GstMPEGStream *gst_dvd_demux_get_subpicture_stream
|
|
|
|
(GstMPEGDemux * dvd_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info);
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static GstFlowReturn gst_dvd_demux_process_private
|
2004-03-27 22:45:41 +00:00
|
|
|
(GstMPEGDemux * mpeg_demux,
|
|
|
|
GstBuffer * buffer,
|
|
|
|
guint stream_nr, GstClockTime timestamp, guint headerlen, guint datalen);
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static GstFlowReturn gst_dvd_demux_send_subbuffer
|
2004-03-27 22:45:41 +00:00
|
|
|
(GstMPEGDemux * mpeg_demux,
|
|
|
|
GstMPEGStream * outstream,
|
|
|
|
GstBuffer * buffer, GstClockTime timestamp, guint offset, guint size);
|
|
|
|
|
|
|
|
static void gst_dvd_demux_set_cur_audio
|
|
|
|
(GstDVDDemux * dvd_demux, gint stream_nr);
|
|
|
|
static void gst_dvd_demux_set_cur_subpicture
|
|
|
|
(GstDVDDemux * dvd_demux, gint stream_nr);
|
|
|
|
|
2005-01-05 17:03:27 +00:00
|
|
|
static void gst_dvd_demux_reset (GstDVDDemux * dvd_demux);
|
2005-11-14 21:20:21 +00:00
|
|
|
static void gst_dvd_demux_synchronise_pads (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstClockTime threshold, GstClockTime new_ts);
|
|
|
|
static void gst_dvd_demux_sync_stream_to_time (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstMPEGStream * stream, GstClockTime last_ts);
|
2005-01-05 17:03:27 +00:00
|
|
|
|
2005-09-02 15:43:54 +00:00
|
|
|
static GstStateChangeReturn gst_dvd_demux_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
/*static guint gst_dvd_demux_signals[LAST_SIGNAL] = { 0 };*/
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-11-24 13:52:49 +00:00
|
|
|
gst_dvd_demux_base_init (gpointer klass)
|
2004-03-27 22:45:41 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
2005-11-24 13:52:49 +00:00
|
|
|
GstMPEGParseClass *mpeg_parse_class = GST_MPEG_PARSE_CLASS (klass);
|
2004-03-27 22:45:41 +00:00
|
|
|
GstMPEGDemuxClass *demux_class = GST_MPEG_DEMUX_CLASS (klass);
|
2005-11-24 13:52:49 +00:00
|
|
|
GstDVDDemuxClass *dvd_demux_class = GST_DVD_DEMUX_CLASS (klass);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
mpeg_parse_class->send_buffer = gst_dvd_demux_send_buffer;
|
|
|
|
mpeg_parse_class->process_event = gst_dvd_demux_process_event;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
/* sink pad */
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
demux_class->audio_template = gst_static_pad_template_get (&audio_template);
|
|
|
|
|
2005-11-24 13:52:49 +00:00
|
|
|
dvd_demux_class->cur_video_template =
|
|
|
|
gst_static_pad_template_get (&cur_video_template);
|
|
|
|
dvd_demux_class->cur_audio_template =
|
|
|
|
gst_static_pad_template_get (&cur_audio_template);
|
|
|
|
dvd_demux_class->subpicture_template =
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_static_pad_template_get (&subpicture_template);
|
2005-11-24 13:52:49 +00:00
|
|
|
dvd_demux_class->cur_subpicture_template =
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_static_pad_template_get (&cur_subpicture_template);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
demux_class->audio_template);
|
|
|
|
|
2005-11-24 13:52:49 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
dvd_demux_class->cur_video_template);
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
dvd_demux_class->cur_audio_template);
|
2005-11-14 21:20:21 +00:00
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
2005-11-24 13:52:49 +00:00
|
|
|
dvd_demux_class->subpicture_template);
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
2005-11-24 13:52:49 +00:00
|
|
|
dvd_demux_class->cur_subpicture_template);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &dvd_demux_details);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_demux_class_init (GstDVDDemuxClass * klass)
|
|
|
|
{
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
GstMPEGParseClass *mpeg_parse_class;
|
|
|
|
GstMPEGDemuxClass *mpeg_demux_class;
|
|
|
|
|
|
|
|
parent_class = g_type_class_ref (GST_TYPE_MPEG_DEMUX);
|
|
|
|
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
mpeg_parse_class = (GstMPEGParseClass *) klass;
|
|
|
|
mpeg_demux_class = (GstMPEGDemuxClass *) klass;
|
|
|
|
|
2004-12-16 12:54:04 +00:00
|
|
|
gstelement_class->change_state = gst_dvd_demux_change_state;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
mpeg_demux_class->get_audio_stream = gst_dvd_demux_get_audio_stream;
|
2004-07-28 13:47:59 +00:00
|
|
|
mpeg_demux_class->get_video_stream = gst_dvd_demux_get_video_stream;
|
2004-03-27 22:45:41 +00:00
|
|
|
mpeg_demux_class->send_subbuffer = gst_dvd_demux_send_subbuffer;
|
|
|
|
mpeg_demux_class->process_private = gst_dvd_demux_process_private;
|
2005-11-14 21:20:21 +00:00
|
|
|
mpeg_demux_class->synchronise_pads = gst_dvd_demux_synchronise_pads;
|
|
|
|
mpeg_demux_class->sync_stream_to_time = gst_dvd_demux_sync_stream_to_time;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
klass->get_subpicture_stream = gst_dvd_demux_get_subpicture_stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-11-24 13:52:49 +00:00
|
|
|
gst_dvd_demux_init (GstDVDDemux * dvd_demux, GstDVDDemuxClass * klass)
|
2004-03-27 22:45:41 +00:00
|
|
|
{
|
|
|
|
GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (dvd_demux);
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* Create the pads for the current streams. */
|
|
|
|
dvd_demux->cur_video =
|
|
|
|
DEMUX_CLASS (dvd_demux)->new_output_pad (mpeg_demux, "current_video",
|
|
|
|
CLASS (dvd_demux)->cur_video_template);
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), dvd_demux->cur_video);
|
2004-03-27 22:45:41 +00:00
|
|
|
dvd_demux->cur_audio =
|
|
|
|
DEMUX_CLASS (dvd_demux)->new_output_pad (mpeg_demux, "current_audio",
|
|
|
|
CLASS (dvd_demux)->cur_audio_template);
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), dvd_demux->cur_audio);
|
2004-03-27 22:45:41 +00:00
|
|
|
dvd_demux->cur_subpicture =
|
|
|
|
DEMUX_CLASS (dvd_demux)->new_output_pad (mpeg_demux, "current_subpicture",
|
|
|
|
CLASS (dvd_demux)->cur_subpicture_template);
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), dvd_demux->cur_subpicture);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2004-07-28 13:47:59 +00:00
|
|
|
dvd_demux->mpeg_version = 0;
|
2004-03-27 22:45:41 +00:00
|
|
|
dvd_demux->cur_video_nr = 0;
|
|
|
|
dvd_demux->cur_audio_nr = 0;
|
|
|
|
dvd_demux->cur_subpicture_nr = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS; i++) {
|
|
|
|
dvd_demux->subpicture_stream[i] = NULL;
|
|
|
|
}
|
2005-11-14 21:20:21 +00:00
|
|
|
|
2005-12-30 23:51:46 +00:00
|
|
|
/* Directly after starting we operate as if we had just flushed. */
|
2006-01-05 21:36:49 +00:00
|
|
|
dvd_demux->segment_filter = TRUE;
|
2005-12-30 23:51:46 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
dvd_demux->langcodes = NULL;
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_dvd_demux_send_buffer (GstMPEGParse * mpeg_parse, GstBuffer * buffer,
|
2004-03-27 22:45:41 +00:00
|
|
|
GstClockTime time)
|
|
|
|
{
|
2005-11-14 21:20:21 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static gboolean
|
2005-12-19 17:26:47 +00:00
|
|
|
gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
|
2005-11-14 21:20:21 +00:00
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_parse);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
gboolean ret = TRUE;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2006-01-05 21:36:49 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:
|
|
|
|
{
|
|
|
|
gboolean update;
|
|
|
|
|
|
|
|
gst_event_parse_new_segment (event, &update, NULL, NULL,
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
|
|
|
|
if (!update) {
|
|
|
|
/* This is a discontinuity in the timestamp sequence. which
|
|
|
|
may mean that we find some audio blocks lying outside the
|
|
|
|
segment. Filter them. */
|
|
|
|
dvd_demux->segment_filter = TRUE;
|
|
|
|
}
|
|
|
|
|
2006-01-22 12:00:46 +00:00
|
|
|
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
|
|
|
|
event);
|
2006-01-05 21:36:49 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-12-30 23:51:46 +00:00
|
|
|
case GST_EVENT_FLUSH_STOP:
|
2006-01-05 21:36:49 +00:00
|
|
|
dvd_demux->segment_filter = TRUE;
|
2005-12-30 23:51:46 +00:00
|
|
|
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
|
|
|
|
event);
|
|
|
|
break;
|
gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment): Properly handle non contiguous VOBUs by adding the se...
Original commit message from CVS:
2005-12-08 Martin Soto <martinsoto@users.sourceforge.net>
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment):
Properly handle non contiguous VOBUs by adding the segment accum
field to the adjust value.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_init, gst_dvd_demux_handle_newsegment): Extend
handle_newsegment to prevent sending actual newsegment events and
use tiemstamp rewriting instead.
(gst_dvd_demux_handle_dvd_event): Don't send a newsegment after
dvd-lang-codes.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParseClass):
Add a new parameter to handle_newsegment to allow controlling
whether newsegment events are forwarded or not.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_reset):
last_end_ptm and discont_time aren't necessary anymore, since
timestamp adjustment is now replaced by newsegment events.
(gst_dvd_demux_init): Prevent MPEGParse from adjusting
timestamps.
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_dvd_event):
Don't handle dvd-nav-packet events anymore, since the are now
replaced by standard newsegment events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_change_state):
* gst/mpegstream/gstdvddemux.h:
Get rid of the ignore_next_newmedia_discont hack.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_handle_newsegment):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_class_init)
(gst_mpeg_demux_handle_newsegment): Don't override
handle_newsegment anymore. It was only necessary to handle
NEWMEDIA events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_process_event)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_set_cur_audio)
(gst_dvd_demux_set_cur_subpicture):
Reactivate handling of DVD events.
* gst/mpegstream/gstmpegparse.c (normal_seek)
(gst_mpeg_parse_handle_src_event)
(gst_mpeg_parse_handle_src_query):
First attempt at reenabling seek.
* gst/mpegstream/gstmpegparse.h:
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_update_streaminfo)
(gst_mpeg_parse_get_rate)
(gst_mpeg_parse_convert, gst_mpeg_parse_get_src_query_types)
(gst_mpeg_parse_handle_src_query):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_new_output_pad):
Make queries work again.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_reset)
(gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_send_newsegment, gst_mpeg_parse_pad_added)
(gst_mpeg_parse_chain, gst_mpeg_parse_handle_src_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
Get rid of the newsegment_pending attribute, and rely instead on
proper timestamp adjustment.
* gst/mpegstream/gstmpegparse.c
(gst_mpeg_parse_get_src_event_masks): Erase.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init):
Initialize fields before creating pads to prevent the pad creation
callback from failing.
(gst_mpeg_parse_reset): Initialize new fields, and change
initialization order to match the order in the structure.
(gst_mpeg_parse_handle_newsegment): Forward new segment events
whenever possible, and update the current segment.
(gst_mpeg_parse_send_newsegment): Update the current segment and
pending_newsegment.
(gst_mpeg_parse_pad_added): Use the current segment to send
newsegment events to new pads.
(gst_mpeg_parse_chain): Properly add adjust time to sent buffers
and events. Properly update newsegment_pending.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
New fields do_adjust and current_segment.
* gst/mpegstream/gstmpegdemux.c:
* gst/mpegstream/gstdvddemux.c:
* gst/mpegstream/gstmpegparse.h:
Rename handle_discont virtual method to handle_newsegment. Erase
some (already commented out support) for old NEW_MEDIA events.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_reset, gst_mpeg_parse_handle_discont)
(gst_mpeg_parse_pad_added, gst_mpeg_parse_parse_packhead)
(gst_mpeg_parse_event, gst_mpeg_parse_chain):
Erase the "pending_scr" field, and replace it by a slightly
different handling of the current SCR. Document code blocks in
parse_packhead and chain.
2005-12-08 12:45:09 +00:00
|
|
|
case GST_EVENT_CUSTOM_DOWNSTREAM:
|
2005-12-19 17:26:47 +00:00
|
|
|
case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
|
|
|
|
if (gst_structure_has_name (gst_event_get_structure (event),
|
|
|
|
"application/x-gst-dvd")) {
|
|
|
|
ret = gst_dvd_demux_handle_dvd_event (dvd_demux, event);
|
|
|
|
} else {
|
|
|
|
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
|
|
|
|
event);
|
gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment): Properly handle non contiguous VOBUs by adding the se...
Original commit message from CVS:
2005-12-08 Martin Soto <martinsoto@users.sourceforge.net>
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment):
Properly handle non contiguous VOBUs by adding the segment accum
field to the adjust value.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_init, gst_dvd_demux_handle_newsegment): Extend
handle_newsegment to prevent sending actual newsegment events and
use tiemstamp rewriting instead.
(gst_dvd_demux_handle_dvd_event): Don't send a newsegment after
dvd-lang-codes.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParseClass):
Add a new parameter to handle_newsegment to allow controlling
whether newsegment events are forwarded or not.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_reset):
last_end_ptm and discont_time aren't necessary anymore, since
timestamp adjustment is now replaced by newsegment events.
(gst_dvd_demux_init): Prevent MPEGParse from adjusting
timestamps.
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_dvd_event):
Don't handle dvd-nav-packet events anymore, since the are now
replaced by standard newsegment events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_change_state):
* gst/mpegstream/gstdvddemux.h:
Get rid of the ignore_next_newmedia_discont hack.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_handle_newsegment):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_class_init)
(gst_mpeg_demux_handle_newsegment): Don't override
handle_newsegment anymore. It was only necessary to handle
NEWMEDIA events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_process_event)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_set_cur_audio)
(gst_dvd_demux_set_cur_subpicture):
Reactivate handling of DVD events.
* gst/mpegstream/gstmpegparse.c (normal_seek)
(gst_mpeg_parse_handle_src_event)
(gst_mpeg_parse_handle_src_query):
First attempt at reenabling seek.
* gst/mpegstream/gstmpegparse.h:
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_update_streaminfo)
(gst_mpeg_parse_get_rate)
(gst_mpeg_parse_convert, gst_mpeg_parse_get_src_query_types)
(gst_mpeg_parse_handle_src_query):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_new_output_pad):
Make queries work again.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_reset)
(gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_send_newsegment, gst_mpeg_parse_pad_added)
(gst_mpeg_parse_chain, gst_mpeg_parse_handle_src_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
Get rid of the newsegment_pending attribute, and rely instead on
proper timestamp adjustment.
* gst/mpegstream/gstmpegparse.c
(gst_mpeg_parse_get_src_event_masks): Erase.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init):
Initialize fields before creating pads to prevent the pad creation
callback from failing.
(gst_mpeg_parse_reset): Initialize new fields, and change
initialization order to match the order in the structure.
(gst_mpeg_parse_handle_newsegment): Forward new segment events
whenever possible, and update the current segment.
(gst_mpeg_parse_send_newsegment): Update the current segment and
pending_newsegment.
(gst_mpeg_parse_pad_added): Use the current segment to send
newsegment events to new pads.
(gst_mpeg_parse_chain): Properly add adjust time to sent buffers
and events. Properly update newsegment_pending.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
New fields do_adjust and current_segment.
* gst/mpegstream/gstmpegdemux.c:
* gst/mpegstream/gstdvddemux.c:
* gst/mpegstream/gstmpegparse.h:
Rename handle_discont virtual method to handle_newsegment. Erase
some (already commented out support) for old NEW_MEDIA events.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_reset, gst_mpeg_parse_handle_discont)
(gst_mpeg_parse_pad_added, gst_mpeg_parse_parse_packhead)
(gst_mpeg_parse_event, gst_mpeg_parse_chain):
Erase the "pending_scr" field, and replace it by a slightly
different handling of the current SCR. Document code blocks in
parse_packhead and chain.
2005-12-08 12:45:09 +00:00
|
|
|
}
|
2005-11-14 21:20:21 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-12-19 17:26:47 +00:00
|
|
|
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
|
|
|
|
event);
|
2005-11-14 21:20:21 +00:00
|
|
|
break;
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
return ret;
|
2005-11-14 21:20:21 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_dvd_demux_handle_dvd_event (GstDVDDemux * dvd_demux, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstMPEGParse *mpeg_parse = GST_MPEG_PARSE (dvd_demux);
|
|
|
|
GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (dvd_demux);
|
2005-11-14 21:20:21 +00:00
|
|
|
const GstStructure *structure = gst_event_get_structure (event);
|
2004-03-27 22:45:41 +00:00
|
|
|
const char *event_type = gst_structure_get_string (structure, "event");
|
|
|
|
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
{
|
|
|
|
gchar *text = gst_structure_to_string (structure);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (dvd_demux, "processing event \"%s\"", text);
|
|
|
|
g_free (text);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (strcmp (event_type, "dvd-audio-stream-change") == 0) {
|
|
|
|
gint stream_nr;
|
|
|
|
|
|
|
|
gst_structure_get_int (structure, "physical", &stream_nr);
|
|
|
|
if (stream_nr < -1 || stream_nr >= GST_MPEG_DEMUX_NUM_AUDIO_STREAMS) {
|
|
|
|
GST_ERROR_OBJECT (dvd_demux,
|
|
|
|
"GstDVDDemux: Invalid audio stream %02d", stream_nr);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
gst_dvd_demux_set_cur_audio (dvd_demux, stream_nr);
|
|
|
|
gst_event_unref (event);
|
gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment): Properly handle non contiguous VOBUs by adding the se...
Original commit message from CVS:
2005-12-08 Martin Soto <martinsoto@users.sourceforge.net>
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_newsegment):
Properly handle non contiguous VOBUs by adding the segment accum
field to the adjust value.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_init, gst_dvd_demux_handle_newsegment): Extend
handle_newsegment to prevent sending actual newsegment events and
use tiemstamp rewriting instead.
(gst_dvd_demux_handle_dvd_event): Don't send a newsegment after
dvd-lang-codes.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParseClass):
Add a new parameter to handle_newsegment to allow controlling
whether newsegment events are forwarded or not.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_reset):
last_end_ptm and discont_time aren't necessary anymore, since
timestamp adjustment is now replaced by newsegment events.
(gst_dvd_demux_init): Prevent MPEGParse from adjusting
timestamps.
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_handle_dvd_event):
Don't handle dvd-nav-packet events anymore, since the are now
replaced by standard newsegment events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_init)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_send_subbuffer)
(gst_dvd_demux_change_state):
* gst/mpegstream/gstdvddemux.h:
Get rid of the ignore_next_newmedia_discont hack.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_class_init)
(gst_dvd_demux_handle_newsegment):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_class_init)
(gst_mpeg_demux_handle_newsegment): Don't override
handle_newsegment anymore. It was only necessary to handle
NEWMEDIA events.
* gst/mpegstream/gstdvddemux.c (gst_dvd_demux_process_event)
(gst_dvd_demux_handle_dvd_event, gst_dvd_demux_set_cur_audio)
(gst_dvd_demux_set_cur_subpicture):
Reactivate handling of DVD events.
* gst/mpegstream/gstmpegparse.c (normal_seek)
(gst_mpeg_parse_handle_src_event)
(gst_mpeg_parse_handle_src_query):
First attempt at reenabling seek.
* gst/mpegstream/gstmpegparse.h:
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_update_streaminfo)
(gst_mpeg_parse_get_rate)
(gst_mpeg_parse_convert, gst_mpeg_parse_get_src_query_types)
(gst_mpeg_parse_handle_src_query):
* gst/mpegstream/gstmpegdemux.c (gst_mpeg_demux_new_output_pad):
Make queries work again.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_reset)
(gst_mpeg_parse_handle_newsegment)
(gst_mpeg_parse_send_newsegment, gst_mpeg_parse_pad_added)
(gst_mpeg_parse_chain, gst_mpeg_parse_handle_src_event):
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
Get rid of the newsegment_pending attribute, and rely instead on
proper timestamp adjustment.
* gst/mpegstream/gstmpegparse.c
(gst_mpeg_parse_get_src_event_masks): Erase.
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init):
Initialize fields before creating pads to prevent the pad creation
callback from failing.
(gst_mpeg_parse_reset): Initialize new fields, and change
initialization order to match the order in the structure.
(gst_mpeg_parse_handle_newsegment): Forward new segment events
whenever possible, and update the current segment.
(gst_mpeg_parse_send_newsegment): Update the current segment and
pending_newsegment.
(gst_mpeg_parse_pad_added): Use the current segment to send
newsegment events to new pads.
(gst_mpeg_parse_chain): Properly add adjust time to sent buffers
and events. Properly update newsegment_pending.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
New fields do_adjust and current_segment.
* gst/mpegstream/gstmpegdemux.c:
* gst/mpegstream/gstdvddemux.c:
* gst/mpegstream/gstmpegparse.h:
Rename handle_discont virtual method to handle_newsegment. Erase
some (already commented out support) for old NEW_MEDIA events.
* gst/mpegstream/gstmpegparse.h (struct _GstMPEGParse):
* gst/mpegstream/gstmpegparse.c (gst_mpeg_parse_init)
(gst_mpeg_parse_reset, gst_mpeg_parse_handle_discont)
(gst_mpeg_parse_pad_added, gst_mpeg_parse_parse_packhead)
(gst_mpeg_parse_event, gst_mpeg_parse_chain):
Erase the "pending_scr" field, and replace it by a slightly
different handling of the current SCR. Document code blocks in
parse_packhead and chain.
2005-12-08 12:45:09 +00:00
|
|
|
} else if (strcmp (event_type, "dvd-spu-stream-change") == 0) {
|
2004-03-27 22:45:41 +00:00
|
|
|
gint stream_nr;
|
|
|
|
|
|
|
|
gst_structure_get_int (structure, "physical", &stream_nr);
|
|
|
|
if (stream_nr < -1 || stream_nr >= GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS) {
|
|
|
|
GST_ERROR_OBJECT (dvd_demux,
|
|
|
|
"GstDVDDemux: Invalid subpicture stream %02d", stream_nr);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
gst_dvd_demux_set_cur_subpicture (dvd_demux, stream_nr);
|
|
|
|
gst_event_unref (event);
|
2005-11-14 21:20:21 +00:00
|
|
|
} else if (!strcmp (event_type, "dvd-lang-codes")) {
|
|
|
|
gint num_substreams = 0, num_audstreams = 0, n;
|
|
|
|
gchar *t;
|
|
|
|
|
|
|
|
/* reset */
|
|
|
|
if (dvd_demux->langcodes)
|
|
|
|
gst_event_unref (dvd_demux->langcodes);
|
|
|
|
|
|
|
|
/* see what kind of streams we have */
|
|
|
|
dvd_demux->langcodes = event;
|
|
|
|
|
|
|
|
/* now create pads for each; first video */
|
|
|
|
n = 2;
|
|
|
|
DEMUX_CLASS (dvd_demux)->get_video_stream (mpeg_demux,
|
|
|
|
0, GST_MPEG_DEMUX_VIDEO_MPEG, &n);
|
|
|
|
|
|
|
|
/* audio */
|
|
|
|
for (n = 0;; n++) {
|
|
|
|
gint fmt, ifo = 0;
|
|
|
|
|
|
|
|
t = g_strdup_printf ("audio-%d-format", num_audstreams);
|
|
|
|
if (!gst_structure_get_int (structure, t, &fmt)) {
|
|
|
|
g_free (t);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
g_free (t);
|
|
|
|
switch (fmt) {
|
|
|
|
case 0x0: /* AC-3 */
|
|
|
|
fmt = GST_DVD_DEMUX_AUDIO_AC3;
|
|
|
|
break;
|
|
|
|
case 0x2:
|
|
|
|
case 0x3: /* MPEG */
|
|
|
|
fmt = GST_MPEG_DEMUX_AUDIO_MPEG;
|
|
|
|
break;
|
|
|
|
case 0x4:
|
|
|
|
fmt = GST_DVD_DEMUX_AUDIO_LPCM;
|
|
|
|
break;
|
|
|
|
case 0x6:
|
|
|
|
fmt = GST_DVD_DEMUX_AUDIO_DTS;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fmt = GST_MPEG_DEMUX_AUDIO_UNKNOWN;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
|
|
|
num_audstreams++, fmt, &ifo);
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
/* subtitle */
|
|
|
|
for (;;) {
|
|
|
|
t = g_strdup_printf ("subtitle-%d-language", num_substreams);
|
|
|
|
if (!gst_structure_get_value (structure, t)) {
|
|
|
|
g_free (t);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
g_free (t);
|
|
|
|
CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
|
|
|
|
num_substreams++, GST_DVD_DEMUX_SUBP_DVD, NULL);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
2005-11-14 21:20:21 +00:00
|
|
|
GST_DEBUG_OBJECT (dvd_demux,
|
|
|
|
"Created 1 video stream, %d audio streams and %d subpicture streams "
|
|
|
|
"based on DVD lang codes event; now signalling no-more-pads",
|
|
|
|
num_audstreams, num_substreams);
|
|
|
|
|
|
|
|
/* we know this will be all */
|
|
|
|
gst_element_no_more_pads (GST_ELEMENT (dvd_demux));
|
|
|
|
|
|
|
|
/* Keep video/audio/subtitle pads within 1/2 sec of the SCR */
|
|
|
|
mpeg_demux->max_gap = 0.5 * GST_SECOND;
|
|
|
|
mpeg_demux->max_gap_tolerance = 0.05 * GST_SECOND;
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (dvd_demux, "dvddemux Forwarding DVD event %s to all pads",
|
|
|
|
event_type);
|
|
|
|
|
2005-12-19 17:26:47 +00:00
|
|
|
PARSE_CLASS (dvd_demux)->send_event (mpeg_parse, event);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2005-01-05 17:03:27 +00:00
|
|
|
|
2004-07-28 13:47:59 +00:00
|
|
|
static GstMPEGStream *
|
|
|
|
gst_dvd_demux_get_video_stream (GstMPEGDemux * mpeg_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
|
|
|
GstMPEGStream *str =
|
|
|
|
parent_class->get_video_stream (mpeg_demux, stream_nr, type, info);
|
|
|
|
gint mpeg_version = *((gint *) info);
|
|
|
|
|
|
|
|
if (dvd_demux->mpeg_version != mpeg_version) {
|
2005-12-27 19:06:08 +00:00
|
|
|
str->caps = gst_caps_new_simple ("video/mpeg",
|
2004-07-28 13:47:59 +00:00
|
|
|
"mpegversion", G_TYPE_INT, mpeg_version,
|
|
|
|
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
|
|
|
|
|
2005-12-27 19:06:08 +00:00
|
|
|
if (!gst_pad_set_caps (dvd_demux->cur_video, str->caps)) {
|
2004-07-28 13:47:59 +00:00
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
|
|
|
|
CORE, NEGOTIATION, (NULL), ("failed to set caps"));
|
2005-12-27 19:06:08 +00:00
|
|
|
gst_caps_unref (str->caps);
|
|
|
|
str->caps = NULL;
|
|
|
|
return str;
|
2004-07-28 13:47:59 +00:00
|
|
|
} else {
|
|
|
|
dvd_demux->mpeg_version = mpeg_version;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
dvd_demux->mpeg_version = mpeg_version;
|
2004-07-28 13:47:59 +00:00
|
|
|
return str;
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
static GstMPEGStream *
|
|
|
|
gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
guint32 sample_info = 0;
|
2004-03-27 22:45:41 +00:00
|
|
|
GstMPEGStream *str;
|
|
|
|
GstDVDLPCMStream *lpcm_str = NULL;
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gboolean add_pad = FALSE;
|
2005-11-14 21:20:21 +00:00
|
|
|
const gchar *codec = NULL, *lang_code = NULL;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (stream_nr < GST_MPEG_DEMUX_NUM_AUDIO_STREAMS, NULL);
|
|
|
|
g_return_val_if_fail (type > GST_MPEG_DEMUX_AUDIO_UNKNOWN &&
|
|
|
|
type < GST_DVD_DEMUX_AUDIO_LAST, NULL);
|
|
|
|
|
|
|
|
if (type < GST_MPEG_DEMUX_AUDIO_LAST) {
|
2005-11-14 21:20:21 +00:00
|
|
|
/* FIXME: language codes on MPEG audio streams */
|
2004-03-27 22:45:41 +00:00
|
|
|
return parent_class->get_audio_stream (mpeg_demux, stream_nr, type, info);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type == GST_DVD_DEMUX_AUDIO_LPCM) {
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
sample_info = *((guint32 *) info);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
str = mpeg_demux->audio_stream[stream_nr];
|
2005-11-14 21:20:21 +00:00
|
|
|
|
|
|
|
/* If the stream type is changing, recreate the pad */
|
|
|
|
if (str && str->type != type) {
|
|
|
|
gst_element_remove_pad (GST_ELEMENT (mpeg_demux), str->pad);
|
|
|
|
g_free (str);
|
|
|
|
str = mpeg_demux->audio_stream[stream_nr] = NULL;
|
|
|
|
}
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
if (str == NULL) {
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gchar *name;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
if (type != GST_DVD_DEMUX_AUDIO_LPCM) {
|
|
|
|
str = g_new0 (GstMPEGStream, 1);
|
|
|
|
} else {
|
|
|
|
lpcm_str = g_new0 (GstDVDLPCMStream, 1);
|
|
|
|
str = (GstMPEGStream *) lpcm_str;
|
|
|
|
}
|
|
|
|
|
|
|
|
name = g_strdup_printf ("audio_%02d", stream_nr);
|
|
|
|
DEMUX_CLASS (dvd_demux)->init_stream (mpeg_demux, type, str, stream_nr,
|
|
|
|
name, DEMUX_CLASS (dvd_demux)->audio_template);
|
2004-09-15 21:43:05 +00:00
|
|
|
/* update caps */
|
|
|
|
str->type = GST_MPEG_DEMUX_AUDIO_UNKNOWN;
|
2004-03-27 22:45:41 +00:00
|
|
|
g_free (name);
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
add_pad = TRUE;
|
2004-03-27 22:45:41 +00:00
|
|
|
} else {
|
2005-11-14 21:20:21 +00:00
|
|
|
/* Stream size may have changed, reset it. */
|
2004-03-27 22:45:41 +00:00
|
|
|
if (type != GST_DVD_DEMUX_AUDIO_LPCM) {
|
|
|
|
str = g_renew (GstMPEGStream, str, 1);
|
|
|
|
} else {
|
|
|
|
lpcm_str = g_renew (GstDVDLPCMStream, str, 1);
|
|
|
|
str = (GstMPEGStream *) lpcm_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
mpeg_demux->audio_stream[stream_nr] = str;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
if (type != str->type ||
|
|
|
|
(type == GST_DVD_DEMUX_AUDIO_LPCM &&
|
|
|
|
sample_info != lpcm_str->sample_info)) {
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
gint width, rate, channels, dynamic_range;
|
|
|
|
gboolean emphasis, mute;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
/* We need to set new caps for this pad. */
|
|
|
|
switch (type) {
|
|
|
|
case GST_DVD_DEMUX_AUDIO_LPCM:
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
/* Dynamic range in the lower byte */
|
|
|
|
dynamic_range = sample_info & 0xff;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
/* Determine the sample width. */
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
switch (sample_info & 0xC000) {
|
|
|
|
case 0x8000:
|
2004-03-27 22:45:41 +00:00
|
|
|
width = 24;
|
|
|
|
break;
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
case 0x4000:
|
2004-03-27 22:45:41 +00:00
|
|
|
width = 20;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
width = 16;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Determine the rate. */
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
if (sample_info & 0x1000) {
|
2004-03-27 22:45:41 +00:00
|
|
|
rate = 96000;
|
|
|
|
} else {
|
|
|
|
rate = 48000;
|
|
|
|
}
|
|
|
|
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
mute = ((sample_info & 0x400000) != 0);
|
|
|
|
emphasis = ((sample_info & 0x800000) != 0);
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
/* Determine the number of channels. */
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
channels = ((sample_info >> 8) & 0x7) + 1;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-12-27 19:06:08 +00:00
|
|
|
str->caps = gst_caps_new_simple ("audio/x-lpcm",
|
2004-03-27 22:45:41 +00:00
|
|
|
"width", G_TYPE_INT, width,
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
"rate", G_TYPE_INT, rate,
|
|
|
|
"channels", G_TYPE_INT, channels,
|
|
|
|
"dynamic_range", G_TYPE_INT, dynamic_range,
|
|
|
|
"emphasis", G_TYPE_BOOLEAN, emphasis,
|
|
|
|
"mute", G_TYPE_BOOLEAN, mute, NULL);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
lpcm_str->sample_info = sample_info;
|
2004-11-28 21:18:18 +00:00
|
|
|
lpcm_str->width = width;
|
|
|
|
lpcm_str->rate = rate;
|
|
|
|
lpcm_str->channels = channels;
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
lpcm_str->dynamic_range = dynamic_range;
|
|
|
|
lpcm_str->mute = mute;
|
|
|
|
lpcm_str->emphasis = emphasis;
|
2005-11-14 21:20:21 +00:00
|
|
|
codec = "LPCM audio";
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GST_DVD_DEMUX_AUDIO_AC3:
|
2005-12-27 19:06:08 +00:00
|
|
|
str->caps = gst_caps_new_simple ("audio/x-ac3", NULL);
|
2005-11-14 21:20:21 +00:00
|
|
|
codec = "AC-3 audio";
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GST_DVD_DEMUX_AUDIO_DTS:
|
2005-12-27 19:06:08 +00:00
|
|
|
str->caps = gst_caps_new_simple ("audio/x-dts", NULL);
|
2005-11-14 21:20:21 +00:00
|
|
|
codec = "DTS audio";
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_return_val_if_reached (NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-12-27 19:06:08 +00:00
|
|
|
if (!gst_pad_set_caps (str->pad, str->caps)) {
|
2005-11-14 21:20:21 +00:00
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
|
|
|
|
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
|
|
|
|
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
|
2005-12-27 19:06:08 +00:00
|
|
|
gst_caps_unref (str->caps);
|
|
|
|
str->caps = NULL;
|
|
|
|
return str;
|
2005-11-14 21:20:21 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
if (str->number == dvd_demux->cur_audio_nr) {
|
|
|
|
/* This is the current audio stream. Use the same caps. */
|
2005-12-27 19:06:08 +00:00
|
|
|
if (!gst_pad_set_caps (dvd_demux->cur_audio, str->caps)) {
|
2005-11-14 21:20:21 +00:00
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
|
|
|
|
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
|
|
|
|
gst_element_get_name (dvd_demux),
|
|
|
|
gst_pad_get_name (dvd_demux->cur_audio)));
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
2005-11-14 21:20:21 +00:00
|
|
|
|
|
|
|
if (add_pad) {
|
|
|
|
if (dvd_demux->langcodes) {
|
|
|
|
gchar *t;
|
|
|
|
|
|
|
|
t = g_strdup_printf ("audio-%d-language", stream_nr);
|
|
|
|
lang_code =
|
|
|
|
gst_structure_get_string (gst_event_get_structure (dvd_demux->
|
|
|
|
langcodes), t);
|
|
|
|
g_free (t);
|
|
|
|
}
|
|
|
|
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
if (codec || lang_code) {
|
|
|
|
GstTagList *list = gst_tag_list_new ();
|
|
|
|
|
|
|
|
if (codec) {
|
|
|
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_AUDIO_CODEC, codec, NULL);
|
|
|
|
}
|
|
|
|
if (lang_code) {
|
|
|
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_LANGUAGE_CODE, lang_code, NULL);
|
|
|
|
}
|
|
|
|
gst_element_found_tags_for_pad (GST_ELEMENT (mpeg_demux),
|
|
|
|
str->pad, list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
str->type = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static GstMPEGStream *
|
|
|
|
gst_dvd_demux_get_subpicture_stream (GstMPEGDemux * mpeg_demux,
|
|
|
|
guint8 stream_nr, gint type, const gpointer info)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
|
|
|
GstMPEGStream *str;
|
|
|
|
gchar *name;
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gboolean add_pad = FALSE;
|
2005-11-14 21:20:21 +00:00
|
|
|
const gchar *lang_code = NULL;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (stream_nr < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS, NULL);
|
|
|
|
g_return_val_if_fail (type > GST_DVD_DEMUX_SUBP_UNKNOWN &&
|
|
|
|
type < GST_DVD_DEMUX_SUBP_LAST, NULL);
|
|
|
|
|
|
|
|
str = dvd_demux->subpicture_stream[stream_nr];
|
|
|
|
|
|
|
|
if (str == NULL) {
|
|
|
|
str = g_new0 (GstMPEGStream, 1);
|
|
|
|
|
|
|
|
name = g_strdup_printf ("subpicture_%02d", stream_nr);
|
|
|
|
DEMUX_CLASS (dvd_demux)->init_stream (mpeg_demux, type, str, stream_nr,
|
|
|
|
name, CLASS (dvd_demux)->subpicture_template);
|
2004-10-30 06:44:03 +00:00
|
|
|
str->type = GST_DVD_DEMUX_SUBP_UNKNOWN;
|
2004-03-27 22:45:41 +00:00
|
|
|
g_free (name);
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
add_pad = TRUE;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
dvd_demux->subpicture_stream[stream_nr] = str;
|
|
|
|
} else {
|
|
|
|
/* This stream may have been created by a derived class, reset the
|
|
|
|
size. */
|
|
|
|
str = g_renew (GstMPEGStream, str, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (str->type != GST_DVD_DEMUX_SUBP_DVD) {
|
|
|
|
/* We need to set new caps for this pad. */
|
2005-12-27 19:06:08 +00:00
|
|
|
str->caps = gst_caps_new_simple ("video/x-dvd-subpicture", NULL);
|
2005-11-14 21:20:21 +00:00
|
|
|
|
2005-12-27 19:06:08 +00:00
|
|
|
if (!gst_pad_set_caps (str->pad, str->caps)) {
|
2005-11-14 21:20:21 +00:00
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
|
|
|
|
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
|
|
|
|
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
|
2005-12-27 19:06:08 +00:00
|
|
|
gst_caps_unref (str->caps);
|
|
|
|
str->caps = NULL;
|
|
|
|
return str;
|
2005-11-14 21:20:21 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
if (str->number == dvd_demux->cur_subpicture_nr) {
|
|
|
|
/* This is the current subpicture stream. Use the same caps. */
|
2005-12-27 19:06:08 +00:00
|
|
|
if (!gst_pad_set_caps (dvd_demux->cur_subpicture, str->caps)) {
|
2005-11-14 21:20:21 +00:00
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
|
|
|
|
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
|
|
|
|
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
if (add_pad) {
|
ext/dvdread/dvdreadsrc.c: Fix. Don't do one big huge loop around the whole DVD, that will cache all data and thus eat...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_dispose), (dvdreadsrc_set_property),
(dvdreadsrc_get_property), (_open), (_seek), (_read),
(dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state):
Fix. Don't do one big huge loop around the whole DVD, that will
cache all data and thus eat sizeof(dvd) (several GB) before we
see something.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Actually NULL'ify event after using it.
* gst/matroska/ebml-read.c: (gst_ebml_read_use_event),
(gst_ebml_read_handle_event), (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_skip):
Handle events.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init),
(gst_dvd_demux_init), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_plugin_init):
Fix timing (this will probably break if I seek using menus, but
I didn't get there yet). VOBs and normal DVDs should now work.
Add a mpeg2-only pad with high rank so this get autoplugged for
MPEG-2 movies.
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_base_init),
(gst_mpeg_demux_class_init), (gst_mpeg_demux_init),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream),
(gst_mpeg_demux_get_private_stream), (gst_mpeg_demux_parse_packet),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_plugin_init):
Use this as second rank for MPEG-1 and MPEG-2. Still use this for
MPEG-1 but use dvddemux for MPEG-2.
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init), (gst_mpeg_parse_new_pad),
(gst_mpeg_parse_parse_packhead):
Timing. Only add pad template if it exists. Add sink template from
class and not from ourselves. This means we will always use the
correct sink template even if it is not the one defined in this
file.
2004-10-01 08:42:56 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad);
|
2005-11-14 21:20:21 +00:00
|
|
|
|
|
|
|
if (dvd_demux->langcodes) {
|
|
|
|
gchar *t;
|
|
|
|
|
|
|
|
t = g_strdup_printf ("subtitle-%d-language", stream_nr);
|
|
|
|
lang_code =
|
|
|
|
gst_structure_get_string (gst_event_get_structure (dvd_demux->
|
|
|
|
langcodes), t);
|
|
|
|
g_free (t);
|
|
|
|
|
|
|
|
if (lang_code) {
|
|
|
|
GstTagList *list = gst_tag_list_new ();
|
|
|
|
|
|
|
|
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_LANGUAGE_CODE, lang_code, NULL);
|
|
|
|
gst_element_found_tags_for_pad (GST_ELEMENT (mpeg_demux),
|
|
|
|
str->pad, list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
str->type = GST_DVD_DEMUX_SUBP_DVD;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static GstFlowReturn
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstBuffer * buffer,
|
|
|
|
guint stream_nr, GstClockTime timestamp, guint headerlen, guint datalen)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2004-03-27 22:45:41 +00:00
|
|
|
guint8 *basebuf;
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
guint8 ps_id_code;
|
2004-03-27 22:45:41 +00:00
|
|
|
GstMPEGStream *outstream = NULL;
|
|
|
|
guint first_access = 0;
|
2004-11-28 21:18:18 +00:00
|
|
|
gint align = 1, len, off;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
basebuf = GST_BUFFER_DATA (buffer);
|
|
|
|
|
|
|
|
/* Determine the substream number. */
|
|
|
|
ps_id_code = basebuf[headerlen + 4];
|
|
|
|
|
|
|
|
/* In the following, the "first access" refers to the location in a
|
|
|
|
buffer the time stamp is associated to. DVDs include this
|
|
|
|
information explicitely. */
|
|
|
|
switch (stream_nr) {
|
|
|
|
case 0:
|
|
|
|
/* Private stream 1. */
|
|
|
|
|
2004-03-28 01:44:31 +00:00
|
|
|
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
|
|
|
GST_LOG_OBJECT (dvd_demux,
|
|
|
|
"we have an audio (AC3) packet, track %d", ps_id_code - 0x80);
|
|
|
|
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
|
|
|
ps_id_code - 0x80, GST_DVD_DEMUX_AUDIO_AC3, NULL);
|
|
|
|
|
|
|
|
/* Determine the position of the "first access". This
|
|
|
|
should always be the beginning of an AC3 frame. */
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
first_access = (basebuf[headerlen + 6] << 8) | basebuf[headerlen + 7];
|
|
|
|
|
|
|
|
headerlen += 4;
|
|
|
|
datalen -= 4;
|
|
|
|
} else if (ps_id_code >= 0x88 && ps_id_code <= 0x8f) {
|
|
|
|
GST_LOG_OBJECT (dvd_demux,
|
|
|
|
"we have an audio (DTS) packet, track %d", ps_id_code - 0x88);
|
|
|
|
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
|
|
|
ps_id_code - 0x88, GST_DVD_DEMUX_AUDIO_DTS, NULL);
|
|
|
|
|
|
|
|
/* Determine the position of the "first access". This
|
|
|
|
should always be the beginning of a DTS frame. */
|
|
|
|
first_access = (basebuf[headerlen + 6] << 8) | basebuf[headerlen + 7];
|
2004-03-28 01:44:31 +00:00
|
|
|
|
|
|
|
headerlen += 4;
|
|
|
|
datalen -= 4;
|
|
|
|
} else if (ps_id_code >= 0xA0 && ps_id_code <= 0xA7) {
|
2004-11-28 21:18:18 +00:00
|
|
|
GstDVDLPCMStream *lpcm_str;
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
guint32 lpcm_sample_info;
|
2004-11-28 21:18:18 +00:00
|
|
|
|
2004-03-28 01:44:31 +00:00
|
|
|
GST_LOG_OBJECT (dvd_demux,
|
|
|
|
"we have an audio (LPCM) packet, track %d", ps_id_code - 0xA0);
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
|
|
|
|
/* Compose the sample info from the LPCM header, masking out the frame_num */
|
|
|
|
lpcm_sample_info =
|
|
|
|
basebuf[headerlen + 10] | (basebuf[headerlen +
|
|
|
|
9] << 8) | ((basebuf[headerlen + 8] & 0xc0) << 16);
|
|
|
|
|
2004-03-28 01:44:31 +00:00
|
|
|
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
|
|
|
ps_id_code - 0xA0, GST_DVD_DEMUX_AUDIO_LPCM, &lpcm_sample_info);
|
2004-11-28 21:18:18 +00:00
|
|
|
lpcm_str = (GstDVDLPCMStream *) outstream;
|
2004-03-28 01:44:31 +00:00
|
|
|
|
|
|
|
/* Determine the position of the "first access". */
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
first_access = (basebuf[headerlen + 6] << 8) | basebuf[headerlen + 7];
|
2004-03-28 01:44:31 +00:00
|
|
|
|
|
|
|
/* Get rid of the LPCM header. */
|
|
|
|
headerlen += 7;
|
|
|
|
datalen -= 7;
|
2004-11-28 21:18:18 +00:00
|
|
|
|
configure.ac: Add dvdlpcmdec
Original commit message from CVS:
* configure.ac:
Add dvdlpcmdec
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_reset),
(free_all_buffers), (gst_mpeg2dec_alloc_buffer):
Don't push buffers if the src pad isn't negotiated yet.
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_buffer_to_default_format),
(gst_audio_convert_buffer_from_default_format):
Add support for 24-bit width.
* gst/dvdlpcmdec/.cvsignore:
* gst/dvdlpcmdec/Makefile.am:
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_get_type),
(gst_dvdlpcmdec_base_init), (gst_dvdlpcmdec_class_init),
(gst_dvdlpcm_reset), (gst_dvdlpcmdec_init), (gst_dvdlpcmdec_link),
(gst_dvdlpcmdec_chain), (gst_dvdlpcmdec_change_state),
(plugin_init):
* gst/dvdlpcmdec/gstdvdlpcmdec.h:
New decoder for rearranging DVD LPCM into our audio/x-raw-int
format. Needs support for the channels maps if someone can find
a DVD LPCM track with > 2 channels.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_handle_dvd_event),
(gst_dvd_demux_send_discont), (gst_dvd_demux_handle_discont),
(gst_dvd_demux_get_audio_stream), (gst_dvd_demux_process_private):
* gst/mpegstream/gstdvddemux.h:
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_discont),
(gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_handle_src_query):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_reset),
(gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_loop),
(gst_mpeg_parse_get_rate), (gst_mpeg_parse_convert_src),
(gst_mpeg_parse_handle_src_query),
(gst_mpeg_parse_handle_src_event):
Use audio/x-dvd-lpcm for LPCM output.
Add DTS output.
2005-02-08 11:08:15 +00:00
|
|
|
/* align by frame round up to nearest byte */
|
|
|
|
align = (lpcm_str->width * lpcm_str->channels + 7) / 8;
|
2004-03-28 01:44:31 +00:00
|
|
|
} else if (ps_id_code >= 0x20 && ps_id_code <= 0x3F) {
|
|
|
|
GST_LOG_OBJECT (dvd_demux,
|
|
|
|
"we have a subpicture packet, track %d", ps_id_code - 0x20);
|
|
|
|
outstream = CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
|
|
|
|
ps_id_code - 0x20, GST_DVD_DEMUX_SUBP_DVD, NULL);
|
|
|
|
|
|
|
|
headerlen += 1;
|
|
|
|
datalen -= 1;
|
|
|
|
} else {
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_WARNING_OBJECT (dvd_demux,
|
2004-03-28 01:44:31 +00:00
|
|
|
"unknown DVD (private 1) id 0x%02x", ps_id_code);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
/* Private stream 2 */
|
|
|
|
|
|
|
|
switch (ps_id_code) {
|
|
|
|
case 0:
|
|
|
|
GST_LOG_OBJECT (dvd_demux, "we have a PCI nav packet");
|
|
|
|
|
|
|
|
outstream = DEMUX_CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
|
|
|
1, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
GST_LOG_OBJECT (dvd_demux, "we have a DSI nav packet");
|
|
|
|
|
|
|
|
outstream = DEMUX_CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
|
|
|
1, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_WARNING_OBJECT (dvd_demux,
|
|
|
|
"unknown DVD (private 2) id 0x%02x", ps_id_code);
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
g_return_val_if_reached (GST_FLOW_UNEXPECTED);
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (outstream == NULL) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
return GST_FLOW_OK;
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (timestamp != GST_CLOCK_TIME_NONE && first_access > 1) {
|
|
|
|
/* We have a first access location. Since GStreamer doesn't have
|
|
|
|
a means to associate a timestamp to the middle of a buffer, we
|
|
|
|
send two separate buffers and put the timestamp in the second
|
|
|
|
one. */
|
2004-11-28 21:18:18 +00:00
|
|
|
off = headerlen + 4;
|
|
|
|
len = first_access - 1;
|
|
|
|
len -= len % align;
|
|
|
|
if (len > 0) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
ret = DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
|
examples/gstplay/player.c: Don't iterate.
Original commit message from CVS:
* examples/gstplay/player.c: (main):
Don't iterate.
* examples/seeking/seek.c: (fixate), (make_playerbin_pipeline):
Add visualizations.
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_frame):
Set duration.
* ext/dvdnav/gst-dvd:
Add audioconvert. Fixes #161325.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get):
Explicitely case to gint64. Possible valgrind error.
* gst-libs/gst/play/play.c: (caps_set), (setup_size),
(gst_play_tick_callback), (gst_play_change_state),
(gst_play_dispose), (gst_play_init), (gst_play_class_init),
(gst_play_set_location), (gst_play_get_location),
(gst_play_seek_to_time), (gst_play_set_data_src),
(gst_play_set_video_sink), (gst_play_set_audio_sink),
(gst_play_set_visualization), (gst_play_connect_visualization),
(gst_play_get_framerate), (gst_play_get_all_by_interface),
(gst_play_new):
Use playbin. Fixes #139749 and #147744.
* gst/apetag/apedemux.c: (gst_ape_demux_parse_tags):
Add genre tag.
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(audioscale_get_type), (gst_audioscale_base_init),
(gst_audioscale_class_init), (gst_audioscale_expand_caps),
(gst_audioscale_getcaps), (gst_audioscale_fixate),
(gst_audioscale_link), (gst_audioscale_get_buffer),
(gst_audioscale_decrease_rate), (gst_audioscale_increase_rate),
(gst_audioscale_init), (gst_audioscale_dispose),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property), (plugin_init):
Indent properly.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
Fix LPCM.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_udta),
(qtdemux_tag_add_str), (qtdemux_tag_add_num),
(qtdemux_tag_add_gnre), (qtdemux_video_caps):
Add more metadata (fixes #162656).
2005-01-05 14:56:27 +00:00
|
|
|
buffer, GST_CLOCK_TIME_NONE, off, len);
|
2004-11-28 21:18:18 +00:00
|
|
|
}
|
|
|
|
off += len;
|
|
|
|
len = datalen - len;
|
|
|
|
len -= len % align;
|
|
|
|
if (len > 0) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
ret = DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
|
examples/gstplay/player.c: Don't iterate.
Original commit message from CVS:
* examples/gstplay/player.c: (main):
Don't iterate.
* examples/seeking/seek.c: (fixate), (make_playerbin_pipeline):
Add visualizations.
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_frame):
Set duration.
* ext/dvdnav/gst-dvd:
Add audioconvert. Fixes #161325.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get):
Explicitely case to gint64. Possible valgrind error.
* gst-libs/gst/play/play.c: (caps_set), (setup_size),
(gst_play_tick_callback), (gst_play_change_state),
(gst_play_dispose), (gst_play_init), (gst_play_class_init),
(gst_play_set_location), (gst_play_get_location),
(gst_play_seek_to_time), (gst_play_set_data_src),
(gst_play_set_video_sink), (gst_play_set_audio_sink),
(gst_play_set_visualization), (gst_play_connect_visualization),
(gst_play_get_framerate), (gst_play_get_all_by_interface),
(gst_play_new):
Use playbin. Fixes #139749 and #147744.
* gst/apetag/apedemux.c: (gst_ape_demux_parse_tags):
Add genre tag.
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(audioscale_get_type), (gst_audioscale_base_init),
(gst_audioscale_class_init), (gst_audioscale_expand_caps),
(gst_audioscale_getcaps), (gst_audioscale_fixate),
(gst_audioscale_link), (gst_audioscale_get_buffer),
(gst_audioscale_decrease_rate), (gst_audioscale_increase_rate),
(gst_audioscale_init), (gst_audioscale_dispose),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property), (plugin_init):
Indent properly.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
Fix LPCM.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_udta),
(qtdemux_tag_add_str), (qtdemux_tag_add_num),
(qtdemux_tag_add_gnre), (qtdemux_video_caps):
Add more metadata (fixes #162656).
2005-01-05 14:56:27 +00:00
|
|
|
buffer, timestamp, off, len);
|
2004-11-28 21:18:18 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
} else {
|
2004-11-28 21:18:18 +00:00
|
|
|
off = headerlen + 4;
|
|
|
|
len = datalen;
|
|
|
|
len -= len % align;
|
|
|
|
if (len > 0) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
ret = DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
|
examples/gstplay/player.c: Don't iterate.
Original commit message from CVS:
* examples/gstplay/player.c: (main):
Don't iterate.
* examples/seeking/seek.c: (fixate), (make_playerbin_pipeline):
Add visualizations.
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_frame):
Set duration.
* ext/dvdnav/gst-dvd:
Add audioconvert. Fixes #161325.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get):
Explicitely case to gint64. Possible valgrind error.
* gst-libs/gst/play/play.c: (caps_set), (setup_size),
(gst_play_tick_callback), (gst_play_change_state),
(gst_play_dispose), (gst_play_init), (gst_play_class_init),
(gst_play_set_location), (gst_play_get_location),
(gst_play_seek_to_time), (gst_play_set_data_src),
(gst_play_set_video_sink), (gst_play_set_audio_sink),
(gst_play_set_visualization), (gst_play_connect_visualization),
(gst_play_get_framerate), (gst_play_get_all_by_interface),
(gst_play_new):
Use playbin. Fixes #139749 and #147744.
* gst/apetag/apedemux.c: (gst_ape_demux_parse_tags):
Add genre tag.
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(audioscale_get_type), (gst_audioscale_base_init),
(gst_audioscale_class_init), (gst_audioscale_expand_caps),
(gst_audioscale_getcaps), (gst_audioscale_fixate),
(gst_audioscale_link), (gst_audioscale_get_buffer),
(gst_audioscale_decrease_rate), (gst_audioscale_increase_rate),
(gst_audioscale_init), (gst_audioscale_dispose),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property), (plugin_init):
Indent properly.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
Fix LPCM.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_udta),
(qtdemux_tag_add_str), (qtdemux_tag_add_num),
(qtdemux_tag_add_gnre), (qtdemux_video_caps):
Add more metadata (fixes #162656).
2005-01-05 14:56:27 +00:00
|
|
|
buffer, timestamp, off, len);
|
2004-11-28 21:18:18 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
|
|
|
|
return ret;
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
static GstFlowReturn
|
2004-03-27 22:45:41 +00:00
|
|
|
gst_dvd_demux_send_subbuffer (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstMPEGStream * outstream, GstBuffer * buffer,
|
|
|
|
GstClockTime timestamp, guint offset, guint size)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
GstFlowReturn ret;
|
2004-03-27 22:45:41 +00:00
|
|
|
GstPad *outpad;
|
|
|
|
gint cur_nr;
|
|
|
|
|
2006-01-05 21:36:49 +00:00
|
|
|
if (dvd_demux->segment_filter &&
|
2005-12-30 23:51:46 +00:00
|
|
|
GST_MPEG_DEMUX_STREAM_KIND (outstream->type) ==
|
|
|
|
GST_MPEG_DEMUX_STREAM_AUDIO) {
|
2006-01-05 21:36:49 +00:00
|
|
|
/* We are in segment_filter mode and have an audio buffer. */
|
2005-12-30 23:51:46 +00:00
|
|
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
|
|
|
/* This is the first valid audio buffer after the flush. */
|
2006-01-05 21:36:49 +00:00
|
|
|
dvd_demux->segment_filter = FALSE;
|
2005-12-30 23:51:46 +00:00
|
|
|
} else {
|
2006-01-05 21:36:49 +00:00
|
|
|
/* Discard the buffer. */
|
2005-12-30 23:51:46 +00:00
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
/* You never know what happens to a buffer when you send it. Just
|
|
|
|
in case, we keep a reference to the buffer during the execution
|
|
|
|
of this function. */
|
|
|
|
gst_buffer_ref (buffer);
|
|
|
|
|
|
|
|
/* Send the buffer to the standard output pad. */
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
ret = parent_class->send_subbuffer (mpeg_demux, outstream, buffer,
|
2004-03-27 22:45:41 +00:00
|
|
|
timestamp, offset, size);
|
|
|
|
|
|
|
|
/* Determine the current output pad and stream number for the given
|
|
|
|
type of stream. */
|
|
|
|
switch (GST_MPEG_DEMUX_STREAM_KIND (outstream->type)) {
|
|
|
|
case GST_MPEG_DEMUX_STREAM_VIDEO:
|
|
|
|
outpad = dvd_demux->cur_video;
|
|
|
|
cur_nr = dvd_demux->cur_video_nr;
|
|
|
|
break;
|
|
|
|
case GST_MPEG_DEMUX_STREAM_AUDIO:
|
|
|
|
outpad = dvd_demux->cur_audio;
|
|
|
|
cur_nr = dvd_demux->cur_audio_nr;
|
|
|
|
break;
|
|
|
|
case GST_MPEG_DEMUX_STREAM_PRIVATE:
|
|
|
|
outpad = NULL;
|
|
|
|
cur_nr = 0;
|
|
|
|
break;
|
|
|
|
case GST_DVD_DEMUX_STREAM_SUBPICTURE:
|
|
|
|
outpad = dvd_demux->cur_subpicture;
|
|
|
|
cur_nr = dvd_demux->cur_subpicture_nr;
|
|
|
|
break;
|
|
|
|
default:
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
g_return_val_if_reached (GST_FLOW_UNEXPECTED);
|
2004-03-27 22:45:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
if (outpad != NULL && cur_nr == outstream->number && size > 0) {
|
2004-03-27 22:45:41 +00:00
|
|
|
GstBuffer *outbuf;
|
|
|
|
|
|
|
|
/* We have a packet of the current stream. Send it to the
|
|
|
|
corresponding pad as well. */
|
|
|
|
outbuf = gst_buffer_create_sub (buffer, offset, size);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
g_return_val_if_fail (outbuf != NULL, GST_FLOW_UNEXPECTED);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
|
|
|
|
GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + offset;
|
2005-12-27 19:06:08 +00:00
|
|
|
gst_buffer_set_caps (outbuf, outstream->caps);
|
2004-03-27 22:45:41 +00:00
|
|
|
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
ret = gst_pad_push (outpad, outbuf);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
|
|
|
|
return ret;
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_demux_set_cur_audio (GstDVDDemux * dvd_demux, gint stream_nr)
|
|
|
|
{
|
|
|
|
GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (dvd_demux);
|
|
|
|
GstMPEGStream *str;
|
2005-11-14 21:20:21 +00:00
|
|
|
GstCaps *caps;
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
g_return_if_fail (stream_nr >= -1 &&
|
|
|
|
stream_nr < GST_MPEG_DEMUX_NUM_AUDIO_STREAMS);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dvd_demux, "changing current audio to %02d", stream_nr);
|
|
|
|
|
|
|
|
dvd_demux->cur_audio_nr = stream_nr;
|
|
|
|
|
|
|
|
if (stream_nr == -1) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
str = mpeg_demux->audio_stream[stream_nr];
|
|
|
|
if (str != NULL) {
|
|
|
|
/* (Re)set the caps in the "current" pad. */
|
2005-11-14 21:20:21 +00:00
|
|
|
caps = GST_PAD_CAPS (str->pad);
|
2004-03-27 22:45:41 +00:00
|
|
|
if (caps != NULL) {
|
2005-11-14 21:20:21 +00:00
|
|
|
gst_pad_set_caps (dvd_demux->cur_audio, caps);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_demux_set_cur_subpicture (GstDVDDemux * dvd_demux, gint stream_nr)
|
|
|
|
{
|
|
|
|
GstMPEGStream *str;
|
|
|
|
|
|
|
|
g_return_if_fail (stream_nr >= -1 &&
|
|
|
|
stream_nr < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dvd_demux, "changing current subpicture to %02d",
|
|
|
|
stream_nr);
|
|
|
|
|
|
|
|
dvd_demux->cur_subpicture_nr = stream_nr;
|
|
|
|
|
|
|
|
if (stream_nr == -1) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
str = dvd_demux->subpicture_stream[stream_nr];
|
|
|
|
if (str != NULL) {
|
2004-10-30 06:44:03 +00:00
|
|
|
GstCaps *caps = NULL;
|
|
|
|
|
2004-03-27 22:45:41 +00:00
|
|
|
/* (Re)set the caps in the "current" pad. */
|
2005-11-14 21:20:21 +00:00
|
|
|
caps = GST_PAD_CAPS (str->pad);
|
|
|
|
gst_pad_set_caps (dvd_demux->cur_subpicture, caps);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-12-16 12:54:04 +00:00
|
|
|
static void
|
|
|
|
gst_dvd_demux_reset (GstDVDDemux * dvd_demux)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2005-11-14 21:20:21 +00:00
|
|
|
//GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (dvd_demux);
|
|
|
|
|
2004-12-16 12:54:04 +00:00
|
|
|
GST_INFO ("Resetting the dvd demuxer");
|
|
|
|
for (i = 0; i < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS; i++) {
|
|
|
|
if (dvd_demux->subpicture_stream[i]) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
gst_pad_push_event (dvd_demux->subpicture_stream[i]->pad,
|
|
|
|
gst_event_new_eos ());
|
|
|
|
|
2004-12-16 12:54:04 +00:00
|
|
|
gst_element_remove_pad (GST_ELEMENT (dvd_demux),
|
|
|
|
dvd_demux->subpicture_stream[i]->pad);
|
|
|
|
g_free (dvd_demux->subpicture_stream[i]);
|
|
|
|
dvd_demux->subpicture_stream[i] = NULL;
|
|
|
|
}
|
|
|
|
}
|
2005-11-14 21:20:21 +00:00
|
|
|
gst_pad_set_caps (dvd_demux->cur_video, NULL);
|
|
|
|
gst_pad_set_caps (dvd_demux->cur_audio, NULL);
|
|
|
|
gst_pad_set_caps (dvd_demux->cur_subpicture, NULL);
|
2004-12-16 12:54:04 +00:00
|
|
|
|
|
|
|
dvd_demux->cur_video_nr = 0;
|
|
|
|
dvd_demux->cur_audio_nr = 0;
|
|
|
|
dvd_demux->cur_subpicture_nr = 0;
|
|
|
|
dvd_demux->mpeg_version = 0;
|
2005-11-14 21:20:21 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* Reset max_gap handling */
|
|
|
|
mpeg_demux->max_gap = GST_CLOCK_TIME_NONE;
|
|
|
|
mpeg_demux->max_gap_tolerance = GST_CLOCK_TIME_NONE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_demux_synchronise_pads (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstClockTime threshold, GstClockTime new_ts)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
parent_class->synchronise_pads (mpeg_demux, threshold, new_ts);
|
|
|
|
|
|
|
|
for (i = 0; i < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS; i++) {
|
|
|
|
if (dvd_demux->subpicture_stream[i]
|
|
|
|
&& (dvd_demux->subpicture_stream[i]->cur_ts < threshold)) {
|
|
|
|
DEMUX_CLASS (mpeg_demux)->sync_stream_to_time (mpeg_demux,
|
|
|
|
dvd_demux->subpicture_stream[i], new_ts);
|
|
|
|
dvd_demux->subpicture_stream[i]->cur_ts = new_ts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_demux_sync_stream_to_time (GstMPEGDemux * mpeg_demux,
|
|
|
|
GstMPEGStream * stream, GstClockTime last_ts)
|
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
GstClockTime start_ts;
|
|
|
|
GstEvent *filler = NULL;
|
|
|
|
GstFormat fmt = GST_FORMAT_TIME;
|
|
|
|
#endif
|
|
|
|
GstPad *outpad = NULL;
|
|
|
|
gint cur_nr = 0;
|
|
|
|
|
|
|
|
parent_class->sync_stream_to_time (mpeg_demux, stream, last_ts);
|
|
|
|
|
|
|
|
switch (GST_MPEG_DEMUX_STREAM_KIND (stream->type)) {
|
|
|
|
case GST_MPEG_DEMUX_STREAM_VIDEO:
|
|
|
|
outpad = dvd_demux->cur_video;
|
|
|
|
cur_nr = dvd_demux->cur_video_nr;
|
|
|
|
break;
|
|
|
|
case GST_MPEG_DEMUX_STREAM_AUDIO:
|
|
|
|
outpad = dvd_demux->cur_audio;
|
|
|
|
cur_nr = dvd_demux->cur_audio_nr;
|
|
|
|
break;
|
|
|
|
case GST_DVD_DEMUX_STREAM_SUBPICTURE:
|
|
|
|
outpad = dvd_demux->cur_subpicture;
|
|
|
|
cur_nr = dvd_demux->cur_subpicture_nr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* FIXME: fillers in 0.9 aren't specified properly yet */
|
|
|
|
if ((outpad != NULL) && (cur_nr == stream->number)) {
|
|
|
|
if (GST_PAD_PEER (stream->pad)
|
|
|
|
&& gst_pad_query_position (GST_PAD_PEER (stream->pad), &fmt,
|
|
|
|
(gint64 *) & start_ts)) {
|
|
|
|
if (start_ts < last_ts)
|
|
|
|
filler =
|
|
|
|
gst_event_new_filler_stamped (start_ts, GST_CLOCK_DIFF (last_ts,
|
|
|
|
start_ts));
|
|
|
|
} else
|
|
|
|
filler = gst_event_new_filler_stamped (last_ts, GST_CLOCK_TIME_NONE);
|
|
|
|
|
|
|
|
if (filler) {
|
ext/mpeg2dec/gstmpeg2dec.c: Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe; nice-ify debug message...
Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_slice),
(gst_mpeg2dec_sink_event):
Set DELTA_UNIT flag on outgoing buffers if this is NOT a keyframe;
nice-ify debug message in event handler; add CHECKME.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_send_event), (gst_dvd_demux_process_private),
(gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
(gst_dvd_demux_sync_stream_to_time):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_demux_send_event),
(gst_mpeg_demux_handle_discont), (gst_mpeg_demux_new_output_pad),
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes),
(gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_process_private),
(gst_mpeg_demux_sync_stream_to_time),
(gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegdemux.h:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_buffer),
(gst_mpeg_parse_process_event), (gst_mpeg_parse_send_discont),
(gst_mpeg_parse_send_event), (gst_mpeg_parse_event),
(gst_mpeg_parse_chain):
* gst/mpegstream/gstmpegparse.h:
Get rid of GST_PAD_IS_USABLE and fix GstFlowReturn vs. gboolean
return value confusion (gst_pad_push vs. gst_pad_send_event and
gst_pad_push_event); pass flow return values to caller;
miscellaneous fixes and clean-ups.
2005-11-15 14:19:38 +00:00
|
|
|
if (!gst_pad_push_event (stream->pad, filler))
|
2005-11-14 21:20:21 +00:00
|
|
|
gst_event_unref (filler);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2004-12-16 12:54:04 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:54 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_dvd_demux_change_state (GstElement * element, GstStateChange transition)
|
2004-12-16 12:54:04 +00:00
|
|
|
{
|
|
|
|
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (element);
|
|
|
|
|
2005-09-02 15:43:54 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2004-12-16 12:54:04 +00:00
|
|
|
gst_dvd_demux_reset (dvd_demux);
|
2005-11-14 21:20:21 +00:00
|
|
|
if (dvd_demux->langcodes) {
|
|
|
|
gst_event_unref (dvd_demux->langcodes);
|
|
|
|
dvd_demux->langcodes = NULL;
|
|
|
|
}
|
2004-12-16 12:54:04 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:54 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
2004-12-16 12:54:04 +00:00
|
|
|
}
|
2004-03-27 22:45:41 +00:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
gst_dvd_demux_plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
return gst_element_register (plugin, "dvddemux",
|
2005-11-15 08:37:00 +00:00
|
|
|
GST_RANK_SECONDARY, GST_TYPE_DVD_DEMUX);
|
2004-03-27 22:45:41 +00:00
|
|
|
}
|