Commit 40cec75c authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

ext/dirac/: Do something. Don't actually know if this works because I don't have a demuxer yet.

Original commit message from CVS:
* ext/dirac/Makefile.am:
* ext/dirac/gstdirac.cc:
* ext/dirac/gstdiracdec.cc:
* ext/dirac/gstdiracdec.h:
Do something. Don't actually know if this works because I don't
have a demuxer yet.
* ext/gsm/gstgsmdec.c: (gst_gsmdec_getcaps):
Add channels=1 to caps returned from _getcaps().
* ext/ogg/gstogmparse.c: (gst_ogm_audio_parse_get_type),
(gst_ogm_video_parse_get_type), (gst_ogm_audio_parse_base_init),
(gst_ogm_video_parse_base_init), (gst_ogm_parse_init),
(gst_ogm_audio_parse_init), (gst_ogm_video_parse_init),
(gst_ogm_parse_sink_convert), (gst_ogm_parse_chain),
(gst_ogm_parse_change_state):
Separate between audio/video so ogmaudioparse actually uses the
audio pad templates. Both audio and video work now, including
autoplugging. Also use sometimes-srcpad hack.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Handle events better. Don't hang on infinite loops.
* gst/avi/gstavidemux.c: (gst_avi_demux_class_init),
(gst_avi_demux_init), (gst_avi_demux_reset),
(gst_avi_demux_src_convert), (gst_avi_demux_handle_src_query),
(gst_avi_demux_stream_header), (gst_avi_demux_stream_data),
(gst_avi_demux_change_state):
* gst/avi/gstavidemux.h:
Improve A/V sync. Still not perfect.
* gst/matroska/ebml-read.c: (gst_ebml_read_seek),
(gst_ebml_read_skip):
Handle events better.
* gst/qtdemux/qtdemux.c: (gst_qtdemux_handle_sink_event),
(gst_qtdemux_loop_header), (qtdemux_parse_trak),
(qtdemux_audio_caps):
Add IMA4. Improve event handling. Save offset after a seek when
the headers are at the end of the file so that we don't end up in
an infinite loop.
* gst/typefind/gsttypefindfunctions.c: (qt_type_find):
Add low-priority typefind support for files with no length.
parent 131232f2
2004-09-23 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/dirac/Makefile.am:
* ext/dirac/gstdirac.cc:
* ext/dirac/gstdiracdec.cc:
* ext/dirac/gstdiracdec.h:
Do something. Don't actually know if this works because I don't
have a demuxer yet.
* ext/gsm/gstgsmdec.c: (gst_gsmdec_getcaps):
Add channels=1 to caps returned from _getcaps().
* ext/ogg/gstogmparse.c: (gst_ogm_audio_parse_get_type),
(gst_ogm_video_parse_get_type), (gst_ogm_audio_parse_base_init),
(gst_ogm_video_parse_base_init), (gst_ogm_parse_init),
(gst_ogm_audio_parse_init), (gst_ogm_video_parse_init),
(gst_ogm_parse_sink_convert), (gst_ogm_parse_chain),
(gst_ogm_parse_change_state):
Separate between audio/video so ogmaudioparse actually uses the
audio pad templates. Both audio and video work now, including
autoplugging. Also use sometimes-srcpad hack.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_seek):
Handle events better. Don't hang on infinite loops.
* gst/avi/gstavidemux.c: (gst_avi_demux_class_init),
(gst_avi_demux_init), (gst_avi_demux_reset),
(gst_avi_demux_src_convert), (gst_avi_demux_handle_src_query),
(gst_avi_demux_stream_header), (gst_avi_demux_stream_data),
(gst_avi_demux_change_state):
* gst/avi/gstavidemux.h:
Improve A/V sync. Still not perfect.
* gst/matroska/ebml-read.c: (gst_ebml_read_seek),
(gst_ebml_read_skip):
Handle events better.
* gst/qtdemux/qtdemux.c: (gst_qtdemux_handle_sink_event),
(gst_qtdemux_loop_header), (qtdemux_parse_trak),
(qtdemux_audio_caps):
Add IMA4. Improve event handling. Save offset after a seek when
the headers are at the end of the file so that we don't end up in
an infinite loop.
* gst/typefind/gsttypefindfunctions.c: (qt_type_find):
Add low-priority typefind support for files with no length.
2004-09-23 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* testsuite/multifilesink/Makefile.am:
......
......@@ -31,20 +31,6 @@
GST_DEBUG_CATEGORY_STATIC (avidemux_debug);
#define GST_CAT_DEFAULT avidemux_debug
/* AviDemux signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0,
ARG_STREAMINFO
/* FILL ME */
};
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
......@@ -73,13 +59,8 @@ static gboolean gst_avi_demux_src_convert (GstPad * pad,
static GstElementStateReturn gst_avi_demux_change_state (GstElement * element);
static void gst_avi_demux_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstRiffReadClass *parent_class = NULL;
/*static guint gst_avi_demux_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_avi_demux_get_type (void)
{
......@@ -145,17 +126,11 @@ gst_avi_demux_class_init (GstAviDemuxClass * klass)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
g_object_class_install_property (gobject_class, ARG_STREAMINFO,
g_param_spec_boxed ("streaminfo", "Streaminfo", "Streaminfo",
GST_TYPE_CAPS, G_PARAM_READABLE));
GST_DEBUG_CATEGORY_INIT (avidemux_debug, "avidemux",
0, "Demuxer for AVI streams");
parent_class = g_type_class_ref (GST_TYPE_RIFF_READ);
gobject_class->get_property = gst_avi_demux_get_property;
gstelement_class->change_state = gst_avi_demux_change_state;
gstelement_class->send_event = gst_avi_demux_send_event;
}
......@@ -174,7 +149,6 @@ gst_avi_demux_init (GstAviDemux * avi)
gst_element_set_loop_function (GST_ELEMENT (avi), gst_avi_demux_loop);
gst_avi_demux_reset (avi);
avi->streaminfo = NULL;
avi->index_entries = NULL;
memset (&avi->stream, 0, sizeof (avi->stream));
}
......@@ -208,19 +182,6 @@ gst_avi_demux_reset (GstAviDemux * avi)
avi->us_per_frame = 0;
avi->seek_offset = (guint64) - 1;
gst_caps_replace (&avi->streaminfo, NULL);
}
static void
gst_avi_demux_streaminfo (GstAviDemux * avi)
{
/* compression formats are added later - a bit hacky */
gst_caps_replace (&avi->streaminfo,
gst_caps_new_simple ("application/x-gst-streaminfo", NULL));
/*g_object_notify(G_OBJECT(avi), "streaminfo"); */
}
static gst_avi_index_entry *
......@@ -341,7 +302,7 @@ gst_avi_demux_src_convert (GstPad * pad,
/*GstAviDemux *avi = GST_AVI_DEMUX (gst_pad_get_parent (pad)); */
avi_stream_context *stream = gst_pad_get_element_private (pad);
if (stream->strh->type != GST_RIFF_FCC_auds &&
if (stream->strh->type == GST_RIFF_FCC_vids &&
(src_format == GST_FORMAT_BYTES || *dest_format == GST_FORMAT_BYTES))
return FALSE;
......@@ -444,12 +405,15 @@ gst_avi_demux_handle_src_query (GstPad * pad,
if (stream->strh->samplesize == 1 && stream->blockalign != 0) {
*value = stream->current_byte * GST_SECOND /
(stream->blockalign * stream->strh->rate);
} else if (stream->strh->rate != 0) {
*value = (gfloat) stream->current_frame * stream->strh->scale *
GST_SECOND / stream->strh->rate;
} else if (stream->bitrate != 0) {
*value = ((gfloat) stream->current_byte) * GST_SECOND /
stream->bitrate;
} else if (stream->total_frames != 0) {
/* calculate timestamps based on video size */
guint64 len = demux->us_per_frame * demux->num_frames *
GST_USECOND;
*value = len * stream->current_frame / stream->total_frames;
} else {
*value = 0;
}
......@@ -1289,9 +1253,6 @@ gst_avi_demux_stream_header (GstAviDemux * avi)
GST_DEBUG ("signaling no more pads");
gst_element_no_more_pads (GST_ELEMENT (avi));
/* we've got streaminfo now */
g_object_notify (G_OBJECT (avi), "streaminfo");
/* Now, find the data (i.e. skip all junk between header and data) */
while (1) {
if (!(tag = gst_riff_peek_tag (riff, NULL)))
......@@ -1544,9 +1505,6 @@ gst_avi_demux_change_state (GstElement * element)
GstAviDemux *avi = GST_AVI_DEMUX (element);
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_READY_TO_PAUSED:
gst_avi_demux_streaminfo (avi);
break;
case GST_STATE_PAUSED_TO_READY:
gst_avi_demux_reset (avi);
break;
......@@ -1559,19 +1517,3 @@ gst_avi_demux_change_state (GstElement * element)
return GST_STATE_SUCCESS;
}
static void
gst_avi_demux_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstAviDemux *avi = GST_AVI_DEMUX (object);
switch (prop_id) {
case ARG_STREAMINFO:
g_value_set_boxed (value, avi->streaminfo);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......@@ -114,9 +114,6 @@ typedef struct _GstAviDemux {
/* seeking */
guint64 seek_offset;
guint64 last_seek;
/* info */
GstCaps *streaminfo;
} GstAviDemux;
typedef struct _GstAviDemuxClass {
......
......@@ -350,7 +350,11 @@ gst_ebml_read_seek (GstEbmlRead * ebml, guint64 offset)
GST_WARNING ("No discontinuity event after seek - seek failed");
break;
} else if (GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
GstEventType type = GST_EVENT_TYPE (event);
gst_pad_event_default (ebml->sinkpad, event);
if (type == GST_EVENT_EOS || type == GST_EVENT_INTERRUPT)
return NULL;
event = NULL;
}
}
......@@ -389,8 +393,9 @@ gst_ebml_read_skip (GstEbmlRead * ebml)
return gst_bytestream_flush (ebml->bs, length);
if (!(event = gst_ebml_read_seek (ebml,
gst_bytestream_tell (ebml->bs) + length)))
gst_bytestream_tell (ebml->bs) + length))) {
return FALSE;
}
gst_event_unref (event);
......
......@@ -474,6 +474,7 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
static gboolean
gst_qtdemux_handle_sink_event (GstQTDemux * qtdemux)
{
gboolean res = TRUE;
guint32 remaining;
GstEvent *event;
GstEventType type;
......@@ -495,12 +496,13 @@ gst_qtdemux_handle_sink_event (GstQTDemux * qtdemux)
//gst_bytestream_flush_fast(qtdemux->bs, remaining);
break;
default:
res = FALSE;
g_warning ("unhandled event %d", type);
break;
}
gst_event_unref (event);
return TRUE;
return res;
}
static GstElementStateReturn
......@@ -713,6 +715,7 @@ gst_qtdemux_loop_header (GstElement * element)
if (!ret) {
g_warning ("seek failed");
}
qtdemux->offset = offset;
GST_DEBUG ("seek returned %d", ret);
return;
}
......@@ -780,7 +783,6 @@ gst_qtdemux_loop_header (GstElement * element)
/* unreached */
g_assert (0);
}
}
void
......@@ -2024,7 +2026,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)),
stream->caps);
} else {
GST_INFO ("unknown subtype");
GST_INFO ("unknown subtype " GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (stream->subtype));
return;
}
......@@ -2156,7 +2159,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
samples_per_chunk * stream->bytes_per_frame /
stream->samples_per_packet / stream->compression;
else
samples[j].size = 0;
samples[j].size = stream->bytes_per_frame;
samples[j].duration =
samples_per_chunk * GST_SECOND / (stream->rate / 2);
samples[j].timestamp = timestamp;
......@@ -2208,7 +2211,6 @@ done2:
break;
}
#endif
gst_qtdemux_add_stream (qtdemux, stream);
}
......@@ -2573,12 +2575,14 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data,
case GST_MAKE_FOURCC ('a', 'g', 's', 'm'):
/* GSM */
return gst_caps_new_simple ("audio/x-gsm", NULL);
case GST_MAKE_FOURCC ('i', 'm', 'a', '4'):
/* IMA 4:1 */
return gst_caps_new_simple ("audio/x-adpcm",
"layout", G_TYPE_STRING, "quicktime", NULL);
case GST_MAKE_FOURCC ('q', 't', 'v', 'r'):
/* ? */
case GST_MAKE_FOURCC ('Q', 'D', 'M', 'C'):
/* QDesign music */
case GST_MAKE_FOURCC ('i', 'm', 'a', '4'):
/* IMA 4:1 */
case GST_MAKE_FOURCC ('Q', 'c', 'l', 'p'):
/* QUALCOMM PureVoice */
default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment