mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
gst/: Modifications for disapearance of GST_PAD_IS_USABLE()
Original commit message from CVS: * gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_chain_raw): * gst/realmedia/rmdemux.c: (gst_rmdemux_chain), (gst_rmdemux_add_stream), (gst_rmdemux_parse_mdpr), (gst_rmdemux_parse_packet): Modifications for disapearance of GST_PAD_IS_USABLE()
This commit is contained in:
parent
eae0c80f16
commit
7cd253d5e1
3 changed files with 37 additions and 32 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-11-21 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* gst/dvdlpcmdec/gstdvdlpcmdec.c: (gst_dvdlpcmdec_chain_raw):
|
||||||
|
* gst/realmedia/rmdemux.c: (gst_rmdemux_chain),
|
||||||
|
(gst_rmdemux_add_stream), (gst_rmdemux_parse_mdpr),
|
||||||
|
(gst_rmdemux_parse_packet):
|
||||||
|
Modifications for disapearance of GST_PAD_IS_USABLE()
|
||||||
|
|
||||||
2005-11-18 Michael Smith <msmith@fluendo.com>
|
2005-11-18 Michael Smith <msmith@fluendo.com>
|
||||||
|
|
||||||
* gst/iec958/ac3iec.c: (ac3iec_init), (ac3iec_chain_dvd):
|
* gst/iec958/ac3iec.c: (ac3iec_init), (ac3iec_chain_dvd):
|
||||||
|
|
|
@ -442,9 +442,6 @@ gst_dvdlpcmdec_chain_raw (GstPad * pad, GstBuffer * buf)
|
||||||
if (dvdlpcmdec->rate == 0)
|
if (dvdlpcmdec->rate == 0)
|
||||||
goto not_negotiated;
|
goto not_negotiated;
|
||||||
|
|
||||||
if (!GST_PAD_IS_USABLE (dvdlpcmdec->srcpad))
|
|
||||||
goto disabled;
|
|
||||||
|
|
||||||
/* We don't currently do anything at all regarding emphasis, mute or
|
/* We don't currently do anything at all regarding emphasis, mute or
|
||||||
* dynamic_range - I'm not sure what they're for */
|
* dynamic_range - I'm not sure what they're for */
|
||||||
switch (dvdlpcmdec->width) {
|
switch (dvdlpcmdec->width) {
|
||||||
|
@ -561,13 +558,6 @@ not_negotiated:
|
||||||
ret = GST_FLOW_NOT_NEGOTIATED;
|
ret = GST_FLOW_NOT_NEGOTIATED;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
disabled:
|
|
||||||
{
|
|
||||||
GST_DEBUG_OBJECT (dvdlpcmdec, "Discarding buffer on disabled pad");
|
|
||||||
gst_buffer_unref (buf);
|
|
||||||
ret = GST_FLOW_NOT_LINKED;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
buffer_alloc_failed:
|
buffer_alloc_failed:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (dvdlpcmdec, RESOURCE, FAILED, (NULL),
|
GST_ELEMENT_ERROR (dvdlpcmdec, RESOURCE, FAILED, (NULL),
|
||||||
|
|
|
@ -139,8 +139,8 @@ static void gst_rmdemux_parse__rmf (GstRMDemux * rmdemux, const void *data,
|
||||||
int length);
|
int length);
|
||||||
static void gst_rmdemux_parse_prop (GstRMDemux * rmdemux, const void *data,
|
static void gst_rmdemux_parse_prop (GstRMDemux * rmdemux, const void *data,
|
||||||
int length);
|
int length);
|
||||||
static void gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, const void *data,
|
static GstFlowReturn gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux,
|
||||||
int length);
|
const void *data, int length);
|
||||||
static guint gst_rmdemux_parse_indx (GstRMDemux * rmdemux, const void *data,
|
static guint gst_rmdemux_parse_indx (GstRMDemux * rmdemux, const void *data,
|
||||||
int length);
|
int length);
|
||||||
static void gst_rmdemux_parse_data (GstRMDemux * rmdemux, const void *data,
|
static void gst_rmdemux_parse_data (GstRMDemux * rmdemux, const void *data,
|
||||||
|
@ -1010,7 +1010,7 @@ gst_rmdemux_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
data = gst_adapter_peek (rmdemux->adapter, rmdemux->size);
|
data = gst_adapter_peek (rmdemux->adapter, rmdemux->size);
|
||||||
|
|
||||||
gst_rmdemux_parse_mdpr (rmdemux, data, rmdemux->size);
|
ret = gst_rmdemux_parse_mdpr (rmdemux, data, rmdemux->size);
|
||||||
|
|
||||||
gst_adapter_flush (rmdemux->adapter, rmdemux->size);
|
gst_adapter_flush (rmdemux->adapter, rmdemux->size);
|
||||||
rmdemux->state = RMDEMUX_STATE_HEADER;
|
rmdemux->state = RMDEMUX_STATE_HEADER;
|
||||||
|
@ -1189,9 +1189,10 @@ gst_rmdemux_send_event (GstRMDemux * rmdemux, GstEvent * event)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
GstFlowReturn
|
||||||
gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
{
|
{
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
int version = 0;
|
int version = 0;
|
||||||
|
|
||||||
if (stream->subtype == GST_RMDEMUX_STREAM_VIDEO) {
|
if (stream->subtype == GST_RMDEMUX_STREAM_VIDEO) {
|
||||||
|
@ -1321,7 +1322,7 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (rmdemux, "not adding stream of type %d",
|
GST_WARNING_OBJECT (rmdemux, "not adding stream of type %d",
|
||||||
stream->subtype);
|
stream->subtype);
|
||||||
return;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PAD_ELEMENT_PRIVATE (stream->pad) = stream;
|
GST_PAD_ELEMENT_PRIVATE (stream->pad) = stream;
|
||||||
|
@ -1356,23 +1357,26 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
if (stream->extra_data_size > 0) {
|
if (stream->extra_data_size > 0) {
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
|
||||||
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE,
|
if ((ret = gst_pad_alloc_buffer
|
||||||
stream->extra_data_size, stream->caps, &buffer) != GST_FLOW_OK) {
|
(stream->pad, GST_BUFFER_OFFSET_NONE, stream->extra_data_size,
|
||||||
|
stream->caps, &buffer))
|
||||||
|
!= GST_FLOW_OK) {
|
||||||
GST_WARNING_OBJECT (rmdemux, "failed to alloc extra_data src "
|
GST_WARNING_OBJECT (rmdemux, "failed to alloc extra_data src "
|
||||||
"buffer for stream %d", stream->id);
|
"buffer for stream %d", stream->id);
|
||||||
return;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (GST_BUFFER_DATA (buffer), stream->extra_data,
|
memcpy (GST_BUFFER_DATA (buffer), stream->extra_data,
|
||||||
stream->extra_data_size);
|
stream->extra_data_size);
|
||||||
|
|
||||||
if (GST_PAD_IS_USABLE (stream->pad)) {
|
GST_DEBUG_OBJECT (rmdemux, "Pushing extra_data of size %d to pad",
|
||||||
GST_DEBUG_OBJECT (rmdemux, "Pushing extra_data of size %d to pad",
|
stream->extra_data_size);
|
||||||
stream->extra_data_size);
|
ret = gst_pad_push (stream->pad, buffer);
|
||||||
gst_pad_push (stream->pad, buffer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beach:
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_GNUC_UNUSED static void
|
G_GNUC_UNUSED static void
|
||||||
|
@ -1457,7 +1461,7 @@ gst_rmdemux_parse_prop (GstRMDemux * rmdemux, const void *data, int length)
|
||||||
GST_LOG_OBJECT (rmdemux, "flags: 0x%04x", RMDEMUX_GUINT16_GET (data + 38));
|
GST_LOG_OBJECT (rmdemux, "flags: 0x%04x", RMDEMUX_GUINT16_GET (data + 38));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static GstFlowReturn
|
||||||
gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, const void *data, int length)
|
gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, const void *data, int length)
|
||||||
{
|
{
|
||||||
GstRMDemuxStream *stream;
|
GstRMDemuxStream *stream;
|
||||||
|
@ -1609,7 +1613,7 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, const void *data, int length)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_rmdemux_add_stream (rmdemux, stream);
|
return gst_rmdemux_add_stream (rmdemux, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
|
@ -1687,6 +1691,7 @@ gst_rmdemux_parse_packet (GstRMDemux * rmdemux, const void *data,
|
||||||
GstRMDemuxStream *stream;
|
GstRMDemuxStream *stream;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
guint16 packet_size;
|
guint16 packet_size;
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
id = RMDEMUX_GUINT16_GET (data);
|
id = RMDEMUX_GUINT16_GET (data);
|
||||||
rmdemux->cur_timestamp = RMDEMUX_GUINT32_GET (data + 2) * GST_MSECOND;
|
rmdemux->cur_timestamp = RMDEMUX_GUINT32_GET (data + 2) * GST_MSECOND;
|
||||||
|
@ -1710,27 +1715,29 @@ gst_rmdemux_parse_packet (GstRMDemux * rmdemux, const void *data,
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
GST_WARNING_OBJECT (rmdemux, "No stream for stream id %d in parsing "
|
GST_WARNING_OBJECT (rmdemux, "No stream for stream id %d in parsing "
|
||||||
"data packet", id);
|
"data packet", id);
|
||||||
return GST_FLOW_OK;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rmdemux->offset + packet_size) > stream->seek_offset &&
|
if ((rmdemux->offset + packet_size) > stream->seek_offset &&
|
||||||
stream && stream->pad && GST_PAD_IS_USABLE (stream->pad)) {
|
stream && stream->pad) {
|
||||||
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE,
|
if ((ret = gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE,
|
||||||
packet_size, stream->caps, &buffer) != GST_FLOW_OK) {
|
packet_size, stream->caps, &buffer)) != GST_FLOW_OK) {
|
||||||
GST_WARNING_OBJECT (rmdemux, "failed to alloc src buffer for stream %d",
|
GST_WARNING_OBJECT (rmdemux, "failed to alloc src buffer for stream %d",
|
||||||
id);
|
id);
|
||||||
return GST_FLOW_ERROR;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (GST_BUFFER_DATA (buffer), (guint8 *) data, packet_size);
|
memcpy (GST_BUFFER_DATA (buffer), (guint8 *) data, packet_size);
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = rmdemux->cur_timestamp;
|
GST_BUFFER_TIMESTAMP (buffer) = rmdemux->cur_timestamp;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rmdemux, "Pushing buffer of size %d to pad", packet_size);
|
GST_DEBUG_OBJECT (rmdemux, "Pushing buffer of size %d to pad", packet_size);
|
||||||
return gst_pad_push (stream->pad, buffer);
|
ret = gst_pad_push (stream->pad, buffer);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (rmdemux,
|
GST_DEBUG_OBJECT (rmdemux,
|
||||||
"Stream %d is skipping: seek_offset=%d, offset=%d, packet_size",
|
"Stream %d is skipping: seek_offset=%d, offset=%d, packet_size",
|
||||||
stream->id, stream->seek_offset, rmdemux->offset, packet_size);
|
stream->id, stream->seek_offset, rmdemux->offset, packet_size);
|
||||||
return GST_FLOW_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beach:
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue