diff -Nru gst-plugins-bad1.0-1.18.3/ChangeLog gst-plugins-bad1.0-1.18.4/ChangeLog --- gst-plugins-bad1.0-1.18.3/ChangeLog 2021-01-13 21:11:25.350102200 +0000 +++ gst-plugins-bad1.0-1.18.4/ChangeLog 2021-03-15 17:49:19.562848800 +0000 @@ -1,3 +1,158 @@ +=== release 1.18.4 === + +2021-03-15 17:49:16 +0000 Tim-Philipp Müller + + * ChangeLog: + * NEWS: + * RELEASE: + * gst-plugins-bad.doap: + * meson.build: + Release 1.18.4 + +2021-03-08 14:30:52 +0200 Vivia Nikolaidou + + * tests/check/elements/interlace.c: + * tests/check/meson.build: + tests: Add negotiation tests for the interlace elements + Many complicated cases exist. Would be good to have some checks. + Part-of: + +2021-03-08 20:59:14 +0200 Vivia Nikolaidou + + * gst/interlace/gstinterlace.c: + interlace: Discard stored_frame on EOS and PAUSED_TO_READY + Would otherwise leak it. + Part-of: + +2021-03-08 16:16:25 +0200 Vivia Nikolaidou + + * docs/plugins/gst_plugins_cache.json: + * gst/interlace/gstinterlace.c: + interlace: Specify interlace-modes in the sink pad template + Especially specify the field-order in the interleaved mode. Otherwise it + might cause the negotiation to fail, because + GST_PAD_SET_ACCEPT_INTERSECT is not set on the sinkpad, and the + field-order is missing in the sink template but can be present in the + outside caps. + Part-of: + +2021-03-10 13:10:28 +0100 Stéphane Cerveau + + * gst/videoparsers/gstmpegvideoparse.c: + mpegvideoparse: do not clip the frame + If the current buffer is delta unit such as P or B + frame, the buffer should not be clipped and need to + let the decoder handle the segment boundary situation. + Part-of: + +2021-03-09 13:00:10 +0200 Sebastian Dröge + + * gst/timecode/gstavwait.c: + avwait: Don't post messages with the mutex locked + Part-of: + +2021-03-07 16:47:07 +0900 Seungha Yang + + * sys/nvcodec/gstnvh264dec.c: + nvh264sldec: Reopen decoder object if larger DPB size is required + Equivalent to the d3d11h264dec fix + https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1839 + Part-of: + +2021-03-04 17:42:28 +0900 Seungha Yang + + * sys/d3d11/gstd3d11h264dec.c: + d3d11h264dec: Keep track of actually configured DPB size + ... instead of the largest we ever seen. + Note that d3d11h264dec element holds previously configured DPB size + for later decoder object re-open decision. + This is to fix below case: + 1) Initial SPS, required DPB size is 6 + - decoder object is opened with DPB size 6 + - max_dpb_size is now 6 + 2) SPS update with resolution change, required DPB size is 1 + - decoder object is re-opened with DPB size 1 + - max_dpb_size should be updated to 1, but it didn't happen (BUG) + 3) SPS update without resolution change, only required DPB size is updated to 6 + - decoder object should be re-opened but didn't happen + because we didn't update max_dpb_size at 2). + Part-of: + +2020-11-26 05:55:29 +0900 Seungha Yang + + * sys/d3d11/gstd3d11h264dec.c: + d3d11h264dec: Reconfigure decoder object on DPB size change + Even if resolution and/or bitdepth is not updated, required + DPB size can be changed per SPS update and it could be even + larger than previously configured size of DPB. If so, we need + to reconfigure DPB d3d11 texture pool again. + Part-of: + +2021-03-01 16:23:37 +0100 Jan Alexander Steffens (heftig) + + * gst/mpegtsdemux/mpegtsparse.c: + mpegtsparse: Fix switched DTS/PTS when set-timestamps=false + Fixes 30ee21eae36e7279f63b77167ba1dcf5f70b8e83. + Part-of: + +2021-02-26 16:36:58 +0200 Sebastian Dröge + + * sys/decklink/gstdecklinkvideosink.cpp: + decklinkvideosink: Use correct numerator for 29.97fps + It's not 0.2997fps. + Part-of: + +2021-02-26 11:39:10 +0100 Edward Hervey + + * sys/decklink/gstdecklink.cpp: + decklinksrc: Use a more accurate capture time + Use the hardware reference clock time when the frame was finished being captured + instead of a time much further down the road. + This improves the stability/accuracy of buffer times. + Part-of: + +2021-02-24 16:57:06 +0100 Víctor Manuel Jáquez Leal + + * docs/plugins/gst_plugins_cache.json: + * ext/vulkan/vkcolorconvert.c: + * ext/vulkan/vkviewconvert.c: + vulkan: Fix elements long name. + Fix vkcoloconvert and vkviewconvert long names. + Part-of: + +2021-02-19 00:03:00 +0000 Tim-Philipp Müller + + * gst/sdp/gstsdpsrc.c: + sdpsrc: fix double free if sdp is provided as string via the property + Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1532 + Part-of: + +2021-01-29 02:09:05 -0500 Staz M + + * sys/decklink/gstdecklink.cpp: + decklink: Fixed decklinkvideosink auto format detection + Part-of: + +2021-01-20 18:16:17 +0800 Haihua Hu + + * ext/dash/gstmpdhelper.c: + dashsink: fix double unref of sinkpad caps + no need to unref caps in gst_mpd_helper_get_XXX_codec_from_mime + it will be unref in caller gst_dash_sink_get_stream_metadata() + Part-of: + +2021-01-18 19:23:30 +0900 Seungha Yang + + * sys/d3d11/gstd3d11videosink.c: + d3d11videosink: Fix build error on UWP + gstd3d11videosink.c(662): error C2065: 'sink': undeclared identifier + Part-of: + +2021-01-14 02:17:31 +0000 Tim-Philipp Müller + + * meson.build: + Back to development + === release 1.18.3 === 2021-01-13 21:11:22 +0000 Tim-Philipp Müller diff -Nru gst-plugins-bad1.0-1.18.3/debian/changelog gst-plugins-bad1.0-1.18.4/debian/changelog --- gst-plugins-bad1.0-1.18.3/debian/changelog 2021-03-02 23:41:37.000000000 +0000 +++ gst-plugins-bad1.0-1.18.4/debian/changelog 2021-05-08 04:27:17.000000000 +0000 @@ -1,8 +1,39 @@ -gst-plugins-bad1.0 (1.18.3-1ubuntu2~20.10.sav0) groovy; urgency=medium +gst-plugins-bad1.0 (1.18.4-1ubuntu1~20.10.sav0.1) groovy; urgency=medium + + * No-change rebuild against libaom3 (aom 3.1.0) + + -- Rob Savoury Fri, 07 May 2021 21:27:17 -0700 + +gst-plugins-bad1.0 (1.18.4-1ubuntu1~20.10.sav0) groovy; urgency=medium * Backport to Groovy - -- Rob Savoury Tue, 02 Mar 2021 15:41:37 -0800 + -- Rob Savoury Thu, 06 May 2021 22:14:43 -0700 + +gst-plugins-bad1.0 (1.18.4-1ubuntu1) hirsute; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - Stop installing camerabin2 basecamerabin jpegformat - plugins which have + moved to -good. + - Provide gstreamer-plugins-bad-1.0.pc with Requires on + gstreamer-plugins-good-1.0 - the package we've moved the referenced + library to. This maintains compatibility with upstream software and + other distributions. + - Don't build the opencv binary packages on i386, avoiding a large tree + of numeric-related dependencies for a binary package it's not required + to support. + + -- Sebastien Bacher Mon, 12 Apr 2021 11:23:20 +0200 + +gst-plugins-bad1.0 (1.18.4-1) experimental; urgency=medium + + [ Marc Leeman ] + * New upstream version 1.18.4 + + [ Sebastian Dröge ] + * Upload to experimental. + + -- Sebastian Dröge Mon, 05 Apr 2021 11:32:14 +0300 gst-plugins-bad1.0 (1.18.3-1ubuntu2) hirsute; urgency=medium diff -Nru gst-plugins-bad1.0-1.18.3/debian/patches/02_opencv-data-path.patch gst-plugins-bad1.0-1.18.4/debian/patches/02_opencv-data-path.patch --- gst-plugins-bad1.0-1.18.3/debian/patches/02_opencv-data-path.patch 2021-01-15 11:06:51.000000000 +0000 +++ gst-plugins-bad1.0-1.18.4/debian/patches/02_opencv-data-path.patch 2021-04-12 09:21:38.000000000 +0000 @@ -1,8 +1,8 @@ -Index: gst-plugins-bad1.0/ext/opencv/gstfaceblur.cpp +Index: gst-plugins-bad1.0-1.18.4/ext/opencv/gstfaceblur.cpp =================================================================== ---- gst-plugins-bad1.0.orig/ext/opencv/gstfaceblur.cpp -+++ gst-plugins-bad1.0/ext/opencv/gstfaceblur.cpp -@@ -72,9 +72,8 @@ +--- gst-plugins-bad1.0-1.18.4.orig/ext/opencv/gstfaceblur.cpp ++++ gst-plugins-bad1.0-1.18.4/ext/opencv/gstfaceblur.cpp +@@ -68,9 +68,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_face_blur_debug); #define GST_CAT_DEFAULT gst_face_blur_debug @@ -14,11 +14,11 @@ #define DEFAULT_SCALE_FACTOR 1.25 #if (CV_MAJOR_VERSION >= 4) #define DEFAULT_FLAGS CASCADE_DO_CANNY_PRUNING -Index: gst-plugins-bad1.0/ext/opencv/gstfacedetect.cpp +Index: gst-plugins-bad1.0-1.18.4/ext/opencv/gstfacedetect.cpp =================================================================== ---- gst-plugins-bad1.0.orig/ext/opencv/gstfacedetect.cpp -+++ gst-plugins-bad1.0/ext/opencv/gstfacedetect.cpp -@@ -89,9 +89,7 @@ using namespace std; +--- gst-plugins-bad1.0-1.18.4.orig/ext/opencv/gstfacedetect.cpp ++++ gst-plugins-bad1.0-1.18.4/ext/opencv/gstfacedetect.cpp +@@ -86,9 +86,7 @@ using namespace std; GST_DEBUG_CATEGORY_STATIC (gst_face_detect_debug); #define GST_CAT_DEFAULT gst_face_detect_debug diff -Nru gst-plugins-bad1.0-1.18.3/docs/plugins/gst_plugins_cache.json gst-plugins-bad1.0-1.18.4/docs/plugins/gst_plugins_cache.json --- gst-plugins-bad1.0-1.18.3/docs/plugins/gst_plugins_cache.json 2021-01-13 21:11:25.378102300 +0000 +++ gst-plugins-bad1.0-1.18.4/docs/plugins/gst_plugins_cache.json 2021-03-15 17:49:19.594847000 +0000 @@ -25229,7 +25229,7 @@ "long-name": "Interlace filter", "pad-templates": { "sink": { - "caps": "video/x-raw:\n format: { AYUV, YUY2, UYVY, I420, YV12, Y42B, Y444, NV12, NV21 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", + "caps": "video/x-raw:\n format: { AYUV, YUY2, UYVY, I420, YV12, Y42B, Y444, NV12, NV21 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: progressive\nvideo/x-raw:\n format: { AYUV, YUY2, UYVY, I420, YV12, Y42B, Y444, NV12, NV21 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: interleaved\n field-order: { (string)top-field-first, (string)bottom-field-first }\nvideo/x-raw:\n format: { AYUV, YUY2, UYVY, I420, YV12, Y42B, Y444, NV12, NV21 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: mixed\n\nvideo/x-raw(format:Interlaced):\n format: { AYUV, YUY2, UYVY, I420, YV12, Y42B, Y444, NV12, NV21 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n interlace-mode: alternate\n", "direction": "sink", "presence": "always" }, @@ -222500,7 +222500,7 @@ "GObject" ], "klass": "Filter/Video/Convert", - "long-name": "Vulkan Uploader", + "long-name": "Vulkan Color Convert", "pad-templates": { "sink": { "caps": "video/x-raw(memory:VulkanImage):\n format: { BGRA, RGBA, ABGR, ARGB, BGRx, RGBx, xBGR, xRGB, AYUV, YUY2, NV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", @@ -222680,7 +222680,7 @@ "GObject" ], "klass": "Filter/Video/Convert", - "long-name": "Vulkan Uploader", + "long-name": "Vulkan View Convert", "pad-templates": { "sink": { "caps": "video/x-raw(memory:VulkanImage):\n format: { BGRA, RGBA }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", diff -Nru gst-plugins-bad1.0-1.18.3/ext/dash/gstmpdhelper.c gst-plugins-bad1.0-1.18.4/ext/dash/gstmpdhelper.c --- gst-plugins-bad1.0-1.18.3/ext/dash/gstmpdhelper.c 2021-01-13 21:11:25.394102300 +0000 +++ gst-plugins-bad1.0-1.18.4/ext/dash/gstmpdhelper.c 2021-03-15 17:49:19.610846300 +0000 @@ -103,7 +103,6 @@ } done: - gst_caps_unref (caps); return codec_name; } @@ -128,7 +127,6 @@ } done: - gst_caps_unref (caps); return codec_name; } diff -Nru gst-plugins-bad1.0-1.18.3/ext/vulkan/vkcolorconvert.c gst-plugins-bad1.0-1.18.4/ext/vulkan/vkcolorconvert.c --- gst-plugins-bad1.0-1.18.3/ext/vulkan/vkcolorconvert.c 2021-01-13 21:11:25.446102400 +0000 +++ gst-plugins-bad1.0-1.18.4/ext/vulkan/vkcolorconvert.c 2021-03-15 17:49:19.658843800 +0000 @@ -895,7 +895,7 @@ gstelement_class = (GstElementClass *) klass; gstbasetransform_class = (GstBaseTransformClass *) klass; - gst_element_class_set_metadata (gstelement_class, "Vulkan Uploader", + gst_element_class_set_metadata (gstelement_class, "Vulkan Color Convert", "Filter/Video/Convert", "A Vulkan Color Convert", "Matthew Waters "); diff -Nru gst-plugins-bad1.0-1.18.3/ext/vulkan/vkviewconvert.c gst-plugins-bad1.0-1.18.4/ext/vulkan/vkviewconvert.c --- gst-plugins-bad1.0-1.18.3/ext/vulkan/vkviewconvert.c 2021-01-13 21:11:25.446102400 +0000 +++ gst-plugins-bad1.0-1.18.4/ext/vulkan/vkviewconvert.c 2021-03-15 17:49:19.658843800 +0000 @@ -607,7 +607,7 @@ GST_TYPE_VULKAN_STEREO_DOWNMIX, DEFAULT_DOWNMIX, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - gst_element_class_set_metadata (gstelement_class, "Vulkan Uploader", + gst_element_class_set_metadata (gstelement_class, "Vulkan View Convert", "Filter/Video/Convert", "A Vulkan View Convert", "Matthew Waters "); diff -Nru gst-plugins-bad1.0-1.18.3/gst/interlace/gstinterlace.c gst-plugins-bad1.0-1.18.4/gst/interlace/gstinterlace.c --- gst-plugins-bad1.0-1.18.3/gst/interlace/gstinterlace.c 2021-01-13 21:11:25.498102400 +0000 +++ gst-plugins-bad1.0-1.18.4/gst/interlace/gstinterlace.c 2021-03-15 17:49:19.710841000 +0000 @@ -186,12 +186,16 @@ ); static GstStaticPadTemplate gst_interlace_sink_template = -GST_STATIC_PAD_TEMPLATE ("sink", + GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE - ("{AYUV,YUY2,UYVY,I420,YV12,Y42B,Y444,NV12,NV21}") - ) + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (VIDEO_FORMATS) + ",interlace-mode=progressive ;" GST_VIDEO_CAPS_MAKE (VIDEO_FORMATS) + ",interlace-mode=interleaved,field-order={top-field-first,bottom-field-first}; " + GST_VIDEO_CAPS_MAKE (VIDEO_FORMATS) ",interlace-mode=mixed ;" + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_FORMAT_INTERLACED, + VIDEO_FORMATS) + ",interlace-mode=alternate") ); GType gst_interlace_get_type (void); @@ -649,6 +653,10 @@ } #endif + if (interlace->stored_frame) { + gst_buffer_unref (interlace->stored_frame); + interlace->stored_frame = NULL; + } ret = gst_pad_push_event (interlace->srcpad, event); break; case GST_EVENT_CAPS: @@ -1442,6 +1450,9 @@ case GST_STATE_CHANGE_PAUSED_TO_READY: g_mutex_lock (&interlace->lock); interlace->src_fps_n = 0; + if (interlace->stored_frame) { + gst_buffer_unref (interlace->stored_frame); + } g_mutex_unlock (&interlace->lock); /* why? */ //gst_interlace_reset (interlace); diff -Nru gst-plugins-bad1.0-1.18.3/gst/mpegtsdemux/mpegtsparse.c gst-plugins-bad1.0-1.18.4/gst/mpegtsdemux/mpegtsparse.c --- gst-plugins-bad1.0-1.18.3/gst/mpegtsdemux/mpegtsparse.c 2021-01-13 21:11:25.502102600 +0000 +++ gst-plugins-bad1.0-1.18.4/gst/mpegtsdemux/mpegtsparse.c 2021-03-15 17:49:19.714840700 +0000 @@ -809,8 +809,8 @@ } /* Copy over input PTS/DTS (if present) */ - GST_BUFFER_DTS (buf) = base->packetizer->last_pts; - GST_BUFFER_PTS (buf) = base->packetizer->last_dts; + GST_BUFFER_DTS (buf) = base->packetizer->last_dts; + GST_BUFFER_PTS (buf) = base->packetizer->last_pts; ret = mpegts_parse_have_buffer (base, gst_buffer_ref (buf)); while (pad && !done) { diff -Nru gst-plugins-bad1.0-1.18.3/gst/sdp/gstsdpsrc.c gst-plugins-bad1.0-1.18.4/gst/sdp/gstsdpsrc.c --- gst-plugins-bad1.0-1.18.3/gst/sdp/gstsdpsrc.c 2021-01-13 21:11:25.518102600 +0000 +++ gst-plugins-bad1.0-1.18.4/gst/sdp/gstsdpsrc.c 2021-03-15 17:49:19.730839700 +0000 @@ -159,8 +159,11 @@ if (self->location && strcmp (self->location, "sdp://") != 0) { /* Do nothing */ } else if (self->sdp) { + guint sdp_len = strlen (self->sdp); + self->sdp_buffer = - gst_buffer_new_wrapped (self->sdp, strlen (self->sdp) + 1); + gst_buffer_new_wrapped (g_strndup (self->sdp, sdp_len), + sdp_len + 1); } else { ret = GST_STATE_CHANGE_FAILURE; } diff -Nru gst-plugins-bad1.0-1.18.3/gst/timecode/gstavwait.c gst-plugins-bad1.0-1.18.4/gst/timecode/gstavwait.c --- gst-plugins-bad1.0-1.18.3/gst/timecode/gstavwait.c 2021-01-13 21:11:25.518102600 +0000 +++ gst-plugins-bad1.0-1.18.4/gst/timecode/gstavwait.c 2021-03-15 17:49:19.730839700 +0000 @@ -353,7 +353,9 @@ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY:{ + gboolean send_message = FALSE; + g_mutex_lock (&self->mutex); if (self->mode != MODE_RUNNING_TIME) { GST_DEBUG_OBJECT (self, "First time reset in paused to ready"); @@ -364,7 +366,7 @@ } if (!self->dropping) { self->dropping = TRUE; - gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); + send_message = TRUE; } gst_segment_init (&self->asegment, GST_FORMAT_UNDEFINED); self->asegment.position = GST_CLOCK_TIME_NONE; @@ -377,7 +379,11 @@ gst_video_time_code_free (self->last_seen_tc); self->last_seen_tc = NULL; g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); break; + } default: break; } @@ -609,7 +615,9 @@ GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_SEGMENT: + case GST_EVENT_SEGMENT:{ + gboolean send_message = FALSE; + g_mutex_lock (&self->mutex); gst_event_copy_segment (event, &self->vsegment); if (self->vsegment.format != GST_FORMAT_TIME) { @@ -625,16 +633,22 @@ self->audio_running_time_to_end_at = GST_CLOCK_TIME_NONE; if (!self->dropping) { self->dropping = TRUE; - gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); + send_message = TRUE; } self->vsegment.position = GST_CLOCK_TIME_NONE; g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); break; + } case GST_EVENT_GAP: gst_event_unref (event); return TRUE; case GST_EVENT_EOS:{ GstClockTime running_time; + gboolean send_message = FALSE; + GstClockTime audio_running_time_to_end_at; g_mutex_lock (&self->mutex); self->video_eos_flag = TRUE; @@ -661,15 +675,16 @@ if (self->must_send_end_message & END_MESSAGE_AUDIO_PUSHED) { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); - gst_avwait_send_element_message (self, TRUE, - self->audio_running_time_to_end_at); + send_message = TRUE; + audio_running_time_to_end_at = self->audio_running_time_to_end_at; } else if (self->must_send_end_message & END_MESSAGE_STREAM_ENDED) { self->must_send_end_message |= END_MESSAGE_VIDEO_PUSHED; - g_mutex_unlock (&self->mutex); - } else { - g_mutex_unlock (&self->mutex); } + g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, + audio_running_time_to_end_at); break; } case GST_EVENT_FLUSH_START: @@ -678,7 +693,9 @@ g_cond_signal (&self->audio_cond); g_mutex_unlock (&self->mutex); break; - case GST_EVENT_FLUSH_STOP: + case GST_EVENT_FLUSH_STOP:{ + gboolean send_message = FALSE; + g_mutex_lock (&self->mutex); self->video_flush_flag = FALSE; GST_DEBUG_OBJECT (self, "First time reset in video flush"); @@ -688,12 +705,16 @@ self->audio_running_time_to_end_at = GST_CLOCK_TIME_NONE; if (!self->dropping) { self->dropping = TRUE; - gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); + send_message = TRUE; } gst_segment_init (&self->vsegment, GST_FORMAT_UNDEFINED); self->vsegment.position = GST_CLOCK_TIME_NONE; g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, GST_CLOCK_TIME_NONE); break; + } case GST_EVENT_CAPS:{ GstCaps *caps; gst_event_parse_caps (event, &caps); @@ -748,22 +769,27 @@ g_mutex_unlock (&self->mutex); break; case GST_EVENT_EOS:{ + gboolean send_message = FALSE; + GstClockTime audio_running_time_to_end_at; + g_mutex_lock (&self->mutex); self->audio_eos_flag = TRUE; g_cond_signal (&self->audio_cond); if ((self->must_send_end_message & END_MESSAGE_VIDEO_PUSHED)) { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); - gst_avwait_send_element_message (self, TRUE, - self->audio_running_time_to_end_at); + audio_running_time_to_end_at = self->audio_running_time_to_end_at; + send_message = TRUE; } else if (self->must_send_end_message & END_MESSAGE_STREAM_ENDED) { self->must_send_end_message |= END_MESSAGE_AUDIO_PUSHED; - g_mutex_unlock (&self->mutex); } else { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); } + g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, + audio_running_time_to_end_at); break; } case GST_EVENT_FLUSH_STOP: @@ -803,6 +829,9 @@ GstVideoTimeCodeMeta *tc_meta; gboolean retry = FALSE; gboolean ret = GST_FLOW_OK; + gboolean send_message = FALSE; + GstClockTime message_running_time; + gboolean message_dropping; timestamp = GST_BUFFER_TIMESTAMP (inbuf); if (timestamp == GST_CLOCK_TIME_NONE) { @@ -898,8 +927,9 @@ inbuf = NULL; } } else if (emit_passthrough_signal && self->recording) { - gst_avwait_send_element_message (self, FALSE, - self->running_time_to_wait_for); + send_message = TRUE; + message_running_time = self->running_time_to_wait_for; + message_dropping = FALSE; } } break; @@ -924,8 +954,11 @@ if (self->recording) { self->audio_running_time_to_wait_for = running_time; } - if (self->recording) - gst_avwait_send_element_message (self, FALSE, running_time); + if (self->recording) { + send_message = TRUE; + message_running_time = running_time; + message_dropping = FALSE; + } } if (GST_CLOCK_TIME_IS_VALID (self->end_running_time) @@ -948,8 +981,9 @@ inbuf = NULL; } } else if (emit_passthrough_signal && self->recording) { - gst_avwait_send_element_message (self, FALSE, - self->running_time_to_wait_for); + send_message = TRUE; + message_running_time = self->running_time_to_wait_for; + message_dropping = FALSE; } break; @@ -964,9 +998,11 @@ } if (self->dropping) { self->dropping = FALSE; - if (self->recording) - gst_avwait_send_element_message (self, FALSE, - self->running_time_to_wait_for); + if (self->recording) { + send_message = TRUE; + message_running_time = self->running_time_to_wait_for; + message_dropping = FALSE; + } } } break; @@ -1015,7 +1051,9 @@ && running_time > self->running_time_to_wait_for) { /* We just started recording: synchronise the audio */ self->audio_running_time_to_wait_for = running_time; - gst_avwait_send_element_message (self, FALSE, running_time); + send_message = TRUE; + message_running_time = running_time; + message_dropping = FALSE; } else { /* We will start in the future when running_time_to_wait_for is * reached */ @@ -1044,6 +1082,11 @@ g_cond_signal (&self->cond); g_mutex_unlock (&self->mutex); + if (send_message) + gst_avwait_send_element_message (self, message_dropping, + message_running_time); + send_message = FALSE; + if (inbuf) { GST_DEBUG_OBJECT (self, "Pass video buffer %" GST_TIME_FORMAT "-%" GST_TIME_FORMAT, @@ -1058,22 +1101,24 @@ g_mutex_lock (&self->mutex); if (self->must_send_end_message & END_MESSAGE_AUDIO_PUSHED) { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); - gst_avwait_send_element_message (self, TRUE, - self->audio_running_time_to_end_at); + send_message = TRUE; + message_dropping = TRUE; + message_running_time = self->audio_running_time_to_end_at; } else if (self->must_send_end_message & END_MESSAGE_STREAM_ENDED) { if (self->audio_eos_flag) { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); - gst_avwait_send_element_message (self, TRUE, - self->audio_running_time_to_end_at); + send_message = TRUE; + message_dropping = TRUE; + message_running_time = self->audio_running_time_to_end_at; } else { self->must_send_end_message |= END_MESSAGE_VIDEO_PUSHED; - g_mutex_unlock (&self->mutex); } - } else { - g_mutex_unlock (&self->mutex); } + g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, message_dropping, + message_running_time); return ret; } @@ -1284,20 +1329,25 @@ } if (send_element_message) { + gboolean send_message = FALSE; + GstClockTime audio_running_time_to_end_at; + g_mutex_lock (&self->mutex); if ((self->must_send_end_message & END_MESSAGE_VIDEO_PUSHED) || self->video_eos_flag) { self->must_send_end_message = END_MESSAGE_NORMAL; - g_mutex_unlock (&self->mutex); - gst_avwait_send_element_message (self, TRUE, - self->audio_running_time_to_end_at); + send_message = TRUE; + audio_running_time_to_end_at = self->audio_running_time_to_end_at; } else if (self->must_send_end_message & END_MESSAGE_STREAM_ENDED) { self->must_send_end_message |= END_MESSAGE_AUDIO_PUSHED; - g_mutex_unlock (&self->mutex); } else { g_assert_not_reached (); - g_mutex_unlock (&self->mutex); } + g_mutex_unlock (&self->mutex); + + if (send_message) + gst_avwait_send_element_message (self, TRUE, + audio_running_time_to_end_at); } send_element_message = FALSE; return ret; diff -Nru gst-plugins-bad1.0-1.18.3/gst/videoparsers/gstmpegvideoparse.c gst-plugins-bad1.0-1.18.4/gst/videoparsers/gstmpegvideoparse.c --- gst-plugins-bad1.0-1.18.3/gst/videoparsers/gstmpegvideoparse.c 2021-01-13 21:11:25.522102600 +0000 +++ gst-plugins-bad1.0-1.18.4/gst/videoparsers/gstmpegvideoparse.c 2021-03-15 17:49:19.734839700 +0000 @@ -999,9 +999,6 @@ mpvparse->send_codec_tag = FALSE; } - /* usual clipping applies */ - frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP; - if (mpvparse->send_mpeg_meta) { GstBuffer *buf; diff -Nru gst-plugins-bad1.0-1.18.3/gst-plugins-bad.doap gst-plugins-bad1.0-1.18.4/gst-plugins-bad.doap --- gst-plugins-bad1.0-1.18.3/gst-plugins-bad.doap 2021-01-13 21:11:25.478102400 +0000 +++ gst-plugins-bad1.0-1.18.4/gst-plugins-bad.doap 2021-03-15 17:49:19.690842000 +0000 @@ -35,6 +35,16 @@ + 1.18.4 + 1.18 + + 2021-03-15 + + + + + + 1.18.3 1.18 diff -Nru gst-plugins-bad1.0-1.18.3/meson.build gst-plugins-bad1.0-1.18.4/meson.build --- gst-plugins-bad1.0-1.18.3/meson.build 2021-01-13 21:11:25.526102500 +0000 +++ gst-plugins-bad1.0-1.18.4/meson.build 2021-03-15 17:49:19.738839400 +0000 @@ -1,5 +1,5 @@ project('gst-plugins-bad', 'c', 'cpp', - version : '1.18.3', + version : '1.18.4', meson_version : '>= 0.49', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) diff -Nru gst-plugins-bad1.0-1.18.3/NEWS gst-plugins-bad1.0-1.18.4/NEWS --- gst-plugins-bad1.0-1.18.3/NEWS 2021-01-13 21:11:25.350102200 +0000 +++ gst-plugins-bad1.0-1.18.4/NEWS 2021-03-15 17:49:19.562848800 +0000 @@ -2,13 +2,13 @@ GStreamer 1.18.0 was originally released on 8 September 2020. -The latest bug-fix release in the 1.18 series is 1.18.3 and was released -on 13 January 2021. +The latest bug-fix release in the 1.18 series is 1.18.4 and was released +on 15 March 2021. See https://gstreamer.freedesktop.org/releases/1.18/ for the latest version of this document. -Last updated: Wednesday 13 January 2021, 20:00 UTC (log) +Last updated: Monday 15 March 2021, 13:00 UTC (log) Introduction @@ -2717,6 +2717,168 @@ - List of Merge Requests applied in 1.18.3 - List of Issues fixed in 1.18.3 +1.18.4 + +The fourth 1.18 bug-fix release (1.18.4) was released on 15 March 2021. + +This release only contains bugfixes and security fixes and it should be +safe to update from 1.18.x. + +Highlighted bugfixes in 1.18.4 + +- important security fixes for ID3 tag reading, matroska and realmedia + parsing, and gst-libav audio decoding +- audiomixer, audioaggregator: input buffer handling fixes +- decodebin3: improve stream-selection message handling +- uridecodebin3: make “caps” property work +- wavenc: fix writing of INFO chunks in some cases +- v4l2: bt601 colorimetry, allow encoder resolution changes, fix + decoder frame rate negotiation +- decklinkvideosink: fix auto format detection, and fixes for 29.97fps + framerate output +- mpeg-2 video handling fixes when seeking +- avviddec: fix bufferpool negotiation and possible memory corruption + when changing resolution +- various stability, performance and reliability improvements +- memory leak fixes +- build fixes: rpicamsrc, qt overlay example, d3d11videosink on UWP + +gstreamer + +- info: Don’t leak log function user_data if the debug system is + compiled out +- task: Use SetThreadDescription() Win32 API for setting thread names, + which preserves thread names in dump files. +- buffer, memory: Mark info in map functions as caller-allocates and + pass allocation params as const pointers where possible +- clock: define AUTO_CLEANUP_FREE_FUNC for GstClockID + +gst-plugins-base + +- tag: id3v2: fix frame size check and potential invalid reads +- audio: Fix gst_audio_buffer_truncate() meta handling for + non-interleaved audio +- audioresample: respect buffer layout when draining +- audioaggregator: fix input_buffer ownership +- decodebin3: change stream selection message owner, so that the app + sends the stream-selection event to the right element +- rtspconnection: correct data_size when tunneled mode +- uridecodebin3: make caps property work +- video-converter: Don’t upsample invalid lines +- videodecoder: Fix racy critical when pool negotiation occurs during + flush +- video: Convert gst_video_info_to_caps() to take self as const ptr +- examples: added qt core dependency for qt overlay example + +gst-plugins-good + +- matroskademux: header parsing fixes +- rpicamsrc: depend on posix threads and vchiq_arm to fix build on + raspios again +- wavenc: Fixed INFO chunk corruption, caused by odd sized data not + being padded +- wavpackdec: Add floating point format support to fix distortions in + some cases +- v4l2: recognize V4L2 bt601 colorimetry again +- v4l2videoenc: support resolution change stream encode +- v4l2h265codec: fix HEVC profile string issue +- v4l2object: Need keep same transfer as input caps +- v4l2videodec: Fix vp8 and vp9 streams can’t play on board with + vendor bsp +- v4l2videodec: fix src side frame rate negotiation + +gst-plugins-bad + +- avwait: Don’t post messages with the mutex locked +- d3d11h264dec: Reconfigure decoder object on DPB size change and keep + track of actually configured DPB size +- dashsink: fix double unref of sinkpad caps +- decklinkvideosink: Use correct numerator for 29.97fps +- decklinkvideosink: fix auto format detection +- decklinksrc: Use a more accurate capture time +- d3d11videosink: Fix build error on UWP +- interlace: negotiation and buffer leak fixes +- mpegvideoparse: do not clip, so decoder receives data from keyframe + even if it’s before the segment start +- mpegtsparse: Fix switched DTS/PTS when set-timestamps=false +- nvh264sldec: Reopen decoder object if larger DPB size is required +- sdpsrc: fix double free if sdp is provided as string via the + property +- vulkan: Fix elements long name. + +gst-plugins-ugly + +- rmdemux: Make sure we have enough data available when parsing + audio/video packets + +gst-libav + +- avviddec: take the maximum of the height/coded_height +- viddec: don’t configure an incorrect buffer pool when receiving a + gap event +- audiodec: fix stack overflow in gst_ffmpeg_channel_layout_to_gst() + +gst-rtsp-server + +- rtspclientsink: fix deadlock on shutdown if no data has been + received yet +- rtspclientsink: fix leaks in unit tests +- rtsp-stream: avoid deadlock in send_func +- rtsp-client: cleanup transports during TEARDOWN + +gstreamer-vaapi + +- h264 encoder: append encoder exposure to aud +- postproc: Fix a problem of propose_allocation when passthrough +- glx: Iterate over FBConfig and select 8 bit color size + +gstreamer-sharp + +- no changes + +gst-omx + +- no changes + +gst-python + +- no changes + +gst-editing-services + +- group: Use proper group constructor + +gst-integration-testsuites + +- no changes + +gst-build + +- no changes + +Cerbero build tool and packaging changes in 1.18.4 + +- macOS: more BigSur fixes +- glib: Backport patch to set thread names on Windows 10 + +Contributors to 1.18.4 + +Alicia Boya García, Ashley Brighthope, Bing Song, Branko Subasic, Edward +Hervey, Guillaume Desmottes, Haihua Hu, He Junyan, Hou Qi, Jan Alexander +Steffens (heftig), Jeongki Kim, Jordan Petridis, Knobe, Kristofer +Björkström, Marijn Suijten, Matthew Waters, Paul Goulpié, Philipp Zabel, +Rafał Dzięgiel, Sebastian Dröge, Seungha Yang, Staz M, Stéphane Cerveau, +Thibault Saunier, Tim-Philipp Müller, Víctor Manuel Jáquez Leal, Vivia +Nikolaidou, Vladimir Menshakov, + +… and many others who have contributed bug reports, translations, sent +suggestions or helped testing. Thank you all! + +List of merge requests and issues fixed in 1.18.4 + +- List of Merge Requests applied in 1.18.4 +- List of Issues fixed in 1.18.4 + Schedule for 1.20 Our next major feature release will be 1.20, and 1.19 will be the @@ -2724,9 +2886,9 @@ development of 1.19/1.20 will happen in the git master branch. The plan for the 1.20 development cycle is yet to be confirmed, but it -is now expected that feature freeze will take place some time in -January/February 2021, with the first 1.20 stable release hopefully -around February/March 2021. +is now expected that feature freeze will take place some time in April +2021, with the first 1.20 stable release hopefully around April/May +2021. 1.20 will be backwards-compatible to the stable 1.18, 1.16, 1.14, 1.12, 1.10, 1.8, 1.6, 1.4, 1.2 and 1.0 release series. diff -Nru gst-plugins-bad1.0-1.18.3/po/gst-plugins-bad-1.0.pot gst-plugins-bad1.0-1.18.4/po/gst-plugins-bad-1.0.pot --- gst-plugins-bad1.0-1.18.3/po/gst-plugins-bad-1.0.pot 2021-01-13 21:11:26.010103700 +0000 +++ gst-plugins-bad1.0-1.18.4/po/gst-plugins-bad-1.0.pot 2021-03-15 17:49:20.262811700 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gst-plugins-bad-1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-13 21:11+0000\n" +"POT-Creation-Date: 2021-03-15 17:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff -Nru gst-plugins-bad1.0-1.18.3/RELEASE gst-plugins-bad1.0-1.18.4/RELEASE --- gst-plugins-bad1.0-1.18.3/RELEASE 2021-01-13 21:11:25.350102200 +0000 +++ gst-plugins-bad1.0-1.18.4/RELEASE 2021-03-15 17:49:19.562848800 +0000 @@ -1,4 +1,4 @@ -This is GStreamer gst-plugins-bad 1.18.3. +This is GStreamer gst-plugins-bad 1.18.4. The GStreamer team is thrilled to announce a new major feature release of your favourite cross-platform multimedia framework! diff -Nru gst-plugins-bad1.0-1.18.3/sys/d3d11/gstd3d11h264dec.c gst-plugins-bad1.0-1.18.4/sys/d3d11/gstd3d11h264dec.c --- gst-plugins-bad1.0-1.18.3/sys/d3d11/gstd3d11h264dec.c 2021-01-13 21:11:25.538102600 +0000 +++ gst-plugins-bad1.0-1.18.4/sys/d3d11/gstd3d11h264dec.c 2021-03-15 17:49:19.750838800 +0000 @@ -99,6 +99,8 @@ guint chroma_format_idc; GstVideoFormat out_format; + gint max_dpb_size; + /* Array of DXVA_Slice_H264_Short */ GArray *slice_list; @@ -288,6 +290,20 @@ GST_ELEMENT_CLASS (parent_class)->set_context (element, context); } +/* Clear all codec specific (e.g., SPS) data */ +static void +gst_d3d11_h264_dec_reset (GstD3D11H264Dec * self) +{ + self->width = 0; + self->height = 0; + self->coded_width = 0; + self->coded_height = 0; + self->bitdepth = 0; + self->chroma_format_idc = 0; + self->out_format = GST_VIDEO_FORMAT_UNKNOWN; + self->max_dpb_size = 0; +} + static gboolean gst_d3d11_h264_dec_open (GstVideoDecoder * decoder) { @@ -308,6 +324,8 @@ return FALSE; } + gst_d3d11_h264_dec_reset (self); + return TRUE; } @@ -419,6 +437,12 @@ modified = TRUE; } + if (self->max_dpb_size < max_dpb_size) { + GST_INFO_OBJECT (self, "Requires larger DPB size (%d -> %d)", + self->max_dpb_size, max_dpb_size); + modified = TRUE; + } + if (modified || !self->d3d11_decoder->opened) { GstVideoInfo info; @@ -446,6 +470,12 @@ gst_video_info_set_format (&info, self->out_format, self->width, self->height); + /* Store configured DPB size here. Then, it will be referenced later + * to decide whether we need to re-open decoder object or not. + * For instance, if every configuration is same apart from DPB size and + * new DPB size is decreased, we can reuse existing decoder object. + */ + self->max_dpb_size = max_dpb_size; gst_d3d11_decoder_reset (self->d3d11_decoder); if (!gst_d3d11_decoder_open (self->d3d11_decoder, GST_D3D11_CODEC_H264, &info, self->coded_width, self->coded_height, diff -Nru gst-plugins-bad1.0-1.18.3/sys/d3d11/gstd3d11videosink.c gst-plugins-bad1.0-1.18.4/sys/d3d11/gstd3d11videosink.c --- gst-plugins-bad1.0-1.18.3/sys/d3d11/gstd3d11videosink.c 2021-01-13 21:11:25.542102600 +0000 +++ gst-plugins-bad1.0-1.18.4/sys/d3d11/gstd3d11videosink.c 2021-03-15 17:49:19.754838500 +0000 @@ -559,7 +559,7 @@ #if GST_D3D11_WINAPI_ONLY_APP if (window_type != GST_D3D11_WINDOW_NATIVE_TYPE_CORE_WINDOW && window_type != GST_D3D11_WINDOW_NATIVE_TYPE_SWAP_CHAIN_PANEL) { - GST_ERROR_OBJECT (sink, "Overlay handle must be set before READY state"); + GST_ERROR_OBJECT (self, "Overlay handle must be set before READY state"); return FALSE; } #endif diff -Nru gst-plugins-bad1.0-1.18.3/sys/decklink/gstdecklink.cpp gst-plugins-bad1.0-1.18.4/sys/decklink/gstdecklink.cpp --- gst-plugins-bad1.0-1.18.3/sys/decklink/gstdecklink.cpp 2021-01-13 21:11:25.542102600 +0000 +++ gst-plugins-bad1.0-1.18.4/sys/decklink/gstdecklink.cpp 2021-03-15 17:49:19.754838500 +0000 @@ -661,7 +661,8 @@ } f = vinfo.finfo->format; - return gst_decklink_type_from_video_format (f); + *format = gst_decklink_pixel_format_from_type(gst_decklink_type_from_video_format (f)); + return TRUE; } static GstStructure * @@ -1022,6 +1023,41 @@ if (clock) { capture_time = gst_clock_get_time (clock); + if (video_frame) { + // If we have the actual capture time for the frame, compensate the + // capture time accordingly. + // + // We do this by subtracting the belay between "now" in hardware + // reference clock and the time when the frame was finished being + // capture based on the same hardware reference clock. + // + // We then subtract that difference from the "now" on the gst clock. + // + // *Technically* we should be compensating that difference for the + // difference in clock rate between the "hardware reference clock" and + // the GStreamer clock. But since the values are quite small this has + // very little impact. + BMDTimeValue hardware_now; + res = m_input->input->GetHardwareReferenceClock (GST_SECOND, &hardware_now, NULL, NULL); + if (res == S_OK) { + res = + video_frame->GetHardwareReferenceTimestamp (GST_SECOND, + &hardware_time, &hardware_duration); + if (res != S_OK) { + GST_ERROR ("Failed to get hardware time: 0x%08lx", (unsigned long) res); + hardware_time = GST_CLOCK_TIME_NONE; + hardware_duration = GST_CLOCK_TIME_NONE; + } else { + GstClockTime hardware_diff = hardware_now - hardware_time; + GST_LOG ("Compensating capture time by %" GST_TIME_FORMAT, + GST_TIME_ARGS (hardware_diff)); + if (capture_time > hardware_diff) + capture_time -= hardware_diff; + else + capture_time = 0; + } + } + } if (capture_time > base_time) capture_time -= base_time; else diff -Nru gst-plugins-bad1.0-1.18.3/sys/decklink/gstdecklinkvideosink.cpp gst-plugins-bad1.0-1.18.4/sys/decklink/gstdecklinkvideosink.cpp --- gst-plugins-bad1.0-1.18.3/sys/decklink/gstdecklinkvideosink.cpp 2021-01-13 21:11:25.542102600 +0000 +++ gst-plugins-bad1.0-1.18.4/sys/decklink/gstdecklinkvideosink.cpp 2021-03-15 17:49:19.758838400 +0000 @@ -823,7 +823,7 @@ gst_byte_writer_put_uint8_unchecked (&bw, 0x2f); } else if (mode->fps_n == 25 && mode->fps_d == 1) { gst_byte_writer_put_uint8_unchecked (&bw, 0x3f); - } else if (mode->fps_n == 30 && mode->fps_d == 1001) { + } else if (mode->fps_n == 30000 && mode->fps_d == 1001) { gst_byte_writer_put_uint8_unchecked (&bw, 0x4f); } else if (mode->fps_n == 30 && mode->fps_d == 1) { gst_byte_writer_put_uint8_unchecked (&bw, 0x5f); diff -Nru gst-plugins-bad1.0-1.18.3/sys/nvcodec/gstnvh264dec.c gst-plugins-bad1.0-1.18.4/sys/nvcodec/gstnvh264dec.c --- gst-plugins-bad1.0-1.18.3/sys/nvcodec/gstnvh264dec.c 2021-01-13 21:11:25.562102600 +0000 +++ gst-plugins-bad1.0-1.18.4/sys/nvcodec/gstnvh264dec.c 2021-03-15 17:49:19.774837500 +0000 @@ -112,6 +112,7 @@ guint coded_width, coded_height; guint bitdepth; guint chroma_format_idc; + gint max_dpb_size; GstVideoFormat out_format; /* For OpenGL interop. */ @@ -232,6 +233,20 @@ GST_ELEMENT_CLASS (parent_class)->set_context (element, context); } +/* Clear all codec specific (e.g., SPS) data */ +static void +gst_d3d11_h264_dec_reset (GstNvH264Dec * self) +{ + self->width = 0; + self->height = 0; + self->coded_width = 0; + self->coded_height = 0; + self->bitdepth = 0; + self->chroma_format_idc = 0; + self->out_format = GST_VIDEO_FORMAT_UNKNOWN; + self->max_dpb_size = 0; +} + static gboolean gst_nv_h264_dec_open (GstVideoDecoder * decoder) { @@ -245,6 +260,8 @@ return FALSE; } + gst_d3d11_h264_dec_reset (self); + return TRUE; } @@ -362,6 +379,12 @@ modified = TRUE; } + if (self->max_dpb_size < max_dpb_size) { + GST_INFO_OBJECT (self, "Requires larger DPB size (%d -> %d)", + self->max_dpb_size, max_dpb_size); + modified = TRUE; + } + if (modified || !self->decoder) { GstVideoInfo info; @@ -391,6 +414,7 @@ gst_video_info_set_format (&info, self->out_format, self->width, self->height); + self->max_dpb_size = max_dpb_size; /* FIXME: add support cudaVideoCodec_H264_SVC and cudaVideoCodec_H264_MVC */ self->decoder = gst_nv_decoder_new (self->context, cudaVideoCodec_H264, &info, diff -Nru gst-plugins-bad1.0-1.18.3/tests/check/elements/interlace.c gst-plugins-bad1.0-1.18.4/tests/check/elements/interlace.c --- gst-plugins-bad1.0-1.18.3/tests/check/elements/interlace.c 1970-01-01 00:00:00.000000000 +0000 +++ gst-plugins-bad1.0-1.18.4/tests/check/elements/interlace.c 2021-03-15 17:49:19.794836500 +0000 @@ -0,0 +1,216 @@ +/* GStreamer + * unit test for interlace + * + * Copyright (C) 2021 Vivia Nikolaidou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include + +GST_START_TEST (test_passthrough) +{ + GstBuffer *buffer; + GstHarness *h; + + h = gst_harness_new ("interlace"); + + gst_harness_set (h, "interlace", "field-pattern", 1, "top-field-first", TRUE, + NULL); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=interleaved,field-order=top-field-first,format=AYUV,height=1,width=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_set (h, "interlace", "field-pattern", 1, "top-field-first", FALSE, + NULL); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=interleaved,field-order=bottom-field-first,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_reject_passthrough_mixed) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + gst_harness_play (h); + + gst_harness_set (h, "interlace", "field-pattern", 3, NULL); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=mixed,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), + GST_FLOW_NOT_NEGOTIATED); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_field_switch) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + + gst_harness_set (h, "interlace", "field-pattern", 1, "top-field-first", FALSE, + NULL); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=interleaved,field-order=top-field-first,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_set (h, "interlace", "field-pattern", 1, "top-field-first", TRUE, + NULL); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=interleaved,field-order=bottom-field-first,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_framerate_2_2) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + + gst_harness_set (h, "interlace", "field-pattern", 1, "top-field-first", TRUE, + NULL); + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=1/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=1/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=2/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), + GST_FLOW_NOT_NEGOTIATED); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_framerate_1_1) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + + gst_harness_set (h, "interlace", "field-pattern", 0, "top-field-first", TRUE, + NULL); + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=1/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), + GST_FLOW_NOT_NEGOTIATED); + + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=1/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=2/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_framerate_3_2) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + + gst_harness_set (h, "interlace", "field-pattern", 2, NULL); + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=30/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=24/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK); + + gst_harness_set_sink_caps_str (h, "video/x-raw,framerate=1/1"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=1/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), + GST_FLOW_NOT_NEGOTIATED); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +GST_START_TEST (test_framerate_empty_not_negotiated) +{ + GstHarness *h; + GstBuffer *buffer; + + h = gst_harness_new ("interlace"); + + gst_harness_set_sink_caps_str (h, "EMPTY"); + gst_harness_set_src_caps_str (h, + "video/x-raw,interlace-mode=progressive,format=AYUV,width=1,height=1,framerate=24/1"); + buffer = gst_harness_create_buffer (h, 4); + fail_unless_equals_int (gst_harness_push (h, buffer), + GST_FLOW_NOT_NEGOTIATED); + + gst_harness_teardown (h); +} + +GST_END_TEST; + +static Suite * +interlace_suite (void) +{ + Suite *s = suite_create ("interlace"); + TCase *tc_chain = tcase_create ("general"); + + suite_add_tcase (s, tc_chain); + + tcase_add_test (tc_chain, test_passthrough); + tcase_add_test (tc_chain, test_reject_passthrough_mixed); + tcase_add_test (tc_chain, test_field_switch); + tcase_add_test (tc_chain, test_framerate_2_2); + tcase_add_test (tc_chain, test_framerate_1_1); + tcase_add_test (tc_chain, test_framerate_3_2); + tcase_add_test (tc_chain, test_framerate_empty_not_negotiated); + + return s; +} + +GST_CHECK_MAIN (interlace); diff -Nru gst-plugins-bad1.0-1.18.3/tests/check/meson.build gst-plugins-bad1.0-1.18.4/tests/check/meson.build --- gst-plugins-bad1.0-1.18.3/tests/check/meson.build 2021-01-13 21:11:25.582102800 +0000 +++ gst-plugins-bad1.0-1.18.4/tests/check/meson.build 2021-03-15 17:49:19.798836200 +0000 @@ -33,6 +33,7 @@ [['elements/h265parse.c'], false, [libparser_dep, gstcodecparsers_dep]], [['elements/hlsdemux_m3u8.c'], not hls_dep.found(), [hls_dep]], [['elements/id3mux.c']], + [['elements/interlace.c']], [['elements/jpeg2000parse.c'], false, [libparser_dep, gstcodecparsers_dep]], [['elements/mfvideosrc.c'], host_machine.system() != 'windows', ], [['elements/mpegtsdemux.c'], false, [gstmpegts_dep]],