extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts;
extern struct SwsContext *sws_opts;
-extern AVDictionary *format_opts, *codec_opts;
+extern AVDictionary *format_opts, *codec_opts, *resample_opts;
+
+/**
+ * Register a program-specific cleanup routine.
+ */
+void register_exit(void (*cb)(int ret));
+
+/**
+ * Wraps exit with a program-specific cleanup routine.
+ */
+void exit_program(int ret);
/**
* Initialize the cmdutils option system, in particular
an int containing element count in the array. */
#define OPT_TIME 0x10000
#define OPT_DOUBLE 0x20000
+#define OPT_INPUT 0x40000
+#define OPT_OUTPUT 0x80000
union {
void *dst_ptr;
int (*func_arg)(void *, const char *, const char *);
* are terminated by a non-option argument (e.g. avconv output files)
*/
const char *sep;
+ /**
+ * Option flags that must be set on each option that is
+ * applied to this group
+ */
+ int flags;
} OptionGroupDef;
typedef struct OptionGroup {
AVDictionary *codec_opts;
AVDictionary *format_opts;
+ AVDictionary *resample_opts;
struct SwsContext *sws_opts;
} OptionGroup;
*/
void *grow_array(void *array, int elem_size, int *size, int new_size);
-#define GROW_ARRAY(array, nb_elems)\
- array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
-
-typedef struct FrameBuffer {
- uint8_t *base[4];
- uint8_t *data[4];
- int linesize[4];
-
- int h, w;
- enum AVPixelFormat pix_fmt;
-
- int refcount;
- struct FrameBuffer **pool; ///< head of the buffer pool
- struct FrameBuffer *next;
-} FrameBuffer;
-
/**
- * Get a frame from the pool. This is intended to be used as a callback for
- * AVCodecContext.get_buffer.
- *
- * @param s codec context. s->opaque must be a pointer to the head of the
- * buffer pool.
- * @param frame frame->opaque will be set to point to the FrameBuffer
- * containing the frame data.
+ * Get a string describing a media type.
*/
-int codec_get_buffer(AVCodecContext *s, AVFrame *frame);
+const char *media_type_string(enum AVMediaType media_type);
-/**
- * A callback to be used for AVCodecContext.release_buffer along with
- * codec_get_buffer().
- */
-void codec_release_buffer(AVCodecContext *s, AVFrame *frame);
-
-/**
- * A callback to be used for AVFilterBuffer.free.
- * @param fb buffer to free. fb->priv must be a pointer to the FrameBuffer
- * containing the buffer data.
- */
-void filter_release_buffer(AVFilterBuffer *fb);
-
-/**
- * Free all the buffers in the pool. This must be called after all the
- * buffers have been released.
- */
-void free_buffer_pool(FrameBuffer **pool);
+#define GROW_ARRAY(array, nb_elems)\
+ array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
#define GET_PIX_FMT_NAME(pix_fmt)\
const char *name = av_get_pix_fmt_name(pix_fmt);