/* needed for mkstemp() */
#define _XOPEN_SOURCE 600
+#include "libavutil/avstring.h"
#include "libavutil/integer.h"
#include "libavutil/crc.h"
#include "avcodec.h"
return 0;
}
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count){
+int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
int i;
for(i=0; i<count; i++){
- int r= func(c, arg[i]);
+ int r= func(c, (char*)arg + i*size);
if(ret) ret[i]= r;
}
return 0;
{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, 1.0, 0.0, 1.0, A|D},
{"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BIT_RESERVOIR, INT_MIN, INT_MAX, A|E, "flags2"},
{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
+{"channel_layout", NULL, OFFSET(channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|E|D, "channel_layout"},
+{"request_channel_layout", NULL, OFFSET(request_channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|D, "request_channel_layout"},
+{"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), FF_OPT_TYPE_FLOAT, 1.0/3, 0.0, FLT_MAX, V|E},
+{"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), FF_OPT_TYPE_FLOAT, 3, 0.0, FLT_MAX, V|E},
{NULL},
};
const char *codec_name;
AVCodec *p;
char buf1[32];
- char channels_str[100];
int bitrate;
AVRational display_aspect_ratio;
snprintf(buf, buf_size,
"Audio: %s",
codec_name);
- switch (enc->channels) {
- case 1:
- strcpy(channels_str, "mono");
- break;
- case 2:
- strcpy(channels_str, "stereo");
- break;
- case 6:
- strcpy(channels_str, "5:1");
- break;
- default:
- snprintf(channels_str, sizeof(channels_str), "%d channels", enc->channels);
- break;
- }
if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %d Hz, %s",
- enc->sample_rate,
- channels_str);
+ ", %d Hz", enc->sample_rate);
}
+ av_strlcat(buf, ", ", buf_size);
+ avcodec_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
if (enc->sample_fmt != SAMPLE_FMT_NONE) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s", avcodec_get_sample_fmt_name(enc->sample_fmt));
int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str)
{
int i;
- int n = sizeof(video_frame_size_abbrs) / sizeof(VideoFrameSizeAbbr);
+ int n = FF_ARRAY_ELEMS(video_frame_size_abbrs);
const char *p;
int frame_width = 0, frame_height = 0;
int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg)
{
int i;
- int n = sizeof(video_frame_rate_abbrs) / sizeof(VideoFrameRateAbbr);
+ int n = FF_ARRAY_ELEMS(video_frame_rate_abbrs);
char* cp;
/* First, we check our abbreviation table */