mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
rtp/vp8depay+vp9depay: Enable hdrext aggregation for VP8 and VP9
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
This commit is contained in:
parent
2673a66e60
commit
a97d3acb90
2 changed files with 16 additions and 0 deletions
|
@ -82,6 +82,9 @@ enum
|
||||||
static void
|
static void
|
||||||
gst_rtp_vp8_depay_init (GstRtpVP8Depay * self)
|
gst_rtp_vp8_depay_init (GstRtpVP8Depay * self)
|
||||||
{
|
{
|
||||||
|
gst_rtp_base_depayload_set_aggregate_hdrext_enabled (GST_RTP_BASE_DEPAYLOAD
|
||||||
|
(self), TRUE);
|
||||||
|
|
||||||
self->adapter = gst_adapter_new ();
|
self->adapter = gst_adapter_new ();
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
self->wait_for_keyframe = DEFAULT_WAIT_FOR_KEYFRAME;
|
self->wait_for_keyframe = DEFAULT_WAIT_FOR_KEYFRAME;
|
||||||
|
@ -351,6 +354,8 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
if (frame_start) {
|
if (frame_start) {
|
||||||
if (G_UNLIKELY (self->started)) {
|
if (G_UNLIKELY (self->started)) {
|
||||||
GST_DEBUG_OBJECT (depay, "Incomplete frame, flushing adapter");
|
GST_DEBUG_OBJECT (depay, "Incomplete frame, flushing adapter");
|
||||||
|
/* keep the current buffer because it may still be used later */
|
||||||
|
gst_rtp_base_depayload_flush (depay, TRUE);
|
||||||
gst_adapter_clear (self->adapter);
|
gst_adapter_clear (self->adapter);
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
|
|
||||||
|
@ -425,6 +430,7 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DELTA_UNIT);
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DELTA_UNIT);
|
||||||
|
|
||||||
if (self->waiting_for_keyframe) {
|
if (self->waiting_for_keyframe) {
|
||||||
|
gst_rtp_base_depayload_flush (depay, FALSE);
|
||||||
gst_buffer_unref (out);
|
gst_buffer_unref (out);
|
||||||
out = NULL;
|
out = NULL;
|
||||||
GST_INFO_OBJECT (self, "Dropping inter-frame before intra-frame");
|
GST_INFO_OBJECT (self, "Dropping inter-frame before intra-frame");
|
||||||
|
@ -473,10 +479,12 @@ gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
gst_rtp_base_depayload_dropped (depay);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
too_small:
|
too_small:
|
||||||
GST_DEBUG_OBJECT (self, "Invalid rtp packet (too small), ignoring");
|
GST_DEBUG_OBJECT (self, "Invalid rtp packet (too small), ignoring");
|
||||||
|
gst_rtp_base_depayload_flush (depay, FALSE);
|
||||||
gst_adapter_clear (self->adapter);
|
gst_adapter_clear (self->adapter);
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ enum
|
||||||
static void
|
static void
|
||||||
gst_rtp_vp9_depay_init (GstRtpVP9Depay * self)
|
gst_rtp_vp9_depay_init (GstRtpVP9Depay * self)
|
||||||
{
|
{
|
||||||
|
gst_rtp_base_depayload_set_aggregate_hdrext_enabled (GST_RTP_BASE_DEPAYLOAD
|
||||||
|
(self), TRUE);
|
||||||
|
|
||||||
self->adapter = gst_adapter_new ();
|
self->adapter = gst_adapter_new ();
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
self->inter_picture = FALSE;
|
self->inter_picture = FALSE;
|
||||||
|
@ -421,6 +424,8 @@ gst_rtp_vp9_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
if (is_start_of_picture) {
|
if (is_start_of_picture) {
|
||||||
if (G_UNLIKELY (self->started)) {
|
if (G_UNLIKELY (self->started)) {
|
||||||
GST_DEBUG_OBJECT (depay, "Incomplete frame, flushing adapter");
|
GST_DEBUG_OBJECT (depay, "Incomplete frame, flushing adapter");
|
||||||
|
/* keep the current buffer because it may still be used later */
|
||||||
|
gst_rtp_base_depayload_flush (depay, TRUE);
|
||||||
gst_adapter_clear (self->adapter);
|
gst_adapter_clear (self->adapter);
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
flushed_adapter = TRUE;
|
flushed_adapter = TRUE;
|
||||||
|
@ -503,6 +508,7 @@ gst_rtp_vp9_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DELTA_UNIT);
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DELTA_UNIT);
|
||||||
|
|
||||||
if (self->waiting_for_keyframe) {
|
if (self->waiting_for_keyframe) {
|
||||||
|
gst_rtp_base_depayload_flush (depay, FALSE);
|
||||||
gst_buffer_unref (out);
|
gst_buffer_unref (out);
|
||||||
out = NULL;
|
out = NULL;
|
||||||
GST_INFO_OBJECT (self, "Dropping inter-frame before intra-frame");
|
GST_INFO_OBJECT (self, "Dropping inter-frame before intra-frame");
|
||||||
|
@ -547,10 +553,12 @@ gst_rtp_vp9_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
gst_rtp_base_depayload_dropped (depay);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
too_small:
|
too_small:
|
||||||
GST_LOG_OBJECT (self, "Invalid rtp packet (too small), ignoring");
|
GST_LOG_OBJECT (self, "Invalid rtp packet (too small), ignoring");
|
||||||
|
gst_rtp_base_depayload_flush (depay, FALSE);
|
||||||
gst_adapter_clear (self->adapter);
|
gst_adapter_clear (self->adapter);
|
||||||
self->started = FALSE;
|
self->started = FALSE;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
Loading…
Reference in a new issue