#ifndef AVCODEC_VDA_H
#define AVCODEC_VDA_H
+#include <pthread.h>
#include <stdint.h>
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
#undef __GNUC_STDC_INLINE__
#define Picture QuickdrawPicture
-
-#include <pthread.h>
-#include "avcodec.h"
#include <VideoDecodeAcceleration/VDADecoder.h>
+#undef Picture
/**
* This structure is used to store a decoded frame information and data.
*/
-typedef struct
-{
+typedef struct {
/**
* The PTS of the frame.
*
* - decoding: Set/Unset by libavcodec.
*/
struct vda_frame *next_frame;
-
} vda_frame;
/**
* The application must make it available as AVCodecContext.hwaccel_context.
*/
struct vda_context {
-
/**
* VDA decoder object.
*
* - encoding: unused
* - decoding: Set/Unset by libavcodec.
*/
- void *queue_mutex;
+ pthread_mutex_t queue_mutex;
/**
* The frame width.
* - decoding: Set/Unset by user.
*/
int format;
+
+ /**
+ * The pixel format for output image buffers.
+ *
+ * - encoding: unused
+ * - decoding: Set/Unset by user.
+ */
+ OSType cv_pix_fmt_type;
+
+ /**
+ * The current bitstream buffer.
+ *
+ * - encoding: unused
+ * - decoding: Set/Unset by libavcodec.
+ */
+ uint8_t *bitstream;
+
+ /**
+ * The current size of the bitstream.
+ *
+ * - encoding: unused
+ * - decoding: Set/Unset by libavcodec.
+ */
+ int bitstream_size;
+
+ /**
+ * The reference size used for fast reallocation.
+ *
+ * - encoding: unused
+ * - decoding: Set/Unset by libavcodec.
+ */
+ int ref_size;
};
-/** Creates the video decoder. */
+/** Create the video decoder. */
int ff_vda_create_decoder(struct vda_context *vda_ctx,
uint8_t *extradata,
int extradata_size);
-/** Destroys the video decoder. */
+/** Destroy the video decoder. */
int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
-/** Returns the top frame of the queue. */
+/** Return the top frame of the queue. */
vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
-/** Releases the given frame. */
+/** Release the given frame. */
void ff_vda_release_vda_frame(vda_frame *frame);
#endif /* AVCODEC_VDA_H */