gstreamer/subprojects/gst-plugins-bad/sys/applemedia
Piotr Brzeziński 1a28d541a4 vtenc: Restart encoding session when certain errors are detected
Sometimes under certain loads, VT can error out with kVTVideoEncoderMalfunctionErr or kVTVideoEncoderNotAvailableNowErr.
These have been reported to happen more often than usual if CopyProperty/SetProperty() is used close to the encode call.
Both can be worked around by restarting the encoding session.

These errors can be returned either directly from VTCompressionSessionEncodeFrame() or later in the encoding callback.
This patch handles both scenarios the same way - a session restart is be attempted on the next encode_frame() call.

If the error is returned immediately by the encode call, it's possible that some correct frames will still be given to
the output callback, but for simplicity (+ because I wasn't able to verify this scenario) let's just discard those.

In addition, this commit also simplifies the beach/drop logic in enqueue_buffer.

Related bug reports in other projects:
http://www.openradar.me/45889262
https://github.com/aws/amazon-chime-sdk-ios/issues/170#issuecomment-741908622

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7449>
2024-09-09 13:40:00 +00:00
..
atdec.c atdec: Handle channel counts greater than 2 2024-04-05 10:14:59 +00:00
atdec.h atdec: Handle channel counts greater than 2 2024-04-05 10:14:59 +00:00
avfassetsrc.h
avfassetsrc.m
avfdeviceprovider.h
avfdeviceprovider.m avfdeviceprovider: Fix debug category initialization 2024-07-18 10:54:45 +01:00
avfvideosrc.h avfdeviceprovider: Fix debug category initialization 2024-07-18 10:54:45 +01:00
avfvideosrc.m avfdeviceprovider: Fix debug category initialization 2024-07-18 10:54:45 +01:00
avsamplevideosink.h
avsamplevideosink.m applemedia: Also fix inconsistent pixel format definition for NV12 2023-08-16 14:15:52 +00:00
coremediabuffer.c applemedia: Fix pixel format for I420 2023-08-16 14:15:52 +00:00
coremediabuffer.h
corevideobuffer.c applemedia: Fix pixel format for I420 2023-08-16 14:15:52 +00:00
corevideobuffer.h
corevideomemory.c
corevideomemory.h
glcontexthelper.c
glcontexthelper.h
helpers.c applemedia: Also fix inconsistent pixel format definition for NV12 2023-08-16 14:15:52 +00:00
helpers.h applemedia: Consolidate GstVideoFormat <-> CVPixelFormat conversion 2023-03-14 23:35:16 +00:00
iosassetsrc.h applemedia: silence some deprecation warnings from ios 12.0 2023-07-27 13:05:37 +00:00
iosassetsrc.m applemedia: silence some deprecation warnings from ios 12.0 2023-07-27 13:05:37 +00:00
iosglmemory.c
iosglmemory.h
iosurfaceglmemory.c
iosurfaceglmemory.h
iosurfacevulkanmemory.c vkimagebufferpool: allow specifying initial image layout 2024-01-13 05:54:00 +00:00
iosurfacevulkanmemory.h
meson.build vtenc: apply DTS offset to ensure DTS <= PTS 2023-06-19 08:37:54 +00:00
metal-helpers.h
plugin.m
videotexturecache-gl.h
videotexturecache-gl.m applemedia: silence some deprecation warnings from ios 12.0 2023-07-27 13:05:37 +00:00
videotexturecache-vulkan.h
videotexturecache-vulkan.mm
videotexturecache.h
videotexturecache.m
vtdec.c vtdec: Use GST_VIDEO_DECODER_ERROR instead of aborting when frame has an ERROR flag 2024-06-17 14:53:08 +01:00
vtdec.h vtdec: Handle output in separate thread 2023-09-27 13:01:33 +00:00
vtenc.c vtenc: Restart encoding session when certain errors are detected 2024-09-09 13:40:00 +00:00
vtenc.h vtenc: Restart encoding session when certain errors are detected 2024-09-09 13:40:00 +00:00
vtutil.c
vtutil.h applemedia: Consolidate GstVideoFormat <-> CVPixelFormat conversion 2023-03-14 23:35:16 +00:00