2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2006-02-09 17:27:57 +00:00
|
|
|
* Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu>
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
* Copyright (C) 2001 Billy Biggs <vektor@dumbterm.net>.
|
2001-12-23 12:29:33 +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.
|
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:09 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2003-11-07 12:46:51 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
#include "_stdint.h"
|
|
|
|
|
2001-12-23 12:29:33 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2006-02-09 17:27:57 +00:00
|
|
|
#include <string.h>
|
2001-12-23 12:29:33 +00:00
|
|
|
#include <errno.h>
|
|
|
|
|
2005-01-09 19:00:29 +00:00
|
|
|
#include "dvdreadsrc.h"
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* #include <gst/gst-i18n-plugin.h> */
|
|
|
|
/* FIXME: remove once GETTEXT_PACKAGE etc. is set */
|
|
|
|
#define _(s) s
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gstgst_dvd_read_src_debug);
|
|
|
|
#define GST_CAT_DEFAULT (gstgst_dvd_read_src_debug)
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static void gst_dvd_read_src_do_init (GType dvdreadsrc_type);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
enum
|
|
|
|
{
|
2001-12-23 12:29:33 +00:00
|
|
|
ARG_0,
|
Synchronize property names where not yet the case. Devices are now device=X, other versions are deprecated (but still...
Original commit message from CVS:
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_set_property), (cdparanoia_get_property):
* ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_class_init),
(dvdnavsrc_set_property), (dvdnavsrc_get_property):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_set_property),
(dvdreadsrc_get_property):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_class_init),
(gst_vcdsrc_set_property), (gst_vcdsrc_get_property):
Synchronize property names where not yet the case. Devices are
now device=X, other versions are deprecated (but still exist).
Also use g_free() unconditionally.
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
(setup_source), (gst_play_base_bin_get_property):
Expose source.
2004-12-09 12:57:29 +00:00
|
|
|
ARG_DEVICE,
|
2001-12-23 12:29:33 +00:00
|
|
|
ARG_TITLE,
|
|
|
|
ARG_CHAPTER,
|
|
|
|
ARG_ANGLE
|
|
|
|
};
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static GstElementDetails gst_dvd_read_src_details = {
|
|
|
|
"DVD Source",
|
|
|
|
"Source/File/DVD",
|
|
|
|
"Access a DVD title/chapter/angle using libdvdread",
|
|
|
|
"Erik Walthinsen <omega@cse.ogi.edu>",
|
|
|
|
};
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/mpeg, mpegversion=2, systemstream=(boolean)true"));
|
|
|
|
|
|
|
|
static GstFormat title_format;
|
|
|
|
static GstFormat angle_format;
|
|
|
|
static GstFormat sector_format;
|
|
|
|
static GstFormat chapter_format;
|
|
|
|
|
|
|
|
static gboolean gst_dvd_read_src_start (GstBaseSrc * basesrc);
|
|
|
|
static gboolean gst_dvd_read_src_stop (GstBaseSrc * basesrc);
|
|
|
|
static GstFlowReturn gst_dvd_read_src_create (GstPushSrc * pushsrc,
|
|
|
|
GstBuffer ** buf);
|
|
|
|
static gboolean gst_dvd_read_src_src_query (GstBaseSrc * basesrc,
|
|
|
|
GstQuery * query);
|
|
|
|
static gboolean gst_dvd_read_src_src_event (GstBaseSrc * basesrc,
|
|
|
|
GstEvent * event);
|
|
|
|
static gboolean gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title,
|
|
|
|
gint angle);
|
|
|
|
static gboolean gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src,
|
|
|
|
gint chapter);
|
|
|
|
static gboolean gst_dvd_read_src_goto_sector (GstDvdReadSrc * src, gint angle);
|
|
|
|
static void gst_dvd_read_src_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:30 +00:00
|
|
|
const GValue * value, GParamSpec * pspec);
|
2006-02-09 17:27:57 +00:00
|
|
|
static void gst_dvd_read_src_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:30 +00:00
|
|
|
GValue * value, GParamSpec * pspec);
|
2006-02-09 17:27:57 +00:00
|
|
|
static GstEvent *gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src,
|
|
|
|
const guint * clut);
|
2006-02-13 14:09:26 +00:00
|
|
|
static gboolean gst_dvd_read_src_get_size (GstDvdReadSrc * src, gint64 * size);
|
2006-06-30 11:26:22 +00:00
|
|
|
static gboolean gst_dvd_read_src_do_seek (GstBaseSrc * src, GstSegment * s);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_BOILERPLATE_FULL (GstDvdReadSrc, gst_dvd_read_src, GstPushSrc,
|
2006-05-06 00:18:31 +00:00
|
|
|
GST_TYPE_PUSH_SRC, gst_dvd_read_src_do_init);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-05-06 00:18:31 +00:00
|
|
|
static void
|
|
|
|
gst_dvd_read_src_base_init (gpointer g_class)
|
2006-02-09 17:27:57 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&srctemplate));
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_element_class_set_details (element_class, &gst_dvd_read_src_details);
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static void
|
|
|
|
gst_dvd_read_src_finalize (GObject * object)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (object);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_free (src->location);
|
|
|
|
g_free (src->last_uri);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2003-11-01 15:19:40 +00:00
|
|
|
static void
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_init (GstDvdReadSrc * src, GstDvdReadSrcClass * klass)
|
2003-11-01 15:19:40 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
src->dvd = NULL;
|
|
|
|
src->vts_file = NULL;
|
|
|
|
src->vmg_file = NULL;
|
|
|
|
src->dvd_title = NULL;
|
|
|
|
|
|
|
|
src->location = g_strdup ("/dev/dvd");
|
|
|
|
src->last_uri = NULL;
|
|
|
|
src->new_seek = TRUE;
|
|
|
|
src->new_cell = TRUE;
|
|
|
|
src->change_cell = FALSE;
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_title = 1;
|
|
|
|
src->uri_chapter = 1;
|
|
|
|
src->uri_angle = 1;
|
2006-02-09 17:27:57 +00:00
|
|
|
|
|
|
|
src->title_lang_event_pending = NULL;
|
|
|
|
src->pending_clut_event = NULL;
|
2006-03-28 19:29:39 +00:00
|
|
|
|
|
|
|
gst_pad_use_fixed_caps (GST_BASE_SRC_PAD (src));
|
|
|
|
gst_pad_set_caps (GST_BASE_SRC_PAD (src),
|
|
|
|
gst_static_pad_template_get_caps (&srctemplate));
|
2003-11-01 15:19:40 +00:00
|
|
|
}
|
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_is_seekable (GstBaseSrc * src)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-12-23 12:29:33 +00:00
|
|
|
static void
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_class_init (GstDvdReadSrcClass * klass)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstPushSrcClass *gstpushsrc_class = GST_PUSH_SRC_CLASS (klass);
|
|
|
|
GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass);
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gobject_class->finalize = gst_dvd_read_src_finalize;
|
|
|
|
gobject_class->set_property = gst_dvd_read_src_set_property;
|
|
|
|
gobject_class->get_property = gst_dvd_read_src_get_property;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
Synchronize property names where not yet the case. Devices are now device=X, other versions are deprecated (but still...
Original commit message from CVS:
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_set_property), (cdparanoia_get_property):
* ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_class_init),
(dvdnavsrc_set_property), (dvdnavsrc_get_property):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_init), (dvdreadsrc_set_property),
(dvdreadsrc_get_property):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_class_init),
(gst_vcdsrc_set_property), (gst_vcdsrc_get_property):
Synchronize property names where not yet the case. Devices are
now device=X, other versions are deprecated (but still exist).
Also use g_free() unconditionally.
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
(setup_source), (gst_play_base_bin_get_property):
Expose source.
2004-12-09 12:57:29 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEVICE,
|
|
|
|
g_param_spec_string ("device", "Device",
|
|
|
|
"DVD device location", NULL, G_PARAM_READWRITE));
|
2004-03-14 22:34:30 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TITLE,
|
|
|
|
g_param_spec_int ("title", "title", "title",
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
1, 999, 1, G_PARAM_READWRITE));
|
2004-03-14 22:34:30 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CHAPTER,
|
|
|
|
g_param_spec_int ("chapter", "chapter", "chapter",
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
1, 999, 1, G_PARAM_READWRITE));
|
2004-03-14 22:34:30 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ANGLE,
|
|
|
|
g_param_spec_int ("angle", "angle", "angle",
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
1, 999, 1, G_PARAM_READWRITE));
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_dvd_read_src_start);
|
|
|
|
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_dvd_read_src_stop);
|
|
|
|
gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_dvd_read_src_src_query);
|
|
|
|
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (gst_dvd_read_src_src_event);
|
2006-06-30 11:26:22 +00:00
|
|
|
gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_dvd_read_src_do_seek);
|
|
|
|
gstbasesrc_class->is_seekable =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_dvd_read_src_is_seekable);
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_dvd_read_src_create);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_start (GstBaseSrc * basesrc)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_return_val_if_fail (src->location != NULL, FALSE);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (src, "Opening DVD '%s'", src->location);
|
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
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
if ((src->dvd = DVDOpen (src->location)) == NULL)
|
|
|
|
goto open_failed;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* Load the video manager to find out the information about the titles */
|
|
|
|
GST_DEBUG_OBJECT (src, "Loading VMG info");
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
if (!(src->vmg_file = ifoOpen (src->dvd, 0)))
|
|
|
|
goto ifo_open_failed;
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
src->tt_srpt = src->vmg_file->tt_srpt;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->title = src->uri_title - 1;
|
|
|
|
src->chapter = src->uri_chapter - 1;
|
|
|
|
src->angle = src->uri_angle - 1;
|
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
if (!gst_dvd_read_src_goto_title (src, src->title, src->angle))
|
|
|
|
goto title_open_failed;
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
if (!gst_dvd_read_src_goto_chapter (src, src->chapter))
|
|
|
|
goto chapter_open_failed;
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
|
|
|
|
src->new_seek = FALSE;
|
|
|
|
src->change_cell = TRUE;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return TRUE;
|
2006-04-21 11:17:08 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Could not open DVD")),
|
|
|
|
("DVDOpen(%s) failed: %s", src->location, g_strerror (errno)));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ifo_open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Could not open DVD")),
|
|
|
|
("ifoOpen() failed: %s", g_strerror (errno)));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
title_open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Could not open DVD title %d"), src->uri_title), (NULL));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
chapter_open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Failed to go to chapter %d of DVD title %d"),
|
|
|
|
src->uri_chapter, src->uri_title), (NULL));
|
|
|
|
return FALSE;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_stop (GstBaseSrc * basesrc)
|
|
|
|
{
|
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc);
|
|
|
|
|
|
|
|
if (src->vts_file) {
|
|
|
|
ifoClose (src->vts_file);
|
|
|
|
src->vts_file = NULL;
|
|
|
|
}
|
|
|
|
if (src->vmg_file) {
|
|
|
|
ifoClose (src->vmg_file);
|
|
|
|
src->vmg_file = NULL;
|
|
|
|
}
|
|
|
|
if (src->dvd_title) {
|
|
|
|
DVDCloseFile (src->dvd_title);
|
|
|
|
src->dvd_title = NULL;
|
|
|
|
}
|
|
|
|
if (src->dvd) {
|
|
|
|
DVDClose (src->dvd);
|
|
|
|
src->dvd = NULL;
|
|
|
|
}
|
|
|
|
src->new_cell = TRUE;
|
|
|
|
src->new_seek = TRUE;
|
|
|
|
src->change_cell = FALSE;
|
|
|
|
src->chapter = 0;
|
|
|
|
src->title = 0;
|
2006-06-30 11:26:22 +00:00
|
|
|
src->need_newsegment = TRUE;
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->title_lang_event_pending) {
|
|
|
|
gst_event_unref (src->title_lang_event_pending);
|
|
|
|
src->title_lang_event_pending = NULL;
|
|
|
|
}
|
|
|
|
if (src->pending_clut_event) {
|
|
|
|
gst_event_unref (src->pending_clut_event);
|
|
|
|
src->pending_clut_event = NULL;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
GST_LOG_OBJECT (src, "closed DVD");
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return TRUE;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
static void
|
2006-02-09 17:27:57 +00:00
|
|
|
cur_title_get_chapter_pgc (GstDvdReadSrc * src, gint chapter, gint * p_pgn,
|
|
|
|
gint * p_pgc_id, pgc_t ** p_pgc)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
pgc_t *pgc;
|
|
|
|
gint pgn, pgc_id;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_assert (chapter >= 0 && chapter < src->num_chapters);
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
pgc_id = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter].pgcn;
|
|
|
|
pgn = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter].pgn;
|
|
|
|
pgc = src->vts_file->vts_pgcit->pgci_srp[pgc_id - 1].pgc;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
*p_pgn = pgn;
|
|
|
|
*p_pgc_id = pgc_id;
|
|
|
|
*p_pgc = pgc;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static void
|
|
|
|
cur_title_get_chapter_bounds (GstDvdReadSrc * src, gint chapter,
|
|
|
|
gint * p_first_cell, gint * p_last_cell)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
pgc_t *pgc;
|
|
|
|
gint pgn, pgc_id, pgn_next_ch;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_assert (chapter >= 0 && chapter < src->num_chapters);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
cur_title_get_chapter_pgc (src, chapter, &pgn, &pgc_id, &pgc);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
*p_first_cell = pgc->program_map[pgn - 1] - 1;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (chapter == (src->num_chapters - 1)) {
|
|
|
|
*p_last_cell = pgc->nr_of_cells;
|
|
|
|
} else {
|
|
|
|
pgn_next_ch = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter + 1].pgn;
|
|
|
|
*p_last_cell = pgc->program_map[pgn_next_ch - 1] - 1;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_goto_chapter (GstDvdReadSrc * src, gint chapter)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
gint i;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* make sure the chapter number is valid for this title */
|
|
|
|
if (chapter < 0 || chapter >= src->num_chapters) {
|
|
|
|
GST_WARNING_OBJECT (src, "invalid chapter %d (only %d available)",
|
|
|
|
chapter, src->num_chapters);
|
|
|
|
chapter = CLAMP (chapter, 0, src->num_chapters - 1);
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* determine which program chain we want to watch. This is
|
|
|
|
* based on the chapter number */
|
|
|
|
cur_title_get_chapter_pgc (src, chapter, &src->pgn, &src->pgc_id,
|
|
|
|
&src->cur_pgc);
|
|
|
|
cur_title_get_chapter_bounds (src, chapter, &src->start_cell,
|
|
|
|
&src->last_cell);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_LOG_OBJECT (src, "Opened chapter %d - cell %d-%d", chapter,
|
|
|
|
src->start_cell, src->last_cell);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* retrieve position */
|
|
|
|
src->cur_pack = 0;
|
|
|
|
for (i = 0; i < chapter; i++) {
|
|
|
|
gint c1, c2;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
cur_title_get_chapter_bounds (src, i, &c1, &c2);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
while (c1 < c2) {
|
|
|
|
src->cur_pack +=
|
|
|
|
src->cur_pgc->cell_playback[c1].last_sector -
|
|
|
|
src->cur_pgc->cell_playback[c1].first_sector;
|
|
|
|
++c1;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* prepare reading for new cell */
|
|
|
|
src->new_cell = TRUE;
|
|
|
|
src->next_cell = src->start_cell;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
src->chapter = chapter;
|
|
|
|
|
|
|
|
if (src->pending_clut_event)
|
|
|
|
gst_event_unref (src->pending_clut_event);
|
|
|
|
|
|
|
|
src->pending_clut_event =
|
|
|
|
gst_dvd_read_src_make_clut_change_event (src, src->cur_pgc->palette);
|
|
|
|
|
|
|
|
return TRUE;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstStructure *s;
|
|
|
|
gchar lang_code[3] = { '\0', '\0', '\0' }, *t;
|
|
|
|
gint title_set_nr;
|
|
|
|
gint num_titles;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* make sure our title number is valid */
|
|
|
|
num_titles = src->tt_srpt->nr_of_srpts;
|
|
|
|
GST_INFO_OBJECT (src, "There are %d titles on this DVD", num_titles);
|
2006-04-21 11:17:08 +00:00
|
|
|
if (title < 0 || title >= num_titles)
|
|
|
|
goto invalid_title;
|
2006-02-09 17:27:57 +00:00
|
|
|
|
|
|
|
src->num_chapters = src->tt_srpt->title[title].nr_of_ptts;
|
|
|
|
GST_INFO_OBJECT (src, "Title %d has %d chapters", title, src->num_chapters);
|
|
|
|
|
|
|
|
/* make sure the angle number is valid for this title */
|
2006-06-30 11:26:22 +00:00
|
|
|
src->num_angles = src->tt_srpt->title[title].nr_of_angles;
|
|
|
|
GST_LOG_OBJECT (src, "Title %d has %d angles", title, src->num_angles);
|
|
|
|
if (angle < 0 || angle >= src->num_angles) {
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_WARNING_OBJECT (src, "Invalid angle %d (only %d available)",
|
2006-06-30 11:26:22 +00:00
|
|
|
angle, src->num_angles);
|
|
|
|
angle = CLAMP (angle, 0, src->num_angles - 1);
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* load the VTS information for the title set our title is in */
|
|
|
|
title_set_nr = src->tt_srpt->title[title].title_set_nr;
|
|
|
|
src->vts_file = ifoOpen (src->dvd, title_set_nr);
|
2006-04-21 11:17:08 +00:00
|
|
|
if (src->vts_file == NULL)
|
|
|
|
goto ifo_open_failed;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
src->ttn = src->tt_srpt->title[title].vts_ttn;
|
|
|
|
src->vts_ptt_srpt = src->vts_file->vts_ptt_srpt;
|
|
|
|
|
|
|
|
/* we've got enough info, time to open the title set data */
|
|
|
|
src->dvd_title = DVDOpenFile (src->dvd, title_set_nr, DVD_READ_TITLE_VOBS);
|
2006-04-21 11:17:08 +00:00
|
|
|
if (src->dvd_title == NULL)
|
|
|
|
goto title_open_failed;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_INFO_OBJECT (src, "Opened title %d, angle %d", title, angle);
|
|
|
|
src->title = title;
|
|
|
|
src->angle = angle;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* build event */
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->title_lang_event_pending) {
|
|
|
|
gst_event_unref (src->title_lang_event_pending);
|
|
|
|
src->title_lang_event_pending = NULL;
|
|
|
|
}
|
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
|
|
|
|
2006-03-28 19:29:39 +00:00
|
|
|
s = gst_structure_new ("application/x-gst-dvd",
|
2006-02-09 17:27:57 +00:00
|
|
|
"event", G_TYPE_STRING, "dvd-lang-codes", NULL);
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* audio */
|
|
|
|
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_audio_streams; i++) {
|
|
|
|
const audio_attr_t *a = &src->vts_file->vtsi_mat->vts_audio_attr[i];
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
t = g_strdup_printf ("audio-%d-format", i);
|
|
|
|
gst_structure_set (s, t, G_TYPE_INT, (int) a->audio_format, NULL);
|
|
|
|
g_free (t);
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (a->lang_type) {
|
|
|
|
t = g_strdup_printf ("audio-%d-language", i);
|
|
|
|
lang_code[0] = (a->lang_code >> 8) & 0xff;
|
|
|
|
lang_code[1] = a->lang_code & 0xff;
|
|
|
|
gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL);
|
|
|
|
g_free (t);
|
|
|
|
} else {
|
|
|
|
lang_code[0] = '\0';
|
|
|
|
}
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_INFO_OBJECT (src, "[%02d] Audio %02d: lang='%s', format=%d",
|
|
|
|
src->title, i, lang_code, (gint) a->audio_format);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* subtitle */
|
|
|
|
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) {
|
|
|
|
const subp_attr_t *u = &src->vts_file->vtsi_mat->vts_subp_attr[i];
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (u->type) {
|
|
|
|
t = g_strdup_printf ("subtitle-%d-language", i);
|
|
|
|
lang_code[0] = (u->lang_code >> 8) & 0xff;
|
|
|
|
lang_code[1] = u->lang_code & 0xff;
|
|
|
|
gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL);
|
|
|
|
g_free (t);
|
|
|
|
} else {
|
|
|
|
lang_code[0] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_INFO_OBJECT (src, "[%02d] Subtitle %02d: lang='%s', format=%d",
|
|
|
|
src->title, i, lang_code);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
|
|
|
|
src->title_lang_event_pending =
|
|
|
|
gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
return TRUE;
|
2006-04-21 11:17:08 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
invalid_title:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (src, "Invalid title %d (only %d available)",
|
|
|
|
title, num_titles);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ifo_open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Could not open DVD title %d"), title_set_nr),
|
|
|
|
("ifoOpen(%d) failed: %s", title_set_nr, g_strerror (errno)));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
title_open_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
|
|
|
(_("Could not open DVD title %d"), title_set_nr),
|
|
|
|
("Can't open title VOBS (VTS_%02d_1.VOB)", title_set_nr));
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* FIXME: double-check this function, compare against original */
|
|
|
|
static gint
|
|
|
|
gst_dvd_read_src_get_next_cell_for (GstDvdReadSrc * src, gint cell)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
/* Check if we're entering an angle block. */
|
|
|
|
if (src->cur_pgc->cell_playback[cell].block_type != BLOCK_TYPE_ANGLE_BLOCK)
|
|
|
|
return (cell + 1);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
while (src->cur_pgc->cell_playback[cell].block_mode == BLOCK_MODE_LAST_CELL)
|
|
|
|
++cell;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return cell + 1; /* really +1? (tpm) */
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-06-29 12:25:15 +00:00
|
|
|
/* Returns true if the pack is a NAV pack */
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
2006-06-29 12:25:15 +00:00
|
|
|
gst_dvd_read_src_is_nav_pack (const guint8 * data)
|
2006-02-09 17:27:57 +00:00
|
|
|
{
|
2006-06-29 12:25:15 +00:00
|
|
|
if (GST_READ_UINT32_BE (data + 0x26) != 0x000001BF)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Check that this is substream 0 (PCI) */
|
|
|
|
if (data[0x2c] != 0)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (GST_READ_UINT32_BE (data + 0x400) != 0x000001BF)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Check that this is substream 1 (DSI) */
|
|
|
|
if (data[0x406] != 1)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Check sizes of PCI and DSI packets */
|
|
|
|
if (GST_READ_UINT16_BE (data + 0x2a) != 0x03d4)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (GST_READ_UINT16_BE (data + 0x404) != 0x03fa)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_DVD_READ_OK = 0,
|
|
|
|
GST_DVD_READ_ERROR = -1,
|
|
|
|
GST_DVD_READ_EOS = -2,
|
|
|
|
GST_DVD_READ_AGAIN = -3
|
|
|
|
} GstDvdReadReturn;
|
|
|
|
|
|
|
|
static GstDvdReadReturn
|
|
|
|
gst_dvd_read_src_read (GstDvdReadSrc * src, gint angle, gint new_seek,
|
2006-02-13 14:00:35 +00:00
|
|
|
GstBuffer ** p_buf)
|
2006-02-09 17:27:57 +00:00
|
|
|
{
|
2006-02-13 14:00:35 +00:00
|
|
|
GstBuffer *buf;
|
|
|
|
guint8 oneblock[DVD_VIDEO_LB_LEN];
|
2006-02-09 17:27:57 +00:00
|
|
|
dsi_t dsi_pack;
|
|
|
|
guint next_vobu, next_ilvu_start, cur_output_size;
|
|
|
|
gint len;
|
2005-01-09 19:00:29 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* playback by cell in this pgc, starting at the cell for our chapter */
|
|
|
|
if (new_seek)
|
|
|
|
src->cur_cell = src->start_cell;
|
2005-01-09 19:00:29 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
again:
|
2005-01-09 19:00:29 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->cur_cell >= src->last_cell) {
|
|
|
|
/* advance to next chapter */
|
2006-04-21 11:17:08 +00:00
|
|
|
if (src->chapter == (src->num_chapters - 1))
|
|
|
|
goto eos;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_INFO_OBJECT (src, "end of chapter %d, switch to next", src->chapter);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
++src->chapter;
|
|
|
|
gst_dvd_read_src_goto_chapter (src, src->chapter);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return GST_DVD_READ_AGAIN;
|
2004-11-23 12:49:59 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->new_cell || new_seek) {
|
|
|
|
if (!new_seek) {
|
|
|
|
src->cur_cell = src->next_cell;
|
|
|
|
if (src->cur_cell >= src->last_cell) {
|
|
|
|
GST_LOG_OBJECT (src, "last cell in chapter");
|
|
|
|
goto again;
|
|
|
|
}
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* take angle into account */
|
|
|
|
if (src->cur_pgc->cell_playback[src->cur_cell].block_type
|
|
|
|
== BLOCK_TYPE_ANGLE_BLOCK)
|
|
|
|
src->cur_cell += angle;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* calculate next cell */
|
|
|
|
src->next_cell = gst_dvd_read_src_get_next_cell_for (src, src->cur_cell);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* we loop until we're out of this cell */
|
|
|
|
src->cur_pack = src->cur_pgc->cell_playback[src->cur_cell].first_sector;
|
|
|
|
src->new_cell = FALSE;
|
2004-03-14 22:34:30 +00:00
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->cur_pack >= src->cur_pgc->cell_playback[src->cur_cell].last_sector) {
|
|
|
|
src->new_cell = TRUE;
|
|
|
|
GST_LOG_OBJECT (src, "Beyond last sector, go to next cell");
|
|
|
|
return GST_DVD_READ_AGAIN;
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* read NAV packet */
|
|
|
|
nav_retry:
|
2005-01-17 16:57:46 +00:00
|
|
|
|
2006-02-13 14:00:35 +00:00
|
|
|
len = DVDReadBlocks (src->dvd_title, src->cur_pack, 1, oneblock);
|
2006-04-21 11:17:08 +00:00
|
|
|
if (len == 0)
|
|
|
|
goto read_error;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-13 14:00:35 +00:00
|
|
|
if (!gst_dvd_read_src_is_nav_pack (oneblock)) {
|
2006-02-09 17:27:57 +00:00
|
|
|
src->cur_pack++;
|
|
|
|
goto nav_retry;
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* parse the contained dsi packet */
|
2006-02-13 14:00:35 +00:00
|
|
|
navRead_DSI (&dsi_pack, &oneblock[DSI_START_BYTE]);
|
2006-02-09 17:27:57 +00:00
|
|
|
g_assert (src->cur_pack == dsi_pack.dsi_gi.nv_pck_lbn);
|
|
|
|
|
|
|
|
/* determine where we go next. These values are the ones we
|
|
|
|
* mostly care about */
|
|
|
|
next_ilvu_start = src->cur_pack + dsi_pack.sml_agli.data[angle].address;
|
|
|
|
cur_output_size = dsi_pack.dsi_gi.vobu_ea;
|
|
|
|
|
|
|
|
/* If we're not at the end of this cell, we can determine the next
|
|
|
|
* VOBU to display using the VOBU_SRI information section of the
|
|
|
|
* DSI. Using this value correctly follows the current angle,
|
|
|
|
* avoiding the doubled scenes in The Matrix, and makes our life
|
|
|
|
* really happy.
|
|
|
|
*
|
|
|
|
* Otherwise, we set our next address past the end of this cell to
|
|
|
|
* force the code above to go to the next cell in the program. */
|
|
|
|
if (dsi_pack.vobu_sri.next_vobu != SRI_END_OF_CELL) {
|
|
|
|
next_vobu = src->cur_pack + (dsi_pack.vobu_sri.next_vobu & 0x7fffffff);
|
|
|
|
} else {
|
|
|
|
next_vobu = src->cur_pack + cur_output_size + 1;
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_assert (cur_output_size < 1024);
|
|
|
|
++src->cur_pack;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-13 14:00:35 +00:00
|
|
|
/* create the buffer (TODO: use buffer pool?) */
|
|
|
|
buf = gst_buffer_new_and_alloc (cur_output_size * DVD_VIDEO_LB_LEN);
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* read in and output cursize packs */
|
2006-02-13 14:00:35 +00:00
|
|
|
len = DVDReadBlocks (src->dvd_title, src->cur_pack, cur_output_size,
|
|
|
|
GST_BUFFER_DATA (buf));
|
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
if (len != cur_output_size)
|
|
|
|
goto block_read_error;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_BUFFER_SIZE (buf) = cur_output_size * DVD_VIDEO_LB_LEN;
|
|
|
|
/* GST_BUFFER_OFFSET (buf) = priv->cur_pack * DVD_VIDEO_LB_LEN; */
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-03-28 19:29:39 +00:00
|
|
|
gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (src)));
|
|
|
|
|
2006-02-13 14:00:35 +00:00
|
|
|
*p_buf = buf;
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
src->cur_pack = next_vobu;
|
2005-01-17 16:17:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_LOG_OBJECT (src, "Read %u sectors", cur_output_size);
|
2006-04-21 11:17:08 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return GST_DVD_READ_OK;
|
2006-04-21 11:17:08 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
GST_INFO_OBJECT (src, "last chapter done - EOS");
|
|
|
|
return GST_DVD_READ_EOS;
|
|
|
|
}
|
|
|
|
read_error:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (src, "Read failed for block %d", src->cur_pack);
|
|
|
|
return GST_DVD_READ_ERROR;
|
|
|
|
}
|
|
|
|
block_read_error:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (src, "Read failed for %d blocks at %d",
|
|
|
|
cur_output_size, src->cur_pack);
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
return GST_DVD_READ_ERROR;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_dvd_read_src_create (GstPushSrc * pushsrc, GstBuffer ** p_buf)
|
|
|
|
{
|
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (pushsrc);
|
|
|
|
GstPad *srcpad;
|
|
|
|
gint res;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_return_val_if_fail (src->dvd != NULL, GST_FLOW_ERROR);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
srcpad = GST_BASE_SRC (src)->srcpad;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
if (src->need_newsegment) {
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_pad_push_event (srcpad,
|
|
|
|
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES,
|
|
|
|
src->cur_pack * DVD_VIDEO_LB_LEN, -1, 0));
|
2006-06-30 11:26:22 +00:00
|
|
|
src->need_newsegment = FALSE;
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->new_seek) {
|
|
|
|
gst_dvd_read_src_goto_title (src, src->title, src->angle);
|
|
|
|
gst_dvd_read_src_goto_chapter (src, src->chapter);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
src->new_seek = FALSE;
|
|
|
|
src->change_cell = TRUE;
|
|
|
|
}
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->title_lang_event_pending) {
|
|
|
|
gst_pad_push_event (srcpad, src->title_lang_event_pending);
|
|
|
|
src->title_lang_event_pending = 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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (src->pending_clut_event) {
|
|
|
|
gst_pad_push_event (srcpad, src->pending_clut_event);
|
|
|
|
src->pending_clut_event = NULL;
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* read it in */
|
|
|
|
do {
|
2006-02-13 14:00:35 +00:00
|
|
|
res = gst_dvd_read_src_read (src, src->angle, src->change_cell, p_buf);
|
2006-02-09 17:27:57 +00:00
|
|
|
} while (res == GST_DVD_READ_AGAIN);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
switch (res) {
|
|
|
|
case GST_DVD_READ_ERROR:{
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), (NULL));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
case GST_DVD_READ_EOS:{
|
|
|
|
GST_INFO_OBJECT (src, "Reached EOS");
|
|
|
|
return GST_FLOW_UNEXPECTED;
|
|
|
|
}
|
|
|
|
case GST_DVD_READ_OK:{
|
|
|
|
src->change_cell = FALSE;
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
2004-03-14 22:34:30 +00:00
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_return_val_if_reached (GST_FLOW_UNEXPECTED);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static void
|
|
|
|
gst_dvd_read_src_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (object);
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
gboolean started;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_OBJECT_LOCK (src);
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
started = GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:{
|
2006-03-27 14:04:08 +00:00
|
|
|
if (started) {
|
2006-02-09 17:27:57 +00:00
|
|
|
g_warning ("%s: property '%s' needs to be set before the device is "
|
|
|
|
"opened", GST_ELEMENT_NAME (src), pspec->name);
|
|
|
|
break;;
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_free (src->location);
|
|
|
|
/* clear the filename if we get a NULL (is that possible?) */
|
|
|
|
if (g_value_get_string (value) == NULL) {
|
|
|
|
src->location = g_strdup ("/dev/dvd");
|
|
|
|
} else {
|
|
|
|
src->location = g_strdup (g_value_get_string (value));
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
case ARG_TITLE:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_title = g_value_get_int (value);
|
|
|
|
if (started) {
|
|
|
|
src->title = src->uri_title - 1;
|
|
|
|
src->new_seek = TRUE;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
case ARG_CHAPTER:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_chapter = g_value_get_int (value);
|
|
|
|
if (started) {
|
|
|
|
src->chapter = src->uri_chapter - 1;
|
|
|
|
src->new_seek = TRUE;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
case ARG_ANGLE:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_angle = g_value_get_int (value);
|
|
|
|
if (started) {
|
|
|
|
src->angle = src->uri_angle - 1;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static void
|
|
|
|
gst_dvd_read_src_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (object);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_OBJECT_LOCK (src);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:
|
|
|
|
g_value_set_string (value, src->location);
|
|
|
|
break;
|
|
|
|
case ARG_TITLE:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
g_value_set_int (value, src->uri_title);
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
case ARG_CHAPTER:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
g_value_set_int (value, src->uri_chapter);
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
case ARG_ANGLE:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
g_value_set_int (value, src->uri_angle);
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
2006-02-10 12:40:54 +00:00
|
|
|
static gboolean
|
2006-02-13 14:09:26 +00:00
|
|
|
gst_dvd_read_src_get_size (GstDvdReadSrc * src, gint64 * size)
|
2006-02-10 12:40:54 +00:00
|
|
|
{
|
|
|
|
gboolean ret = FALSE;
|
|
|
|
|
|
|
|
if (src->dvd_title) {
|
|
|
|
gsize blocks;
|
|
|
|
|
|
|
|
blocks = DVDFileSize (src->dvd_title);
|
|
|
|
if (blocks >= 0) {
|
2006-02-13 14:09:26 +00:00
|
|
|
*size = (gint64) blocks *DVD_VIDEO_LB_LEN;
|
2006-02-10 12:40:54 +00:00
|
|
|
|
|
|
|
ret = TRUE;
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (src, "DVDFileSize(%p) failed!", src->dvd_title);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/*** Querying and seeking ***/
|
|
|
|
|
|
|
|
static gboolean
|
2006-06-30 11:26:22 +00:00
|
|
|
gst_dvd_read_src_handle_seek_event (GstDvdReadSrc * src, GstEvent * event)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstSeekFlags flags;
|
|
|
|
GstSeekType cur_type, end_type;
|
2006-06-30 11:26:22 +00:00
|
|
|
gint64 new_off, total;
|
2006-02-09 17:27:57 +00:00
|
|
|
GstFormat format;
|
|
|
|
GstPad *srcpad;
|
2006-02-13 14:09:26 +00:00
|
|
|
gboolean query_ok;
|
2006-02-09 17:27:57 +00:00
|
|
|
gdouble rate;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &new_off,
|
|
|
|
&end_type, NULL);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
if (rate <= 0.0) {
|
|
|
|
GST_DEBUG_OBJECT (src, "cannot do backwards playback yet");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((flags & GST_SEEK_FLAG_SEGMENT) != 0) {
|
|
|
|
GST_DEBUG_OBJECT (src, "segment seek not supported");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((flags & GST_SEEK_FLAG_FLUSH) == 0) {
|
|
|
|
GST_DEBUG_OBJECT (src, "can only do flushing seeks at the moment");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (end_type != GST_SEEK_TYPE_NONE) {
|
2006-06-30 11:26:22 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "end seek type not supported");
|
|
|
|
return FALSE;
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
if (cur_type != GST_SEEK_TYPE_SET) {
|
|
|
|
GST_DEBUG_OBJECT (src, "only SEEK_TYPE_SET is supported");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (format == angle_format) {
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
if (new_off < 0 || new_off >= src->num_angles) {
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
GST_DEBUG_OBJECT (src, "invalid angle %d, only %d available",
|
|
|
|
src->num_angles);
|
|
|
|
return FALSE;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
2006-06-30 11:26:22 +00:00
|
|
|
src->angle = (gint) new_off;
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
GST_DEBUG_OBJECT (src, "switched to angle %d", (gint) new_off);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (format != chapter_format && format != title_format &&
|
|
|
|
format != GST_FORMAT_BYTES) {
|
|
|
|
GST_DEBUG_OBJECT (src, "unsupported seek format %d (%s)", format,
|
|
|
|
gst_format_get_name (format));
|
|
|
|
return FALSE;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
if (format == GST_FORMAT_BYTES) {
|
|
|
|
GST_DEBUG_OBJECT (src, "Requested seek to byte %" G_GUINT64_FORMAT,
|
|
|
|
new_off);
|
|
|
|
} else if (format == GST_FORMAT_TIME) {
|
|
|
|
GST_DEBUG_OBJECT (src, "Requested seek to time %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (new_off));
|
|
|
|
}
|
|
|
|
|
|
|
|
srcpad = GST_BASE_SRC_PAD (src);
|
|
|
|
|
|
|
|
/* check whether the seek looks reasonable (ie within possible range) */
|
2006-02-13 14:09:26 +00:00
|
|
|
if (format == GST_FORMAT_BYTES) {
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
query_ok = gst_dvd_read_src_get_size (src, &total);
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
} else {
|
2006-06-30 11:26:22 +00:00
|
|
|
query_ok = gst_pad_query_duration (srcpad, &format, &total);
|
2006-02-13 14:09:26 +00:00
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
|
2006-02-13 14:09:26 +00:00
|
|
|
if (!query_ok) {
|
2006-06-30 11:26:22 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "Failed to query duration in format %s",
|
|
|
|
gst_format_get_name (format));
|
2006-02-13 14:09:26 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (src, "Total %s: %12" G_GINT64_FORMAT,
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_format_get_name (format), total);
|
2006-06-30 11:26:22 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "Seek to %s: %12" G_GINT64_FORMAT,
|
|
|
|
gst_format_get_name (format), new_off);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
if (new_off >= total) {
|
|
|
|
GST_DEBUG_OBJECT (src, "Seek position out of range");
|
2006-02-09 17:27:57 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
/* set segment to seek format; this allows us to use the do_seek
|
|
|
|
* virtual function and let the base source handle all the tricky
|
|
|
|
* stuff for us. We don't use the segment internally anyway */
|
|
|
|
/* FIXME: can't take the stream lock here - what to do? */
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
GST_BASE_SRC (src)->segment.format = format;
|
|
|
|
GST_BASE_SRC (src)->segment.start = 0;
|
|
|
|
GST_BASE_SRC (src)->segment.stop = total;
|
|
|
|
GST_BASE_SRC (src)->segment.duration = total;
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
2006-02-13 14:09:26 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
return GST_BASE_SRC_CLASS (parent_class)->event (GST_BASE_SRC (src), event);
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_do_seek (GstBaseSrc * basesrc, GstSegment * s)
|
|
|
|
{
|
|
|
|
GstDvdReadSrc *src;
|
2006-02-09 17:27:57 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
src = GST_DVD_READ_SRC (basesrc);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (src, "Seeking to %s: %12" G_GINT64_FORMAT,
|
|
|
|
gst_format_get_name (s->format), s->last_stop);
|
|
|
|
|
|
|
|
if (s->format == sector_format || s->format == GST_FORMAT_BYTES) {
|
|
|
|
guint old;
|
|
|
|
|
|
|
|
old = src->cur_pack;
|
|
|
|
|
|
|
|
if (s->format == sector_format) {
|
|
|
|
src->cur_pack = s->last_stop;
|
|
|
|
} else {
|
|
|
|
/* byte format */
|
|
|
|
src->cur_pack = s->last_stop / DVD_VIDEO_LB_LEN;
|
|
|
|
if ((src->cur_pack * DVD_VIDEO_LB_LEN) != s->last_stop) {
|
|
|
|
GST_LOG_OBJECT (src, "rounded down offset %" G_GINT64_FORMAT " => %"
|
|
|
|
G_GINT64_FORMAT, s->last_stop,
|
|
|
|
(gint64) src->cur_pack * DVD_VIDEO_LB_LEN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gst_dvd_read_src_goto_sector (src, src->angle)) {
|
|
|
|
GST_DEBUG_OBJECT (src, "seek to sector 0x%08x failed", src->cur_pack);
|
|
|
|
src->cur_pack = old;
|
|
|
|
return FALSE;
|
|
|
|
}
|
2006-02-09 17:27:57 +00:00
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
GST_LOG_OBJECT (src, "seek to sector 0x%08x ok", src->cur_pack);
|
|
|
|
} else if (s->format == chapter_format) {
|
|
|
|
if (!gst_dvd_read_src_goto_chapter (src, (gint) s->last_stop)) {
|
|
|
|
GST_DEBUG_OBJECT (src, "seek to chapter %d failed", (gint) s->last_stop);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
GST_INFO_OBJECT (src, "seek to chapter %d ok", (gint) s->last_stop);
|
|
|
|
src->chapter = s->last_stop;
|
|
|
|
} else if (s->format == title_format) {
|
|
|
|
if (!gst_dvd_read_src_goto_title (src, (gint) s->last_stop, src->angle) ||
|
|
|
|
!gst_dvd_read_src_goto_chapter (src, 0)) {
|
|
|
|
GST_DEBUG_OBJECT (src, "seek to title %d failed", (gint) s->last_stop);
|
|
|
|
return FALSE;
|
2006-02-13 14:09:26 +00:00
|
|
|
}
|
2006-06-30 11:26:22 +00:00
|
|
|
src->title = (gint) s->last_stop;
|
2006-02-09 17:27:57 +00:00
|
|
|
src->chapter = 0;
|
2006-06-30 11:26:22 +00:00
|
|
|
GST_INFO_OBJECT (src, "seek to title %d ok", src->title);
|
2006-02-09 17:27:57 +00:00
|
|
|
} else {
|
|
|
|
g_return_val_if_reached (FALSE);
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-06-30 11:26:22 +00:00
|
|
|
src->need_newsegment = TRUE;
|
2006-02-09 17:27:57 +00:00
|
|
|
return TRUE;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
static gboolean
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_src_event (GstBaseSrc * basesrc, GstEvent * event)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc);
|
|
|
|
gboolean res;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-13 14:00:35 +00:00
|
|
|
GST_LOG_OBJECT (src, "handling %s event", GST_EVENT_TYPE_NAME (event));
|
2006-02-09 17:27:57 +00:00
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
2006-06-30 11:26:22 +00:00
|
|
|
res = gst_dvd_read_src_handle_seek_event (src, event);
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
res = GST_BASE_SRC_CLASS (parent_class)->event (basesrc, event);
|
|
|
|
break;
|
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
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstEvent *
|
|
|
|
gst_dvd_read_src_make_clut_change_event (GstDvdReadSrc * src,
|
|
|
|
const guint * clut)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
gchar name[16];
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
structure = gst_structure_new ("application/x-gst-dvd",
|
|
|
|
"event", G_TYPE_STRING, "dvd-spu-clut-change", NULL);
|
|
|
|
|
|
|
|
/* Create a separate field for each value in the table. */
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
g_snprintf (name, sizeof (name), "clut%02d", i);
|
|
|
|
gst_structure_set (structure, name, G_TYPE_INT, (int) clut[i], NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create the DVD event and put the structure into it. */
|
|
|
|
return gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, structure);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint64
|
|
|
|
gst_dvd_read_src_convert_timecode (dvd_time_t * time)
|
|
|
|
{
|
|
|
|
gint64 ret_time;
|
|
|
|
const gint64 one_hour = 3600 * GST_SECOND;
|
|
|
|
const gint64 one_min = 60 * GST_SECOND;
|
|
|
|
|
|
|
|
g_return_val_if_fail ((time->hour >> 4) < 0xa
|
|
|
|
&& (time->hour & 0xf) < 0xa, -1);
|
|
|
|
g_return_val_if_fail ((time->minute >> 4) < 0x7
|
|
|
|
&& (time->minute & 0xf) < 0xa, -1);
|
|
|
|
g_return_val_if_fail ((time->second >> 4) < 0x7
|
|
|
|
&& (time->second & 0xf) < 0xa, -1);
|
|
|
|
|
|
|
|
ret_time = ((time->hour >> 4) * 10 + (time->hour & 0xf)) * one_hour;
|
|
|
|
ret_time += ((time->minute >> 4) * 10 + (time->minute & 0xf)) * one_min;
|
|
|
|
ret_time += ((time->second >> 4) * 10 + (time->second & 0xf)) * GST_SECOND;
|
|
|
|
|
|
|
|
return ret_time;
|
|
|
|
}
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_do_duration_query (GstDvdReadSrc * src, GstQuery * query)
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
gint64 val;
|
|
|
|
|
|
|
|
gst_query_parse_duration (query, &format, NULL);
|
|
|
|
|
|
|
|
switch (format) {
|
|
|
|
case GST_FORMAT_TIME:{
|
|
|
|
if (src->cur_pgc == NULL)
|
|
|
|
return FALSE;
|
|
|
|
val = gst_dvd_read_src_convert_timecode (&src->cur_pgc->playback_time);
|
|
|
|
if (val < 0)
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_FORMAT_BYTES:{
|
2006-02-13 14:09:26 +00:00
|
|
|
if (!gst_dvd_read_src_get_size (src, &val))
|
2006-02-10 12:40:54 +00:00
|
|
|
return FALSE;
|
2006-02-09 17:27:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:{
|
|
|
|
if (format == sector_format) {
|
|
|
|
val = DVDFileSize (src->dvd_title);
|
|
|
|
} else if (format == title_format) {
|
|
|
|
val = src->tt_srpt->nr_of_srpts;
|
|
|
|
} else if (format == chapter_format) {
|
|
|
|
val = src->num_chapters;
|
|
|
|
} else if (format == angle_format) {
|
|
|
|
val = src->tt_srpt->title[src->title].nr_of_angles;
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (src, "Don't know how to handle format %d (%s)",
|
|
|
|
format, gst_format_get_name (format));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-10 12:40:54 +00:00
|
|
|
GST_LOG_OBJECT (src, "duration = %" G_GINT64_FORMAT " %s", val,
|
|
|
|
gst_format_get_name (format));
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_query_set_duration (query, format, val);
|
2001-12-23 12:29:33 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_do_position_query (GstDvdReadSrc * src, GstQuery * query)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstFormat format;
|
|
|
|
gint64 val;
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_query_parse_position (query, &format, NULL);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
switch (format) {
|
|
|
|
case GST_FORMAT_BYTES:{
|
|
|
|
val = src->cur_pack * DVD_VIDEO_LB_LEN;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:{
|
|
|
|
if (format == sector_format) {
|
|
|
|
val = src->cur_pack;
|
|
|
|
} else if (format == title_format) {
|
|
|
|
val = src->title;
|
|
|
|
} else if (format == chapter_format) {
|
|
|
|
val = src->chapter;
|
|
|
|
} else if (format == angle_format) {
|
|
|
|
val = src->angle;
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (src, "Don't know how to handle format %d (%s)",
|
|
|
|
format, gst_format_get_name (format));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-10 12:40:54 +00:00
|
|
|
GST_LOG_OBJECT (src, "position = %" G_GINT64_FORMAT " %s", val,
|
|
|
|
gst_format_get_name (format));
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_query_set_position (query, format, val);
|
|
|
|
return TRUE;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_src_query (GstBaseSrc * basesrc, GstQuery * query)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc);
|
|
|
|
gboolean started;
|
|
|
|
gboolean res = TRUE;
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_LOG_OBJECT (src, "handling %s query",
|
|
|
|
gst_query_type_get_name (GST_QUERY_TYPE (query)));
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
started = (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED));
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
if (!started) {
|
|
|
|
GST_DEBUG_OBJECT (src, "query failed: not started");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
|
|
|
case GST_QUERY_DURATION:
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
res = gst_dvd_read_src_do_duration_query (src, query);
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
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
|
|
|
break;
|
2006-02-09 17:27:57 +00:00
|
|
|
case GST_QUERY_POSITION:
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
res = gst_dvd_read_src_do_position_query (src, query);
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
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
|
|
|
break;
|
|
|
|
default:
|
2006-02-09 17:27:57 +00:00
|
|
|
res = GST_BASE_SRC_CLASS (parent_class)->query (basesrc, query);
|
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
|
|
|
break;
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return res;
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvd_read_src_goto_sector (GstDvdReadSrc * src, int angle)
|
|
|
|
{
|
|
|
|
gint seek_to = src->cur_pack;
|
|
|
|
gint chapter, sectors, next, cur, i;
|
|
|
|
|
|
|
|
/* retrieve position */
|
|
|
|
src->cur_pack = 0;
|
|
|
|
for (i = 0; i < src->num_chapters; i++) {
|
|
|
|
gint c1, c2;
|
|
|
|
|
|
|
|
cur_title_get_chapter_bounds (src, i, &c1, &c2);
|
|
|
|
|
|
|
|
for (next = cur = c1; cur < c2;) {
|
|
|
|
if (next != cur) {
|
|
|
|
sectors =
|
|
|
|
src->cur_pgc->cell_playback[cur].last_sector -
|
|
|
|
src->cur_pgc->cell_playback[cur].first_sector;
|
|
|
|
if (src->cur_pack + sectors > seek_to) {
|
|
|
|
chapter = i;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
src->cur_pack += sectors;
|
|
|
|
}
|
|
|
|
cur = next;
|
|
|
|
if (src->cur_pgc->cell_playback[cur].block_type == BLOCK_TYPE_ANGLE_BLOCK)
|
|
|
|
cur += angle;
|
|
|
|
next = gst_dvd_read_src_get_next_cell_for (src, cur);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (src, "Seek to sector %u failed", seek_to);
|
2006-04-21 11:17:08 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
done:
|
2006-04-21 11:17:08 +00:00
|
|
|
{
|
|
|
|
/* so chapter $chapter and cell $cur contain our sector
|
|
|
|
* of interest. Let's go there! */
|
|
|
|
GST_INFO_OBJECT (src, "Seek succeeded, going to chapter %u, cell %u",
|
|
|
|
chapter, cur);
|
|
|
|
|
|
|
|
gst_dvd_read_src_goto_chapter (src, chapter);
|
|
|
|
src->cur_cell = cur;
|
|
|
|
src->next_cell = next;
|
|
|
|
src->new_cell = FALSE;
|
|
|
|
src->cur_pack = seek_to;
|
2006-02-09 17:27:57 +00:00
|
|
|
|
2006-04-21 11:17:08 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
|
|
|
|
/*** URI interface ***/
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2005-01-17 16:57:46 +00:00
|
|
|
static GstURIType
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_uri_get_type (void)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
|
|
|
return GST_URI_SRC;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar **
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_uri_get_protocols (void)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
|
|
|
static gchar *protocols[] = { "dvd", NULL };
|
|
|
|
|
|
|
|
return protocols;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar *
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_uri_get_uri (GstURIHandler * handler)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (handler);
|
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
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
g_free (src->last_uri);
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->last_uri = g_strdup_printf ("dvd://%d,%d,%d", src->uri_title,
|
|
|
|
src->uri_chapter, src->uri_angle);
|
|
|
|
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
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
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
return src->last_uri;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GstDvdReadSrc *src = GST_DVD_READ_SRC (handler);
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
gboolean ret;
|
2006-02-09 17:27:57 +00:00
|
|
|
gchar *protocol;
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
protocol = gst_uri_get_protocol (uri);
|
|
|
|
ret = (protocol != NULL && g_str_equal (protocol, "dvd"));
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
g_free (protocol);
|
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
|
|
|
protocol = NULL;
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
return ret;
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
/* parse out the new t/c/a and seek to them */
|
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
|
|
|
{
|
|
|
|
gchar *location = NULL;
|
|
|
|
gchar **strs;
|
|
|
|
gchar **strcur;
|
|
|
|
gint pos = 0;
|
|
|
|
|
|
|
|
location = gst_uri_get_location (uri);
|
|
|
|
|
|
|
|
if (!location)
|
|
|
|
return ret;
|
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
|
|
|
|
src->uri_title = 1;
|
|
|
|
src->uri_chapter = 1;
|
|
|
|
src->uri_angle = 1;
|
|
|
|
|
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
|
|
|
strcur = strs = g_strsplit (location, ",", 0);
|
|
|
|
while (strcur && *strcur) {
|
|
|
|
gint val;
|
|
|
|
|
|
|
|
if (!sscanf (*strcur, "%d", &val))
|
|
|
|
break;
|
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
if (val <= 0) {
|
|
|
|
g_warning ("Invalid value %d in URI '%s'. Must be 1 or greater",
|
|
|
|
val, location);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
switch (pos) {
|
|
|
|
case 0:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_title = val;
|
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
|
|
|
break;
|
|
|
|
case 1:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_chapter = val;
|
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
|
|
|
break;
|
|
|
|
case 2:
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
src->uri_angle = val;
|
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
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
strcur++;
|
|
|
|
pos++;
|
|
|
|
}
|
|
|
|
|
ext/dvdread/dvdreadsrc.*: Let's try to play the title the user set via the URI handler or via properties instead of a...
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
(gst_dvd_read_src_class_init), (gst_dvd_read_src_start),
(gst_dvd_read_src_stop), (gst_dvd_read_src_goto_title),
(gst_dvd_read_src_set_property), (gst_dvd_read_src_get_property),
(gst_dvd_read_src_uri_get_uri), (gst_dvd_read_src_uri_set_uri):
* ext/dvdread/dvdreadsrc.h:
Let's try to play the title the user set via the URI handler or
via properties instead of always playing the first title. Also,
Also, count title/chapter/angle number in URI and properties
from 1 rather than 0.
2006-02-14 14:57:18 +00:00
|
|
|
if (pos > 0 && GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED)) {
|
|
|
|
src->title = src->uri_title - 1;
|
|
|
|
src->chapter = src->uri_chapter - 1;
|
|
|
|
src->angle = src->uri_angle - 1;
|
|
|
|
src->new_seek = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
|
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
|
|
|
g_strfreev (strs);
|
|
|
|
g_free (location);
|
|
|
|
}
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-02-09 17:27:57 +00:00
|
|
|
gst_dvd_read_src_uri_handler_init (gpointer g_iface, gpointer iface_data)
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
{
|
|
|
|
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
|
|
|
|
|
2006-02-09 17:27:57 +00:00
|
|
|
iface->get_type = gst_dvd_read_src_uri_get_type;
|
|
|
|
iface->get_protocols = gst_dvd_read_src_uri_get_protocols;
|
|
|
|
iface->get_uri = gst_dvd_read_src_uri_get_uri;
|
|
|
|
iface->set_uri = gst_dvd_read_src_uri_set_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvd_read_src_do_init (GType dvdreadsrc_type)
|
|
|
|
{
|
|
|
|
static const GInterfaceInfo urihandler_info = {
|
|
|
|
gst_dvd_read_src_uri_handler_init,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
g_type_add_interface_static (dvdreadsrc_type, GST_TYPE_URI_HANDLER,
|
|
|
|
&urihandler_info);
|
|
|
|
|
|
|
|
title_format = gst_format_register ("title", "DVD title");
|
|
|
|
angle_format = gst_format_register ("angle", "DVD angle");
|
|
|
|
sector_format = gst_format_register ("sector", "DVD sector");
|
|
|
|
chapter_format = gst_format_register ("chapter", "DVD chapter");
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
}
|
|
|
|
|
2001-12-23 12:29:33 +00:00
|
|
|
static gboolean
|
2004-03-14 22:34:30 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2001-12-23 12:29:33 +00:00
|
|
|
{
|
2006-02-09 17:27:57 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gstgst_dvd_read_src_debug, "dvdreadsrc", 0,
|
|
|
|
"DVD reader element based on dvdreadsrc");
|
|
|
|
|
|
|
|
if (!gst_element_register (plugin, "dvdreadsrc", GST_RANK_SECONDARY,
|
|
|
|
GST_TYPE_DVD_READ_SRC)) {
|
2003-11-01 15:19:40 +00:00
|
|
|
return FALSE;
|
2006-02-09 17:27:57 +00:00
|
|
|
}
|
2001-12-23 12:29:33 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
2006-02-09 17:27:57 +00:00
|
|
|
"dvdread",
|
2004-03-14 22:34:30 +00:00
|
|
|
"Access a DVD with dvdread",
|
2006-04-01 09:54:39 +00:00
|
|
|
plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|