mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
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.
This commit is contained in:
parent
131232f221
commit
40cec75c3f
5 changed files with 64 additions and 76 deletions
40
ChangeLog
40
ChangeLog
|
@ -1,3 +1,43 @@
|
||||||
|
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>
|
2004-09-23 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
* testsuite/multifilesink/Makefile.am:
|
* testsuite/multifilesink/Makefile.am:
|
||||||
|
|
|
@ -31,20 +31,6 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (avidemux_debug);
|
GST_DEBUG_CATEGORY_STATIC (avidemux_debug);
|
||||||
#define GST_CAT_DEFAULT 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",
|
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
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 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 GstRiffReadClass *parent_class = NULL;
|
||||||
|
|
||||||
/*static guint gst_avi_demux_signals[LAST_SIGNAL] = { 0 }; */
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gst_avi_demux_get_type (void)
|
gst_avi_demux_get_type (void)
|
||||||
{
|
{
|
||||||
|
@ -145,17 +126,11 @@ gst_avi_demux_class_init (GstAviDemuxClass * klass)
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) 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",
|
GST_DEBUG_CATEGORY_INIT (avidemux_debug, "avidemux",
|
||||||
0, "Demuxer for AVI streams");
|
0, "Demuxer for AVI streams");
|
||||||
|
|
||||||
parent_class = g_type_class_ref (GST_TYPE_RIFF_READ);
|
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->change_state = gst_avi_demux_change_state;
|
||||||
gstelement_class->send_event = gst_avi_demux_send_event;
|
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_element_set_loop_function (GST_ELEMENT (avi), gst_avi_demux_loop);
|
||||||
gst_avi_demux_reset (avi);
|
gst_avi_demux_reset (avi);
|
||||||
|
|
||||||
avi->streaminfo = NULL;
|
|
||||||
avi->index_entries = NULL;
|
avi->index_entries = NULL;
|
||||||
memset (&avi->stream, 0, sizeof (avi->stream));
|
memset (&avi->stream, 0, sizeof (avi->stream));
|
||||||
}
|
}
|
||||||
|
@ -208,19 +182,6 @@ gst_avi_demux_reset (GstAviDemux * avi)
|
||||||
avi->us_per_frame = 0;
|
avi->us_per_frame = 0;
|
||||||
|
|
||||||
avi->seek_offset = (guint64) - 1;
|
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 *
|
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)); */
|
/*GstAviDemux *avi = GST_AVI_DEMUX (gst_pad_get_parent (pad)); */
|
||||||
avi_stream_context *stream = gst_pad_get_element_private (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))
|
(src_format == GST_FORMAT_BYTES || *dest_format == GST_FORMAT_BYTES))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -444,12 +405,15 @@ gst_avi_demux_handle_src_query (GstPad * pad,
|
||||||
if (stream->strh->samplesize == 1 && stream->blockalign != 0) {
|
if (stream->strh->samplesize == 1 && stream->blockalign != 0) {
|
||||||
*value = stream->current_byte * GST_SECOND /
|
*value = stream->current_byte * GST_SECOND /
|
||||||
(stream->blockalign * stream->strh->rate);
|
(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) {
|
} else if (stream->bitrate != 0) {
|
||||||
*value = ((gfloat) stream->current_byte) * GST_SECOND /
|
*value = ((gfloat) stream->current_byte) * GST_SECOND /
|
||||||
stream->bitrate;
|
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 {
|
} else {
|
||||||
*value = 0;
|
*value = 0;
|
||||||
}
|
}
|
||||||
|
@ -1289,9 +1253,6 @@ gst_avi_demux_stream_header (GstAviDemux * avi)
|
||||||
GST_DEBUG ("signaling no more pads");
|
GST_DEBUG ("signaling no more pads");
|
||||||
gst_element_no_more_pads (GST_ELEMENT (avi));
|
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) */
|
/* Now, find the data (i.e. skip all junk between header and data) */
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
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);
|
GstAviDemux *avi = GST_AVI_DEMUX (element);
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
|
||||||
gst_avi_demux_streaminfo (avi);
|
|
||||||
break;
|
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
gst_avi_demux_reset (avi);
|
gst_avi_demux_reset (avi);
|
||||||
break;
|
break;
|
||||||
|
@ -1559,19 +1517,3 @@ gst_avi_demux_change_state (GstElement * element)
|
||||||
|
|
||||||
return GST_STATE_SUCCESS;
|
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 */
|
/* seeking */
|
||||||
guint64 seek_offset;
|
guint64 seek_offset;
|
||||||
guint64 last_seek;
|
guint64 last_seek;
|
||||||
|
|
||||||
/* info */
|
|
||||||
GstCaps *streaminfo;
|
|
||||||
} GstAviDemux;
|
} GstAviDemux;
|
||||||
|
|
||||||
typedef struct _GstAviDemuxClass {
|
typedef struct _GstAviDemuxClass {
|
||||||
|
|
|
@ -350,7 +350,11 @@ gst_ebml_read_seek (GstEbmlRead * ebml, guint64 offset)
|
||||||
GST_WARNING ("No discontinuity event after seek - seek failed");
|
GST_WARNING ("No discontinuity event after seek - seek failed");
|
||||||
break;
|
break;
|
||||||
} else if (GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
|
} else if (GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
|
||||||
|
GstEventType type = GST_EVENT_TYPE (event);
|
||||||
|
|
||||||
gst_pad_event_default (ebml->sinkpad, event);
|
gst_pad_event_default (ebml->sinkpad, event);
|
||||||
|
if (type == GST_EVENT_EOS || type == GST_EVENT_INTERRUPT)
|
||||||
|
return NULL;
|
||||||
event = NULL;
|
event = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,8 +393,9 @@ gst_ebml_read_skip (GstEbmlRead * ebml)
|
||||||
return gst_bytestream_flush (ebml->bs, length);
|
return gst_bytestream_flush (ebml->bs, length);
|
||||||
|
|
||||||
if (!(event = gst_ebml_read_seek (ebml,
|
if (!(event = gst_ebml_read_seek (ebml,
|
||||||
gst_bytestream_tell (ebml->bs) + length)))
|
gst_bytestream_tell (ebml->bs) + length))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
|
||||||
|
|
|
@ -474,6 +474,7 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qtdemux_handle_sink_event (GstQTDemux * qtdemux)
|
gst_qtdemux_handle_sink_event (GstQTDemux * qtdemux)
|
||||||
{
|
{
|
||||||
|
gboolean res = TRUE;
|
||||||
guint32 remaining;
|
guint32 remaining;
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
GstEventType type;
|
GstEventType type;
|
||||||
|
@ -495,12 +496,13 @@ gst_qtdemux_handle_sink_event (GstQTDemux * qtdemux)
|
||||||
//gst_bytestream_flush_fast(qtdemux->bs, remaining);
|
//gst_bytestream_flush_fast(qtdemux->bs, remaining);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
res = FALSE;
|
||||||
g_warning ("unhandled event %d", type);
|
g_warning ("unhandled event %d", type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
return TRUE;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
|
@ -713,6 +715,7 @@ gst_qtdemux_loop_header (GstElement * element)
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
g_warning ("seek failed");
|
g_warning ("seek failed");
|
||||||
}
|
}
|
||||||
|
qtdemux->offset = offset;
|
||||||
GST_DEBUG ("seek returned %d", ret);
|
GST_DEBUG ("seek returned %d", ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -780,7 +783,6 @@ gst_qtdemux_loop_header (GstElement * element)
|
||||||
/* unreached */
|
/* unreached */
|
||||||
g_assert (0);
|
g_assert (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2024,7 +2026,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)),
|
GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)),
|
||||||
stream->caps);
|
stream->caps);
|
||||||
} else {
|
} else {
|
||||||
GST_INFO ("unknown subtype");
|
GST_INFO ("unknown subtype " GST_FOURCC_FORMAT,
|
||||||
|
GST_FOURCC_ARGS (stream->subtype));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2156,7 +2159,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
samples_per_chunk * stream->bytes_per_frame /
|
samples_per_chunk * stream->bytes_per_frame /
|
||||||
stream->samples_per_packet / stream->compression;
|
stream->samples_per_packet / stream->compression;
|
||||||
else
|
else
|
||||||
samples[j].size = 0;
|
samples[j].size = stream->bytes_per_frame;
|
||||||
samples[j].duration =
|
samples[j].duration =
|
||||||
samples_per_chunk * GST_SECOND / (stream->rate / 2);
|
samples_per_chunk * GST_SECOND / (stream->rate / 2);
|
||||||
samples[j].timestamp = timestamp;
|
samples[j].timestamp = timestamp;
|
||||||
|
@ -2208,7 +2211,6 @@ done2:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_qtdemux_add_stream (qtdemux, stream);
|
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'):
|
case GST_MAKE_FOURCC ('a', 'g', 's', 'm'):
|
||||||
/* GSM */
|
/* GSM */
|
||||||
return gst_caps_new_simple ("audio/x-gsm", NULL);
|
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', 't', 'v', 'r'):
|
||||||
/* ? */
|
/* ? */
|
||||||
case GST_MAKE_FOURCC ('Q', 'D', 'M', 'C'):
|
case GST_MAKE_FOURCC ('Q', 'D', 'M', 'C'):
|
||||||
/* QDesign music */
|
/* QDesign music */
|
||||||
case GST_MAKE_FOURCC ('i', 'm', 'a', '4'):
|
|
||||||
/* IMA 4:1 */
|
|
||||||
case GST_MAKE_FOURCC ('Q', 'c', 'l', 'p'):
|
case GST_MAKE_FOURCC ('Q', 'c', 'l', 'p'):
|
||||||
/* QUALCOMM PureVoice */
|
/* QUALCOMM PureVoice */
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue