summaryrefslogtreecommitdiffstats
path: root/libavcodec/hwaccel.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-24 15:14:22 +0100
committerAnton Khirnov <anton@khirnov.net>2016-12-19 08:10:22 +0100
commitd4a91e65343be5d79a4afa61c791191e1b57499a (patch)
treeb6a191f872f3162949018d145d2d706f106fd8b9 /libavcodec/hwaccel.h
parent8dfba25ce89b62c80ba83e2116d549176c376144 (diff)
downloadffmpeg-streaming-d4a91e65343be5d79a4afa61c791191e1b57499a.zip
ffmpeg-streaming-d4a91e65343be5d79a4afa61c791191e1b57499a.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).
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..60dbe81
--- /dev/null
+++ b/libavcodec/hwaccel.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; 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