ext/resindvd/resindvdbin.c: Parse the URI argument into the device name so dvd:///path/to/image works.

Original commit message from CVS:
* ext/resindvd/resindvdbin.c:
Parse the URI argument into the device name so dvd:///path/to/image
works.
* ext/resindvd/resindvdsrc.c:
Implement a trivial duration query reporting the current PGC length.
* gst/dvdspu/gstdvdspu.c:
Rename typo in the function name.
This commit is contained in:
Jan Schmidt 2008-06-17 19:52:00 +00:00
parent fe76d3be8d
commit fc19ab1ded
4 changed files with 57 additions and 11 deletions

View file

@ -1,3 +1,15 @@
2008-06-17 Jan Schmidt <jan.schmidt@sun.com>
* ext/resindvd/resindvdbin.c:
Parse the URI argument into the device name so dvd:///path/to/image
works.
* ext/resindvd/resindvdsrc.c:
Implement a trivial duration query reporting the current PGC length.
* gst/dvdspu/gstdvdspu.c:
Rename typo in the function name.
2008-06-17 Sebastian Dröge <slomo@circular-chaos.org> 2008-06-17 Sebastian Dröge <slomo@circular-chaos.org>
* configure.ac: * configure.ac:

View file

@ -191,7 +191,7 @@ rsn_dvdbin_uri_get_uri (GstURIHandler * handler)
static gboolean static gboolean
rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri) rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{ {
// RsnDvdBin *dvdbin = RESINDVDBIN (handler); RsnDvdBin *dvdbin = RESINDVDBIN (handler);
gboolean ret; gboolean ret;
gchar *protocol, *location; gchar *protocol, *location;
@ -208,9 +208,14 @@ rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri)
location = gst_uri_get_location (uri); location = gst_uri_get_location (uri);
if (!location) if (!location)
return ret; return ret;
/* /*
* Parse out the device name * URI structure: dvd:///path/to/device
*/ */
if (g_str_has_prefix (uri, "dvd://")) {
g_free (dvdbin->device);
dvdbin->device = g_strdup (uri + 6);
}
#if 0 #if 0
/* /*
* Parse out the new t/c/a and seek to them * Parse out the new t/c/a and seek to them
@ -220,11 +225,6 @@ rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri)
gchar **strcur; gchar **strcur;
gint pos = 0; gint pos = 0;
location = gst_uri_get_location (uri);
if (!location)
return ret;
strcur = strs = g_strsplit (location, ",", 0); strcur = strs = g_strsplit (location, ",", 0);
while (strcur && *strcur) { while (strcur && *strcur) {
gint val; gint val;
@ -527,6 +527,7 @@ remove_elements (RsnDvdBin * dvdbin)
DVDBIN_LOCK (dvdbin); DVDBIN_LOCK (dvdbin);
if (dvdbin->pieces[i] != NULL) { if (dvdbin->pieces[i] != NULL) {
GstElement *piece = dvdbin->pieces[i]; GstElement *piece = dvdbin->pieces[i];
dvdbin->pieces[i] = NULL; dvdbin->pieces[i] = NULL;
DVDBIN_UNLOCK (dvdbin); DVDBIN_UNLOCK (dvdbin);

View file

@ -113,6 +113,7 @@ static void rsn_dvdsrc_update_highlight (resinDvdSrc * src);
static GstFlowReturn rsn_dvdsrc_create (RsnPushSrc * psrc, GstBuffer ** buf); static GstFlowReturn rsn_dvdsrc_create (RsnPushSrc * psrc, GstBuffer ** buf);
static gboolean rsn_dvdsrc_src_event (RsnBaseSrc * basesrc, GstEvent * event); static gboolean rsn_dvdsrc_src_event (RsnBaseSrc * basesrc, GstEvent * event);
static gboolean rsn_dvdsrc_src_query (RsnBaseSrc * basesrc, GstQuery * query);
static void static void
rsn_dvdsrc_register_extra (GType rsn_dvdsrc_type) rsn_dvdsrc_register_extra (GType rsn_dvdsrc_type)
@ -160,6 +161,7 @@ rsn_dvdsrc_class_init (resinDvdSrcClass * klass)
gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (rsn_dvdsrc_unlock); gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (rsn_dvdsrc_unlock);
gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (rsn_dvdsrc_unlock_stop); gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (rsn_dvdsrc_unlock_stop);
gstbasesrc_class->event = GST_DEBUG_FUNCPTR (rsn_dvdsrc_src_event); gstbasesrc_class->event = GST_DEBUG_FUNCPTR (rsn_dvdsrc_src_event);
gstbasesrc_class->query = GST_DEBUG_FUNCPTR (rsn_dvdsrc_src_query);
gstbasesrc_class->prepare_seek_segment = gstbasesrc_class->prepare_seek_segment =
GST_DEBUG_FUNCPTR (rsn_dvdsrc_prepare_seek); GST_DEBUG_FUNCPTR (rsn_dvdsrc_prepare_seek);
gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (rsn_dvdsrc_do_seek); gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (rsn_dvdsrc_do_seek);
@ -187,6 +189,7 @@ static void
rsn_dvdsrc_finalize (GObject * object) rsn_dvdsrc_finalize (GObject * object)
{ {
resinDvdSrc *src = RESINDVDSRC (object); resinDvdSrc *src = RESINDVDSRC (object);
g_mutex_free (src->dvd_lock); g_mutex_free (src->dvd_lock);
g_mutex_free (src->branch_lock); g_mutex_free (src->branch_lock);
g_cond_free (src->still_cond); g_cond_free (src->still_cond);
@ -287,6 +290,7 @@ rsn_dvdsrc_start (RsnBaseSrc * bsrc)
src->need_segment = TRUE; src->need_segment = TRUE;
src->cur_position = GST_CLOCK_TIME_NONE; src->cur_position = GST_CLOCK_TIME_NONE;
src->pgc_duration = GST_CLOCK_TIME_NONE;
src->cur_start_ts = GST_CLOCK_TIME_NONE; src->cur_start_ts = GST_CLOCK_TIME_NONE;
src->cur_end_ts = GST_CLOCK_TIME_NONE; src->cur_end_ts = GST_CLOCK_TIME_NONE;
@ -343,6 +347,7 @@ read_vts_info (resinDvdSrc * src)
for (i = 1; i <= n_vts; i++) { for (i = 1; i <= n_vts; i++) {
ifo_handle_t *ifo = ifoOpen (src->dvdread, i); ifo_handle_t *ifo = ifoOpen (src->dvdread, i);
if (!ifo) { if (!ifo) {
GST_ERROR ("Can't open VTS %d", i); GST_ERROR ("Can't open VTS %d", i);
return FALSE; return FALSE;
@ -574,6 +579,7 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock, GstBuffer ** outbuf)
break; break;
case DVDNAV_STILL_FRAME:{ case DVDNAV_STILL_FRAME:{
dvdnav_still_event_t *info = (dvdnav_still_event_t *) data; dvdnav_still_event_t *info = (dvdnav_still_event_t *) data;
g_print ("STILL frame duration %d\n", info->length); g_print ("STILL frame duration %d\n", info->length);
if (!have_dvd_lock) { if (!have_dvd_lock) {
@ -660,6 +666,7 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock, GstBuffer ** outbuf)
rsn_dvdsrc_update_highlight (src); rsn_dvdsrc_update_highlight (src);
if (src->highlight_event && have_dvd_lock) { if (src->highlight_event && have_dvd_lock) {
GstEvent *hl_event = src->highlight_event; GstEvent *hl_event = src->highlight_event;
src->highlight_event = NULL; src->highlight_event = NULL;
g_mutex_unlock (src->dvd_lock); g_mutex_unlock (src->dvd_lock);
g_print ("Highlight change - button: %d\n", src->active_button); g_print ("Highlight change - button: %d\n", src->active_button);
@ -893,6 +900,7 @@ rsn_dvdsrc_handle_navigation_event (resinDvdSrc * src, GstEvent * event)
if (strcmp (event_type, "key-press") == 0) { if (strcmp (event_type, "key-press") == 0) {
const gchar *key = gst_structure_get_string (s, "key"); const gchar *key = gst_structure_get_string (s, "key");
if (key == NULL) if (key == NULL)
return FALSE; return FALSE;
@ -1327,6 +1335,31 @@ rsn_dvdsrc_src_event (RsnBaseSrc * basesrc, GstEvent * event)
return res; return res;
} }
static gboolean
rsn_dvdsrc_src_query (RsnBaseSrc * basesrc, GstQuery * query)
{
resinDvdSrc *src = RESINDVDSRC (basesrc);
gboolean res = FALSE;
GstFormat format;
gint64 val;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
gst_query_parse_duration (query, &format, NULL);
if (format == GST_FORMAT_TIME && src->pgc_duration != GST_CLOCK_TIME_NONE) {
val = src->pgc_duration;
gst_query_set_duration (query, format, val);
res = TRUE;
}
break;
default:
res = GST_BASE_SRC_CLASS (parent_class)->query (basesrc, query);
break;
}
return res;
}
static gboolean static gboolean
rsn_dvdsrc_prepare_seek (RsnBaseSrc * bsrc, GstEvent * event, rsn_dvdsrc_prepare_seek (RsnBaseSrc * bsrc, GstEvent * event,
GstSegment * segment) GstSegment * segment)

View file

@ -102,7 +102,7 @@ static void gst_dvd_spu_clear (GstDVDSpu * dvdspu);
static void gst_dvd_spu_flush_spu_info (GstDVDSpu * dvdspu); static void gst_dvd_spu_flush_spu_info (GstDVDSpu * dvdspu);
static void gst_dvd_spu_advance_spu (GstDVDSpu * dvdspu, GstClockTime new_ts); static void gst_dvd_spu_advance_spu (GstDVDSpu * dvdspu, GstClockTime new_ts);
static GstFlowReturn static GstFlowReturn
dvspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf); dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf);
static void static void
gst_dvd_spu_base_init (gpointer gclass) gst_dvd_spu_base_init (gpointer gclass)
@ -470,7 +470,7 @@ gst_dvd_spu_video_event (GstPad * pad, GstEvent * event)
while (dvdspu->video_seg.last_stop < start && while (dvdspu->video_seg.last_stop < start &&
!(state->flags & SPU_STATE_STILL_FRAME)) { !(state->flags & SPU_STATE_STILL_FRAME)) {
DVD_SPU_UNLOCK (dvdspu); DVD_SPU_UNLOCK (dvdspu);
if (dvspu_handle_vid_buffer (dvdspu, NULL) != GST_FLOW_OK) { if (dvdspu_handle_vid_buffer (dvdspu, NULL) != GST_FLOW_OK) {
DVD_SPU_LOCK (dvdspu); DVD_SPU_LOCK (dvdspu);
break; break;
} }
@ -525,7 +525,7 @@ gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf)
GST_LOG_OBJECT (dvdspu, "video buffer %p with TS %" GST_TIME_FORMAT, GST_LOG_OBJECT (dvdspu, "video buffer %p with TS %" GST_TIME_FORMAT,
buf, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); buf, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
ret = dvspu_handle_vid_buffer (dvdspu, buf); ret = dvdspu_handle_vid_buffer (dvdspu, buf);
gst_object_unref (dvdspu); gst_object_unref (dvdspu);
@ -533,7 +533,7 @@ gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf)
} }
static GstFlowReturn static GstFlowReturn
dvspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf) dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf)
{ {
GstClockTime new_ts; GstClockTime new_ts;
GstFlowReturn ret; GstFlowReturn ret;