diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2008-06-17 19:52:00 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2008-06-17 19:52:00 +0000 |
commit | fc19ab1ded25b25481b7562f5033b563da3e1f4f (patch) | |
tree | 9ce8fdfd780a917b095eeaba01af41a0f876d6c9 | |
parent | fe76d3be8dceaa6170a3c479987496941f1ed2a2 (diff) | |
download | gst-plugins-bad-fc19ab1ded25b25481b7562f5033b563da3e1f4f.tar.gz gst-plugins-bad-fc19ab1ded25b25481b7562f5033b563da3e1f4f.tar.bz2 gst-plugins-bad-fc19ab1ded25b25481b7562f5033b563da3e1f4f.zip |
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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ext/resindvd/resindvdbin.c | 15 | ||||
-rw-r--r-- | ext/resindvd/resindvdsrc.c | 33 | ||||
-rw-r--r-- | gst/dvdspu/gstdvdspu.c | 8 |
4 files changed, 57 insertions, 11 deletions
@@ -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> * configure.ac: diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c index 9fe091f2..81d511a0 100644 --- a/ext/resindvd/resindvdbin.c +++ b/ext/resindvd/resindvdbin.c @@ -191,7 +191,7 @@ rsn_dvdbin_uri_get_uri (GstURIHandler * handler) static gboolean rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri) { - // RsnDvdBin *dvdbin = RESINDVDBIN (handler); + RsnDvdBin *dvdbin = RESINDVDBIN (handler); gboolean ret; gchar *protocol, *location; @@ -208,9 +208,14 @@ rsn_dvdbin_uri_set_uri (GstURIHandler * handler, const gchar * uri) location = gst_uri_get_location (uri); if (!location) 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 /* * 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; gint pos = 0; - location = gst_uri_get_location (uri); - - if (!location) - return ret; - strcur = strs = g_strsplit (location, ",", 0); while (strcur && *strcur) { gint val; @@ -527,6 +527,7 @@ remove_elements (RsnDvdBin * dvdbin) DVDBIN_LOCK (dvdbin); if (dvdbin->pieces[i] != NULL) { GstElement *piece = dvdbin->pieces[i]; + dvdbin->pieces[i] = NULL; DVDBIN_UNLOCK (dvdbin); diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index c98870c7..13fae757 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -113,6 +113,7 @@ static void rsn_dvdsrc_update_highlight (resinDvdSrc * src); static GstFlowReturn rsn_dvdsrc_create (RsnPushSrc * psrc, GstBuffer ** buf); static gboolean rsn_dvdsrc_src_event (RsnBaseSrc * basesrc, GstEvent * event); +static gboolean rsn_dvdsrc_src_query (RsnBaseSrc * basesrc, GstQuery * query); static void 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_stop = GST_DEBUG_FUNCPTR (rsn_dvdsrc_unlock_stop); 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 = GST_DEBUG_FUNCPTR (rsn_dvdsrc_prepare_seek); gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (rsn_dvdsrc_do_seek); @@ -187,6 +189,7 @@ static void rsn_dvdsrc_finalize (GObject * object) { resinDvdSrc *src = RESINDVDSRC (object); + g_mutex_free (src->dvd_lock); g_mutex_free (src->branch_lock); g_cond_free (src->still_cond); @@ -287,6 +290,7 @@ rsn_dvdsrc_start (RsnBaseSrc * bsrc) src->need_segment = TRUE; src->cur_position = GST_CLOCK_TIME_NONE; + src->pgc_duration = GST_CLOCK_TIME_NONE; src->cur_start_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++) { ifo_handle_t *ifo = ifoOpen (src->dvdread, i); + if (!ifo) { GST_ERROR ("Can't open VTS %d", i); return FALSE; @@ -574,6 +579,7 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock, GstBuffer ** outbuf) break; case DVDNAV_STILL_FRAME:{ dvdnav_still_event_t *info = (dvdnav_still_event_t *) data; + g_print ("STILL frame duration %d\n", info->length); if (!have_dvd_lock) { @@ -660,6 +666,7 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock, GstBuffer ** outbuf) rsn_dvdsrc_update_highlight (src); if (src->highlight_event && have_dvd_lock) { GstEvent *hl_event = src->highlight_event; + src->highlight_event = NULL; g_mutex_unlock (src->dvd_lock); 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) { const gchar *key = gst_structure_get_string (s, "key"); + if (key == NULL) return FALSE; @@ -1328,6 +1336,31 @@ rsn_dvdsrc_src_event (RsnBaseSrc * basesrc, GstEvent * event) } 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 rsn_dvdsrc_prepare_seek (RsnBaseSrc * bsrc, GstEvent * event, GstSegment * segment) { diff --git a/gst/dvdspu/gstdvdspu.c b/gst/dvdspu/gstdvdspu.c index 680d9101..a2273d96 100644 --- a/gst/dvdspu/gstdvdspu.c +++ b/gst/dvdspu/gstdvdspu.c @@ -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_advance_spu (GstDVDSpu * dvdspu, GstClockTime new_ts); static GstFlowReturn -dvspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf); +dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf); static void 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 && !(state->flags & SPU_STATE_STILL_FRAME)) { 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); 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, 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); @@ -533,7 +533,7 @@ gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf) } static GstFlowReturn -dvspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf) +dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf) { GstClockTime new_ts; GstFlowReturn ret; |