summaryrefslogtreecommitdiffstats
path: root/libavcodec/hwaccel.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-24 15:14:22 +0100
committerwm4 <nfxjfg@googlemail.com>2017-03-21 06:17:28 +0100
commite0cd598bc4684654d63942e9ff4872c0b48a7dc2 (patch)
tree4d342847caf85a15ef39d57508bcd458e1da02ff /libavcodec/hwaccel.h
parent14bb15bfd56d6e907fabe4620206c1ee152b7a20 (diff)
downloadffmpeg-streaming-e0cd598bc4684654d63942e9ff4872c0b48a7dc2.zip
ffmpeg-streaming-e0cd598bc4684654d63942e9ff4872c0b48a7dc2.tar.gz
pthread_frame: do not run hwaccel decoding asynchronously unless it's safe
Certain hardware decoding APIs are not guaranteed to be thread-safe, so having the user access decoded hardware surfaces while the decoder is running in another thread can cause failures (this is mainly known to happen with DXVA2). For such hwaccels, only allow the decoding thread to run while the user is inside a lavc decode call (avcodec_send_packet/receive_frame). Merges Libav commit d4a91e65. Signed-off-by: wm4 <nfxjfg@googlemail.com> Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hwaccel.h')
-rw-r--r--libavcodec/hwaccel.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/hwaccel.h b/libavcodec/hwaccel.h
new file mode 100644
index 0000000..17af437
--- /dev/null
+++ b/libavcodec/hwaccel.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of FFmpeg and was stolen from Libav.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_HWACCEL_H
+#define AVCODEC_HWACCEL_H
+
+#define HWACCEL_CAP_ASYNC_SAFE (1 << 0)
+
+#endif /* AVCODEC_HWACCEL_H */
OpenPOWER on IntegriCloud