Merge remote branch 'qatar/master'

* qatar/master:
  APIChanges: document git revision for CODEC_CAP_SLICE_THREADS addition.
  Introduce slice threads flag.
  FATE: allow forcing thread-type when doing threaded fate runs.
  Use av_log_ask_for_sample() where appropriate.
  error: sort, pack, and align error code and string definitions
  The stabilization period after version bumps should be one month, not one week.
  applehttp: Expose the stream bitrate via metadata
  doc: Add some initial docs on the applehttp demuxer
  Provide a fallback version of the libm function trunc
  libavdevice: Define _XOPEN_SOURCE for usleep
  lavc: provide deprecated avcodec_thread_init until next major version
  lavc: provide the opt.h header until the next bump
  error: change AVERROR_EOF value
  error: remove AVERROR_NUMEXPECTED
  error: add error code AVERROR_OPTION_NOT_FOUND, and use it in opt.c

Conflicts:
	libavcodec/h264.c
	libavutil/error.c
	libavutil/error.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/2/head
Michael Niedermayer 14 years ago
commit 8772156be0
  1. 2
      Makefile
  2. 2
      configure
  3. 8
      doc/APIchanges
  4. 11
      doc/demuxers.texi
  5. 2
      ffmpeg.c
  6. 2
      libavcodec/Makefile
  7. 12
      libavcodec/avcodec.h
  8. 12
      libavcodec/cook.c
  9. 1
      libavcodec/dnxhdenc.c
  10. 3
      libavcodec/dv.c
  11. 3
      libavcodec/ffv1.c
  12. 4
      libavcodec/h264.c
  13. 4
      libavcodec/mpeg12.c
  14. 4
      libavcodec/mpeg12enc.c
  15. 2
      libavcodec/mpeg4videoenc.c
  16. 1
      libavcodec/mpegvideo_enc.c
  17. 16
      libavcodec/opt.h
  18. 3
      libavcodec/pthread.c
  19. 4
      libavcodec/truemotion1.c
  20. 5
      libavcodec/tta.c
  21. 8
      libavcodec/utils.c
  22. 2
      libavcodec/v210x.c
  23. 8
      libavcodec/version.h
  24. 1
      libavdevice/bktr.c
  25. 3
      libavformat/applehttp.c
  26. 1
      libavformat/avformat.h
  27. 2
      libavformat/utils.c
  28. 2
      libavformat/version.h
  29. 24
      libavutil/error.c
  30. 20
      libavutil/error.h
  31. 7
      libavutil/libm.h
  32. 6
      libavutil/opt.c
  33. 5
      tests/fate-run.sh

@ -291,7 +291,7 @@ fate: $(FATE)
$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
@echo "TEST $(@:fate-%=%)"
$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)'
$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
fate-list:
@printf '%s\n' $(sort $(FATE))

2
configure vendored

@ -1128,6 +1128,7 @@ HAVE_LIST="
ten_operands
termios_h
threads
trunc
truncf
vfp_args
VirtualAlloc
@ -2887,6 +2888,7 @@ check_mathfunc lrint
check_mathfunc lrintf
check_mathfunc round
check_mathfunc roundf
check_mathfunc trunc
check_mathfunc truncf
# these are off by default, so fail if requested and not available

@ -1,5 +1,6 @@
Never assume the API of libav* to be stable unless at least 1 week has passed since
the last major version increase.
Never assume the API of libav* to be stable unless at least 1 month has passed
since the last major version increase.
The last version increases were:
libavcodec: 2011-04-18
libavdevice: 2011-04-18
@ -12,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
2011-04-15 - lavc 52.120.0 - avcodec.h
AVPacket structure got additional members for passing side information:
4de339e introduce side information for AVPacket

@ -64,4 +64,15 @@ Note that the pattern must not necessarily contain "%d" or
ffmpeg -f image2 -i img.jpeg img.png
@end example
@section applehttp
Apple HTTP Live Streaming demuxer.
This demuxer presents all AVStreams from all variant streams.
The id field is set to the bitrate variant index number. By setting
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
the caller can decide which variant streams to actually receive.
The total bitrate of the variant that the stream belongs to is
available in a metadata key named "variant_bitrate".
@c man end INPUT DEVICES

@ -3852,7 +3852,7 @@ static void opt_output_file(const char *filename)
/* check filename in case of an image number is expected */
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(oc->filename)) {
print_error(oc->filename, AVERROR_NUMEXPECTED);
print_error(oc->filename, AVERROR(EINVAL));
ffmpeg_exit(1);
}
}

@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak
NAME = avcodec
FFLIBS = avutil
HEADERS = avcodec.h avfft.h dxva2.h vaapi.h vdpau.h version.h xvmc.h
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h version.h xvmc.h
OBJS = allcodecs.o \
audioconvert.o \

@ -680,6 +680,10 @@ typedef struct RcOverride{
* Codec supports frame-level multithreading.
*/
#define CODEC_CAP_FRAME_THREADS 0x1000
/**
* Codec supports slice-based (or partition-based) multithreading.
*/
#define CODEC_CAP_SLICE_THREADS 0x2000
//The following defines may change, don't expect compatibility if you use them.
#define MB_TYPE_INTRA4x4 0x0001
@ -3633,6 +3637,14 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
#if FF_API_THREAD_INIT
/**
* @deprecated Set s->thread_count before calling avcodec_open() instead of calling this.
*/
attribute_deprecated
int avcodec_thread_init(AVCodecContext *s, int thread_count);
#endif
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
//FIXME func typedef

@ -1136,7 +1136,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
switch (q->subpacket[s].cookversion) {
case MONO:
if (q->nb_channels != 1) {
av_log(avctx,AV_LOG_ERROR,"Container channels != 1, report sample!\n");
av_log_ask_for_sample(avctx, "Container channels != 1.!\n");
return -1;
}
av_log(avctx,AV_LOG_DEBUG,"MONO\n");
@ -1150,7 +1150,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
break;
case JOINT_STEREO:
if (q->nb_channels != 2) {
av_log(avctx,AV_LOG_ERROR,"Container channels != 2, report sample!\n");
av_log_ask_for_sample(avctx, "Container channels != 2.\n");
return -1;
}
av_log(avctx,AV_LOG_DEBUG,"JOINT_STEREO\n");
@ -1188,7 +1188,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
break;
default:
av_log(avctx,AV_LOG_ERROR,"Unknown Cook version, report sample!\n");
av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
return -1;
break;
}
@ -1205,7 +1205,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if (q->subpacket[s].total_subbands > 53) {
av_log(avctx,AV_LOG_ERROR,"total_subbands > 53, report sample!\n");
av_log_ask_for_sample(avctx, "total_subbands > 53\n");
return -1;
}
@ -1215,7 +1215,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
}
if (q->subpacket[s].subbands > 50) {
av_log(avctx,AV_LOG_ERROR,"subbands > 50, report sample!\n");
av_log_ask_for_sample(avctx, "subbands > 50\n");
return -1;
}
q->subpacket[s].gains1.now = q->subpacket[s].gain_1;
@ -1226,7 +1226,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q->num_subpackets++;
s++;
if (s > MAX_SUBPACKETS) {
av_log(avctx,AV_LOG_ERROR,"Too many subpackets > 5, report file!\n");
av_log_ask_for_sample(avctx, "Too many subpackets > 5\n");
return -1;
}
}

@ -869,6 +869,7 @@ AVCodec ff_dnxhd_encoder = {
dnxhd_encode_init,
dnxhd_encode_picture,
dnxhd_encode_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
.priv_class = &class,

@ -1297,6 +1297,7 @@ AVCodec ff_dvvideo_encoder = {
sizeof(DVVideoContext),
dvvideo_init_encoder,
dvvideo_encode_frame,
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
};
@ -1312,7 +1313,7 @@ AVCodec ff_dvvideo_decoder = {
NULL,
dvvideo_close,
dvvideo_decode_frame,
CODEC_CAP_DR1,
CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
NULL,
.max_lowres = 3,
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),

@ -1795,7 +1795,7 @@ AVCodec ff_ffv1_decoder = {
NULL,
common_end,
decode_frame,
CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/ | CODEC_CAP_SLICE_THREADS,
NULL,
.long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
};
@ -1809,6 +1809,7 @@ AVCodec ff_ffv1_encoder = {
encode_init,
encode_frame,
common_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
};

@ -3467,7 +3467,9 @@ AVCodec ff_h264_decoder = {
NULL,
ff_h264_decode_end,
decode_frame,
/*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_FRAME_THREADS,
/*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY |
CODEC_CAP_FRAME_THREADS |
CODEC_CAP_SLICE_THREADS,
.flush= flush_dpb,
.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),

@ -2602,7 +2602,7 @@ AVCodec ff_mpeg2video_decoder = {
NULL,
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
.flush= flush,
.max_lowres= 3,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
@ -2619,7 +2619,7 @@ AVCodec ff_mpegvideo_decoder = {
NULL,
mpeg_decode_end,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
.flush= flush,
.max_lowres= 3,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),

@ -940,7 +940,7 @@ AVCodec ff_mpeg1video_encoder = {
MPV_encode_end,
.supported_framerates= ff_frame_rate_tab+1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.capabilities= CODEC_CAP_DELAY,
.capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
};
@ -954,6 +954,6 @@ AVCodec ff_mpeg2video_encoder = {
MPV_encode_end,
.supported_framerates= ff_frame_rate_tab+1,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE},
.capabilities= CODEC_CAP_DELAY,
.capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
};

@ -1359,6 +1359,6 @@ AVCodec ff_mpeg4_encoder = {
MPV_encode_picture,
MPV_encode_end,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.capabilities= CODEC_CAP_DELAY,
.capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
};

@ -3802,6 +3802,7 @@ AVCodec ff_h263p_encoder = {
MPV_encode_init,
MPV_encode_picture,
MPV_encode_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
};

@ -0,0 +1,16 @@
/**
* @file
* This header is provided for compatibility only and will be removed
* on next major bump
*/
#ifndef AVCODEC_OPT_H
#define AVCODEC_OPT_H
#include "libavcodec/version.h"
#if FF_API_OPT_H
#include "libavutil/opt.h"
#endif
#endif

@ -877,7 +877,8 @@ static void validate_thread_parameters(AVCodecContext *avctx)
avctx->active_thread_type = 0;
} else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
avctx->active_thread_type = FF_THREAD_FRAME;
} else if (avctx->thread_type & FF_THREAD_SLICE) {
} else if (avctx->codec->capabilities & CODEC_CAP_SLICE_THREADS &&
avctx->thread_type & FF_THREAD_SLICE) {
avctx->active_thread_type = FF_THREAD_SLICE;
}
}

@ -353,7 +353,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
s->flags = FLAG_KEYFRAME;
if (s->flags & FLAG_SPRITE) {
av_log(s->avctx, AV_LOG_INFO, "SPRITE frame found, please report the sample to the developers\n");
av_log_ask_for_sample(s->avctx, "SPRITE frame found.\n");
/* FIXME header.width, height, xoffset and yoffset aren't initialized */
#if 0
s->w = header.width;
@ -370,7 +370,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
if ((s->w < 213) && (s->h >= 176))
{
s->flags |= FLAG_INTERPOLATED;
av_log(s->avctx, AV_LOG_INFO, "INTERPOLATION selected, please report the sample to the developers\n");
av_log_ask_for_sample(s->avctx, "INTERPOLATION selected.\n");
}
}
}

@ -247,7 +247,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
if (s->is_float)
{
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
av_log(s->avctx, AV_LOG_ERROR, "Unsupported sample format. Please contact the developers.\n");
av_log_ask_for_sample(s->avctx, "Unsupported sample format.\n");
return -1;
}
else switch(s->bps) {
@ -256,7 +256,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
// case 3: avctx->sample_fmt = AV_SAMPLE_FMT_S24; break;
case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
default:
av_log(s->avctx, AV_LOG_ERROR, "Invalid/unsupported sample format. Please contact the developers.\n");
av_log_ask_for_sample(s->avctx,
"Invalid/unsupported sample format.\n");
return -1;
}

@ -1295,3 +1295,11 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field)
}
#endif
#if FF_API_THREAD_INIT
int avcodec_thread_init(AVCodecContext *s, int thread_count)
{
s->thread_count = thread_count;
return ff_thread_init(s);
}
#endif

@ -52,7 +52,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
if(avpkt->size > avctx->width * avctx->height * 8 / 3){
av_log(avctx, AV_LOG_ERROR, "Probably padded data, need sample!\n");
av_log_ask_for_sample(avctx, "Probably padded data\n");
}
pic->reference= 0;

@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 0
#define LIBAVCODEC_VERSION_MINOR 1
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@ -62,5 +62,11 @@
#ifndef FF_API_REQUEST_CHANNELS
#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OPT_H
#define FF_API_OPT_H (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_THREAD_INIT
#define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#endif /* AVCODEC_VERSION_H */

@ -26,6 +26,7 @@
#define _BSD_SOURCE 1
#define _NETBSD_SOURCE
#define _XOPEN_SOURCE 600
#include "libavformat/avformat.h"
#if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H

@ -367,6 +367,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
for (i = 0; i < c->n_variants; i++) {
struct variant *v = c->variants[i];
AVInputFormat *in_fmt = NULL;
char bitrate_str[20];
if (v->n_segments == 0)
continue;
@ -393,6 +394,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (ret < 0)
goto fail;
v->stream_offset = stream_offset;
snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
/* Create new AVStreams for each stream in this variant */
for (j = 0; j < v->ctx->nb_streams; j++) {
AVStream *st = av_new_stream(s, i);
@ -401,6 +403,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
goto fail;
}
avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
av_metadata_set2(&st->metadata, "variant_bitrate", bitrate_str, 0);
}
stream_offset += v->ctx->nb_streams;
}

@ -104,6 +104,7 @@ struct AVFormatContext;
* service_provider -- name of the service provider in broadcasting.
* title -- name of the work.
* track -- number of this work in the set, can be in form current/total.
* variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
*/
#define AV_METADATA_MATCH_CASE 1

@ -586,7 +586,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
/* check filename in case an image number is expected */
if (fmt->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(filename)) {
err = AVERROR_NUMEXPECTED;
err = AVERROR(EINVAL);
goto fail;
}
}

@ -25,7 +25,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 0
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_MICRO 1
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

@ -25,19 +25,19 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
const char *errstr = NULL;
switch (errnum) {
case AVERROR_EOF: errstr = "End of file"; break;
case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break;
case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break;
case AVERROR_BSF_NOT_FOUND: errstr = "Bitstream filter not found" ; break;
case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found" ; break;
case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found" ; break;
case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found" ; break;
case AVERROR_EOF: errstr = "End of file" ; break;
case AVERROR_EXIT: errstr = "Immediate exit requested" ; break;
case AVERROR_FILTER_NOT_FOUND: errstr = "Filter not found" ; break;
case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input" ; break;
case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found" ; break;
case AVERROR_OPTION_NOT_FOUND: errstr = "Option not found" ; break;
case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"; break;
case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found"; break;
case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found"; break;
case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found"; break;
case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"; break;
case AVERROR_FILTER_NOT_FOUND: errstr = "Filter not found"; break;
case AVERROR_BSF_NOT_FOUND: errstr = "Bitstream filter not found"; break;
case AVERROR_STREAM_NOT_FOUND: errstr = "Stream not found"; break;
case AVERROR_EXIT: errstr = "Immediate exit requested"; break;
case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found" ; break;
case AVERROR_STREAM_NOT_FOUND: errstr = "Stream not found" ; break;
}
if (errstr) {

@ -44,24 +44,22 @@
#define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported
#define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error
#define AVERROR_EOF AVERROR(EPIPE) ///< End of file
#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
#define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found
#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
#define AVERROR_EOF (-MKTAG( 'E','O','F',' ')) ///< End of file
#define AVERROR_EXIT (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found
#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
#define AVERROR_INVALIDDATA (-MKTAG( 'I','N','D','A')) ///< Invalid data found when processing input
#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
#define AVERROR_OPTION_NOT_FOUND (-MKTAG(0xF8,'O','P','T')) ///< Option not found
#define AVERROR_PATCHWELCOME (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
#define AVERROR_EXIT (-MKTAG('E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
/**
* Put a description of the AVERROR code errnum in errbuf.
* In case of failure the global variable errno is set to indicate the

@ -86,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
}
#endif /* HAVE_ROUNDF */
#if !HAVE_TRUNC
static av_always_inline av_const double trunc(double x)
{
return (x > 0) ? floor(x) : ceil(x);
}
#endif /* HAVE_TRUNC */
#if !HAVE_TRUNCF
static av_always_inline av_const float truncf(float x)
{

@ -57,7 +57,7 @@ static int av_set_number2(void *obj, const char *name, double num, int den, int6
if (o_out)
*o_out= o;
if (!o || o->offset<=0)
return AVERROR(ENOENT);
return AVERROR_OPTION_NOT_FOUND;
if (o->max*den < num*intnum || o->min*den > num*intnum) {
av_log(obj, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);
@ -119,7 +119,7 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
if (o_out)
*o_out = o;
if (!o)
return AVERROR(ENOENT);
return AVERROR_OPTION_NOT_FOUND;
if (!val || o->offset<=0)
return AVERROR(EINVAL);
@ -490,7 +490,7 @@ static int parse_key_value_pair(void *ctx, const char **buf,
av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key);
ret = av_set_string3(ctx, key, val, 1, NULL);
if (ret == AVERROR(ENOENT))
if (ret == AVERROR_OPTION_NOT_FOUND)
av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key);
av_free(key);

@ -16,6 +16,7 @@ cmp=${6:-diff}
ref=${7:-"${base}/ref/fate/${test}"}
fuzz=$8
threads=${9:-1}
thread_type=${10:-3}
outdir="tests/data/fate"
outfile="${outdir}/${test}"
@ -49,7 +50,7 @@ run(){
}
ffmpeg(){
run ffmpeg -v 0 -threads $threads "$@"
run ffmpeg -v 0 -threads $threads -thread_type $thread_type "$@"
}
framecrc(){
@ -78,7 +79,7 @@ regtest(){
cleanfiles="$cleanfiles $outfile $errfile"
outfile=tests/data/regression/$2/$t
errfile=tests/data/$t.$2.err
${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads"
${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads" "$thread_type"
}
codectest(){

Loading…
Cancel
Save