Hello community, here is the log from the commit of package gstreamer-plugins-libav for openSUSE:Factory checked in at 2020-11-09 13:56:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gstreamer-plugins-libav (Old) and /work/SRC/openSUSE:Factory/.gstreamer-plugins-libav.new.11331 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gstreamer-plugins-libav" Mon Nov 9 13:56:49 2020 rev:21 rq:846454 version:1.18.1 Changes: -------- --- /work/SRC/openSUSE:Factory/gstreamer-plugins-libav/gstreamer-plugins-libav.changes 2020-10-27 18:58:16.502713996 +0100 +++ /work/SRC/openSUSE:Factory/.gstreamer-plugins-libav.new.11331/gstreamer-plugins-libav.changes 2020-11-09 13:58:17.935847967 +0100 @@ -1,0 +2,14 @@ +Wed Oct 28 10:30:41 UTC 2020 - Antonio Larrosa <alarr...@suse.com> + +- Update to 1.18.1: + + Highlighted bugfixes in 1.18.1 + - important security fixes + - bug fixes and memory leak fixes + - various stability and reliability improvements + + gst-libav changes: + - avaudenc/avvidenc: Reopen encoding session if it's required + - avauddec/audenc/videnc: Don't return GST_FLOW_EOS when draining + - avauddec/avviddec: Avoid dropping non-OK flow return + - avcodecmap: Enable 24 bit WMA Lossless decoding + +------------------------------------------------------------------- Old: ---- gst-libav-1.18.0.tar.xz New: ---- gst-libav-1.18.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gstreamer-plugins-libav.spec ++++++ --- /var/tmp/diff_new_pack.6XwYbO/_old 2020-11-09 13:58:18.695846310 +0100 +++ /var/tmp/diff_new_pack.6XwYbO/_new 2020-11-09 13:58:18.699846301 +0100 @@ -18,7 +18,7 @@ %define gst_branch 1.0 Name: gstreamer-plugins-libav -Version: 1.18.0 +Version: 1.18.1 Release: 0 Summary: A ffmpeg/libav plugin for GStreamer License: GPL-2.0-or-later ++++++ gst-libav-1.18.0.tar.xz -> gst-libav-1.18.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ChangeLog new/gst-libav-1.18.1/ChangeLog --- old/gst-libav-1.18.0/ChangeLog 2020-09-08 01:08:13.142985000 +0200 +++ new/gst-libav-1.18.1/ChangeLog 2020-10-26 12:15:11.964274000 +0100 @@ -1,7 +1,110 @@ +=== release 1.18.1 === + +2020-10-26 11:15:11 +0000 Tim-Philipp Müller <t...@centricular.com> + + * ChangeLog: + * NEWS: + * RELEASE: + * gst-libav.doap: + * meson.build: + Release 1.18.1 + +2020-10-06 03:47:42 +0900 Seungha Yang <seun...@centricular.com> + + * ext/libav/gstavaudenc.c: + * ext/libav/gstavaudenc.h: + * ext/libav/gstavutils.h: + * ext/libav/gstavvidenc.c: + * ext/libav/gstavvidenc.h: + avaudenc/avvidenc: Reopen encoding session if it's required + Since the commit https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/22b25b3ea5c, + ffmpeg will not clear draning flag for encoder by avcodec_flush_buffers() API + by default. Allowed case is only if encoder has AV_CODEC_CAP_ENCODER_FLUSH + capability flag. If it's not supported, we should re-open encoding + session, otherwise ffmpeg encoder will keep returning AVERROR_EOF + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/102> + +2020-10-01 11:18:58 +0300 Sebastian Dröge <sebast...@centricular.com> + + * ext/libav/gstavvidenc.c: + avvidenc: Call avcodec_flush_buffers() after draining to allow accepting new input again + This is already done in all other codec elements. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/101> + +2020-09-30 16:13:28 +0300 Sebastian Dröge <sebast...@centricular.com> + + * ext/libav/gstavauddec.c: + * ext/libav/gstavaudenc.c: + * ext/libav/gstavviddec.c: + * ext/libav/gstavvidenc.c: + avauddec/audenc/videnc: Don't return GST_FLOW_EOS when draining + Same behaviour as for avviddec now. FFmpeg will return AVERROR_EOF when it's + completely drained but we should not return that here or otherwise + upstream will receive EOS and not forward us more data. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/101> + +2020-09-16 03:13:09 +0900 Seungha Yang <seun...@centricular.com> + + * ext/libav/gstavviddec.c: + avviddec: Don't return GST_FLOW_EOS from drain()/finish() + AVERROR_EOF means that it's fully drained, but it doesn't + mean that that end of stream. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/96> + +2020-09-15 02:12:23 +0900 Seungha Yang <seun...@centricular.com> + + * ext/libav/gstavauddec.c: + avauddec: Ensure finish_subframe() and finish_frame() are paired + audiodecoder baseclass implementation is expecting that + finish_subframe() is followed by finish_frame() in order clear + its internal state related to subframe. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/96> + +2020-09-14 14:30:35 +0300 Sebastian Dröge <sebast...@centricular.com> + + * ext/libav/gstavauddec.c: + avauddec: Forward flow returns from draining instead of assuming OK + It might be useful for upstream to know that draining/finishing didn't + succeed, and why. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/96> + +2020-09-14 14:24:51 +0300 Sebastian Dröge <sebast...@centricular.com> + + * ext/libav/gstavviddec.c: + avviddec: Forward flow returns from draining instead of assuming OK + It might be useful for upstream to know that draining/finishing didn't + succeed, and why. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/96> + +2020-09-09 08:55:28 +0200 Edward Hervey <edw...@centricular.com> + + * ext/libav/gstavauddec.c: + avauddec: Avoid dropping non-OK flow return + When sucessfully finishing out frames (or finishing configuration), we must make + sure we don't override any failing GstFlowReturn that might have been detected + previously. + Failure to do this would result in not propagating not-linked, flushing, + etc... + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/96> + +2016-09-26 20:06:54 -0400 Olivier Crête <olivier.cr...@collabora.com> + + * docs/gst_plugins_cache.json: + * ext/libav/gstavcodecmap.c: + avcodecmap: Enable 24 bit WMA Lossless decoding + This now works with not so recent ffmpeg. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/95> + +2020-09-08 17:44:35 +0100 Tim-Philipp Müller <t...@centricular.com> + + * meson.build: + Back to development + === release 1.18.0 === 2020-09-08 00:08:12 +0100 Tim-Philipp Müller <t...@centricular.com> + * .gitlab-ci.yml: * ChangeLog: * NEWS: * RELEASE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/NEWS new/gst-libav-1.18.1/NEWS --- old/gst-libav-1.18.0/NEWS 2020-09-08 01:08:13.142985000 +0200 +++ new/gst-libav-1.18.1/NEWS 2020-10-26 12:15:11.964274000 +0100 @@ -1,11 +1,14 @@ GStreamer 1.18 Release Notes -GStreamer 1.18.0 was originally released on 7 September 2020. +GStreamer 1.18.0 was originally released on 8 September 2020. + +The latest bug-fix release in the 1.18 series is 1.18.1 and was released +on 26 October 2020. See https://gstreamer.freedesktop.org/releases/1.18/ for the latest version of this document. -Last updated: Monday 7 September 2020, 10:30 UTC (log) +Last updated: Monday 26 October 2020, 11:00 UTC (log) Introduction @@ -28,7 +31,8 @@ - Active Format Description (AFD) and Bar Data support -- ONVIF trick modes support in both GStreamer RTSP server and client +- RTSP server and client implementations gained ONVIF trick modes + support - Hardware-accelerated video decoding on Windows via DXVA2 / Direct3D11 @@ -39,24 +43,25 @@ - qmlgloverlay: New overlay element that renders a QtQuick scene over the top of an input video stream -- New imagesequencesrc element to easily create a video stream from a +- imagesequencesrc: New element to easily create a video stream from a sequence of jpeg or png images -- dashsink: Add new sink to produce DASH content +- dashsink: New sink to produce DASH content -- dvbsubenc: DVB Subtitle encoder element +- dvbsubenc: New DVB Subtitle encoder element -- TV broadcast compliant MPEG-TS muxing with constant bitrate muxing - and SCTE-35 support +- MPEG-TS muxing now also supports TV broadcast compliant muxing with + constant bitrate muxing and SCTE-35 support -- rtmp2: new RTMP client source and sink element implementation +- rtmp2: New RTMP client source and sink element from-scratch + implementation -- svthevcenc: new SVT-HEVC-based H.265 video encoder +- svthevcenc: New SVT-HEVC-based H.265 video encoder -- vaapioverlay compositor element using VA-API +- vaapioverlay: New compositor element using VA-API -- rtpmanager support for Google’s Transport-Wide Congestion Control - (twcc) RTP extension +- rtpmanager gained support for Google’s Transport-Wide Congestion + Control (twcc) RTP extension - splitmuxsink and splitmuxsrc gained support for auxiliary video streams @@ -64,18 +69,18 @@ - webrtcbin now contains some initial support for renegotiation involving stream addition and removal -- New RTP source and sink elements to easily set up RTP streaming via - rtp:// URIs +- RTP support was enhanced with new RTP source and sink elements to + easily set up RTP streaming via rtp:// URIs -- New Audio Video Transport Protocol (AVTP) plugin for Time-Sensitive - Applications +- avtp: New Audio Video Transport Protocol (AVTP) plugin for + Time-Sensitive Applications - Support for the Video Services Forum’s Reliable Internet Stream Transport (RIST) TR-06-1 Simple Profile - Universal Windows Platform (UWP) support -- rpicamsrc element for capturing from the Raspberry Pi camera +- rpicamsrc: New element for capturing from the Raspberry Pi camera - RTSP Server TCP interleaved backpressure handling improvements as well as support for Scale/Speed headers @@ -2179,7 +2184,208 @@ 1.18.0 -1.18.0 was released on 7 September 2020. +1.18.0 was released on 8 September 2020. + +1.18.1 + +The first 1.18 bug-fix release (1.18.1) was released on 26 October 2020. + +This release only contains bugfixes and it should be safe to update from +1.18.0. + +Highlighted bugfixes in 1.18.1 + +- important security fixes +- bug fixes and memory leak fixes +- various stability and reliability improvements + +gstreamer + +- aggregator: make peek() has() pop() drop() buffer API threadsafe +- gstvalue: don’t write to const char * +- meson: Disallow DbgHelp for UWP build +- info: Fix build on Windows ARM64 device +- build: use cpu_family for arch checks +- basetransform: Fix in/outbuf confusion of _default_transform_meta +- Fix documentation +- info: Load DbgHelp.dll using g_module_open() +- padtemplate: mark documentation caps as may be leaked +- gstmeta: intern registered impl string +- aggregator: Hold SRC_LOCK while unblocking via SRC_BROADCAST() +- ptp_helper_post_install.sh: deal with none +- skip elements/leak.c if tracer is not available +- aggregator: Wake up source pad in PAUSED<->PLAYING transitions +- input-selector: Wake up blocking pads when releasing them +- ptp: Also handle gnu/kfreebsd + +gst-plugins-base + +- theoradec: Set telemetry options only if they are nonzero +- glslstage: delete shader on finalize of stage +- urisourcebin: Fix crash caused by use after free +- decodebin3: Store stream-start event on output pad before exposing + it +- Add some missing nullable annotations +- typefind/xdgmime: Validate mimetypes to be valid GstStructure names + before using them +- uridecodebin3: Forward upstream events to decodebin3 directly +- video-converter: Add fast paths from v210 to I420/YV12, Y42B, UYVY + and YUY2 +- videoaggregator: Limit accepted caps by template caps +- gstrtpbuffer: fix header extension length validation +- decodebin3: only force streams-selected seqnum after a + select-streams +- videodecoder: don’t copy interlace-mode from reference state +- enable abi checks +- multihandlesink: Don’t pass NULL caps to gst_caps_is_equal +- audio: video: Fix in/outbuf confusion of transform_meta +- meson: Always wrap “prefix” option with join_paths() to make Windows + happy +- videoaggregator: ensure peek_next_sample() uses the correct caps +- meson: Actually build gstgl without implicit include dirs +- videoaggregator: Don’t require any pads to be configured for + negotiating source pad caps +- gst-libs: gl: Fix documentation typo and clarify + gl_memory_texsubimage +- audioaggregator: Reset offset if the output rate is renegotiated +- video-anc: Implement transform functions for AFD/Bar metas +- appsrc: Wake up the create() function on caps changes +- rtpbasepayload: do not forget delayed segment when forwarding gaps + +gst-plugins-good + +- v4l2object: Only offer inactive pools and if needed +- vpx: Fix the check to unfixed/unknown framerate to set bitrate +- qmlglsink: fix crash when created/destroyed in quick succession +- rtputils: Count metas with an empty tag list for copying/keeping +- rtpbin: Remove the rtpjitterbuffer with the stream +- rtph26*depay: drop FU’s without a corresponding start bit +- imagefreeze: Response caps query from srcpad +- rtpmp4gdepay: Allow lower-case “aac-hbr” instead of correct + “AAC-hbr” +- rtspsrc: Fix push-backchannel-buffer parameter mismatch +- jpegdec: check buffer size before dereferencing +- flvmux: Move stream skipping to GstAggregatorPadClass.skip_buffer +- v4l2object: plug memory leak +- splitmuxsink: fix sink pad release while PLAYING + +gst-plugins-bad + +- codecparsers: h264parser: guard against ref_pic_markings overflow +- v4l2codecs: Various fixes +- h265parse: Don’t enable passthrough by default +- srt: Fix “Fix timestamping” +- srt: Fixes for 1.4.2 +- dtlsconnection: Ignore OpenSSL system call errors +- h265parse: set interlace-mode=interleaved on interlaced content +- Replace GPL v2 with LGPL v2 in COPYING file +- srt: Consume the error from gst_srt_object_write +- srt: Check socket state before retrieving payload size +- x265enc: fix deadlock on reconfig +- webrtc: Require gstreamer-sdp in the pkg-config file +- srtsrc: Fix timestamping +- mfvideosrc: Use only the first video stream per device +- srtobject: typecast SRTO_LINGER to linger +- decklink: Correctly order the different dependent mode tables +- wasapisrc: Make sure that wasapisrc produces data in loopback mode +- wpesrc: fix some caps leaks using the non-GL output +- smoothstreaming: clear live adapter on seek +- vtdec/vulkan: use Shared storage mode for IOSurface textures +- wpe: Move webview load waiting to WPEView +- wpe: Use proper callback for TLS errors signal handling +- kmssink: Do not source using padded width/height +- avtp: avtpaafdepay: fix crash when building caps +- opencv: set opencv_dep when option is disabled to fix the build +- line21encoder: miscellaneous enhancements +- Hls youtube issues with urisourcebin/queue2 +- rtmp2: Replace stats queue with stats lock +- rtmp2sink: support EOS event for graceful connection shutdown +- mpegtsmux: Make handling of sinkpads thread-safe +- hlssink2: Actually release splitmuxsink’s pads +- mpegtsmux: Don’t create streams with reserved PID + +gst-plugins-ugly + +- no changes + +gst-libav + +- avaudenc/avvidenc: Reopen encoding session if it’s required +- avauddec/audenc/videnc: Don’t return GST_FLOW_EOS when draining +- avauddec/avviddec: Avoid dropping non-OK flow return +- avcodecmap: Enable 24 bit WMA Lossless decoding + +gst-rtsp-server + +- rtsp-stream: collect rtp info when blocking +- rtsp-media: set a 0 storage size for TCP receivers +- rtsp-stream: preroll on gap events +- rtsp-media: do not unblock on unsuspend + +gstreamer-vaapi + +- decoder: don’t reply src caps query with allowed if pad is fixed +- plugins: decode: fix a DMA caps typo in ensure_allowed_srcpad_caps + +gstreamer-sharp + +- Add bindings for some missing 1.18 API + +gst-omx + +- omxvideodec: support interlace-mode=interleaved input + +gst-python + +- no changes + +gst-editing-services + +- ges: Do not recreate auto-transitions when changing clip assets +- ges: Fix a copy/paste mistake in meson file + +gst-integration-testsuites + +- medias: Update for h265parse passthrough behavior change +- update validate.test.h265parse.alternate test + +gst-build + +- windows: Detect Strawberry Perl and error out early +- {pygobject,pycairo}.wrap: point to stable refs + +Cerbero build tool and packaging changes in 1.18.1 + +- Add macOS Big Sur support +- gst-plugins-bad: Ship rtpmanagerbad plugin +- gstreamer-1.0: Don’t enable DbgHelp for UWP build +- pango: fix font corruption on windows +- cairo: use thread local storage to grant one windows HDC per thread +- small fixes for Xcode 12 +- cerbero: Re-add alsa-devel to bootstrap on Linux +- FreeType: update to 2.10.4 to fix security vulnerability + +Contributors to 1.18.1 + +Aaron Boxer, Adam Williamson, Andrew Wesie, Arun Raghavan, Bastien +Reboulet, Brent Gardner, Edward Hervey, François Laignel, Guillaume +Desmottes, Havard Graff, He Junyan, Hosang Lee, Jacek Tomaszewski, Jakub +Adam, Jan Alexander Steffens (heftig), Jan Schmidt, Jérôme Laheurte, +Jordan Petridis, Marc Leeman, Marian Cichy, Marijn Suijten, Mathieu +Duponchelle, Matthew Waters, Michael Tretter, Nazar Mokrynskyi, Nicolas +Dufresne, Niklas Hambüchen, Nirbheek Chauhan, Olivier Crête, Philippe +Normand, raghavendra, Ricky Tang, Sebastian Dröge, Seungha Yang, +sohwan.park, Stéphane Cerveau, Thibault Saunier, Tim-Philipp Müller, Tom +Schoonjans, Víctor Manuel Jáquez Leal, Will Miller, Xavier Claessens, Xℹ +Ruoyao, Zebediah Figura, + +… 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.1 + +- List of Merge Requests applied in 1.18.1 +- List of Issues fixed in 1.18.1 Schedule for 1.20 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/RELEASE new/gst-libav-1.18.1/RELEASE --- old/gst-libav-1.18.0/RELEASE 2020-09-08 01:08:13.142985000 +0200 +++ new/gst-libav-1.18.1/RELEASE 2020-10-26 12:15:11.964274000 +0100 @@ -1,4 +1,4 @@ -This is GStreamer gst-libav 1.18.0. +This is GStreamer gst-libav 1.18.1. The GStreamer team is thrilled to announce a new major feature release of your favourite cross-platform multimedia framework! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/docs/gst_plugins_cache.json new/gst-libav-1.18.1/docs/gst_plugins_cache.json --- old/gst-libav-1.18.0/docs/gst_plugins_cache.json 2020-09-08 01:08:13.166985000 +0200 +++ new/gst-libav-1.18.1/docs/gst_plugins_cache.json 2020-10-26 12:15:11.992273800 +0100 @@ -22978,7 +22978,7 @@ "long-name": "libav Windows Media Audio Lossless decoder", "pad-templates": { "sink": { - "caps": "audio/x-wma:\n wmaversion: 4\n depth: 16\n", + "caps": "audio/x-wma:\n wmaversion: 4\n", "direction": "sink", "presence": "always" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavauddec.c new/gst-libav-1.18.1/ext/libav/gstavauddec.c --- old/gst-libav-1.18.0/ext/libav/gstavauddec.c 2020-09-08 01:08:13.166985000 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavauddec.c 2020-10-26 12:15:11.992273800 +0100 @@ -57,7 +57,7 @@ static gboolean gst_ffmpegauddec_negotiate (GstFFMpegAudDec * ffmpegdec, AVCodecContext * context, AVFrame * frame, gboolean force); -static void gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec); +static GstFlowReturn gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec); #define GST_FFDEC_PARAMS_QDATA g_quark_from_static_string("avdec-params") @@ -594,9 +594,10 @@ } } -static void +static GstFlowReturn gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec) { + GstFlowReturn ret = GST_FLOW_OK; gboolean got_any_frames = FALSE; gboolean got_frame; @@ -604,21 +605,34 @@ goto send_packet_failed; do { - GstFlowReturn ret; - got_frame = gst_ffmpegauddec_frame (ffmpegdec, &ret); if (got_frame) got_any_frames = TRUE; } while (got_frame); avcodec_flush_buffers (ffmpegdec->context); - if (got_any_frames) - gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec), NULL, 1); + /* FFMpeg will return AVERROR_EOF if it's internal was fully drained + * then we are translating it to GST_FLOW_EOS. However, because this behavior + * is fully internal stuff of this implementation and gstaudiodecoder + * baseclass doesn't convert this GST_FLOW_EOS to GST_FLOW_OK, + * convert this flow returned here */ + if (ret == GST_FLOW_EOS) + ret = GST_FLOW_OK; + + if (got_any_frames) { + GstFlowReturn new_ret = + gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec), NULL, 1); + + if (ret == GST_FLOW_OK) + ret = new_ret; + } - return; +done: + return ret; send_packet_failed: GST_WARNING_OBJECT (ffmpegdec, "send packet failed, could not drain decoder"); + goto done; } static void @@ -651,8 +665,7 @@ goto not_negotiated; if (inbuf == NULL) { - gst_ffmpegauddec_drain (ffmpegdec); - return GST_FLOW_OK; + return gst_ffmpegauddec_drain (ffmpegdec); } inbuf = gst_buffer_ref (inbuf); @@ -723,8 +736,18 @@ } while (got_frame); if (is_header || got_any_frames) { - ret = + /* Even if previous return wasn't GST_FLOW_OK, we need to call + * _finish_frame() since baseclass is expecting that _finish_frame() + * is followed by _finish_subframe() + */ + GstFlowReturn new_ret = gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec), NULL, 1); + + /* Only override the flow return value if previously did have a GST_FLOW_OK. + * Failure to do this would result in skipping downstream issues caught in + * earlier steps. */ + if (ret == GST_FLOW_OK) + ret = new_ret; } unmap: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavaudenc.c new/gst-libav-1.18.1/ext/libav/gstavaudenc.c --- old/gst-libav-1.18.0/ext/libav/gstavaudenc.c 2020-09-08 01:08:13.166985000 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavaudenc.c 2020-10-26 12:15:11.992273800 +0100 @@ -190,6 +190,9 @@ GstFFMpegAudEncClass *oclass = (GstFFMpegAudEncClass *) G_OBJECT_GET_CLASS (ffmpegaudenc); + ffmpegaudenc->opened = FALSE; + ffmpegaudenc->need_reopen = FALSE; + gst_ffmpeg_avcodec_close (ffmpegaudenc->context); if (avcodec_get_context_defaults3 (ffmpegaudenc->context, oclass->in_plugin) < 0) { @@ -208,6 +211,7 @@ /* close old session */ gst_ffmpeg_avcodec_close (ffmpegaudenc->context); ffmpegaudenc->opened = FALSE; + ffmpegaudenc->need_reopen = FALSE; return TRUE; } @@ -233,6 +237,8 @@ GstFFMpegAudEncClass *oclass = (GstFFMpegAudEncClass *) G_OBJECT_GET_CLASS (ffmpegaudenc); + ffmpegaudenc->need_reopen = FALSE; + /* close old session */ if (ffmpegaudenc->opened) { gst_ffmpeg_avcodec_close (ffmpegaudenc->context); @@ -368,6 +374,7 @@ /* success! */ ffmpegaudenc->opened = TRUE; + ffmpegaudenc->need_reopen = FALSE; return TRUE; } @@ -530,9 +537,21 @@ av_frame_unref (frame); } else { + GstFFMpegAudEncClass *oclass = + (GstFFMpegAudEncClass *) G_OBJECT_GET_CLASS (ffmpegaudenc); + GST_LOG_OBJECT (ffmpegaudenc, "draining"); /* flushing the encoder */ res = avcodec_send_frame (ctx, NULL); + + /* If AV_CODEC_CAP_ENCODER_FLUSH wasn't set, we need to re-open + * encoder */ + if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_ENCODER_FLUSH)) { + GST_DEBUG_OBJECT (ffmpegaudenc, "Encoder needs reopen later"); + + /* we will reopen later handle_frame() */ + ffmpegaudenc->need_reopen = TRUE; + } } if (res == 0) { @@ -604,8 +623,17 @@ } while (got_packet); } + /* NOTE: this may or may not work depending on capability */ avcodec_flush_buffers (ffmpegaudenc->context); + /* FFMpeg will return AVERROR_EOF if it's internal was fully drained + * then we are translating it to GST_FLOW_EOS. However, because this behavior + * is fully internal stuff of this implementation and gstaudioencoder + * baseclass doesn't convert this GST_FLOW_EOS to GST_FLOW_OK, + * convert this flow returned here */ + if (ret == GST_FLOW_EOS) + ret = GST_FLOW_OK; + return ret; } @@ -624,6 +652,18 @@ if (!inbuf) return gst_ffmpegaudenc_drain (ffmpegaudenc); + /* endoder was drained or flushed, and ffmpeg encoder doesn't support + * flushing. We need to re-open encoder then */ + if (ffmpegaudenc->need_reopen) { + GST_DEBUG_OBJECT (ffmpegaudenc, "Open encoder again"); + + if (!gst_ffmpegaudenc_set_format (encoder, + gst_audio_encoder_get_audio_info (encoder))) { + GST_ERROR_OBJECT (ffmpegaudenc, "Couldn't re-open encoder"); + return GST_FLOW_NOT_NEGOTIATED; + } + } + inbuf = gst_buffer_ref (inbuf); GST_DEBUG_OBJECT (ffmpegaudenc, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavaudenc.h new/gst-libav-1.18.1/ext/libav/gstavaudenc.h --- old/gst-libav-1.18.0/ext/libav/gstavaudenc.h 2020-09-08 01:08:13.166985000 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavaudenc.h 2020-10-26 12:15:11.992273800 +0100 @@ -39,6 +39,7 @@ AVCodecContext *context; AVCodecContext *refcontext; gboolean opened; + gboolean need_reopen; AVFrame *frame; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavcodecmap.c new/gst-libav-1.18.1/ext/libav/gstavcodecmap.c --- old/gst-libav-1.18.0/ext/libav/gstavcodecmap.c 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavcodecmap.c 2020-10-26 12:15:11.992273800 +0100 @@ -1220,10 +1220,9 @@ } case AV_CODEC_ID_WMALOSSLESS: { - /* libav only supports a depth of 16 at the moment */ caps = gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-wma", - "wmaversion", G_TYPE_INT, 4, "depth", G_TYPE_INT, 16, NULL); + "wmaversion", G_TYPE_INT, 4, NULL); break; } case AV_CODEC_ID_WMAVOICE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavutils.h new/gst-libav-1.18.1/ext/libav/gstavutils.h --- old/gst-libav-1.18.0/ext/libav/gstavutils.h 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavutils.h 2020-10-26 12:15:11.992273800 +0100 @@ -29,6 +29,26 @@ #include <gst/gst.h> +/* Introduced since ffmpeg version 4.3 + * + * Note: Not all ffmpeg encoders seem to be reusable after flushing/draining. + * So if ffmpeg encoder doesn't support it, we should reopen encoding session. + * + * Before ffmpeg 4.3, avcodec_flush_buffers() was implemented in + * libavcodec/decodec.c but it was moved to libavcodec/utils.c and it would be + * accepted if encoder supports AV_CODEC_CAP_ENCODER_FLUSH flag. + * That implies that avcodec_flush_buffers() wasn't intended to be working + * properly for encoders. + */ +#ifndef AV_CODEC_CAP_ENCODER_FLUSH +/* + * This encoder can be flushed using avcodec_flush_buffers(). If this flag is + * not set, the encoder must be closed and reopened to ensure that no frames + * remain pending. + */ +#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) +#endif + /* *Get the size of an picture */ @@ -79,7 +99,7 @@ return out; } -void +void gst_ffmpeg_init_pix_fmt_info(void); int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavviddec.c new/gst-libav-1.18.1/ext/libav/gstavviddec.c --- old/gst-libav-1.18.0/ext/libav/gstavviddec.c 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavviddec.c 2020-10-26 12:15:11.992273800 +0100 @@ -1810,7 +1810,7 @@ gst_ffmpegviddec_drain (GstVideoDecoder * decoder) { GstFFMpegVidDec *ffmpegdec = (GstFFMpegVidDec *) decoder; - GstFlowReturn ret; + GstFlowReturn ret = GST_FLOW_OK; gboolean got_frame = FALSE; if (!ffmpegdec->opened) @@ -1824,8 +1824,16 @@ } while (got_frame && ret == GST_FLOW_OK); avcodec_flush_buffers (ffmpegdec->context); + /* FFMpeg will return AVERROR_EOF if it's internal was fully drained + * then we are translating it to GST_FLOW_EOS. However, because this behavior + * is fully internal stuff of this implementation and gstvideodecoder + * baseclass doesn't convert this GST_FLOW_EOS to GST_FLOW_OK, + * convert this flow returned here */ + if (ret == GST_FLOW_EOS) + ret = GST_FLOW_OK; + done: - return GST_FLOW_OK; + return ret; send_packet_failed: GST_WARNING_OBJECT (ffmpegdec, "send packet failed, could not drain decoder"); @@ -2003,12 +2011,15 @@ static GstFlowReturn gst_ffmpegviddec_finish (GstVideoDecoder * decoder) { - gst_ffmpegviddec_drain (decoder); + GstFlowReturn flow_ret; + + flow_ret = gst_ffmpegviddec_drain (decoder); + /* note that finish can and should clean up more drastically, * but drain is also invoked on e.g. packet loss in GAP handling */ gst_ffmpegviddec_flush (decoder); - return GST_FLOW_OK; + return flow_ret; } static gboolean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavvidenc.c new/gst-libav-1.18.1/ext/libav/gstavvidenc.c --- old/gst-libav-1.18.0/ext/libav/gstavvidenc.c 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavvidenc.c 2020-10-26 12:15:11.996274000 +0100 @@ -243,6 +243,8 @@ GstFFMpegVidEncClass *oclass = (GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc); + ffmpegenc->need_reopen = FALSE; + /* close old session */ if (ffmpegenc->opened) { gst_ffmpeg_avcodec_close (ffmpegenc->context); @@ -622,6 +624,20 @@ ffmpegenc->context->ticks_per_frame, ffmpegenc->context->time_base); send_frame: + if (!picture) { + GstFFMpegVidEncClass *oclass = + (GstFFMpegVidEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc)); + + /* If AV_CODEC_CAP_ENCODER_FLUSH wasn't set, we need to re-open + * encoder */ + if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_ENCODER_FLUSH)) { + GST_DEBUG_OBJECT (ffmpegenc, "Encoder needs reopen later"); + + /* we will reopen later handle_frame() */ + ffmpegenc->need_reopen = TRUE; + } + } + res = avcodec_send_frame (ffmpegenc->context, picture); if (picture) @@ -710,6 +726,30 @@ GstFlowReturn ret; gboolean got_packet; + /* endoder was drained or flushed, and ffmpeg encoder doesn't support + * flushing. We need to re-open encoder then */ + if (ffmpegenc->need_reopen) { + gboolean reopen_ret; + GstVideoCodecState *input_state; + + GST_DEBUG_OBJECT (ffmpegenc, "Open encoder again"); + + if (!ffmpegenc->input_state) { + GST_ERROR_OBJECT (ffmpegenc, + "Cannot re-open encoder without input state"); + return GST_FLOW_NOT_NEGOTIATED; + } + + input_state = gst_video_codec_state_ref (ffmpegenc->input_state); + reopen_ret = gst_ffmpegvidenc_set_format (encoder, input_state); + gst_video_codec_state_unref (input_state); + + if (!reopen_ret) { + GST_ERROR_OBJECT (ffmpegenc, "Couldn't re-open encoder"); + return GST_FLOW_NOT_NEGOTIATED; + } + } + ret = gst_ffmpegvidenc_send_frame (ffmpegenc, frame); if (ret != GST_FLOW_OK) @@ -763,8 +803,17 @@ if (ret != GST_FLOW_OK) break; } while (got_packet); + avcodec_flush_buffers (ffmpegenc->context); done: + /* FFMpeg will return AVERROR_EOF if it's internal was fully drained + * then we are translating it to GST_FLOW_EOS. However, because this behavior + * is fully internal stuff of this implementation and gstvideoencoder + * baseclass doesn't convert this GST_FLOW_EOS to GST_FLOW_OK, + * convert this flow returned here */ + if (ret == GST_FLOW_EOS) + ret = GST_FLOW_OK; + return ret; } @@ -843,6 +892,9 @@ GstFFMpegVidEncClass *oclass = (GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc); + ffmpegenc->opened = FALSE; + ffmpegenc->need_reopen = FALSE; + /* close old session */ gst_ffmpeg_avcodec_close (ffmpegenc->context); if (avcodec_get_context_defaults3 (ffmpegenc->context, oclass->in_plugin) < 0) { @@ -863,6 +915,7 @@ gst_ffmpegvidenc_flush_buffers (ffmpegenc, FALSE); gst_ffmpeg_avcodec_close (ffmpegenc->context); ffmpegenc->opened = FALSE; + ffmpegenc->need_reopen = FALSE; if (ffmpegenc->input_state) { gst_video_codec_state_unref (ffmpegenc->input_state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/ext/libav/gstavvidenc.h new/gst-libav-1.18.1/ext/libav/gstavvidenc.h --- old/gst-libav-1.18.0/ext/libav/gstavvidenc.h 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/ext/libav/gstavvidenc.h 2020-10-26 12:15:11.996274000 +0100 @@ -41,6 +41,7 @@ AVCodecContext *context; AVFrame *picture; gboolean opened; + gboolean need_reopen; gboolean discont; guint pass; gfloat quantizer; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/gst-libav.doap new/gst-libav-1.18.1/gst-libav.doap --- old/gst-libav-1.18.0/gst-libav.doap 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/gst-libav.doap 2020-10-26 12:15:11.996274000 +0100 @@ -34,6 +34,16 @@ <release> <Version> + <revision>1.18.1</revision> + <branch>1.18</branch> + <name></name> + <created>2020-10-26</created> + <file-release rdf:resource="https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.18.1.tar.xz" /> + </Version> + </release> + + <release> + <Version> <revision>1.18.0</revision> <branch>master</branch> <name></name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gst-libav-1.18.0/meson.build new/gst-libav-1.18.1/meson.build --- old/gst-libav-1.18.0/meson.build 2020-09-08 01:08:13.170985200 +0200 +++ new/gst-libav-1.18.1/meson.build 2020-10-26 12:15:11.996274000 +0100 @@ -1,5 +1,5 @@ project('gst-libav', 'c', 'cpp', - version : '1.18.0', + version : '1.18.1', meson_version : '>= 0.48.0', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ])