mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
update gst-plugins
This commit is contained in:
parent
618bb244db
commit
d150ff45da
@ -4,7 +4,7 @@
|
||||
|
||||
$SCRIPTS/build toolchain
|
||||
$SCRIPTS/build liboil
|
||||
$SCRIPTS/build ffmpeg
|
||||
#$SCRIPTS/build ffmpeg
|
||||
$SCRIPTS/build bzip2
|
||||
$SCRIPTS/build gstreamer
|
||||
|
||||
|
@ -1 +1 @@
|
||||
http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.10.6.tar.bz2
|
||||
http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.10.6.tar.bz2
|
||||
|
@ -14,7 +14,6 @@ $SCRIPTS/build libcdaudio
|
||||
$SCRIPTS/build faac
|
||||
$SCRIPTS/build faad2
|
||||
$SCRIPTS/build libsndfile
|
||||
$SCRIPTS/build twolame
|
||||
$SCRIPTS/build bzip2
|
||||
#$SCRIPTS/build x264
|
||||
#$SCRIPTS/build swfdec
|
||||
@ -110,7 +109,6 @@ ac_cv_lib_xvidcore_xvid_global=yes \
|
||||
--disable-ofa \
|
||||
--disable-timidity \
|
||||
--disable-wildmidi \
|
||||
--enable-twolame \
|
||||
--disable-sdl \
|
||||
--disable-sdltest \
|
||||
--enable-sndfile \
|
||||
|
@ -8,7 +8,6 @@ $SCRIPTS/install alsa-lib
|
||||
#$SCRIPTS/install libdvdnav
|
||||
#$SCRIPTS/install libtheora
|
||||
#$SCRIPTS/install libsndfile
|
||||
#$SCRIPTS/install twolame
|
||||
#$SCRIPTS/install bzip2
|
||||
#$SCRIPTS/install x264
|
||||
#$SCRIPTS/install xvidcore
|
||||
|
@ -1 +1 @@
|
||||
http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.10.tar.bz2
|
||||
http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.11.tar.bz2
|
||||
|
@ -13,6 +13,7 @@ $SCRIPTS/build lame
|
||||
$SCRIPTS/build libmad
|
||||
$SCRIPTS/build libmpeg2
|
||||
$SCRIPTS/build libid3tag
|
||||
$SCRIPTS/build twolame
|
||||
#$SCRIPTS/build libsidplay
|
||||
|
||||
|
||||
@ -44,6 +45,7 @@ cd $BUILD/$1*
|
||||
--enable-dvdread \
|
||||
--enable-dvdnav \
|
||||
--enable-lame \
|
||||
--enable-twolame \
|
||||
--enable-id3tag \
|
||||
--enable-mad \
|
||||
--enable-mpeg2dec \
|
||||
|
@ -1,110 +0,0 @@
|
||||
diff -up gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c.push-seek gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c
|
||||
--- gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c.push-seek 2009-01-25 11:24:31.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c 2009-01-25 12:51:48.000000000 +0100
|
||||
@@ -127,6 +127,11 @@ gst_asf_payload_queue_for_stream (GstASF
|
||||
GST_DEBUG_OBJECT (demux, "first ts: %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (payload->ts));
|
||||
demux->first_ts = payload->ts;
|
||||
+ if (demux->push_mode) {
|
||||
+ gst_segment_set_seek (&demux->segment, demux->segment.rate,
|
||||
+ GST_FORMAT_TIME, demux->segment.flags, GST_SEEK_TYPE_SET,
|
||||
+ demux->first_ts, GST_SEEK_TYPE_NONE, 0, NULL);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* better drop a few frames at the beginning than send bogus timestamps */
|
||||
@@ -140,7 +145,8 @@ gst_asf_payload_queue_for_stream (GstASF
|
||||
}
|
||||
|
||||
/* make timestamps start from 0 */
|
||||
- payload->ts -= demux->first_ts;
|
||||
+ if (!demux->push_mode)
|
||||
+ payload->ts -= demux->first_ts;
|
||||
|
||||
/* remove any incomplete payloads that will never be completed */
|
||||
while (stream->payloads->len > 0) {
|
||||
diff -up gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c.push-seek gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c
|
||||
--- gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c.push-seek 2009-01-25 11:24:56.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c 2009-01-25 12:54:31.000000000 +0100
|
||||
@@ -23,9 +23,6 @@
|
||||
* - _loop():
|
||||
* stop if at end of segment if != end of file, ie. demux->segment.stop
|
||||
*
|
||||
- * - _chain(): fix newsegment events for live streams where timestamps don't
|
||||
- * start at zero (need sample files/streams for this)
|
||||
- *
|
||||
* - fix packet parsing:
|
||||
* there's something wrong with timestamps for packets with keyframes,
|
||||
* and durations too.
|
||||
@@ -264,6 +261,7 @@ gst_asf_demux_activate_push (GstPad * si
|
||||
|
||||
demux = GST_ASF_DEMUX (GST_OBJECT_PARENT (sinkpad));
|
||||
|
||||
+ demux->push_mode = TRUE;
|
||||
demux->state = GST_ASF_DEMUX_STATE_HEADER;
|
||||
demux->streaming = TRUE;
|
||||
|
||||
@@ -276,6 +274,7 @@ gst_asf_demux_activate_pull (GstPad * pa
|
||||
GstASFDemux *demux;
|
||||
|
||||
demux = GST_ASF_DEMUX (GST_OBJECT_PARENT (pad));
|
||||
+ demux->push_mode = FALSE;
|
||||
|
||||
if (active) {
|
||||
demux->state = GST_ASF_DEMUX_STATE_HEADER;
|
||||
@@ -313,8 +312,17 @@ gst_asf_demux_sink_event (GstPad * pad,
|
||||
}
|
||||
|
||||
GST_OBJECT_LOCK (demux);
|
||||
+ if (demux->packet_size && newsegment_start > demux->data_offset)
|
||||
+ demux->packet = (newsegment_start - demux->data_offset) /
|
||||
+ demux->packet_size;
|
||||
+ else
|
||||
+ demux->packet = 0;
|
||||
+ demux->first_ts = GST_CLOCK_TIME_NONE;
|
||||
+ demux->need_newsegment = TRUE;
|
||||
gst_asf_demux_reset_stream_state_after_discont (demux);
|
||||
GST_OBJECT_UNLOCK (demux);
|
||||
+
|
||||
+ gst_event_unref (event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_EOS:{
|
||||
@@ -331,6 +339,14 @@ gst_asf_demux_sink_event (GstPad * pad,
|
||||
break;
|
||||
}
|
||||
|
||||
+ case GST_EVENT_FLUSH_START:
|
||||
+ case GST_EVENT_FLUSH_STOP:
|
||||
+ GST_OBJECT_LOCK (demux);
|
||||
+ gst_asf_demux_reset_stream_state_after_discont (demux);
|
||||
+ GST_OBJECT_UNLOCK (demux);
|
||||
+ gst_asf_demux_send_event_unlocked (demux, event);
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
@@ -450,6 +466,11 @@ gst_asf_demux_handle_seek_event (GstASFD
|
||||
accurate = ((flags & GST_SEEK_FLAG_ACCURATE) == GST_SEEK_FLAG_ACCURATE);
|
||||
keyunit_sync = ((flags & GST_SEEK_FLAG_KEY_UNIT) == GST_SEEK_FLAG_KEY_UNIT);
|
||||
|
||||
+ if (demux->push_mode) {
|
||||
+ gst_event_ref (event);
|
||||
+ return gst_pad_push_event (demux->sinkpad, event);
|
||||
+ }
|
||||
+
|
||||
/* unlock the streaming thread */
|
||||
if (flush) {
|
||||
gst_pad_push_event (demux->sinkpad, gst_event_new_flush_start ());
|
||||
diff -up gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.h.push-seek gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.h
|
||||
--- gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.h.push-seek 2009-01-25 12:52:19.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.h 2009-01-25 12:52:55.000000000 +0100
|
||||
@@ -171,6 +171,7 @@ struct _GstASFDemux {
|
||||
gboolean need_newsegment; /* do we need to send a new-segment event? */
|
||||
gboolean segment_running; /* if we've started the current segment */
|
||||
gboolean streaming; /* TRUE if we are operating chain-based */
|
||||
+ gboolean push_mode; /* are we operating in push_mode? */
|
||||
|
||||
/* Descrambler settings */
|
||||
guint8 span;
|
@ -1,13 +0,0 @@
|
||||
diff -up gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c~ gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c
|
||||
--- gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c~ 2009-01-25 11:23:20.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/gst/asfdemux/asfpacket.c 2009-01-25 11:23:20.000000000 +0100
|
||||
@@ -317,6 +317,9 @@ gst_asf_demux_parse_payload (GstASFDemux
|
||||
GST_TIME_ARGS (payload.duration));
|
||||
} else if (payload.rep_data_len != 0) {
|
||||
GST_WARNING_OBJECT (demux, "invalid replicated data length, very bad");
|
||||
+ *p_data += payload_len;
|
||||
+ *p_size -= payload_len;
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (demux, "media object offset : %u", payload.mo_offset);
|
@ -1,812 +0,0 @@
|
||||
diff -up gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c.orig gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c
|
||||
--- gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c.orig 2009-01-25 10:25:24.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/gst/asfdemux/gstasfdemux.c 2009-01-25 10:25:40.000000000 +0100
|
||||
@@ -98,8 +98,6 @@ gst_asf_demux_process_queued_extended_st
|
||||
static void gst_asf_demux_activate_ext_props_streams (GstASFDemux * demux);
|
||||
static gboolean gst_asf_demux_pull_headers (GstASFDemux * demux);
|
||||
static void gst_asf_demux_pull_indices (GstASFDemux * demux);
|
||||
-static GstFlowReturn gst_asf_demux_handle_data (GstASFDemux * demux,
|
||||
- guint8 ** p_data, guint64 * p_size);
|
||||
static void gst_asf_demux_reset_stream_state_after_discont (GstASFDemux * asf);
|
||||
static gboolean
|
||||
gst_asf_demux_parse_data_object_start (GstASFDemux * demux, guint8 * data);
|
||||
@@ -724,92 +722,6 @@ gst_asf_demux_aggregate_flow_return (Gst
|
||||
return GST_FLOW_NOT_LINKED;
|
||||
}
|
||||
|
||||
-static GstFlowReturn
|
||||
-gst_asf_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||
-{
|
||||
- GstFlowReturn ret = GST_FLOW_OK;
|
||||
- GstASFDemux *demux;
|
||||
-
|
||||
- demux = GST_ASF_DEMUX (GST_PAD_PARENT (pad));
|
||||
-
|
||||
- GST_LOG_OBJECT (demux, "buffer: size=%u, offset=%" G_GINT64_FORMAT,
|
||||
- GST_BUFFER_SIZE (buf), GST_BUFFER_OFFSET (buf));
|
||||
-
|
||||
- if (GST_BUFFER_IS_DISCONT (buf))
|
||||
- gst_asf_demux_reset_stream_state_after_discont (demux);
|
||||
-
|
||||
- gst_adapter_push (demux->adapter, buf);
|
||||
-
|
||||
- switch (demux->state) {
|
||||
- case GST_ASF_DEMUX_STATE_HEADER:{
|
||||
- ret = gst_asf_demux_chain_headers (demux);
|
||||
- if (demux->state != GST_ASF_DEMUX_STATE_DATA)
|
||||
- break;
|
||||
- /* otherwise fall through */
|
||||
- }
|
||||
- case GST_ASF_DEMUX_STATE_DATA:{
|
||||
-
|
||||
- if (demux->need_newsegment) {
|
||||
- GST_DEBUG_OBJECT (demux, "sending new-segment event from %"
|
||||
- GST_SEGMENT_FORMAT, &demux->segment);
|
||||
-
|
||||
- /* FIXME: check last parameter, streams may have non-zero start */
|
||||
- gst_asf_demux_send_event_unlocked (demux,
|
||||
- gst_event_new_new_segment (FALSE, demux->segment.rate,
|
||||
- GST_FORMAT_TIME, demux->segment.start, demux->segment.stop,
|
||||
- demux->segment.start));
|
||||
-
|
||||
- demux->need_newsegment = FALSE;
|
||||
- demux->segment_running = TRUE;
|
||||
- }
|
||||
-
|
||||
- while (gst_adapter_available (demux->adapter) >= demux->packet_size) {
|
||||
- guint64 data_size;
|
||||
- guint8 *data;
|
||||
-
|
||||
- data_size = demux->packet_size;
|
||||
- data = (guint8 *) gst_adapter_peek (demux->adapter, data_size);
|
||||
- g_assert (data != NULL);
|
||||
-
|
||||
- ret = gst_asf_demux_handle_data (demux, &data, &data_size);
|
||||
-
|
||||
- /* FIXME: check if this can happen, shouldn't really, should it? */
|
||||
- if (ret == ASF_FLOW_NEED_MORE_DATA) {
|
||||
- GST_DEBUG_OBJECT (demux, "not flushing, flow was need-more-data");
|
||||
-
|
||||
- /* FIXME: we always know the packet size, this code is weird */
|
||||
- /* if we know the packet size and still do a
|
||||
- * short read, then something is fishy */
|
||||
-/*
|
||||
- GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
||||
- ("Error parsing packet"),
|
||||
- ("Unexpected short read in packet at offset %" G_GINT64_FORMAT,
|
||||
- gst_asf_demux_get_current_offset (demux, NULL)));
|
||||
-
|
||||
- ret = GST_FLOW_ERROR;
|
||||
-*/
|
||||
- gst_adapter_flush (demux->adapter, demux->packet_size);
|
||||
- ret = GST_FLOW_OK;
|
||||
- break; /* bail out */
|
||||
- } else {
|
||||
- GST_DEBUG ("flushing packet (%u bytes)", demux->packet_size);
|
||||
- gst_adapter_flush (demux->adapter, demux->packet_size);
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
- default:
|
||||
- g_assert_not_reached ();
|
||||
- }
|
||||
-
|
||||
- /* FIXME: eradicate ASF_FLOW_NEED_MORE_DATA */
|
||||
-
|
||||
- if (ret != GST_FLOW_OK)
|
||||
- GST_DEBUG_OBJECT (demux, "flow: %s", gst_flow_get_name (ret));
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static gboolean
|
||||
gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size,
|
||||
GstBuffer ** p_buf, GstFlowReturn * p_flow)
|
||||
@@ -1393,6 +1305,64 @@ parse_error:
|
||||
}
|
||||
}
|
||||
|
||||
+static GstFlowReturn
|
||||
+gst_asf_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||
+{
|
||||
+ GstFlowReturn ret = GST_FLOW_OK;
|
||||
+ GstASFDemux *demux;
|
||||
+
|
||||
+ demux = GST_ASF_DEMUX (GST_PAD_PARENT (pad));
|
||||
+
|
||||
+ GST_LOG_OBJECT (demux, "buffer: size=%u, offset=%" G_GINT64_FORMAT,
|
||||
+ GST_BUFFER_SIZE (buf), GST_BUFFER_OFFSET (buf));
|
||||
+
|
||||
+ if (GST_BUFFER_IS_DISCONT (buf))
|
||||
+ gst_asf_demux_reset_stream_state_after_discont (demux);
|
||||
+
|
||||
+ gst_adapter_push (demux->adapter, buf);
|
||||
+
|
||||
+ switch (demux->state) {
|
||||
+ case GST_ASF_DEMUX_STATE_HEADER:{
|
||||
+ ret = gst_asf_demux_chain_headers (demux);
|
||||
+ if (demux->state != GST_ASF_DEMUX_STATE_DATA)
|
||||
+ break;
|
||||
+ /* otherwise fall through */
|
||||
+ }
|
||||
+ case GST_ASF_DEMUX_STATE_DATA:
|
||||
+ {
|
||||
+ guint64 data_size;
|
||||
+
|
||||
+ data_size = demux->packet_size;
|
||||
+
|
||||
+ while (gst_adapter_available (demux->adapter) >= data_size) {
|
||||
+ GstBuffer *buf;
|
||||
+
|
||||
+ buf = gst_adapter_take_buffer (demux->adapter, data_size);
|
||||
+
|
||||
+ /* FIXME: maybe we should just skip broken packets and error out only
|
||||
+ * after a few broken packets in a row? */
|
||||
+ if (!gst_asf_demux_parse_packet (demux, buf)) {
|
||||
+ GST_WARNING_OBJECT (demux, "Parse error");
|
||||
+ }
|
||||
+
|
||||
+ gst_buffer_unref (buf);
|
||||
+
|
||||
+ ret = gst_asf_demux_push_complete_payloads (demux, FALSE);
|
||||
+
|
||||
+ ++demux->packet;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ default:
|
||||
+ g_assert_not_reached ();
|
||||
+ }
|
||||
+
|
||||
+ if (ret != GST_FLOW_OK)
|
||||
+ GST_DEBUG_OBJECT (demux, "flow: %s", gst_flow_get_name (ret));
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static inline gboolean
|
||||
gst_asf_demux_skip_bytes (guint num_bytes, guint8 ** p_data, guint64 * p_size)
|
||||
{
|
||||
@@ -1561,18 +1531,6 @@ gst_asf_demux_get_guid (ASFGuid * guid,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-gst_asf_demux_get_obj_data_correction (asf_obj_data_correction * object,
|
||||
- guint8 ** p_data, guint64 * p_size)
|
||||
-{
|
||||
- if (*p_size < (1 + 1))
|
||||
- return FALSE;
|
||||
-
|
||||
- object->type = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- object->cycle = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- return TRUE;
|
||||
-}
|
||||
-
|
||||
-static gboolean
|
||||
gst_asf_demux_get_stream_audio (asf_stream_audio * audio, guint8 ** p_data,
|
||||
guint64 * p_size)
|
||||
{
|
||||
@@ -2279,12 +2237,15 @@ gst_asf_demux_process_metadata (GstASFDe
|
||||
|
||||
if (data_type != ASF_DEMUX_DATA_TYPE_DWORD) {
|
||||
gst_asf_demux_skip_bytes (data_len, &data, &size);
|
||||
+ g_free (name_utf8);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* read DWORD */
|
||||
- if (size < 4)
|
||||
+ if (size < 4) {
|
||||
+ g_free (name_utf8);
|
||||
goto not_enough_data;
|
||||
+ }
|
||||
|
||||
ival = gst_asf_demux_get_uint32 (&data, &size);
|
||||
|
||||
@@ -3241,605 +3202,6 @@ gst_asf_demux_send_event_unlocked (GstAS
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static GstFlowReturn
|
||||
-gst_asf_demux_push_buffer (GstASFDemux * demux, AsfStream * stream,
|
||||
- GstBuffer * buf)
|
||||
-{
|
||||
- buf = gst_buffer_make_metadata_writable (buf);
|
||||
-
|
||||
- /* need to send tags? */
|
||||
- if (stream->pending_tags) {
|
||||
- GST_LOG_OBJECT (stream->pad, "tags %" GST_PTR_FORMAT, stream->pending_tags);
|
||||
- gst_element_found_tags_for_pad (GST_ELEMENT (demux), stream->pad,
|
||||
- stream->pending_tags);
|
||||
- stream->pending_tags = NULL;
|
||||
- }
|
||||
-
|
||||
- /* don't set the same time stamp on multiple consecutive outgoing
|
||||
- * video buffers, set it on the first one and set NONE on the others,
|
||||
- * it's the decoder's job to fill the missing bits properly */
|
||||
- if (stream->is_video && GST_BUFFER_TIMESTAMP_IS_VALID (buf) &&
|
||||
- GST_BUFFER_TIMESTAMP (buf) == stream->last_buffer_timestamp) {
|
||||
- GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE;
|
||||
- }
|
||||
-
|
||||
- /* make sure segment.last_stop is continually increasing */
|
||||
- if (GST_BUFFER_TIMESTAMP_IS_VALID (buf) &&
|
||||
- demux->segment.last_stop < (gint64) GST_BUFFER_TIMESTAMP (buf)) {
|
||||
- gst_segment_set_last_stop (&demux->segment, GST_FORMAT_TIME,
|
||||
- GST_BUFFER_TIMESTAMP (buf));
|
||||
- }
|
||||
-
|
||||
- if (GST_BUFFER_TIMESTAMP_IS_VALID (buf))
|
||||
- stream->last_buffer_timestamp = GST_BUFFER_TIMESTAMP (buf);
|
||||
-
|
||||
- gst_buffer_set_caps (buf, stream->caps);
|
||||
-
|
||||
- GST_LOG_OBJECT (stream->pad, "pushing buffer, ts=%" GST_TIME_FORMAT " %s",
|
||||
- GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
||||
- (stream->discont) ? "discont" : "");
|
||||
-
|
||||
- if (stream->discont) {
|
||||
- GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||
- stream->discont = FALSE;
|
||||
- }
|
||||
-
|
||||
- stream->last_flow = gst_pad_push (stream->pad, buf);
|
||||
-
|
||||
- return stream->last_flow;
|
||||
-}
|
||||
-
|
||||
-static GstFlowReturn
|
||||
-gst_asf_demux_process_chunk (GstASFDemux * demux,
|
||||
- asf_packet_info * packet_info, asf_segment_info * segment_info,
|
||||
- guint8 ** p_data, guint64 * p_size)
|
||||
-{
|
||||
- GstFlowReturn ret = GST_FLOW_OK;
|
||||
- AsfStream *stream;
|
||||
- GstBuffer *buffer;
|
||||
-
|
||||
- stream = gst_asf_demux_get_stream (demux, segment_info->stream_number);
|
||||
- if (stream == NULL) {
|
||||
- GST_WARNING ("invalid stream number %d", segment_info->stream_number);
|
||||
- if (!gst_asf_demux_skip_bytes (segment_info->chunk_size, p_data, p_size))
|
||||
- ret = ASF_FLOW_NEED_MORE_DATA;
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- GST_DEBUG ("Processing %s chunk of size %u (frag_offset=%d)",
|
||||
- GST_PAD_NAME (stream->pad), segment_info->chunk_size,
|
||||
- stream->frag_offset);
|
||||
-
|
||||
- if (segment_info->frag_offset == 0) {
|
||||
- /* new packet */
|
||||
- stream->sequence = segment_info->sequence;
|
||||
- if (!GST_CLOCK_TIME_IS_VALID (stream->first_pts))
|
||||
- stream->first_pts = segment_info->frag_timestamp - demux->preroll;
|
||||
- demux->pts =
|
||||
- segment_info->frag_timestamp - demux->preroll - stream->first_pts;
|
||||
-
|
||||
- /*
|
||||
- if (stream->is_video) {
|
||||
- GST_DEBUG ("%s: demux->pts=%lld (frag_timestamp=%ld, preroll=%lld)",
|
||||
- GST_PAD_NAME (stream->pad), demux->pts,
|
||||
- segment_info->frag_timestamp, demux->preroll);
|
||||
- }
|
||||
- */
|
||||
-
|
||||
- if (!gst_asf_demux_get_buffer (&buffer, segment_info->chunk_size,
|
||||
- p_data, p_size)) {
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- GST_DEBUG ("BUFFER: Copied stream to buffer %p", buffer);
|
||||
- stream->payload = buffer;
|
||||
- } else {
|
||||
- GST_DEBUG ("segment_info->sequence=%d, stream->sequence=%d,"
|
||||
- " segment_info->frag_offset=%d, stream->frag_offset=%d",
|
||||
- segment_info->sequence, stream->sequence, segment_info->frag_offset,
|
||||
- stream->frag_offset);
|
||||
-
|
||||
- if (segment_info->sequence == stream->sequence &&
|
||||
- segment_info->frag_offset == stream->frag_offset) {
|
||||
- GstBuffer *new_buffer;
|
||||
-
|
||||
- /* continuing packet */
|
||||
- GST_INFO ("continuation packet");
|
||||
-
|
||||
- if (!gst_asf_demux_get_buffer (&buffer, segment_info->chunk_size,
|
||||
- p_data, p_size)) {
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- GST_DEBUG ("copied stream to buffer %p", buffer);
|
||||
-
|
||||
- new_buffer = gst_buffer_merge (stream->payload, buffer);
|
||||
- GST_DEBUG_OBJECT (demux,
|
||||
- "BUFFER: Merged new_buffer (%p - %d) from stream->payload (%p - %d)"
|
||||
- " and buffer (%p - %d)", new_buffer,
|
||||
- GST_MINI_OBJECT_REFCOUNT_VALUE (new_buffer), stream->payload,
|
||||
- GST_MINI_OBJECT_REFCOUNT_VALUE (stream->payload), buffer,
|
||||
- GST_MINI_OBJECT_REFCOUNT_VALUE (buffer));
|
||||
- gst_buffer_unref (stream->payload);
|
||||
- gst_buffer_unref (buffer);
|
||||
- stream->payload = new_buffer;
|
||||
- } else {
|
||||
- /* cannot continue current packet: free it */
|
||||
- if (stream->frag_offset != 0) {
|
||||
- /* cannot create new packet */
|
||||
- GST_DEBUG ("BUFFER: Freeing stream->payload (%p)", stream->payload);
|
||||
- gst_buffer_unref (stream->payload);
|
||||
-#if 0
|
||||
- /* FIXME: is this right/needed? we already do that below, no? */
|
||||
- packet_info->size_left -= segment_info->chunk_size;
|
||||
-#endif
|
||||
- stream->frag_offset = 0;
|
||||
- }
|
||||
- demux->pts =
|
||||
- segment_info->frag_timestamp - demux->preroll - stream->first_pts;
|
||||
-
|
||||
- /*
|
||||
- if (stream->is_video) {
|
||||
- GST_DEBUG ("%s: demux->pts=%lld (frag_timestamp=%ld, preroll=%lld)",
|
||||
- GST_PAD_NAME (stream->pad), demux->pts,
|
||||
- segment_info->frag_timestamp, demux->preroll);
|
||||
- }
|
||||
- */
|
||||
-
|
||||
- goto done;
|
||||
-#if 0
|
||||
- /* FIXME: where did this come from / fit in ? */
|
||||
- return TRUE;
|
||||
- else {
|
||||
- /* create new packet */
|
||||
- stream->sequence = segment_info->sequence;
|
||||
- }
|
||||
-#endif
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- stream->frag_offset += segment_info->chunk_size;
|
||||
-
|
||||
- GST_DEBUG ("frag_offset = %d segment_size = %d ", stream->frag_offset,
|
||||
- segment_info->segment_size);
|
||||
-
|
||||
- if (stream->frag_offset < segment_info->segment_size) {
|
||||
- /* We don't have the whole packet yet */
|
||||
- } else {
|
||||
- /* We have the whole packet now so we should push the packet to
|
||||
- the src pad now. First though we should check if we need to do
|
||||
- descrambling */
|
||||
- if (demux->span > 1) {
|
||||
- gst_asf_demux_descramble_buffer (demux, stream, &stream->payload);
|
||||
- }
|
||||
-
|
||||
- if (stream->is_video) {
|
||||
- GST_DEBUG ("%s: demux->pts=%lld=%" GST_TIME_FORMAT
|
||||
- ", stream->last_pts=%lld=%" GST_TIME_FORMAT,
|
||||
- GST_PAD_NAME (stream->pad), demux->pts,
|
||||
- GST_TIME_ARGS (GST_MSECOND * demux->pts), stream->last_pts,
|
||||
- GST_TIME_ARGS (GST_MSECOND * stream->last_pts));
|
||||
- }
|
||||
-
|
||||
- /* FIXME: last_pts is not a GstClockTime and not in nanoseconds, so
|
||||
- * this is not really 100% right ... */
|
||||
- if (demux->pts >= stream->last_pts ||
|
||||
- !GST_CLOCK_TIME_IS_VALID (stream->last_pts)) {
|
||||
- stream->last_pts = demux->pts;
|
||||
- }
|
||||
-
|
||||
- GST_BUFFER_TIMESTAMP (stream->payload) = GST_MSECOND * stream->last_pts;
|
||||
-
|
||||
- GST_DEBUG ("sending stream %d of size %d, ts=%" GST_TIME_FORMAT,
|
||||
- stream->id, segment_info->chunk_size,
|
||||
- GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (stream->payload)));
|
||||
-
|
||||
- if (!stream->fps_known) {
|
||||
- if (!stream->cache) {
|
||||
- stream->cache = stream->payload;
|
||||
- } else {
|
||||
- gdouble fps;
|
||||
- gint64 diff;
|
||||
- gint num, denom;
|
||||
-
|
||||
- /* why is all this needed anyway? (tpm) */
|
||||
- diff = GST_BUFFER_TIMESTAMP (stream->payload) -
|
||||
- GST_BUFFER_TIMESTAMP (stream->cache);
|
||||
-
|
||||
- fps = (gdouble) GST_SECOND / diff;
|
||||
-
|
||||
- /* artificial cap */
|
||||
- if (fps >= 50.0) {
|
||||
- num = 50;
|
||||
- denom = 1;
|
||||
- } else if (fps <= 5.0) {
|
||||
- num = 5;
|
||||
- denom = 1;
|
||||
- } else {
|
||||
- /* crack alert */
|
||||
- num = (gint) GST_SECOND;
|
||||
- while (diff > G_MAXINT) {
|
||||
- num = num >> 1;
|
||||
- diff = diff >> 1;
|
||||
- }
|
||||
- denom = (gint) diff;
|
||||
- }
|
||||
- stream->fps_known = TRUE;
|
||||
- stream->caps = gst_caps_make_writable (stream->caps);
|
||||
- gst_caps_set_simple (stream->caps,
|
||||
- "framerate", GST_TYPE_FRACTION, num, denom, NULL);
|
||||
- GST_DEBUG ("set up stream with fps %d/%d", num, denom);
|
||||
- gst_pad_use_fixed_caps (stream->pad);
|
||||
- gst_pad_set_caps (stream->pad, stream->caps);
|
||||
-
|
||||
- ret = gst_asf_demux_push_buffer (demux, stream, stream->cache);
|
||||
- stream->cache = NULL;
|
||||
-
|
||||
- ret = gst_asf_demux_push_buffer (demux, stream, stream->payload);
|
||||
- stream->payload = NULL;
|
||||
- }
|
||||
- } else {
|
||||
- ret = gst_asf_demux_push_buffer (demux, stream, stream->payload);
|
||||
- stream->payload = NULL;
|
||||
- }
|
||||
-
|
||||
- stream->frag_offset = 0;
|
||||
- }
|
||||
-
|
||||
-done:
|
||||
-
|
||||
- packet_info->size_left -= segment_info->chunk_size;
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static GstFlowReturn
|
||||
-gst_asf_demux_process_segment (GstASFDemux * demux,
|
||||
- asf_packet_info * packet_info, guint8 ** p_data, guint64 * p_size)
|
||||
-{
|
||||
- GstFlowReturn ret = GST_FLOW_OK;
|
||||
- asf_segment_info segment_info;
|
||||
- gboolean has_key_frame;
|
||||
- guint64 start_size;
|
||||
- guint32 replic_size;
|
||||
- guint32 time_start;
|
||||
- guint32 frag_size;
|
||||
- guint32 rsize;
|
||||
- guint8 time_delta;
|
||||
- guint8 byte;
|
||||
-
|
||||
- start_size = *p_size;
|
||||
-
|
||||
- if (*p_size < 1)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
-
|
||||
- byte = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- segment_info.stream_number = byte & 0x7f;
|
||||
- has_key_frame = ((byte & 0x80) == 0x80); /* FIXME: use this somewhere? */
|
||||
-
|
||||
- GST_INFO ("processing segment for stream %u%s", segment_info.stream_number,
|
||||
- (has_key_frame) ? " (has keyframe)" : "");
|
||||
-
|
||||
- /* FIXME: check (doesn't work) */
|
||||
-#if 0
|
||||
- {
|
||||
- AsfStream *stream;
|
||||
-
|
||||
- stream = gst_asf_demux_get_stream (demux, segment_info.stream_number);
|
||||
- if (stream && stream->last_pts == GST_CLOCK_TIME_NONE &&
|
||||
- stream->is_video && !has_key_frame) {
|
||||
- g_print ("skipping segment, waiting for a key unit\n");
|
||||
- if (!gst_asf_demux_skip_bytes (segment_info.segment_size - 1, p_data,
|
||||
- p_size))
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- packet_info->size_left -= segment_info.segment_size;
|
||||
- return GST_FLOW_OK;
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
- {
|
||||
- const guint lengths[4] = { 0, 1, 2, 4 };
|
||||
- guint needed;
|
||||
-
|
||||
- needed = lengths[packet_info->seqtype]
|
||||
- + lengths[packet_info->fragoffsettype]
|
||||
- + lengths[packet_info->replicsizetype];
|
||||
-
|
||||
- if (*p_size < needed)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- segment_info.sequence =
|
||||
- gst_asf_demux_get_var_length (packet_info->seqtype, p_data, p_size);
|
||||
- segment_info.frag_offset =
|
||||
- gst_asf_demux_get_var_length (packet_info->fragoffsettype, p_data,
|
||||
- p_size);
|
||||
- replic_size =
|
||||
- gst_asf_demux_get_var_length (packet_info->replicsizetype, p_data,
|
||||
- p_size);
|
||||
-
|
||||
- GST_DEBUG ("sequence=%u, frag_offset=%u, replic_size=%u",
|
||||
- segment_info.sequence, segment_info.frag_offset, replic_size);
|
||||
-
|
||||
- if (replic_size > 1) {
|
||||
- segment_info.compressed = FALSE;
|
||||
-
|
||||
- /* It's uncompressed with replic data */
|
||||
- if (*p_size < (4 + 4))
|
||||
- goto short_repdata;
|
||||
-
|
||||
- segment_info.segment_size = gst_asf_demux_get_uint32 (p_data, p_size);
|
||||
- segment_info.frag_timestamp = gst_asf_demux_get_uint32 (p_data, p_size);
|
||||
-
|
||||
- GST_LOG ("frag_timestamp: %" GST_TIME_FORMAT,
|
||||
- GST_TIME_ARGS (segment_info.frag_timestamp * GST_MSECOND));
|
||||
-
|
||||
- if (replic_size > 8) {
|
||||
- if (!gst_asf_demux_skip_bytes ((replic_size - 8), p_data, p_size))
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
- } else if (replic_size == 1) {
|
||||
- /* It's compressed */
|
||||
- segment_info.compressed = TRUE;
|
||||
- if (*p_size < 1)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- time_delta = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- GST_DEBUG ("time_delta = %u", time_delta);
|
||||
-
|
||||
- time_start = segment_info.frag_offset;
|
||||
- segment_info.frag_offset = 0;
|
||||
- segment_info.frag_timestamp = time_start; /* was: demux->timestamp */
|
||||
- } else {
|
||||
- segment_info.compressed = FALSE;
|
||||
-
|
||||
- time_start = segment_info.frag_offset;
|
||||
- segment_info.frag_offset = 0;
|
||||
- segment_info.frag_timestamp = time_start; /* was: demux->timestamp */
|
||||
- }
|
||||
-
|
||||
- GST_DEBUG ("multiple = %u, compressed = %u",
|
||||
- packet_info->multiple, segment_info.compressed);
|
||||
-
|
||||
- if (packet_info->multiple) {
|
||||
- const guint lengths[4] = { 0, 1, 2, 4 };
|
||||
-
|
||||
- if (*p_size < lengths[packet_info->segsizetype])
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
-
|
||||
- frag_size = gst_asf_demux_get_var_length (packet_info->segsizetype,
|
||||
- p_data, p_size);
|
||||
- } else {
|
||||
- frag_size = packet_info->size_left - (start_size - *p_size);
|
||||
- }
|
||||
-
|
||||
- rsize = start_size - *p_size;
|
||||
-
|
||||
- packet_info->size_left -= rsize;
|
||||
-
|
||||
- GST_DEBUG ("size left = %u, frag size = %u, rsize = %u",
|
||||
- packet_info->size_left, frag_size, rsize);
|
||||
-
|
||||
- if (segment_info.compressed) {
|
||||
- while (frag_size > 0) {
|
||||
- if (*p_size < 1)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- byte = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- packet_info->size_left--;
|
||||
- segment_info.chunk_size = byte;
|
||||
- segment_info.segment_size = segment_info.chunk_size;
|
||||
-
|
||||
- if (segment_info.chunk_size > packet_info->size_left) {
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- /* or is this an error?
|
||||
- * GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
|
||||
- * ("Payload chunk overruns packet size."));
|
||||
- * return GST_FLOW_ERROR; */
|
||||
- }
|
||||
-
|
||||
- ret = gst_asf_demux_process_chunk (demux, packet_info, &segment_info,
|
||||
- p_data, p_size);
|
||||
-
|
||||
- if (ret != GST_FLOW_OK)
|
||||
- break;
|
||||
-
|
||||
- if (segment_info.chunk_size < frag_size)
|
||||
- frag_size -= segment_info.chunk_size + 1;
|
||||
- else {
|
||||
-/*
|
||||
- GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
||||
- ("Invalid data in stream"),
|
||||
- ("Invalid fragment size indicator in segment"));
|
||||
- ret = GST_FLOW_ERROR;
|
||||
-*/
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
- }
|
||||
- } else {
|
||||
- segment_info.chunk_size = frag_size;
|
||||
- ret = gst_asf_demux_process_chunk (demux, packet_info, &segment_info,
|
||||
- p_data, p_size);
|
||||
- }
|
||||
-
|
||||
- return ret;
|
||||
-
|
||||
-/* ERRORS */
|
||||
-short_repdata:
|
||||
- {
|
||||
- if (replic_size < 8) {
|
||||
- GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
|
||||
- ("payload has replicated data, but size is less than 8"));
|
||||
- } else {
|
||||
- GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
|
||||
- ("payload has %u bytes of replicated data, but size is only %u",
|
||||
- replic_size, (guint) * p_size));
|
||||
- }
|
||||
- return GST_FLOW_ERROR;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-static GstFlowReturn
|
||||
-gst_asf_demux_handle_data (GstASFDemux * demux, guint8 ** p_data,
|
||||
- guint64 * p_size)
|
||||
-{
|
||||
- asf_packet_info packet_info;
|
||||
- gboolean correction;
|
||||
- guint64 start_size;
|
||||
- guint32 sequence;
|
||||
- guint32 packet_length;
|
||||
- guint32 rsize;
|
||||
- guint16 duration;
|
||||
- guint8 num_segments;
|
||||
- guint8 segment;
|
||||
- guint8 flags;
|
||||
- guint8 property;
|
||||
-
|
||||
- start_size = *p_size;
|
||||
-
|
||||
- GST_LOG ("processing packet %" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT,
|
||||
- demux->packet + 1, demux->num_packets);
|
||||
-
|
||||
- if (demux->num_packets > 0 && demux->packet >= demux->num_packets) {
|
||||
- GST_LOG_OBJECT (demux, "reached EOS");
|
||||
- return GST_FLOW_UNEXPECTED;
|
||||
- }
|
||||
-
|
||||
- ++demux->packet;
|
||||
-
|
||||
- if (*p_size < 1) {
|
||||
- GST_WARNING ("unexpected end of data"); /* unexpected, why? */
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- correction = ((gst_asf_demux_get_uint8 (p_data, p_size) & 0x80) == 0x80);
|
||||
-
|
||||
- /* Uses error correction? */
|
||||
- if (correction) {
|
||||
- asf_obj_data_correction corr_obj;
|
||||
-
|
||||
- GST_DEBUG ("data has error correction");
|
||||
- if (!gst_asf_demux_get_obj_data_correction (&corr_obj, p_data, p_size)) {
|
||||
- GST_WARNING ("unexpected end of data");
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Read the packet flags */
|
||||
- if (*p_size < (1 + 1)) {
|
||||
- GST_WARNING ("unexpected end of data");
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
- flags = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- property = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
-
|
||||
- packet_info.multiple = ((flags & 0x01) == 0x01);
|
||||
-
|
||||
- {
|
||||
- const guint lengths[4] = { 0, 1, 2, 4 };
|
||||
- guint needed;
|
||||
-
|
||||
- needed = lengths[(flags >> 5) & 0x03]
|
||||
- + lengths[(flags >> 3) & 0x03]
|
||||
- + lengths[(flags >> 1) & 0x03];
|
||||
-
|
||||
- if (*p_size < needed)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- packet_length =
|
||||
- gst_asf_demux_get_var_length ((flags >> 5) & 0x03, p_data, p_size);
|
||||
-
|
||||
- sequence = gst_asf_demux_get_var_length ((flags >> 1) & 0x03, p_data, p_size);
|
||||
-
|
||||
- packet_info.padsize =
|
||||
- gst_asf_demux_get_var_length ((flags >> 3) & 0x03, p_data, p_size);
|
||||
-
|
||||
- if (packet_length == 0)
|
||||
- packet_length = demux->packet_size;
|
||||
-
|
||||
- GST_DEBUG ("multiple = %u, sequence = %u, padsize = %u, "
|
||||
- "packet length = %u", packet_info.multiple, sequence,
|
||||
- packet_info.padsize, packet_length);
|
||||
-
|
||||
- /* Read the property flags */
|
||||
- packet_info.replicsizetype = property & 0x03;
|
||||
- packet_info.fragoffsettype = (property >> 2) & 0x03;
|
||||
- packet_info.seqtype = (property >> 4) & 0x03;
|
||||
-
|
||||
- if (*p_size < (4 + 2)) {
|
||||
- GST_WARNING ("unexpected end of data");
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- /* FIXME: isn't this the send time, ie. not the presentation time? (tpm) */
|
||||
- demux->timestamp = gst_asf_demux_get_uint32 (p_data, p_size);
|
||||
- duration = gst_asf_demux_get_uint16 (p_data, p_size);
|
||||
-
|
||||
- GST_DEBUG ("timestamp = %" GST_TIME_FORMAT ", duration = %" GST_TIME_FORMAT,
|
||||
- GST_TIME_ARGS ((gint64) demux->timestamp * GST_MSECOND),
|
||||
- GST_TIME_ARGS ((gint64) duration * GST_MSECOND));
|
||||
-
|
||||
- /* Are there multiple payloads? */
|
||||
- if (packet_info.multiple) {
|
||||
- guint8 multi_flags;
|
||||
-
|
||||
- if (*p_size < 1)
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
-
|
||||
- multi_flags = gst_asf_demux_get_uint8 (p_data, p_size);
|
||||
- packet_info.segsizetype = (multi_flags >> 6) & 0x03;
|
||||
- num_segments = multi_flags & 0x3f;
|
||||
- } else {
|
||||
- packet_info.segsizetype = 2;
|
||||
- num_segments = 1;
|
||||
- }
|
||||
-
|
||||
- rsize = start_size - *p_size;
|
||||
-
|
||||
- packet_info.size_left = packet_length - packet_info.padsize - rsize;
|
||||
-
|
||||
- GST_DEBUG ("rsize: %u, size left: %u", rsize, packet_info.size_left);
|
||||
-
|
||||
- for (segment = 0; segment < num_segments; ++segment) {
|
||||
- GstFlowReturn ret;
|
||||
-
|
||||
- ret = gst_asf_demux_process_segment (demux, &packet_info, p_data, p_size);
|
||||
- if (ret != GST_FLOW_OK) {
|
||||
- GST_DEBUG ("process_segment %u returned %s", segment,
|
||||
- gst_asf_get_flow_name (ret));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Skip the padding */
|
||||
- if (packet_info.padsize > 0) {
|
||||
- if (*p_size < packet_info.padsize) {
|
||||
- GST_WARNING ("unexpected end of data");
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- if (!gst_asf_demux_skip_bytes (packet_info.padsize, p_data, p_size))
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
-
|
||||
- GST_DEBUG ("remaining size left: %u", packet_info.size_left);
|
||||
-
|
||||
- /* FIXME: this doesn't really make sense, does it? if we don't have enough
|
||||
- * bytes left to skip the stuff at the end and we've already sent out
|
||||
- * buffers, just returning NEED_MORE_DATA isn't really right. Should we
|
||||
- * just throw an error in that case (can it happen with a non-broken
|
||||
- * stream?) */
|
||||
- if (packet_info.size_left > 0) {
|
||||
- if (!gst_asf_demux_skip_bytes (packet_info.size_left, p_data, p_size)) {
|
||||
- GST_WARNING
|
||||
- ("unexpected end of data, *p_size=%lld,packet_info.size_left=%u",
|
||||
- *p_size, packet_info.size_left);
|
||||
- return ASF_FLOW_NEED_MORE_DATA;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return gst_asf_demux_aggregate_flow_return (demux);
|
||||
-}
|
||||
-
|
||||
static const GstQueryType *
|
||||
gst_asf_demux_get_src_query_types (GstPad * pad)
|
||||
{
|
@ -1,96 +0,0 @@
|
||||
diff -up gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.c.foo gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.c
|
||||
--- gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.c.foo 2008-11-08 15:48:46.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.c 2008-12-17 10:42:17.000000000 +0100
|
||||
@@ -57,6 +57,7 @@ GST_ELEMENT_DETAILS ("mpeg1 and mpeg2 vi
|
||||
*/
|
||||
#define WARN_THRESHOLD (5)
|
||||
|
||||
+//#define enable_user_data
|
||||
#ifdef enable_user_data
|
||||
static GstStaticPadTemplate user_data_template_factory =
|
||||
GST_STATIC_PAD_TEMPLATE ("user_data",
|
||||
@@ -78,7 +79,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw-yuv, "
|
||||
- "format = (fourcc) { YV12, I420, Y42B }, "
|
||||
+ "format = (fourcc) { YV12, I420, Y42B, Y444 }, "
|
||||
"width = (int) [ 16, 4096 ], "
|
||||
"height = (int) [ 16, 4096 ], "
|
||||
"framerate = (fraction) [ 0/1, 2147483647/1 ]")
|
||||
@@ -404,7 +405,7 @@ crop_copy_i422_buffer (GstMpeg2dec * mpe
|
||||
static gboolean
|
||||
crop_buffer (GstMpeg2dec * mpeg2dec, GstBuffer ** buf)
|
||||
{
|
||||
- gboolean result = FALSE;
|
||||
+ gboolean result = TRUE;
|
||||
GstBuffer *input = *buf;
|
||||
GstBuffer *outbuf = input;
|
||||
|
||||
@@ -450,8 +451,9 @@ gst_mpeg2dec_alloc_sized_buf (GstMpeg2de
|
||||
|
||||
ret = gst_pad_alloc_buffer_and_set_caps (mpeg2dec->srcpad,
|
||||
GST_BUFFER_OFFSET_NONE, size, GST_PAD_CAPS (mpeg2dec->srcpad), obuf);
|
||||
- if (ret != GST_FLOW_OK)
|
||||
+ if (ret != GST_FLOW_OK) {
|
||||
return ret;
|
||||
+ }
|
||||
|
||||
/* libmpeg2 needs 16 byte aligned buffers... test for this here
|
||||
* and if it fails only a single time create our own buffers from
|
||||
@@ -547,8 +549,10 @@ gst_mpeg2dec_negotiate_format (GstMpeg2d
|
||||
mpeg2dec->v_offs =
|
||||
I420_V_OFFSET (mpeg2dec->decoded_width, mpeg2dec->decoded_height);
|
||||
|
||||
- } else if (sequence->width == sequence->chroma_width ||
|
||||
- sequence->height == sequence->chroma_height) {
|
||||
+ } else if ((sequence->width == sequence->chroma_width &&
|
||||
+ sequence->height != sequence->chroma_height) ||
|
||||
+ (sequence->width != sequence->chroma_width &&
|
||||
+ sequence->height == sequence->chroma_height)) {
|
||||
gint halfsize;
|
||||
|
||||
fourcc = GST_STR_FOURCC ("Y42B");
|
||||
@@ -558,8 +562,15 @@ gst_mpeg2dec_negotiate_format (GstMpeg2d
|
||||
mpeg2dec->u_offs = halfsize;
|
||||
mpeg2dec->v_offs = halfsize + (halfsize / 2);
|
||||
} else {
|
||||
- g_warning ("mpeg2dec: 4:4:4 format not yet supported");
|
||||
- return (FALSE);
|
||||
+ gint size;
|
||||
+
|
||||
+ size = mpeg2dec->decoded_width * mpeg2dec->decoded_height;
|
||||
+
|
||||
+ fourcc = GST_STR_FOURCC ("Y444");
|
||||
+ mpeg2dec->format = MPEG2DEC_FORMAT_Y444;
|
||||
+ mpeg2dec->size = size * 3;
|
||||
+ mpeg2dec->u_offs = size;
|
||||
+ mpeg2dec->v_offs = size * 2;
|
||||
}
|
||||
|
||||
if (mpeg2dec->pixel_width == 0 || mpeg2dec->pixel_height == 0) {
|
||||
@@ -1122,6 +1133,11 @@ gst_mpeg2dec_chain (GstPad * pad, GstBuf
|
||||
GST_DEBUG_OBJECT (mpeg2dec, "parse state %d", state);
|
||||
|
||||
switch (state) {
|
||||
+#if MPEG2_RELEASE >= MPEG2_VERSION (0, 5, 0)
|
||||
+ case STATE_SEQUENCE_MODIFIED:
|
||||
+ GST_DEBUG_OBJECT (mpeg2dec, "sequence modified");
|
||||
+ /* fall through */
|
||||
+#endif
|
||||
case STATE_SEQUENCE:
|
||||
ret = handle_sequence (mpeg2dec, info);
|
||||
/* if there is an error handling the sequence
|
||||
diff -up gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.h.foo gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.h
|
||||
--- gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.h.foo 2008-11-08 15:48:46.000000000 +0100
|
||||
+++ gst-plugins-ugly-0.10.10/ext/mpeg2dec/gstmpeg2dec.h 2008-12-17 10:42:40.000000000 +0100
|
||||
@@ -49,7 +49,8 @@ typedef enum
|
||||
MPEG2DEC_FORMAT_NONE,
|
||||
MPEG2DEC_FORMAT_I422,
|
||||
MPEG2DEC_FORMAT_I420,
|
||||
- MPEG2DEC_FORMAT_YV12
|
||||
+ MPEG2DEC_FORMAT_YV12,
|
||||
+ MPEG2DEC_FORMAT_Y444
|
||||
} Mpeg2decFormat;
|
||||
|
||||
typedef enum
|
@ -1 +1 @@
|
||||
http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-0.10.10.tar.bz2
|
||||
http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-0.10.11.tar.bz2
|
||||
|
@ -34,7 +34,7 @@ $SCRIPTS/install xf86-video-nv
|
||||
$SCRIPTS/install xinit
|
||||
#+$SCRIPTS/install pciutils
|
||||
$SCRIPTS/install evilwm-ewmh
|
||||
$SCRIPTS/install ratpoison
|
||||
#$SCRIPTS/install ratpoison
|
||||
#mkdir -p $INSTALL/usr/bin
|
||||
#cp $PKG_DIR/scripts/oe_wrapper $INSTALL/usr/bin
|
||||
#cp $PKG_DIR/scripts/startx $INSTALL/usr/bin
|
||||
|
Loading…
x
Reference in New Issue
Block a user