]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v4l2_buffers.h
lavc: implement an ATRAC9 decoder
[ffmpeg] / libavcodec / v4l2_buffers.h
index e28a4a650d7630f2e5495cf2273b1ed2fe93b857..dc5cc9e26717b7a9908f3a92df6192baf3124e02 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef AVCODEC_V4L2_BUFFERS_H
 #define AVCODEC_V4L2_BUFFERS_H
 
+#include <stdatomic.h>
 #include <linux/videodev2.h>
 
 #include "avcodec.h"
@@ -41,6 +42,11 @@ typedef struct V4L2Buffer {
     /* each buffer needs to have a reference to its context */
     struct V4L2Context *context;
 
+    /* This object is refcounted per-plane, so we need to keep track
+     * of how many context-refs we are holding. */
+    AVBufferRef *context_ref;
+    atomic_uint context_refcount;
+
     /* keep track of the mmap address and mmap length */
     struct V4L2Plane_info {
         int bytesperline;