summaryrefslogtreecommitdiffstats
path: root/ext/resindvd/gstmpegdemux.c
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-07-11 14:06:08 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-07-11 14:06:08 +0000
commit9a392ef442ef284f63c36ef3690445e5938a046a (patch)
treef648a0b8f712c94cfd1dd8a3c4cd373477b560f5 /ext/resindvd/gstmpegdemux.c
parentf79bf9a0fba0c37de0734fd618bbfc499889facf (diff)
downloadgst-plugins-bad-9a392ef442ef284f63c36ef3690445e5938a046a.tar.gz
gst-plugins-bad-9a392ef442ef284f63c36ef3690445e5938a046a.tar.bz2
gst-plugins-bad-9a392ef442ef284f63c36ef3690445e5938a046a.zip
docs/plugins/.cvsignore: Ignore *-undeclared.txt
Original commit message from CVS: * docs/plugins/.cvsignore: Ignore *-undeclared.txt * ext/resindvd/rsnaudiomunge.c: Turn g_print's into debug statements. * ext/resindvd/resin-play: * ext/resindvd/Makefile.am: * ext/resindvd/resindvdbin.c: * ext/resindvd/resindvdbin.h: * ext/resindvd/rsnparsetter.c: * ext/resindvd/rsnparsetter.h: * ext/resindvd/rsnwrappedbuffer.c: * ext/resindvd/rsnwrappedbuffer.h: Add a bloated implementation of a really simple idea: Replace the pixel-aspect-ratio in the output video with a prescribed one when necessary. There must be an easier way. Split the dvdspu out of the resindvdbin and put out the subpicture stream on the subpicture pad. * ext/resindvd/gstmpegdemux.c: Send video-aspect events down the pipe from the demuxer. * ext/resindvd/resindvdsrc.c: * ext/resindvd/resindvdsrc.h: Handle timed-stills somewhat using g_cond_timed_wait, with a FIXME to make it use clock-waiting later. * ext/resindvd/rsnbasesrc.c: Don't overwrite the last_stop in the basesrc segment after a seamless seek.
Diffstat (limited to 'ext/resindvd/gstmpegdemux.c')
-rw-r--r--ext/resindvd/gstmpegdemux.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/ext/resindvd/gstmpegdemux.c b/ext/resindvd/gstmpegdemux.c
index 5e1da719..358acfa0 100644
--- a/ext/resindvd/gstmpegdemux.c
+++ b/ext/resindvd/gstmpegdemux.c
@@ -35,7 +35,7 @@
/* The SCR_MUNGE value is used to offset the scr_adjust value, to avoid
* ever generating a negative timestamp */
-#define SCR_MUNGE (2 * GST_SECOND)
+#define SCR_MUNGE (10 * GST_SECOND)
/* We clamp scr delta with 0 so negative bytes won't be possible */
#define GSTTIME_TO_BYTES(time) \
@@ -266,6 +266,7 @@ gst_flups_demux_create_stream (GstFluPSDemux * demux, gint id, gint stream_type)
case ST_GST_VIDEO_MPEG1_OR_2:
{
gint mpeg_version = 1;
+
if (stream_type == ST_VIDEO_MPEG2 ||
(stream_type == ST_GST_VIDEO_MPEG1_OR_2 && demux->is_mpeg2_pack)) {
mpeg_version = 2;
@@ -584,19 +585,35 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
if (strcmp (type, "dvd-lang-codes") == 0) {
GstEvent **p_ev;
+
/* Store the language codes event on the element, then iterate over the
* streams it specifies and retrieve them. The stream creation code then
* creates the pad appropriately and sends tag events as needed */
p_ev = &demux->lang_codes;
gst_event_replace (p_ev, event);
- GST_ERROR_OBJECT (demux, "*********************\nLang codes event %s",
- gst_structure_to_string (structure));
-
GST_DEBUG_OBJECT (demux, "Handling language codes event");
- /* Create a video pad to ensure have it before emit no more pads */
+ /* Create a video pad to ensure it exists before emit no more pads */
temp = gst_flups_demux_get_stream (demux, 0xe0, ST_VIDEO_MPEG2);
+ /* Send a video format event downstream */
+ {
+ gboolean is_widescreen, is_pal;
+
+ if (gst_structure_get_boolean (structure,
+ "video-widescreen", &is_widescreen) &&
+ gst_structure_get_boolean (structure, "video-pal-format", &is_pal)) {
+ GstEvent *v_format;
+ GstStructure *v_struct;
+
+ v_struct = gst_structure_new ("application/x-gst-dvd",
+ "event", G_TYPE_STRING, "dvd-video-format",
+ "video-widescreen", G_TYPE_BOOLEAN, is_widescreen,
+ "video-pal-format", G_TYPE_BOOLEAN, is_pal, NULL);
+ v_format = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, v_struct);
+ gst_pad_push_event (temp->pad, v_format);
+ }
+ }
/* Read out the languages for audio streams and request each one that
* is present */
@@ -646,6 +663,7 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
/* And subtitle streams */
for (i = 0; i < MAX_DVD_SUBPICTURE_STREAMS; i++) {
gint stream_format;
+
g_snprintf (cur_stream_name, 32, "subpicture-%d-format", i);
if (!gst_structure_get_int (structure, cur_stream_name, &stream_format))