mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
aacparse: forego (bogus) parsing of already parsed (raw) input
This commit is contained in:
parent
d6d066892e
commit
deb9e7bb30
2 changed files with 32 additions and 1 deletions
|
@ -201,6 +201,7 @@ struct _GstBaseParsePrivate
|
||||||
GstFormat duration_fmt;
|
GstFormat duration_fmt;
|
||||||
|
|
||||||
guint min_frame_size;
|
guint min_frame_size;
|
||||||
|
gboolean passthrough;
|
||||||
|
|
||||||
gboolean discont;
|
gboolean discont;
|
||||||
gboolean flushing;
|
gboolean flushing;
|
||||||
|
@ -405,6 +406,7 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass)
|
||||||
parse->priv->pad_mode = GST_ACTIVATE_NONE;
|
parse->priv->pad_mode = GST_ACTIVATE_NONE;
|
||||||
parse->priv->duration = -1;
|
parse->priv->duration = -1;
|
||||||
parse->priv->min_frame_size = 1;
|
parse->priv->min_frame_size = 1;
|
||||||
|
parse->priv->passthrough = FALSE;
|
||||||
parse->priv->discont = FALSE;
|
parse->priv->discont = FALSE;
|
||||||
parse->priv->flushing = FALSE;
|
parse->priv->flushing = FALSE;
|
||||||
parse->priv->offset = 0;
|
parse->priv->offset = 0;
|
||||||
|
@ -919,7 +921,11 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (G_LIKELY (buffer)) {
|
if (G_LIKELY (buffer)) {
|
||||||
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
|
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
|
||||||
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
|
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
|
||||||
gst_adapter_push (parse->adapter, buffer);
|
if (G_UNLIKELY (parse->priv->passthrough)) {
|
||||||
|
buffer = gst_buffer_make_metadata_writable (buffer);
|
||||||
|
return gst_base_parse_push_buffer (parse, buffer);
|
||||||
|
} else
|
||||||
|
gst_adapter_push (parse->adapter, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse and push as many frames as possible */
|
/* Parse and push as many frames as possible */
|
||||||
|
@ -1410,6 +1416,30 @@ gst_base_parse_set_min_frame_size (GstBaseParse * parse, guint min_size)
|
||||||
GST_BASE_PARSE_UNLOCK (parse);
|
GST_BASE_PARSE_UNLOCK (parse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_base_transform_set_passthrough:
|
||||||
|
* @trans: the #GstBaseTransform to set
|
||||||
|
* @passthrough: boolean indicating passthrough mode.
|
||||||
|
*
|
||||||
|
* Set passthrough mode for this filter by default. This is mostly
|
||||||
|
* useful for filters that do not care about negotiation.
|
||||||
|
*
|
||||||
|
* Always TRUE for filters which don't implement either a transform
|
||||||
|
* or transform_ip method.
|
||||||
|
*
|
||||||
|
* MT safe.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_base_parse_set_passthrough (GstBaseParse * parse, gboolean passthrough)
|
||||||
|
{
|
||||||
|
g_return_if_fail (parse != NULL);
|
||||||
|
|
||||||
|
GST_BASE_PARSE_LOCK (parse);
|
||||||
|
parse->priv->passthrough = passthrough;
|
||||||
|
GST_LOG_OBJECT (parse, "set passthrough: %d", passthrough);
|
||||||
|
GST_BASE_PARSE_UNLOCK (parse);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_base_parse_get_querytypes:
|
* gst_base_parse_get_querytypes:
|
||||||
|
|
|
@ -234,6 +234,7 @@ void gst_base_parse_set_duration (GstBaseParse *parse,
|
||||||
|
|
||||||
void gst_base_parse_set_min_frame_size (GstBaseParse *parse,
|
void gst_base_parse_set_min_frame_size (GstBaseParse *parse,
|
||||||
guint min_size);
|
guint min_size);
|
||||||
|
void gst_base_parse_set_passthrough (GstBaseParse * parse, gboolean passthrough);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue