]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/internal.h
Merge commit 'e57c4706e969afa1f2384481b955ccd9494cddb5'
[ffmpeg] / libavcodec / internal.h
index 9a8b4bc336e2ab15567fccd644f34335539b6b9c..01620fa125e13d70da9f765eeb15df5f5d84bf17 100644 (file)
@@ -30,6 +30,8 @@
 #include "libavutil/pixfmt.h"
 #include "avcodec.h"
 
+#define FF_SANE_NB_CHANNELS 128U
+
 typedef struct InternalBuffer {
     uint8_t *base[AV_NUM_DATA_POINTERS];
     uint8_t *data[AV_NUM_DATA_POINTERS];
@@ -37,9 +39,6 @@ typedef struct InternalBuffer {
     int width;
     int height;
     enum AVPixelFormat pix_fmt;
-    uint8_t **extended_data;
-    int audio_data_size;
-    int nb_channels;
 } InternalBuffer;
 
 typedef struct AVCodecInternal {
@@ -77,6 +76,12 @@ typedef struct AVCodecInternal {
      */
     int last_audio_frame;
 
+    /**
+     * The data for the last allocated audio frame.
+     * Stored here so we can free it.
+     */
+    uint8_t *audio_data;
+
     /**
      * temporary buffer used for encoders to store their bitstream
      */
@@ -96,11 +101,6 @@ struct AVCodecDefault {
     const uint8_t *value;
 };
 
-/**
- * Determine whether pix_fmt is a hardware accelerated format.
- */
-int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt);
-
 /**
  * Return the hardware accelerated codec for codec codec_id and
  * pixel format pix_fmt.
@@ -172,6 +172,13 @@ static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
                         avctx->time_base);
 }
 
+/**
+ * Get a buffer for a frame. This is a wrapper around
+ * AVCodecContext.get_buffer() and should be used instead calling get_buffer()
+ * directly.
+ */
+int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame);
+
 int ff_thread_can_start_frame(AVCodecContext *avctx);
 
 int ff_get_logical_cpus(AVCodecContext *avctx);