History

Merge remote branch 'qatar/master'

* qatar/master: (37 commits) In avcodec_open(), set return code to an error value only when an error occurs instead of unconditionally at the start of the function. lavc: remove reference to opt.h from Makefile. prefer avio_check() over url_exist() avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols lavu: remove misc disabled cruft lavu: remove FF_API_OLD_IMAGE_NAMES cruft NOT PULLED lavu: remove FF_API_OLD_EVAL_NAMES cruft lavc: remove misc disabled cruft. lavc: remove the FF_API_INOFFICIAL cruft. lavc: remove the FF_API_SET_STRING_OLD cruft. lavc: remove the FF_API_USE_LPC cruft. lavc: remove the FF_API_SUBTITLE_OLD cruft. lavc: remove the FF_API_VIDEO_OLD cruft. lavc: remove the FF_API_AUDIO_OLD cruft. lavc: remove the FF_API_OPT_SHOW cruft. lavc: remove the FF_API_MM_FLAGS cruft. lavf: remove misc disabled cruft. lavf: remove FF_API_INDEX_BUILT cruft lavf: remove FF_API_URL_CLASS cruft. lavf: remove FF_API_SYMVER cruft ...

Michael Niedermayer committed 15 years ago

Commit efb5fa72 parents f92b008 31d76ec67 files · +150 −1376Browse files

Unified · Split

67 files
  1. cmdutils.c +1 −1
  2. doc/APIchanges +5 −0
  3. ffmpeg.c +3 −5
  4. ffplay.c +1 −1
  5. ffprobe.c +1 −1
  6. ffserver.c +5 −11
  7. libavcodec/Makefile +1 −2
  8. libavcodec/avcodec.h +2 −199
  9. libavcodec/dsputil.h +0 −8
  10. libavcodec/flacenc.c +0 −11
  11. libavcodec/imgconvert.c +0 −51
  12. libavcodec/libvo-aacenc.c +4 −4
  13. libavcodec/libvo-amrwbenc.c +1 −1
  14. libavcodec/opt.c +0 −89
  15. libavcodec/opt.h +0 −55
  16. libavcodec/options.c +0 −9
  17. libavcodec/parser.c +0 −37
  18. libavcodec/pcm.c +1 −1
  19. libavcodec/resample.c +0 −11
  20. libavcodec/utils.c +10 −76
  21. libavcodec/version.h +2 −26
  22. libavcodec/xvmc.h +0 −21
  23. libavdevice/avdevice.h +2 −2
  24. libavfilter/avfilter.h +3 −3
  25. libavformat/Makefile +0 −1
  26. libavformat/applehttp.c +2 −2
  27. libavformat/applehttpproto.c +3 −3
  28. libavformat/avformat.h +0 −103
  29. libavformat/avio.c +5 −32
  30. libavformat/avio.h +4 −47
  31. libavformat/aviobuf.c +6 −17
  32. libavformat/file.c +5 −6
  33. libavformat/gopher.c +1 −1
  34. libavformat/http.c +3 −3
  35. libavformat/img2.c +5 −5
  36. libavformat/internal.h +0 −12
  37. libavformat/librtmp.c +1 −1
  38. libavformat/matroskadec.c +1 −1
  39. libavformat/md5proto.c +2 −2
  40. libavformat/metadata.c +0 −7
  41. libavformat/metadata.h +0 −5
  42. libavformat/metadata_compat.c +0 −148
  43. libavformat/mms.c +0 −4
  44. libavformat/mmsh.c +2 −2
  45. libavformat/mmst.c +1 −1
  46. libavformat/mov.c +1 −1
  47. libavformat/mpegts.c +0 −5
  48. libavformat/nutdec.c +0 −4
  49. libavformat/options.c +0 −11
  50. libavformat/output-example.c +1 −1
  51. libavformat/rtmpproto.c +28 −35
  52. libavformat/rtpproto.c +1 −1
  53. libavformat/rtsp.c +8 −8
  54. libavformat/sapdec.c +1 −1
  55. libavformat/sapenc.c +2 −2
  56. libavformat/udp.c +7 −10
  57. libavformat/utils.c +3 −135
  58. libavformat/version.h +2 −47
  59. libavutil/avutil.h +4 −12
  60. libavutil/error.h +0 −6
  61. libavutil/file.c +1 −2
  62. libavutil/imgutils.c +0 −29
  63. libavutil/imgutils.h +0 −19
  64. libavutil/log.c +1 −4
  65. libavutil/mem.c +3 −3
  66. libavutil/mem.h +3 −11
  67. libswscale/options.c +1 −1
cmdutils.c+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 #include "libavutil/parseutils.h"
3939 #include "libavutil/pixdesc.h"
4040 #include "libavutil/eval.h"
41−#include "libavcodec/opt.h"
41+#include "libavutil/opt.h"
4242 #include "cmdutils.h"
4343 #include "version.h"
4444 #if CONFIG_NETWORK
doc/APIchanges+5−0
@@ -12,6 +12,11 @@ libavutil: 2009-03-08 · 11 unmodified lines
1212
1313 API changes, most recent first:
1414
15+2011-04-15 - lavc 52.120.0 - avcodec.h
16+ AVPacket structure got additional members for passing side information:
17+ 4de339e introduce side information for AVPacket
18+ 2d8591c make containers pass palette change in AVPacket
19+
1520 2011-04-12 - lavf 52.107.0 - avio.h
1621 Avio cleanup, part II - deprecate the entire URLContext API:
1722 175389c add avio_check as a replacement for url_exist
ffmpeg.c+3−5
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include "libavformat/avformat.h"
3535 #include "libavdevice/avdevice.h"
3636 #include "libswscale/swscale.h"
37−#include "libavcodec/opt.h"
37+#include "libavutil/opt.h"
3838 #include "libavcodec/audioconvert.h"
3939 #include "libavutil/audioconvert.h"
4040 #include "libavutil/parseutils.h"
@@ -113,9 +113,7 @@ typedef struct AVChapterMap { · 72 unmodified lines
113113 static const OptionDef options[];
114114
115115 #define MAX_FILES 100
116−#if !FF_API_MAX_STREAMS
117116 #define MAX_STREAMS 1024 /* arbitrary sanity check value */
118−#endif
119117
120118 static const char *last_asked_format = NULL;
121119 static AVFormatContext *input_files[MAX_FILES];
@@ -3869,7 +3867,7 @@ static void opt_output_file(const char *filename) · 3747 unmodified lines
38693867 (strchr(filename, ':') == NULL ||
38703868 filename[1] == ':' ||
38713869 av_strstart(filename, "file:", NULL))) {
3872− if (url_exist(filename)) {
3870+ if (avio_check(filename, 0) == 0) {
38733871 if (!using_stdin) {
38743872 fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
38753873 fflush(stderr);
@@ -3886,7 +3884,7 @@ static void opt_output_file(const char *filename) · 10 unmodified lines
38863884 }
38873885
38883886 /* open the file */
3889− if ((err = avio_open(&oc->pb, filename, AVIO_WRONLY)) < 0) {
3887+ if ((err = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE)) < 0) {
38903888 print_error(filename, err);
38913889 ffmpeg_exit(1);
38923890 }
ffplay.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include "libavdevice/avdevice.h"
3737 #include "libswscale/swscale.h"
3838 #include "libavcodec/audioconvert.h"
39−#include "libavcodec/opt.h"
39+#include "libavutil/opt.h"
4040 #include "libavcodec/avfft.h"
4141
4242 #if CONFIG_AVFILTER
ffprobe.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323
2424 #include "libavformat/avformat.h"
2525 #include "libavcodec/avcodec.h"
26−#include "libavcodec/opt.h"
26+#include "libavutil/opt.h"
2727 #include "libavutil/pixdesc.h"
2828 #include "libavdevice/avdevice.h"
2929 #include "cmdutils.h"
ffserver.c+5−11
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include "libavutil/lfg.h"
4141 #include "libavutil/random_seed.h"
4242 #include "libavutil/parseutils.h"
43−#include "libavcodec/opt.h"
43+#include "libavutil/opt.h"
4444 #include <stdarg.h>
4545 #include <unistd.h>
4646 #include <fcntl.h>
@@ -95,9 +95,7 @@ static const char *http_state[] = { · 48 unmodified lines
9595 "RTSP_SEND_PACKET",
9696 };
9797
98−#if !FF_API_MAX_STREAMS
9998 #define MAX_STREAMS 20
100−#endif
10199
102100 #define IOBUFFER_INIT_SIZE 8192
103101
@@ -2944,11 +2942,9 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, · 2840 unmodified lines
29442942 snprintf(avc->filename, 1024, "rtp://0.0.0.0");
29452943 }
29462944
2947−#if !FF_API_MAX_STREAMS
29482945 if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
29492946 !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
29502947 goto sdp_done;
2951−#endif
29522948 if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
29532949 !(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
29542950 goto sdp_done;
@@ -2961,9 +2957,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, · 6 unmodified lines
29612957 av_sdp_create(&avc, 1, *pbuffer, 2048);
29622958
29632959 sdp_done:
2964−#if !FF_API_MAX_STREAMS
29652960 av_free(avc->streams);
2966−#endif
29672961 av_metadata_free(&avc->metadata);
29682962 av_free(avc);
29692963 av_free(avs);
@@ -3428,7 +3422,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 458 unmodified lines
34283422 "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
34293423 }
34303424
3431− if (url_open(&h, ctx->filename, AVIO_WRONLY) < 0)
3425+ if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
34323426 goto fail;
34333427 c->rtp_handles[stream_index] = h;
34343428 max_packet_size = url_get_max_packet_size(h);
@@ -3685,7 +3679,7 @@ static void build_feed_streams(void) · 250 unmodified lines
36853679 for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
36863680 int fd;
36873681
3688− if (url_exist(feed->feed_filename)) {
3682+ if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
36893683 /* See if it matches */
36903684 AVFormatContext *s;
36913685 int matches = 0;
@@ -3758,7 +3752,7 @@ static void build_feed_streams(void) · 66 unmodified lines
37583752 unlink(feed->feed_filename);
37593753 }
37603754 }
3761− if (!url_exist(feed->feed_filename)) {
3755+ if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) {
37623756 AVFormatContext s1 = {0}, *s = &s1;
37633757
37643758 if (feed->readonly) {
@@ -3768,7 +3762,7 @@ static void build_feed_streams(void) · 3 unmodified lines
37683762 }
37693763
37703764 /* only write the header of the ffm file */
3771− if (avio_open(&s->pb, feed->feed_filename, AVIO_WRONLY) < 0) {
3765+ if (avio_open(&s->pb, feed->feed_filename, AVIO_FLAG_WRITE) < 0) {
37723766 http_log("Could not open output feed file '%s'\n",
37733767 feed->feed_filename);
37743768 exit(1);
libavcodec/Makefile+1−2
@@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak · 2 unmodified lines
33 NAME = avcodec
44 FFLIBS = avutil
55
6−HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h version.h xvmc.h
6+HEADERS = avcodec.h avfft.h dxva2.h vaapi.h vdpau.h version.h xvmc.h
77
88 OBJS = allcodecs.o \
99 audioconvert.o \
@@ -15,7 +15,6 @@ OBJS = allcodecs.o \ · 5 unmodified lines
1515 fmtconvert.o \
1616 imgconvert.o \
1717 jrevdct.o \
18− opt.o \
1918 options.o \
2019 parser.o \
2120 raw.o \
libavcodec/avcodec.h+2−199
@@ -33,12 +33,6 @@ · 32 unmodified lines
3333
3434 #include "libavcodec/version.h"
3535
36−#if LIBAVCODEC_VERSION_MAJOR < 53
37−# define FF_INTERNALC_MEM_TYPE unsigned int
38−#else
39−# define FF_INTERNALC_MEM_TYPE size_t
40−#endif
41−
4236 /**
4337 * Identify the syntax and semantics of the bitstream.
4438 * The principle is roughly:
@@ -117,9 +111,6 @@ enum CodecID { · 72 unmodified lines
117111 CODEC_ID_QDRAW,
118112 CODEC_ID_VIXL,
119113 CODEC_ID_QPEG,
120−#if LIBAVCODEC_VERSION_MAJOR < 53
121− CODEC_ID_XVID,
122−#endif
123114 CODEC_ID_PNG,
124115 CODEC_ID_PPM,
125116 CODEC_ID_PBM,
@@ -366,18 +357,6 @@ enum CodecID { · 240 unmodified lines
366357 CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information.
367358 };
368359
369−#if LIBAVCODEC_VERSION_MAJOR < 53
370−#define CodecType AVMediaType
371−
372−#define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN
373−#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
374−#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
375−#define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA
376−#define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE
377−#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
378−#define CODEC_TYPE_NB AVMEDIA_TYPE_NB
379−#endif
380−
381360 #if FF_API_OLD_SAMPLE_FMT
382361 #define SampleFormat AVSampleFormat
383362
@@ -1112,9 +1091,6 @@ typedef struct AVPacket { · 728 unmodified lines
11121091 int64_t convergence_duration;
11131092 } AVPacket;
11141093 #define AV_PKT_FLAG_KEY 0x0001
1115−#if LIBAVCODEC_VERSION_MAJOR < 53
1116−#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
1117−#endif
11181094
11191095 /**
11201096 * Audio Video Frame.
@@ -1289,9 +1265,6 @@ typedef struct AVCodecContext { · 168 unmodified lines
12891265 */
12901266 int frame_size;
12911267 int frame_number; ///< audio or video frame number
1292−#if LIBAVCODEC_VERSION_MAJOR < 53
1293− int real_pict_num; ///< Returns the real picture number of previous encoded frame.
1294−#endif
12951268
12961269 /**
12971270 * Number of frames the decoded output will be delayed relative to
@@ -1476,9 +1449,6 @@ typedef struct AVCodecContext { · 178 unmodified lines
14761449 #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
14771450 #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
14781451 #define FF_COMPLIANCE_NORMAL 0
1479−#if FF_API_INOFFICIAL
1480−#define FF_COMPLIANCE_INOFFICIAL -1 ///< Allow inofficial extensions (deprecated - use FF_COMPLIANCE_UNOFFICIAL instead).
1481−#endif
14821452 #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
14831453 #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
14841454
@@ -1752,25 +1722,6 @@ typedef struct AVCodecContext { · 267 unmodified lines
17521722 */
17531723 unsigned dsp_mask;
17541724
1755−#if FF_API_MM_FLAGS
1756−#define FF_MM_FORCE AV_CPU_FLAG_FORCE
1757−#define FF_MM_MMX AV_CPU_FLAG_MMX
1758−#define FF_MM_3DNOW AV_CPU_FLAG_3DNOW
1759−#define FF_MM_MMXEXT AV_CPU_FLAG_MMX2
1760−#define FF_MM_MMX2 AV_CPU_FLAG_MMX2
1761−#define FF_MM_SSE AV_CPU_FLAG_SSE
1762−#define FF_MM_SSE2 AV_CPU_FLAG_SSE2
1763−#define FF_MM_SSE2SLOW AV_CPU_FLAG_SSE2SLOW
1764−#define FF_MM_3DNOWEXT AV_CPU_FLAG_3DNOWEXT
1765−#define FF_MM_SSE3 AV_CPU_FLAG_SSE3
1766−#define FF_MM_SSE3SLOW AV_CPU_FLAG_SSE3SLOW
1767−#define FF_MM_SSSE3 AV_CPU_FLAG_SSSE3
1768−#define FF_MM_SSE4 AV_CPU_FLAG_SSE4
1769−#define FF_MM_SSE42 AV_CPU_FLAG_SSE42
1770−#define FF_MM_IWMMXT AV_CPU_FLAG_IWMMXT
1771−#define FF_MM_ALTIVEC AV_CPU_FLAG_ALTIVEC
1772−#endif
1773−
17741725 /**
17751726 * bits per sample/pixel from the demuxer (needed for huffyuv).
17761727 * - encoding: Set by libavcodec.
@@ -2562,16 +2513,6 @@ typedef struct AVCodecContext { · 785 unmodified lines
25622513 int compression_level;
25632514 #define FF_COMPRESSION_DEFAULT -1
25642515
2565−#if FF_API_USE_LPC
2566− /**
2567− * Sets whether to use LPC mode - used by FLAC encoder.
2568− * - encoding: Set by user.
2569− * - decoding: unused
2570− * @deprecated Deprecated in favor of lpc_type and lpc_passes.
2571− */
2572− int use_lpc;
2573−#endif
2574−
25752516 /**
25762517 * LPC coefficient precision - used by FLAC encoder
25772518 * - encoding: Set by user.
@@ -3269,14 +3210,6 @@ struct AVResampleContext; · 691 unmodified lines
32693210
32703211 typedef struct ReSampleContext ReSampleContext;
32713212
3272−#if FF_API_AUDIO_OLD
3273−/**
3274− * @deprecated Use av_audio_resample_init() instead.
3275− */
3276−attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
3277− int output_rate, int input_rate);
3278−#endif
3279−
32803213 /**
32813214 * Initialize audio resampling context.
32823215 *
@@ -3436,23 +3369,6 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); · 153 unmodified lines
34363369
34373370 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
34383371
3439−#if LIBAVCODEC_VERSION_MAJOR < 53
3440−/**
3441− * Return the pixel format corresponding to the name name.
3442− *
3443− * If there is no pixel format with name name, then look for a
3444− * pixel format with the name corresponding to the native endian
3445− * format of name.
3446− * For example in a little-endian system, first look for "gray16",
3447− * then for "gray16le".
3448− *
3449− * Finally if no pixel format has been found, return PIX_FMT_NONE.
3450− *
3451− * @deprecated Deprecated in favor of av_get_pix_fmt().
3452− */
3453−attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
3454−#endif
3455−
34563372 /**
34573373 * Return a value representing the fourCC code associated to the
34583374 * pixel format pix_fmt, or 0 if no associated fourCC code can be
@@ -3521,14 +3437,6 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 62 unmodified lines
35213437 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
35223438 int has_alpha, int *loss_ptr);
35233439
3524−#if LIBAVCODEC_VERSION_MAJOR < 53
3525−/**
3526− * @deprecated Use av_get_pix_fmt_string() instead.
3527− */
3528−attribute_deprecated
3529−void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
3530−#endif
3531−
35323440 #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
35333441 #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
35343442
@@ -3579,13 +3487,6 @@ const char *avcodec_license(void); · 44 unmodified lines
35793487 */
35803488 void avcodec_init(void);
35813489
3582−#if LIBAVCODEC_VERSION_MAJOR < 53
3583−/**
3584− * @deprecated Deprecated in favor of avcodec_register().
3585− */
3586−attribute_deprecated void register_avcodec(AVCodec *codec);
3587−#endif
3588−
35893490 /**
35903491 * Register the codec codec and initialize libavcodec.
35913492 *
@@ -3730,24 +3631,8 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); · 138 unmodified lines
37303631 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
37313632 int linesize_align[4]);
37323633
3733−#if LIBAVCODEC_VERSION_MAJOR < 53
3734−/**
3735− * @deprecated Deprecated in favor of av_check_image_size().
3736− */
3737−attribute_deprecated
3738−int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
3739−#endif
3740−
37413634 enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
37423635
3743−#if LIBAVCODEC_VERSION_MAJOR < 53
3744−/**
3745− * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this.
3746− */
3747−attribute_deprecated
3748−int avcodec_thread_init(AVCodecContext *s, int thread_count);
3749−void avcodec_thread_free(AVCodecContext *s);
3750−#endif
37513636 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
37523637 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
37533638 //FIXME func typedef
@@ -3781,25 +3666,6 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, · 27 unmodified lines
37813666 */
37823667 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
37833668
3784−#if FF_API_AUDIO_OLD
3785−/**
3786− * Decode an audio frame from buf into samples.
3787− * Wrapper function which calls avcodec_decode_audio3.
3788− *
3789− * @deprecated Use avcodec_decode_audio3 instead.
3790− * @param avctx the codec context
3791− * @param[out] samples the output buffer
3792− * @param[in,out] frame_size_ptr the output buffer size in bytes
3793− * @param[in] buf the input buffer
3794− * @param[in] buf_size the input buffer size in bytes
3795− * @return On error a negative value is returned, otherwise the number of bytes
3796− * used or zero if no frame could be decompressed.
3797− */
3798−attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
3799− int *frame_size_ptr,
3800− const uint8_t *buf, int buf_size);
3801−#endif
3802−
38033669 /**
38043670 * Decode the audio frame of size avpkt->size from avpkt->data into samples.
38053671 * Some decoders may support multiple frames in a single AVPacket, such
@@ -3843,25 +3709,6 @@ int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, · 37 unmodified lines
38433709 int *frame_size_ptr,
38443710 AVPacket *avpkt);
38453711
3846−#if FF_API_VIDEO_OLD
3847−/**
3848− * Decode a video frame from buf into picture.
3849− * Wrapper function which calls avcodec_decode_video2.
3850− *
3851− * @deprecated Use avcodec_decode_video2 instead.
3852− * @param avctx the codec context
3853− * @param[out] picture The AVFrame in which the decoded video frame will be stored.
3854− * @param[in] buf the input buffer
3855− * @param[in] buf_size the size of the input buffer in bytes
3856− * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
3857− * @return On error a negative value is returned, otherwise the number of bytes
3858− * used or zero if no frame could be decompressed.
3859− */
3860−attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
3861− int *got_picture_ptr,
3862− const uint8_t *buf, int buf_size);
3863−#endif
3864−
38653712 /**
38663713 * Decode the video frame of size avpkt->size from avpkt->data into picture.
38673714 * Some decoders may support multiple frames in a single AVPacket, such
@@ -3906,15 +3753,6 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, · 38 unmodified lines
39063753 int *got_picture_ptr,
39073754 AVPacket *avpkt);
39083755
3909−#if FF_API_SUBTITLE_OLD
3910−/* Decode a subtitle message. Return -1 if error, otherwise return the
3911− * number of bytes used. If no subtitle could be decompressed,
3912− * got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
3913−attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
3914− int *got_sub_ptr,
3915− const uint8_t *buf, int buf_size);
3916−#endif
3917−
39183756 /**
39193757 * Decode a subtitle message.
39203758 * Return a negative value on error, otherwise return the number of bytes used.
@@ -4179,15 +4017,6 @@ AVCodecParser *av_parser_next(AVCodecParser *c); · 258 unmodified lines
41794017 void av_register_codec_parser(AVCodecParser *parser);
41804018 AVCodecParserContext *av_parser_init(int codec_id);
41814019
4182−#if LIBAVCODEC_VERSION_MAJOR < 53
4183−attribute_deprecated
4184−int av_parser_parse(AVCodecParserContext *s,
4185− AVCodecContext *avctx,
4186− uint8_t **poutbuf, int *poutbuf_size,
4187− const uint8_t *buf, int buf_size,
4188− int64_t pts, int64_t dts);
4189−#endif
4190−
41914020 /**
41924021 * Parse a packet.
41934022 *
@@ -4266,7 +4095,7 @@ AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f); · 72 unmodified lines
42664095 *
42674096 * @see av_realloc
42684097 */
4269−void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size);
4098+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
42704099
42714100 /**
42724101 * Allocate a buffer, reusing the given one if large enough.
@@ -4280,17 +4109,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_s · 7 unmodified lines
42804109 * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
42814110 * *size 0 if an error occurred.
42824111 */
4283−void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size);
4284−
4285−#if LIBAVCODEC_VERSION_MAJOR < 53
4286−/**
4287− * @deprecated Deprecated in favor of av_image_copy().
4288− */
4289−attribute_deprecated
4290−void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
4291− uint8_t *src_data[4], int src_linesize[4],
4292− enum PixelFormat pix_fmt, int width, int height);
4293−#endif
4112+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
42944113
42954114 /**
42964115 * Copy image src to dst. Wraps av_picture_data_copy() above.
@@ -4319,22 +4138,6 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, · 22 unmodified lines
43194138 */
43204139 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
43214140
4322−#if LIBAVCODEC_VERSION_MAJOR < 53
4323−/**
4324− * Parse str and put in width_ptr and height_ptr the detected values.
4325− *
4326− * @deprecated Deprecated in favor of av_parse_video_size().
4327− */
4328−attribute_deprecated int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
4329−
4330−/**
4331− * Parse str and store the detected values in *frame_rate.
4332− *
4333− * @deprecated Deprecated in favor of av_parse_video_rate().
4334− */
4335−attribute_deprecated int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
4336−#endif
4337−
43384141 /**
43394142 * Logs a generic warning message about a missing feature. This function is
43404143 * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
libavcodec/dsputil.h+0−8
@@ -120,14 +120,6 @@ void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); · 119 unmodified lines
120120 void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
121121
122122 /* 1/2^n downscaling functions from imgconvert.c */
123−#if LIBAVCODEC_VERSION_MAJOR < 53
124−/**
125− * @deprecated Use av_image_copy_plane() instead.
126− */
127−attribute_deprecated
128−void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
129−#endif
130−
131123 void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
132124 void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
133125 void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
libavcodec/flacenc.c+0−11
@@ -285,17 +285,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) · 284 unmodified lines
285285 s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level];
286286
287287 /* set compression option overrides from AVCodecContext */
288−#if FF_API_USE_LPC
289− /* for compatibility with deprecated AVCodecContext.use_lpc */
290− if (avctx->use_lpc == 0) {
291− s->options.lpc_type = AV_LPC_TYPE_FIXED;
292− } else if (avctx->use_lpc == 1) {
293− s->options.lpc_type = AV_LPC_TYPE_LEVINSON;
294− } else if (avctx->use_lpc > 1) {
295− s->options.lpc_type = AV_LPC_TYPE_CHOLESKY;
296− s->options.lpc_passes = avctx->use_lpc - 1;
297− }
298−#endif
299288 if (avctx->lpc_type > AV_LPC_TYPE_DEFAULT) {
300289 if (avctx->lpc_type > AV_LPC_TYPE_CHOLESKY) {
301290 av_log(avctx, AV_LOG_ERROR, "unknown lpc type: %d\n", avctx->lpc_type);
libavcodec/imgconvert.c+0−51
@@ -425,40 +425,11 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt) · 424 unmodified lines
425425 return av_pix_fmt_descriptors[pix_fmt].name;
426426 }
427427
428−#if LIBAVCODEC_VERSION_MAJOR < 53
429−enum PixelFormat avcodec_get_pix_fmt(const char *name)
430−{
431− return av_get_pix_fmt(name);
432−}
433−
434−void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
435−{
436− av_get_pix_fmt_string(buf, buf_size, pix_fmt);
437−}
438−#endif
439−
440428 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)
441429 {
442430 return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;
443431 }
444432
445−#if LIBAVCODEC_VERSION_MAJOR < 53
446−int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
447− return ff_set_systematic_pal2(pal, pix_fmt);
448−}
449−
450−int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
451−{
452− return av_image_fill_linesizes(picture->linesize, pix_fmt, width);
453−}
454−
455−int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
456− int height)
457−{
458− return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
459−}
460−#endif
461−
462433 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
463434 enum PixelFormat pix_fmt, int width, int height)
464435 {
@@ -693,28 +664,6 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma · 228 unmodified lines
693664 return dst_pix_fmt;
694665 }
695666
696−#if LIBAVCODEC_VERSION_MAJOR < 53
697−void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
698− const uint8_t *src, int src_wrap,
699− int width, int height)
700−{
701− av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height);
702−}
703−
704−int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
705−{
706− return av_image_get_linesize(pix_fmt, width, plane);
707−}
708−
709−void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
710− uint8_t *src_data[4], int src_linesize[4],
711− enum PixelFormat pix_fmt, int width, int height)
712−{
713− av_image_copy(dst_data, dst_linesize, src_data, src_linesize,
714− pix_fmt, width, height);
715−}
716−#endif
717−
718667 void av_picture_copy(AVPicture *dst, const AVPicture *src,
719668 enum PixelFormat pix_fmt, int width, int height)
720669 {
libavcodec/libvo-aacenc.c+4−4
@@ -59,7 +59,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 58 unmodified lines
5959 if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, &params)
6060 != VO_ERR_NONE) {
6161 av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n");
62− return AVERROR_UNKNOWN;
62+ return AVERROR(EINVAL);
6363 }
6464
6565 for (index = 0; index < 16; index++)
@@ -68,7 +68,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 2 unmodified lines
6868 if (index == 16) {
6969 av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n",
7070 avctx->sample_rate);
71− return AVERROR_NOTSUPP;
71+ return AVERROR(ENOSYS);
7272 }
7373 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
7474 avctx->extradata_size = 2;
@@ -110,14 +110,14 @@ static int aac_encode_frame(AVCodecContext *avctx, · 35 unmodified lines
110110 if (s->codec_api.GetOutputData(s->handle, &output, &output_info)
111111 != VO_ERR_NONE) {
112112 av_log(avctx, AV_LOG_ERROR, "Unable to encode frame\n");
113− return AVERROR_UNKNOWN;
113+ return AVERROR(EINVAL);
114114 }
115115 return output.Length;
116116 }
117117
118118 AVCodec ff_libvo_aacenc_encoder = {
119119 "libvo_aacenc",
120− CODEC_TYPE_AUDIO,
120+ AVMEDIA_TYPE_AUDIO,
121121 CODEC_ID_AAC,
122122 sizeof(AACContext),
123123 aac_encode_init,
libavcodec/libvo-amrwbenc.c+1−1
@@ -119,7 +119,7 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, · 118 unmodified lines
119119
120120 AVCodec ff_libvo_amrwbenc_encoder = {
121121 "libvo_amrwbenc",
122− CODEC_TYPE_AUDIO,
122+ AVMEDIA_TYPE_AUDIO,
123123 CODEC_ID_AMR_WB,
124124 sizeof(AMRWBContext),
125125 amr_wb_encode_init,
libavcodec/opt.c+0−89
@@ -1,89 +0,0 @@
1−/*
2− * AVOptions ABI compatibility wrapper
3− * Copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
4− *
5− * This file is part of FFmpeg.
6− *
7− * FFmpeg is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU Lesser General Public
9− * License as published by the Free Software Foundation; either
10− * version 2.1 of the License, or (at your option) any later version.
11− *
12− * FFmpeg is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15− * Lesser General Public License for more details.
16− *
17− * You should have received a copy of the GNU Lesser General Public
18− * License along with FFmpeg; if not, write to the Free Software
19− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20− */
21−
22−#include "avcodec.h"
23−#include "opt.h"
24−
25−#if LIBAVCODEC_VERSION_MAJOR < 53 && CONFIG_SHARED && HAVE_SYMVER
26−
27−FF_SYMVER(const AVOption *, av_find_opt, (void *obj, const char *name, const char *unit, int mask, int flags), "LIBAVCODEC_52"){
28− return av_find_opt(obj, name, unit, mask, flags);
29−}
30−FF_SYMVER(int, av_set_string3, (void *obj, const char *name, const char *val, int alloc, const AVOption **o_out), "LIBAVCODEC_52"){
31− return av_set_string3(obj, name, val, alloc, o_out);
32−}
33−FF_SYMVER(const AVOption *, av_set_double, (void *obj, const char *name, double n), "LIBAVCODEC_52"){
34− return av_set_double(obj, name, n);
35−}
36−FF_SYMVER(const AVOption *, av_set_q, (void *obj, const char *name, AVRational n), "LIBAVCODEC_52"){
37− return av_set_q(obj, name, n);
38−}
39−FF_SYMVER(const AVOption *, av_set_int, (void *obj, const char *name, int64_t n), "LIBAVCODEC_52"){
40− return av_set_int(obj, name, n);
41−}
42−FF_SYMVER(double, av_get_double, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
43− return av_get_double(obj, name, o_out);
44−}
45−FF_SYMVER(AVRational, av_get_q, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
46− return av_get_q(obj, name, o_out);
47−}
48−FF_SYMVER(int64_t, av_get_int, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
49− return av_get_int(obj, name, o_out);
50−}
51−FF_SYMVER(const char *, av_get_string, (void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len), "LIBAVCODEC_52"){
52− return av_get_string(obj, name, o_out, buf, buf_len);
53−}
54−FF_SYMVER(const AVOption *, av_next_option, (void *obj, const AVOption *last), "LIBAVCODEC_52"){
55− return av_next_option(obj, last);
56−}
57−FF_SYMVER(int, av_opt_show2, (void *obj, void *av_log_obj, int req_flags, int rej_flags), "LIBAVCODEC_52"){
58− return av_opt_show2(obj, av_log_obj, req_flags, rej_flags);
59−}
60−FF_SYMVER(void, av_opt_set_defaults, (void *s), "LIBAVCODEC_52"){
61− return av_opt_set_defaults(s);
62−}
63−FF_SYMVER(void, av_opt_set_defaults2, (void *s, int mask, int flags), "LIBAVCODEC_52"){
64− return av_opt_set_defaults2(s, mask, flags);
65−}
66−#endif
67−
68−#if FF_API_SET_STRING_OLD
69−const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc){
70− const AVOption *o;
71− if (av_set_string3(obj, name, val, alloc, &o) < 0)
72− return NULL;
73− return o;
74−}
75−
76−const AVOption *av_set_string(void *obj, const char *name, const char *val){
77− const AVOption *o;
78− if (av_set_string3(obj, name, val, 0, &o) < 0)
79− return NULL;
80− return o;
81−}
82−#endif
83−
84−#if FF_API_OPT_SHOW
85−int av_opt_show(void *obj, void *av_log_obj){
86− return av_opt_show2(obj, av_log_obj,
87− AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
88−}
89−#endif
libavcodec/opt.h+0−55
@@ -1,55 +0,0 @@
1−/*
2− * AVOptions
3− * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
4− *
5− * This file is part of FFmpeg.
6− *
7− * FFmpeg is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU Lesser General Public
9− * License as published by the Free Software Foundation; either
10− * version 2.1 of the License, or (at your option) any later version.
11− *
12− * FFmpeg is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15− * Lesser General Public License for more details.
16− *
17− * You should have received a copy of the GNU Lesser General Public
18− * License along with FFmpeg; if not, write to the Free Software
19− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20− */
21−
22−#ifndef AVCODEC_OPT_H
23−#define AVCODEC_OPT_H
24−
25−/**
26− * @file
27− * AVOptions
28− */
29−
30−#include "libavutil/rational.h"
31−#include "avcodec.h"
32−#include "libavutil/opt.h"
33−
34−#if FF_API_SET_STRING_OLD
35−/**
36− * @see av_set_string2()
37− */
38−attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
39−
40−/**
41− * @return a pointer to the AVOption corresponding to the field set or
42− * NULL if no matching AVOption exists, or if the value val is not
43− * valid
44− * @see av_set_string3()
45− */
46−attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
47−#endif
48−#if FF_API_OPT_SHOW
49−/**
50− * @deprecated Use av_opt_show2() instead.
51− */
52−attribute_deprecated int av_opt_show(void *obj, void *av_log_obj);
53−#endif
54−
55−#endif /* AVCODEC_OPT_H */
libavcodec/options.c+0−9
@@ -113,9 +113,6 @@ static const AVOption options[]={ · 112 unmodified lines
113113 {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E},
114114 {"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E},
115115 {"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
116−#if LIBAVCODEC_VERSION_MAJOR < 53
117−{"real_pict_num", NULL, OFFSET(real_pict_num), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
118−#endif
119116 {"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
120117 {"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, 0.5, -FLT_MAX, FLT_MAX, V|E},
121118 {"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), FF_OPT_TYPE_FLOAT, 0.5, 0, FLT_MAX, V|E},
@@ -164,9 +161,6 @@ static const AVOption options[]={ · 42 unmodified lines
164161 {"very", "strictly conform to a older more strict version of the spec or reference software", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_VERY_STRICT, INT_MIN, INT_MAX, V|D|E, "strict"},
165162 {"strict", "strictly conform to all the things in the spec no matter what consequences", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_STRICT, INT_MIN, INT_MAX, V|D|E, "strict"},
166163 {"normal", NULL, 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_NORMAL, INT_MIN, INT_MAX, V|D|E, "strict"},
167−#if FF_API_INOFFICIAL
168−{"inofficial", "allow unofficial extensions (deprecated - use unofficial)", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_UNOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"},
169−#endif
170164 {"unofficial", "allow unofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_UNOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"},
171165 {"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|D|E, "strict"},
172166 {"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E},
@@ -396,9 +390,6 @@ static const AVOption options[]={ · 223 unmodified lines
396390 {"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"},
397391 {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E},
398392 {"compression_level", NULL, OFFSET(compression_level), FF_OPT_TYPE_INT, FF_COMPRESSION_DEFAULT, INT_MIN, INT_MAX, V|A|E},
399−#if FF_API_USE_LPC
400−{"use_lpc", "sets whether to use LPC mode (FLAC)", OFFSET(use_lpc), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
401−#endif
402393 {"lpc_coeff_precision", "LPC coefficient precision (FLAC)", OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|E},
403394 {"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
404395 {"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
libavcodec/parser.c+0−37
@@ -105,43 +105,6 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){ · 104 unmodified lines
105105 }
106106 }
107107
108−#if LIBAVCODEC_VERSION_MAJOR < 53
109−/**
110− *
111− * @param buf input
112− * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output)
113− * @param pts input presentation timestamp
114− * @param dts input decoding timestamp
115− * @param poutbuf will contain a pointer to the first byte of the output frame
116− * @param poutbuf_size will contain the length of the output frame
117− * @return the number of bytes of the input bitstream used
118− *
119− * Example:
120− * @code
121− * while(in_len){
122− * len = av_parser_parse(myparser, AVCodecContext, &data, &size,
123− * in_data, in_len,
124− * pts, dts);
125− * in_data += len;
126− * in_len -= len;
127− *
128− * if(size)
129− * decode_frame(data, size);
130− * }
131− * @endcode
132− *
133− * @deprecated Use av_parser_parse2() instead.
134− */
135−int av_parser_parse(AVCodecParserContext *s,
136− AVCodecContext *avctx,
137− uint8_t **poutbuf, int *poutbuf_size,
138− const uint8_t *buf, int buf_size,
139− int64_t pts, int64_t dts)
140−{
141− return av_parser_parse2(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts, AV_NOPTS_VALUE);
142−}
143−#endif
144−
145108 int av_parser_parse2(AVCodecParserContext *s,
146109 AVCodecContext *avctx,
147110 uint8_t **poutbuf, int *poutbuf_size,
libavcodec/pcm.c+1−1
@@ -71,7 +71,7 @@ static av_cold int pcm_encode_close(AVCodecContext *avctx) · 70 unmodified lines
7171 * @param offset Sample value offset
7272 */
7373 #define ENCODE(type, endian, src, dst, n, shift, offset) \
74− samples_##type = (type*)src; \
74+ samples_##type = (const type*) src; \
7575 for(;n>0;n--) { \
7676 register type v = (*samples_##type++ >> shift) + offset; \
7777 bytestream_put_##endian(&dst, v); \
libavcodec/resample.c+0−11
@@ -218,17 +218,6 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, · 217 unmodified lines
218218 return s;
219219 }
220220
221−#if FF_API_AUDIO_OLD
222−ReSampleContext *audio_resample_init(int output_channels, int input_channels,
223− int output_rate, int input_rate)
224−{
225− return av_audio_resample_init(output_channels, input_channels,
226− output_rate, input_rate,
227− AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
228− TAPS, 10, 0, 0.8);
229−}
230−#endif
231−
232221 /* resample audio. 'nb_samples' is the number of input samples */
233222 /* XXX: optimize it ! */
234223 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples)
libavcodec/utils.c+10−76
@@ -48,7 +48,7 @@ static int volatile entangled_thread_counter=0; · 47 unmodified lines
4848 static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
4949 static void *codec_mutex;
5050
51−void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
51+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
5252 {
5353 if(min_size < *size)
5454 return ptr;
@@ -64,7 +64,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_s · 9 unmodified lines
6464 return ptr;
6565 }
6666
67−void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
67+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
6868 {
6969 void **p = ptr;
7070 if (min_size < *size)
@@ -94,13 +94,6 @@ void avcodec_register(AVCodec *codec) · 23 unmodified lines
9494 codec->next = NULL;
9595 }
9696
97−#if LIBAVCODEC_VERSION_MAJOR < 53
98−void register_avcodec(AVCodec *codec)
99−{
100− avcodec_register(codec);
101−}
102−#endif
103−
10497 unsigned avcodec_get_edge_width(void)
10598 {
10699 return EDGE_WIDTH;
@@ -224,12 +217,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ · 117 unmodified lines
224217 *width=FFALIGN(*width, align);
225218 }
226219
227−#if LIBAVCODEC_VERSION_MAJOR < 53
228−int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
229− return av_image_check_size(w, h, 0, av_log_ctx);
230−}
231−#endif
232−
233220 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
234221 int i;
235222 int w= s->width;
@@ -482,7 +469,7 @@ static void avcodec_get_subtitle_defaults(AVSubtitle *sub) · 246 unmodified lines
482469
483470 int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
484471 {
485− int ret= -1;
472+ int ret = 0;
486473
487474 /* If there is a user-supplied mutex locking routine, call it. */
488475 if (ff_lockmgr_cb) {
@@ -493,11 +480,14 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 4 unmodified lines
493480 entangled_thread_counter++;
494481 if(entangled_thread_counter != 1){
495482 av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
483+ ret = -1;
496484 goto end;
497485 }
498486
499− if(avctx->codec || !codec)
487+ if(avctx->codec || !codec) {
488+ ret = AVERROR(EINVAL);
500489 goto end;
490+ }
501491
502492 if (codec->priv_data_size > 0) {
503493 if(!avctx->priv_data){
@@ -547,6 +537,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 43 unmodified lines
547537 if (avctx->codec_id != codec->id || (avctx->codec_type != codec->type
548538 && avctx->codec_type != AVMEDIA_TYPE_ATTACHMENT)) {
549539 av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n");
540+ ret = AVERROR(EINVAL);
550541 goto free_and_end;
551542 }
552543 avctx->frame_number = 0;
@@ -561,6 +552,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 8 unmodified lines
561552 if (avctx->codec->max_lowres < avctx->lowres) {
562553 av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
563554 avctx->codec->max_lowres);
555+ ret = AVERROR(EINVAL);
564556 goto free_and_end;
565557 }
566558 if (avctx->codec->sample_fmts && avctx->codec->encode) {
@@ -570,6 +562,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 3 unmodified lines
570562 break;
571563 if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) {
572564 av_log(avctx, AV_LOG_ERROR, "Specified sample_fmt is not supported.\n");
565+ ret = AVERROR(EINVAL);
573566 goto free_and_end;
574567 }
575568 }
@@ -736,20 +729,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi · 160 unmodified lines
736729 return ret;
737730 }
738731
739−#if FF_API_AUDIO_OLD
740−int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
741− int *frame_size_ptr,
742− const uint8_t *buf, int buf_size)
743−{
744− AVPacket avpkt;
745− av_init_packet(&avpkt);
746− avpkt.data = buf;
747− avpkt.size = buf_size;
748−
749− return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
750−}
751−#endif
752−
753732 int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
754733 int *frame_size_ptr,
755734 AVPacket *avpkt)
@@ -779,20 +758,6 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa · 23 unmodified lines
779758 return ret;
780759 }
781760
782−#if FF_API_SUBTITLE_OLD
783−int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
784− int *got_sub_ptr,
785− const uint8_t *buf, int buf_size)
786−{
787− AVPacket avpkt;
788− av_init_packet(&avpkt);
789− avpkt.data = buf;
790− avpkt.size = buf_size;
791−
792− return avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, &avpkt);
793−}
794−#endif
795−
796761 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
797762 int *got_sub_ptr,
798763 AVPacket *avpkt)
@@ -1225,20 +1190,6 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v) · 426 unmodified lines
12251190 return n;
12261191 }
12271192
1228−#if LIBAVCODEC_VERSION_MAJOR < 53
1229−#include "libavutil/parseutils.h"
1230−
1231−int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str)
1232−{
1233− return av_parse_video_size(width_ptr, height_ptr, str);
1234−}
1235−
1236−int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg)
1237−{
1238− return av_parse_video_rate(frame_rate, arg);
1239−}
1240−#endif
1241−
12421193 int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b){
12431194 int i;
12441195 for(i=0; i<size && !(tab[i][0]==a && tab[i][1]==b); i++);
@@ -1344,20 +1295,3 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field) · 99 unmodified lines
13441295 }
13451296
13461297 #endif
1347−
1348−#if LIBAVCODEC_VERSION_MAJOR < 53
1349−
1350−int avcodec_thread_init(AVCodecContext *s, int thread_count)
1351−{
1352− s->thread_count = thread_count;
1353− return ff_thread_init(s);
1354−}
1355−
1356−void avcodec_thread_free(AVCodecContext *s)
1357−{
1358−#if HAVE_THREADS
1359− ff_thread_free(s);
1360−#endif
1361−}
1362−
1363−#endif
libavcodec/version.h+2−26
@@ -20,8 +20,8 @@ · 19 unmodified lines
2020 #ifndef AVCODEC_VERSION_H
2121 #define AVCODEC_VERSION_H
2222
23−#define LIBAVCODEC_VERSION_MAJOR 52
24−#define LIBAVCODEC_VERSION_MINOR 120
23+#define LIBAVCODEC_VERSION_MAJOR 53
24+#define LIBAVCODEC_VERSION_MINOR 0
2525 #define LIBAVCODEC_VERSION_MICRO 0
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -41,30 +41,6 @@ · 13 unmodified lines
4141 #ifndef FF_API_PALETTE_CONTROL
4242 #define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54)
4343 #endif
44−#ifndef FF_API_MM_FLAGS
45−#define FF_API_MM_FLAGS (LIBAVCODEC_VERSION_MAJOR < 53)
46−#endif
47−#ifndef FF_API_OPT_SHOW
48−#define FF_API_OPT_SHOW (LIBAVCODEC_VERSION_MAJOR < 53)
49−#endif
50−#ifndef FF_API_AUDIO_OLD
51−#define FF_API_AUDIO_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
52−#endif
53−#ifndef FF_API_VIDEO_OLD
54−#define FF_API_VIDEO_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
55−#endif
56−#ifndef FF_API_SUBTITLE_OLD
57−#define FF_API_SUBTITLE_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
58−#endif
59−#ifndef FF_API_USE_LPC
60−#define FF_API_USE_LPC (LIBAVCODEC_VERSION_MAJOR < 53)
61−#endif
62−#ifndef FF_API_SET_STRING_OLD
63−#define FF_API_SET_STRING_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
64−#endif
65−#ifndef FF_API_INOFFICIAL
66−#define FF_API_INOFFICIAL (LIBAVCODEC_VERSION_MAJOR < 53)
67−#endif
6844 #ifndef FF_API_OLD_SAMPLE_FMT
6945 #define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54)
7046 #endif
libavcodec/xvmc.h+0−21
@@ -25,11 +25,6 @@ · 24 unmodified lines
2525
2626 #include "avcodec.h"
2727
28−#if LIBAVCODEC_VERSION_MAJOR < 53
29−#define AV_XVMC_STATE_DISPLAY_PENDING 1 /** the surface should be shown, the video driver manipulates this */
30−#define AV_XVMC_STATE_PREDICTION 2 /** the surface is needed for prediction, the codec manipulates this */
31−#define AV_XVMC_STATE_OSD_SOURCE 4 /** the surface is needed for subpicture rendering */
32−#endif
3328 #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
3429 the number is 1337 speak for the letters IDCT MCo (motion compensation) */
3530
@@ -151,22 +146,6 @@ struct xvmc_pix_fmt { · 115 unmodified lines
151146 of coded blocks it contains.
152147 */
153148 int next_free_data_block_num;
154−
155−/** extensions may be placed here */
156−#if LIBAVCODEC_VERSION_MAJOR < 53
157−//@{
158− /** State flags used to work around limitations in the MPlayer video system.
159− 0 - Surface is not used.
160− 1 - Surface is still held in application to be displayed or is
161− still visible.
162− 2 - Surface is still held in libavcodec buffer for prediction.
163− */
164− int state;
165−
166− /** pointer to the surface where the subpicture is rendered */
167− void* p_osd_target_surface_render;
168−//}@
169−#endif
170149 };
171150
172151 #endif /* AVCODEC_XVMC_H */
libavdevice/avdevice.h+2−2
@@ -21,8 +21,8 @@ · 20 unmodified lines
2121
2222 #include "libavutil/avutil.h"
2323
24−#define LIBAVDEVICE_VERSION_MAJOR 52
25−#define LIBAVDEVICE_VERSION_MINOR 4
24+#define LIBAVDEVICE_VERSION_MAJOR 53
25+#define LIBAVDEVICE_VERSION_MINOR 0
2626 #define LIBAVDEVICE_VERSION_MICRO 0
2727
2828 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
libavfilter/avfilter.h+3−3
@@ -25,9 +25,9 @@ · 24 unmodified lines
2525 #include "libavutil/avutil.h"
2626 #include "libavutil/samplefmt.h"
2727
28−#define LIBAVFILTER_VERSION_MAJOR 1
29−#define LIBAVFILTER_VERSION_MINOR 79
30−#define LIBAVFILTER_VERSION_MICRO 1
28+#define LIBAVFILTER_VERSION_MAJOR 2
29+#define LIBAVFILTER_VERSION_MINOR 0
30+#define LIBAVFILTER_VERSION_MICRO 0
3131
3232 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3333 LIBAVFILTER_VERSION_MINOR, \
libavformat/Makefile+0−1
@@ -10,7 +10,6 @@ OBJS = allformats.o \ · 9 unmodified lines
1010 id3v1.o \
1111 id3v2.o \
1212 metadata.o \
13− metadata_compat.o \
1413 options.o \
1514 os_support.o \
1615 sdp.o \
libavformat/applehttp.c+2−2
@@ -170,7 +170,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url, · 169 unmodified lines
170170
171171 if (!in) {
172172 close_in = 1;
173− if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0)
173+ if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0)
174174 return ret;
175175 }
176176
@@ -293,7 +293,7 @@ reload: · 116 unmodified lines
293293
294294 ret = ffurl_open(&v->input,
295295 v->segments[v->cur_seq_no - v->start_seq_no]->url,
296− AVIO_RDONLY);
296+ AVIO_FLAG_READ);
297297 if (ret < 0)
298298 return ret;
299299 }
libavformat/applehttpproto.c+3−3
@@ -115,7 +115,7 @@ static int parse_playlist(URLContext *h, const char *url) · 114 unmodified lines
115115 char line[1024];
116116 const char *ptr;
117117
118− if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0)
118+ if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0)
119119 return ret;
120120
121121 read_chomp_line(in, line, sizeof(line));
@@ -180,7 +180,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags) · 58 unmodified lines
180180 int ret, i;
181181 const char *nested_url;
182182
183− if (flags & (AVIO_WRONLY | AVIO_RDWR))
183+ if (flags & AVIO_FLAG_WRITE)
184184 return AVERROR(ENOSYS);
185185
186186 s = av_mallocz(sizeof(AppleHTTPContext));
@@ -275,7 +275,7 @@ retry: · 88 unmodified lines
275275 }
276276 url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
277277 av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url);
278− ret = ffurl_open(&s->seg_hd, url, AVIO_RDONLY);
278+ ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ);
279279 if (ret < 0) {
280280 if (url_interrupt_cb())
281281 return AVERROR_EXIT;
libavformat/avformat.h+0−103
@@ -133,20 +133,6 @@ typedef struct AVMetadataConv AVMetadataConv; · 132 unmodified lines
133133 AVMetadataTag *
134134 av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
135135
136−#if FF_API_OLD_METADATA
137−/**
138− * Set the given tag in *pm, overwriting an existing tag.
139− *
140− * @param pm pointer to a pointer to a metadata struct. If *pm is NULL
141− * a metadata struct is allocated and put in *pm.
142− * @param key tag key to add to *pm (will be av_strduped)
143− * @param value tag value to add to *pm (will be av_strduped)
144− * @return >= 0 on success otherwise an error code <0
145− * @deprecated Use av_metadata_set2() instead.
146− */
147−attribute_deprecated int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
148−#endif
149−
150136 /**
151137 * Set the given tag in *pm, overwriting an existing tag.
152138 *
@@ -256,10 +242,6 @@ typedef struct AVFormatParameters { · 103 unmodified lines
256242 unsigned int initial_pause:1; /**< Do not begin to play the stream
257243 immediately (RTSP only). */
258244 unsigned int prealloced_context:1;
259−#if FF_API_PARAMETERS_CODEC_ID
260− attribute_deprecated enum CodecID video_codec_id;
261− attribute_deprecated enum CodecID audio_codec_id;
262−#endif
263245 } AVFormatParameters;
264246
265247 //! Demuxer will use avio_open, no opened file should be provided by the caller.
@@ -546,10 +528,6 @@ typedef struct AVStream { · 280 unmodified lines
546528 */
547529 int64_t duration;
548530
549−#if FF_API_OLD_METADATA
550− attribute_deprecated char language[4]; /**< ISO 639-2/B 3-letter language code (empty string if undefined) */
551−#endif
552−
553531 /* av_read_frame() support */
554532 enum AVStreamParseType need_parsing;
555533 struct AVCodecParserContext *parser;
@@ -565,14 +543,6 @@ typedef struct AVStream { · 9 unmodified lines
565543
566544 int64_t nb_frames; ///< number of frames in this stream if known or 0
567545
568−#if FF_API_LAVF_UNUSED
569− attribute_deprecated int64_t unused[4+1];
570−#endif
571−
572−#if FF_API_OLD_METADATA
573− attribute_deprecated char *filename; /**< source filename of the stream */
574−#endif
575−
576546 int disposition; /**< AV_DISPOSITION_* bit field */
577547
578548 AVProbeData probe_data;
@@ -656,10 +626,6 @@ typedef struct AVStream { · 77 unmodified lines
656626 */
657627 typedef struct AVProgram {
658628 int id;
659−#if FF_API_OLD_METADATA
660− attribute_deprecated char *provider_name; ///< network name for DVB streams
661− attribute_deprecated char *name; ///< service name for DVB streams
662−#endif
663629 int flags;
664630 enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller
665631 unsigned int *stream_index;
@@ -674,16 +640,9 @@ typedef struct AVChapter { · 8 unmodified lines
674640 int id; ///< unique ID to identify the chapter
675641 AVRational time_base; ///< time base in which the start/end timestamps are specified
676642 int64_t start, end; ///< chapter start/end time in time_base units
677−#if FF_API_OLD_METADATA
678− attribute_deprecated char *title; ///< chapter title
679−#endif
680643 AVMetadata *metadata;
681644 } AVChapter;
682645
683−#if FF_API_MAX_STREAMS
684−#define MAX_STREAMS 20
685−#endif
686−
687646 /**
688647 * Format I/O context.
689648 * New fields can be added to the end with minor version bumps.
@@ -699,24 +658,10 @@ typedef struct AVFormatContext { · 9 unmodified lines
699658 void *priv_data;
700659 AVIOContext *pb;
701660 unsigned int nb_streams;
702−#if FF_API_MAX_STREAMS
703− AVStream *streams[MAX_STREAMS];
704−#else
705661 AVStream **streams;
706−#endif
707662 char filename[1024]; /**< input or output filename */
708663 /* stream info */
709664 int64_t timestamp;
710−#if FF_API_OLD_METADATA
711− attribute_deprecated char title[512];
712− attribute_deprecated char author[512];
713− attribute_deprecated char copyright[512];
714− attribute_deprecated char comment[512];
715− attribute_deprecated char album[512];
716− attribute_deprecated int year; /**< ID3 year, 0 if none */
717− attribute_deprecated int track; /**< track number, 0 if none */
718− attribute_deprecated char genre[32]; /**< ID3 genre */
719−#endif
720665
721666 int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
722667 /* private data for pts handling (do not modify directly). */
@@ -756,17 +701,9 @@ typedef struct AVFormatContext { · 33 unmodified lines
756701
757702 /* av_read_frame() support */
758703 AVStream *cur_st;
759−#if FF_API_LAVF_UNUSED
760− const uint8_t *cur_ptr_deprecated;
761− int cur_len_deprecated;
762− AVPacket cur_pkt_deprecated;
763−#endif
764704
765705 /* av_seek_frame() support */
766706 int64_t data_offset; /**< offset of the first packet */
767−#if FF_API_INDEX_BUILT
768− attribute_deprecated int index_built;
769−#endif
770707
771708 int mux_rate;
772709 unsigned int packet_size;
@@ -888,11 +825,6 @@ typedef struct AVPacketList { · 115 unmodified lines
888825 struct AVPacketList *next;
889826 } AVPacketList;
890827
891−#if FF_API_FIRST_FORMAT
892−attribute_deprecated extern AVInputFormat *first_iformat;
893−attribute_deprecated extern AVOutputFormat *first_oformat;
894−#endif
895−
896828 /**
897829 * If f is NULL, returns the first registered input format,
898830 * if f is non-NULL, returns the next registered input format after f
@@ -917,18 +849,6 @@ attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename); · 18 unmodified lines
917849 /* utils.c */
918850 void av_register_input_format(AVInputFormat *format);
919851 void av_register_output_format(AVOutputFormat *format);
920−#if FF_API_GUESS_FORMAT
921−attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name,
922− const char *filename,
923− const char *mime_type);
924−
925−/**
926− * @deprecated Use av_guess_format() instead.
927− */
928−attribute_deprecated AVOutputFormat *guess_format(const char *short_name,
929− const char *filename,
930− const char *mime_type);
931−#endif
932852
933853 /**
934854 * Return the output format in the list of registered output formats
@@ -1119,13 +1039,6 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, · 184 unmodified lines
11191039 int buf_size,
11201040 AVFormatParameters *ap);
11211041
1122−#if FF_API_ALLOC_FORMAT_CONTEXT
1123−/**
1124− * @deprecated Use avformat_alloc_context() instead.
1125− */
1126−attribute_deprecated AVFormatContext *av_alloc_format_context(void);
1127−#endif
1128−
11291042 /**
11301043 * Allocate an AVFormatContext.
11311044 * avformat_free_context() can be used to free the context and everything
@@ -1492,22 +1405,6 @@ void av_dump_format(AVFormatContext *ic, · 360 unmodified lines
14921405 const char *url,
14931406 int is_output);
14941407
1495−#if FF_API_PARSE_FRAME_PARAM
1496−/**
1497− * Parse width and height out of string str.
1498− * @deprecated Use av_parse_video_frame_size instead.
1499− */
1500−attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr,
1501− const char *str);
1502−
1503−/**
1504− * Convert framerate from a string to a fraction.
1505− * @deprecated Use av_parse_video_frame_rate instead.
1506− */
1507−attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base,
1508− const char *arg);
1509−#endif
1510−
15111408 #if FF_API_PARSE_DATE
15121409 /**
15131410 * Parse datestr and return a corresponding number of microseconds.
libavformat/avio.c+5−32
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #endif
3232 #include "url.h"
3333
34−#if FF_API_URL_CLASS
3534 /** @name Logging context. */
3635 /*@{*/
3736 static const char *urlcontext_to_name(void *ptr)
@@ -44,7 +43,6 @@ static const AVOption options[] = {{NULL}}; · 6 unmodified lines
4443 static const AVClass urlcontext_class =
4544 { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT };
4645 /*@}*/
47−#endif
4846
4947 static int default_interrupt_cb(void);
5048
@@ -82,29 +80,6 @@ int ffurl_register_protocol(URLProtocol *protocol, int size) · 31 unmodified lines
8280 return 0;
8381 }
8482
85−#if FF_API_REGISTER_PROTOCOL
86−/* The layout of URLProtocol as of when major was bumped to 52 */
87−struct URLProtocol_compat {
88− const char *name;
89− int (*url_open)(URLContext *h, const char *filename, int flags);
90− int (*url_read)(URLContext *h, unsigned char *buf, int size);
91− int (*url_write)(URLContext *h, unsigned char *buf, int size);
92− int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
93− int (*url_close)(URLContext *h);
94− struct URLProtocol *next;
95−};
96−
97−int av_register_protocol(URLProtocol *protocol)
98−{
99− return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat));
100−}
101−
102−int register_protocol(URLProtocol *protocol)
103−{
104− return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat));
105−}
106−#endif
107−
10883 static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
10984 const char *filename, int flags)
11085 {
@@ -120,9 +95,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, · 9 unmodified lines
12095 err = AVERROR(ENOMEM);
12196 goto fail;
12297 }
123−#if FF_API_URL_CLASS
12498 uc->av_class = &urlcontext_class;
125−#endif
12699 uc->filename = (char *) &uc[1];
127100 strcpy(uc->filename, filename);
128101 uc->prot = up;
@@ -154,7 +127,7 @@ int ffurl_connect(URLContext* uc) · 25 unmodified lines
154127 return err;
155128 uc->is_connected = 1;
156129 //We must be careful here as ffurl_seek() could be slow, for example for http
157− if( (uc->flags & (AVIO_WRONLY | AVIO_RDWR))
130+ if( (uc->flags & AVIO_FLAG_WRITE)
158131 || !strcmp(uc->prot->name, "file"))
159132 if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0)
160133 uc->is_streamed= 1;
@@ -314,21 +287,21 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int · 153 unmodified lines
314287
315288 int ffurl_read(URLContext *h, unsigned char *buf, int size)
316289 {
317− if (h->flags & AVIO_WRONLY)
290+ if (h->flags & AVIO_FLAG_WRITE)
318291 return AVERROR(EIO);
319292 return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
320293 }
321294
322295 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
323296 {
324− if (h->flags & AVIO_WRONLY)
297+ if (h->flags & AVIO_FLAG_WRITE)
325298 return AVERROR(EIO);
326299 return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
327300 }
328301
329302 int ffurl_write(URLContext *h, const unsigned char *buf, int size)
330303 {
331− if (!(h->flags & (AVIO_WRONLY | AVIO_RDWR)))
304+ if (!(h->flags & AVIO_FLAG_WRITE))
332305 return AVERROR(EIO);
333306 /* avoid sending too big packets */
334307 if (h->max_packet_size && size > h->max_packet_size)
@@ -367,7 +340,7 @@ int ffurl_close(URLContext *h) · 32 unmodified lines
367340 int url_exist(const char *filename)
368341 {
369342 URLContext *h;
370− if (ffurl_open(&h, filename, AVIO_RDONLY) < 0)
343+ if (ffurl_open(&h, filename, AVIO_FLAG_READ) < 0)
371344 return 0;
372345 ffurl_close(h);
373346 return 1;
libavformat/avio.h+4−47
@@ -101,9 +101,7 @@ typedef struct { · 100 unmodified lines
101101 * @deprecated This struct will be made private
102102 */
103103 typedef struct URLContext {
104−#if FF_API_URL_CLASS
105104 const AVClass *av_class; ///< information for av_log(). Set by url_open().
106−#endif
107105 struct URLProtocol *prot;
108106 int flags;
109107 int is_streamed; /**< true if streamed (no seek possible), default = false */
@@ -346,7 +344,7 @@ attribute_deprecated int url_exist(const char *url); · 236 unmodified lines
346344 #endif // FF_API_OLD_AVIO
347345
348346 /**
349− * Return AVIO_* access flags corresponding to the access permissions
347+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
350348 * of the resource in url, or a negative value corresponding to an
351349 * AVERROR code in case of failure. The returned access flags are
352350 * masked by the value in flags.
@@ -356,9 +354,6 @@ attribute_deprecated int url_exist(const char *url); · 3 unmodified lines
356354 * one call to another. Thus you should not trust the returned value,
357355 * unless you are sure that no other processes are accessing the
358356 * checked resource.
359− *
360− * @note This function is slightly broken until next major bump
361− * because of AVIO_RDONLY == 0. Don't use it until then.
362357 */
363358 int avio_check(const char *url, int flags);
364359
@@ -370,22 +365,6 @@ int avio_check(const char *url, int flags); · 5 unmodified lines
370365 */
371366 void avio_set_interrupt_cb(int (*interrupt_cb)(void));
372367
373−#if FF_API_REGISTER_PROTOCOL
374−extern URLProtocol *first_protocol;
375−#endif
376−
377−#if FF_API_REGISTER_PROTOCOL
378−/**
379− * @deprecated Use av_register_protocol() instead.
380− */
381−attribute_deprecated int register_protocol(URLProtocol *protocol);
382−
383−/**
384− * @deprecated Use av_register_protocol2() instead.
385− */
386−attribute_deprecated int av_register_protocol(URLProtocol *protocol);
387−#endif
388−
389368 /**
390369 * Allocate and initialize an AVIOContext for buffered I/O. It must be later
391370 * freed with av_free().
@@ -542,29 +521,15 @@ int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen); · 150 unmodified lines
542521 int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
543522
544523
545−#if FF_API_URL_RESETBUF
546−/** Reset the buffer for reading or writing.
547− * @note Will drop any data currently in the buffer without transmitting it.
548− * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
549− * to set up the buffer for writing. */
550−int url_resetbuf(AVIOContext *s, int flags);
551−#endif
552−
553524 /**
554525 * @defgroup open_modes URL open modes
555526 * The flags argument to avio_open must be one of the following
556527 * constants, optionally ORed with other flags.
557528 * @{
558529 */
559−#if LIBAVFORMAT_VERSION_MAJOR < 53
560−#define AVIO_RDONLY 0 /**< read-only */
561−#define AVIO_WRONLY 1 /**< write-only */
562−#define AVIO_RDWR 2 /**< read-write */
563−#else
564−#define AVIO_RDONLY 1 /**< read-only */
565−#define AVIO_WRONLY 2 /**< write-only */
566−#define AVIO_RDWR 4 /**< read-write */
567−#endif
530+#define AVIO_FLAG_READ 1 /**< read-only */
531+#define AVIO_FLAG_WRITE 2 /**< write-only */
532+#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
568533 /**
569534 * @}
570535 */
@@ -581,11 +546,7 @@ int url_resetbuf(AVIOContext *s, int flags); · 10 unmodified lines
581546 * Warning: non-blocking protocols is work-in-progress; this flag may be
582547 * silently ignored.
583548 */
584−#if LIBAVFORMAT_VERSION_MAJOR < 53
585−#define AVIO_FLAG_NONBLOCK 4
586−#else
587549 #define AVIO_FLAG_NONBLOCK 8
588−#endif
589550
590551 /**
591552 * Create and initialize a AVIOContext for accessing the
@@ -629,10 +590,6 @@ int avio_open_dyn_buf(AVIOContext **s); · 37 unmodified lines
629590 */
630591 int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
631592
632−#if FF_API_UDP_GET_FILE
633−int udp_get_file_handle(URLContext *h);
634−#endif
635−
636593 /**
637594 * Iterate through names of available protocols.
638595 * @note it is recommanded to use av_protocol_next() instead of this
libavformat/aviobuf.c+6−17
@@ -38,9 +38,7 @@ · 37 unmodified lines
3838 #define SHORT_SEEK_THRESHOLD 4096
3939
4040 static void fill_buffer(AVIOContext *s);
41−#if !FF_API_URL_RESETBUF
4241 static int url_resetbuf(AVIOContext *s, int flags);
43−#endif
4442
4543 int ffio_init_context(AVIOContext *s,
4644 unsigned char *buffer,
@@ -55,7 +53,7 @@ int ffio_init_context(AVIOContext *s, · 8 unmodified lines
5553 s->buffer_size = buffer_size;
5654 s->buf_ptr = buffer;
5755 s->opaque = opaque;
58− url_resetbuf(s, write_flag ? AVIO_WRONLY : AVIO_RDONLY);
56+ url_resetbuf(s, write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
5957 s->write_packet = write_packet;
6058 s->read_packet = read_packet;
6159 s->seek = seek;
@@ -854,7 +852,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) · 792 unmodified lines
854852 }
855853
856854 if (ffio_init_context(*s, buffer, buffer_size,
857− (h->flags & AVIO_WRONLY || h->flags & AVIO_RDWR), h,
855+ h->flags & AVIO_FLAG_WRITE, h,
858856 ffurl_read, ffurl_write, ffurl_seek) < 0) {
859857 av_free(buffer);
860858 av_freep(s);
@@ -883,24 +881,15 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) · 22 unmodified lines
883881 s->buffer = buffer;
884882 s->buffer_size = buf_size;
885883 s->buf_ptr = buffer;
886− url_resetbuf(s, s->write_flag ? AVIO_WRONLY : AVIO_RDONLY);
884+ url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
887885 return 0;
888886 }
889887
890−#if FF_API_URL_RESETBUF
891−int url_resetbuf(AVIOContext *s, int flags)
892−#else
893888 static int url_resetbuf(AVIOContext *s, int flags)
894−#endif
895889 {
896−#if FF_API_URL_RESETBUF
897− if (flags & AVIO_RDWR)
898− return AVERROR(EINVAL);
899−#else
900− assert(flags == AVIO_WRONLY || flags == AVIO_RDONLY);
901−#endif
890+ assert(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ);
902891
903− if (flags & AVIO_WRONLY) {
892+ if (flags & AVIO_FLAG_WRITE) {
904893 s->buf_end = s->buffer + s->buffer_size;
905894 s->write_flag = 1;
906895 } else {
@@ -1058,7 +1047,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags) · 151 unmodified lines
10581047 if(!*s)
10591048 return AVERROR(ENOMEM);
10601049 ret = ffio_init_context(*s, buf, buf_size,
1061− (flags & AVIO_WRONLY || flags & AVIO_RDWR),
1050+ flags & AVIO_FLAG_WRITE,
10621051 NULL, NULL, NULL, NULL);
10631052 if(ret != 0)
10641053 av_freep(s);
libavformat/file.c+5−6
@@ -60,9 +60,9 @@ static int file_open(URLContext *h, const char *filename, int flags) · 59 unmodified lines
6060
6161 av_strstart(filename, "file:", &filename);
6262
63− if (flags & AVIO_RDWR) {
63+ if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) {
6464 access = O_CREAT | O_TRUNC | O_RDWR;
65− } else if (flags & AVIO_WRONLY) {
65+ } else if (flags & AVIO_FLAG_WRITE) {
6666 access = O_CREAT | O_TRUNC | O_WRONLY;
6767 } else {
6868 access = O_RDONLY;
@@ -102,9 +102,8 @@ static int file_check(URLContext *h, int mask) · 33 unmodified lines
102102 if (ret < 0)
103103 return AVERROR(errno);
104104
105− ret |= st.st_mode&S_IRUSR ? mask&AVIO_RDONLY : 0;
106− ret |= st.st_mode&S_IWUSR ? mask&AVIO_WRONLY : 0;
107− ret |= st.st_mode&S_IWUSR && st.st_mode&S_IRUSR ? mask&AVIO_RDWR : 0;
105+ ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0;
106+ ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
108107
109108 return ret;
110109 }
@@ -132,7 +131,7 @@ static int pipe_open(URLContext *h, const char *filename, int flags) · 21 unmodified lines
132131
133132 fd = strtol(filename, &final, 10);
134133 if((filename == final) || *final ) {/* No digits found, or something like 10ab */
135− if (flags & AVIO_WRONLY) {
134+ if (flags & AVIO_FLAG_WRITE) {
136135 fd = 1;
137136 } else {
138137 fd = 0;
libavformat/gopher.c+1−1
@@ -100,7 +100,7 @@ static int gopher_open(URLContext *h, const char *uri, int flags) · 99 unmodified lines
100100 ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
101101
102102 s->hd = NULL;
103− err = ffurl_open(&s->hd, buf, AVIO_RDWR);
103+ err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE);
104104 if (err < 0)
105105 goto fail;
106106
libavformat/http.c+3−3
@@ -124,7 +124,7 @@ static int http_open_cnx(URLContext *h) · 123 unmodified lines
124124 port = 80;
125125
126126 ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
127− err = ffurl_open(&hd, buf, AVIO_RDWR);
127+ err = ffurl_open(&hd, buf, AVIO_FLAG_READ_WRITE);
128128 if (err < 0)
129129 goto fail;
130130
@@ -296,7 +296,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, · 165 unmodified lines
296296
297297
298298 /* send http header */
299− post = h->flags & AVIO_WRONLY;
299+ post = h->flags & AVIO_FLAG_WRITE;
300300 authstr = ff_http_auth_create_response(&s->auth_state, auth, path,
301301 post ? "POST" : "GET");
302302
@@ -451,7 +451,7 @@ static int http_close(URLContext *h) · 148 unmodified lines
451451 HTTPContext *s = h->priv_data;
452452
453453 /* signal end of chunked encoding if used */
454− if ((h->flags & AVIO_WRONLY) && s->chunksize != -1) {
454+ if ((h->flags & AVIO_FLAG_WRITE) && s->chunksize != -1) {
455455 ret = ffurl_write(s->hd, footer, sizeof(footer) - 1);
456456 ret = ret > 0 ? 0 : ret;
457457 }
libavformat/img2.c+5−5
@@ -133,11 +133,11 @@ static int find_image_range(int *pfirst_index, int *plast_index, · 132 unmodified lines
133133 if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
134134 *pfirst_index =
135135 *plast_index = 1;
136− if(url_exist(buf))
136+ if (avio_check(buf, AVIO_FLAG_READ) > 0)
137137 return 0;
138138 return -1;
139139 }
140− if (url_exist(buf))
140+ if (avio_check(buf, AVIO_FLAG_READ) > 0)
141141 break;
142142 }
143143 if (first_index == 5)
@@ -155,7 +155,7 @@ static int find_image_range(int *pfirst_index, int *plast_index, · 11 unmodified lines
155155 if (av_get_frame_filename(buf, sizeof(buf), path,
156156 last_index + range1) < 0)
157157 goto fail;
158− if (!url_exist(buf))
158+ if (avio_check(buf, AVIO_FLAG_READ) <= 0)
159159 break;
160160 range = range1;
161161 /* just in case... */
@@ -282,7 +282,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt) · 120 unmodified lines
282282 s->path, s->img_number)<0 && s->img_number > 1)
283283 return AVERROR(EIO);
284284 for(i=0; i<3; i++){
285− if (avio_open(&f[i], filename, AVIO_RDONLY) < 0) {
285+ if (avio_open(&f[i], filename, AVIO_FLAG_READ) < 0) {
286286 if(i==1)
287287 break;
288288 av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename);
@@ -369,7 +369,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) · 80 unmodified lines
369369 return AVERROR(EIO);
370370 }
371371 for(i=0; i<3; i++){
372− if (avio_open(&pb[i], filename, AVIO_WRONLY) < 0) {
372+ if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) {
373373 av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename);
374374 return AVERROR(EIO);
375375 }
libavformat/internal.h+0−12
@@ -79,18 +79,6 @@ void ff_read_frame_flush(AVFormatContext *s); · 78 unmodified lines
7979 /** Get the current time since NTP epoch in microseconds. */
8080 uint64_t ff_ntp_time(void);
8181
82−#if FF_API_URL_SPLIT
83−/**
84− * @deprecated use av_url_split() instead
85− */
86−void ff_url_split(char *proto, int proto_size,
87− char *authorization, int authorization_size,
88− char *hostname, int hostname_size,
89− int *port_ptr,
90− char *path, int path_size,
91− const char *url);
92−#endif
93−
9482 /**
9583 * Assemble a URL string from components. This is the reverse operation
9684 * of av_url_split.
libavformat/librtmp.c+1−1
@@ -94,7 +94,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 93 unmodified lines
9494 goto fail;
9595 }
9696
97− if (flags & AVIO_WRONLY)
97+ if (flags & AVIO_FLAG_WRITE)
9898 RTMP_EnableWrite(r);
9999
100100 if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) {
libavformat/matroskadec.c+1−1
@@ -1334,7 +1334,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) · 1333 unmodified lines
13341334 && track->codec_priv.data != NULL) {
13351335 int ret;
13361336 ffio_init_context(&b, track->codec_priv.data, track->codec_priv.size,
1337− AVIO_RDONLY, NULL, NULL, NULL, NULL);
1337+ AVIO_FLAG_READ, NULL, NULL, NULL, NULL);
13381338 ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size);
13391339 if (ret < 0)
13401340 return ret;
libavformat/md5proto.c+2−2
@@ -36,7 +36,7 @@ static int md5_open(URLContext *h, const char *filename, int flags) · 35 unmodified lines
3636 return -1;
3737 }
3838
39− if (flags != AVIO_WRONLY)
39+ if (!flags & AVIO_FLAG_WRITE)
4040 return AVERROR(EINVAL);
4141
4242 av_md5_init(h->priv_data);
@@ -65,7 +65,7 @@ static int md5_close(URLContext *h) · 22 unmodified lines
6565 av_strstart(filename, "md5:", &filename);
6666
6767 if (*filename) {
68− err = ffurl_open(&out, filename, AVIO_WRONLY);
68+ err = ffurl_open(&out, filename, AVIO_FLAG_WRITE);
6969 if (err)
7070 return err;
7171 err = ffurl_write(out, buf, i*2+1);
libavformat/metadata.c+0−7
@@ -86,13 +86,6 @@ int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int fl · 85 unmodified lines
8686 return 0;
8787 }
8888
89−#if FF_API_OLD_METADATA
90−int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
91−{
92− return av_metadata_set2(pm, key, value, 0);
93−}
94−#endif
95−
9689 #if FF_API_OLD_METADATA2
9790 void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv,
9891 const AVMetadataConv *s_conv)
libavformat/metadata.h+0−5
@@ -43,11 +43,6 @@ struct AVMetadataConv{ · 42 unmodified lines
4343 typedef struct AVMetadataConv AVMetadataConv;
4444 #endif
4545
46−#if FF_API_OLD_METADATA
47−void ff_metadata_demux_compat(AVFormatContext *s);
48−void ff_metadata_mux_compat(AVFormatContext *s);
49−#endif
50−
5146 void ff_metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
5247 const AVMetadataConv *s_conv);
5348 void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv,
libavformat/metadata_compat.c+0−148
@@ -1,148 +0,0 @@
1−/*
2− * Copyright (c) 2009 Aurelien Jacobs <aurel@gnuage.org>
3− *
4− * This file is part of FFmpeg.
5− *
6− * FFmpeg is free software; you can redistribute it and/or
7− * modify it under the terms of the GNU Lesser General Public
8− * License as published by the Free Software Foundation; either
9− * version 2.1 of the License, or (at your option) any later version.
10− *
11− * FFmpeg is distributed in the hope that it will be useful,
12− * but WITHOUT ANY WARRANTY; without even the implied warranty of
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14− * Lesser General Public License for more details.
15− *
16− * You should have received a copy of the GNU Lesser General Public
17− * License along with FFmpeg; if not, write to the Free Software
18− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19− */
20−
21−#include <strings.h>
22−#include "avformat.h"
23−#include "metadata.h"
24−#include "libavutil/avstring.h"
25−
26−#if FF_API_OLD_METADATA
27−
28−#define SIZE_OFFSET(x) sizeof(((AVFormatContext*)0)->x),offsetof(AVFormatContext,x)
29−
30−static const struct {
31− const char name[16];
32− int size;
33− int offset;
34−} compat_tab[] = {
35− { "title", SIZE_OFFSET(title) },
36− { "author", SIZE_OFFSET(author) },
37− { "copyright", SIZE_OFFSET(copyright) },
38− { "comment", SIZE_OFFSET(comment) },
39− { "album", SIZE_OFFSET(album) },
40− { "year", SIZE_OFFSET(year) },
41− { "track", SIZE_OFFSET(track) },
42− { "genre", SIZE_OFFSET(genre) },
43−
44− { "artist", SIZE_OFFSET(author) },
45− { "creator", SIZE_OFFSET(author) },
46− { "written_by", SIZE_OFFSET(author) },
47− { "lead_performer", SIZE_OFFSET(author) },
48− { "composer", SIZE_OFFSET(author) },
49− { "performer", SIZE_OFFSET(author) },
50− { "description", SIZE_OFFSET(comment) },
51− { "albumtitle", SIZE_OFFSET(album) },
52− { "date", SIZE_OFFSET(year) },
53− { "date_written", SIZE_OFFSET(year) },
54− { "date_released", SIZE_OFFSET(year) },
55− { "tracknumber", SIZE_OFFSET(track) },
56− { "part_number", SIZE_OFFSET(track) },
57−};
58−
59−void ff_metadata_demux_compat(AVFormatContext *ctx)
60−{
61− AVMetadata *m;
62− int i, j;
63−
64− if ((m = ctx->metadata))
65− for (j=0; j<m->count; j++)
66− for (i=0; i<FF_ARRAY_ELEMS(compat_tab); i++)
67− if (!strcasecmp(m->elems[j].key, compat_tab[i].name)) {
68− int *ptr = (int *)((char *)ctx+compat_tab[i].offset);
69− if (*ptr) continue;
70− if (compat_tab[i].size > sizeof(int))
71− av_strlcpy((char *)ptr, m->elems[j].value, compat_tab[i].size);
72− else
73− *ptr = atoi(m->elems[j].value);
74− }
75−
76− for (i=0; i<ctx->nb_chapters; i++)
77− if ((m = ctx->chapters[i]->metadata))
78− for (j=0; j<m->count; j++)
79− if (!strcasecmp(m->elems[j].key, "title")) {
80− av_free(ctx->chapters[i]->title);
81− ctx->chapters[i]->title = av_strdup(m->elems[j].value);
82− }
83−
84− for (i=0; i<ctx->nb_programs; i++)
85− if ((m = ctx->programs[i]->metadata))
86− for (j=0; j<m->count; j++) {
87− if (!strcasecmp(m->elems[j].key, "name")) {
88− av_free(ctx->programs[i]->name);
89− ctx->programs[i]->name = av_strdup(m->elems[j].value);
90− }
91− if (!strcasecmp(m->elems[j].key, "provider_name")) {
92− av_free(ctx->programs[i]->provider_name);
93− ctx->programs[i]->provider_name = av_strdup(m->elems[j].value);
94− }
95− }
96−
97− for (i=0; i<ctx->nb_streams; i++)
98− if ((m = ctx->streams[i]->metadata))
99− for (j=0; j<m->count; j++) {
100− if (!strcasecmp(m->elems[j].key, "language"))
101− av_strlcpy(ctx->streams[i]->language, m->elems[j].value, 4);
102− if (!strcasecmp(m->elems[j].key, "filename")) {
103− av_free(ctx->streams[i]->filename);
104− ctx->streams[i]->filename= av_strdup(m->elems[j].value);
105− }
106− }
107−}
108−
109−
110−#define FILL_METADATA(s, key, value) { \
111− if (!av_metadata_get(s->metadata, #key, NULL, 0)) \
112− av_metadata_set2(&s->metadata, #key, value, 0); \
113− }
114−#define FILL_METADATA_STR(s, key) { \
115− if (s->key && *s->key) FILL_METADATA(s, key, s->key); }
116−#define FILL_METADATA_INT(s, key) { \
117− char number[10]; \
118− snprintf(number, sizeof(number), "%d", s->key); \
119− if(s->key) FILL_METADATA(s, key, number) }
120−
121−void ff_metadata_mux_compat(AVFormatContext *ctx)
122−{
123− int i;
124−
125− if (ctx->metadata && ctx->metadata->count > 0)
126− return;
127−
128− FILL_METADATA_STR(ctx, title);
129− FILL_METADATA_STR(ctx, author);
130− FILL_METADATA_STR(ctx, copyright);
131− FILL_METADATA_STR(ctx, comment);
132− FILL_METADATA_STR(ctx, album);
133− FILL_METADATA_INT(ctx, year);
134− FILL_METADATA_INT(ctx, track);
135− FILL_METADATA_STR(ctx, genre);
136− for (i=0; i<ctx->nb_chapters; i++)
137− FILL_METADATA_STR(ctx->chapters[i], title);
138− for (i=0; i<ctx->nb_programs; i++) {
139− FILL_METADATA_STR(ctx->programs[i], name);
140− FILL_METADATA_STR(ctx->programs[i], provider_name);
141− }
142− for (i=0; i<ctx->nb_streams; i++) {
143− FILL_METADATA_STR(ctx->streams[i], language);
144− FILL_METADATA_STR(ctx->streams[i], filename);
145− }
146−}
147−
148−#endif /* FF_API_OLD_METADATA */
libavformat/mms.c+0−4
@@ -24,11 +24,7 @@ · 23 unmodified lines
2424 #include "asf.h"
2525 #include "libavutil/intreadwrite.h"
2626
27−#if FF_API_MAX_STREAMS
28−#define MMS_MAX_STREAMS MAX_STREAMS
29−#else
3027 #define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */
31−#endif
3228
3329 int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
3430 {
libavformat/mmsh.c+2−2
@@ -233,7 +233,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) · 232 unmodified lines
233233 port = 80; // default mmsh protocol port
234234 ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, path);
235235
236− if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_RDONLY) < 0) {
236+ if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ) < 0) {
237237 return AVERROR(EIO);
238238 }
239239
@@ -261,7 +261,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) · 21 unmodified lines
261261 // close the socket and then reopen it for sending the second play request.
262262 ffurl_close(mms->mms_hd);
263263 memset(headers, 0, sizeof(headers));
264− if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_RDONLY) < 0) {
264+ if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ) < 0) {
265265 return AVERROR(EIO);
266266 }
267267 stream_selection = av_mallocz(mms->stream_num * 19 + 1);
libavformat/mmst.c+1−1
@@ -523,7 +523,7 @@ static int mms_open(URLContext *h, const char *uri, int flags) · 522 unmodified lines
523523
524524 // establish tcp connection.
525525 ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL);
526− err = ffurl_open(&mms->mms_hd, tcpname, AVIO_RDWR);
526+ err = ffurl_open(&mms->mms_hd, tcpname, AVIO_FLAG_READ_WRITE);
527527 if (err)
528528 goto fail;
529529
libavformat/mov.c+1−1
@@ -1721,7 +1721,7 @@ static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref) · 1720 unmodified lines
17211721
17221722 av_strlcat(filename, ref->path + l + 1, 1024);
17231723
1724− if (!avio_open(pb, filename, AVIO_RDONLY))
1724+ if (!avio_open(pb, filename, AVIO_FLAG_READ))
17251725 return 0;
17261726 }
17271727 }
libavformat/mpegts.c+0−5
@@ -676,11 +676,6 @@ static int mpegts_push_data(MpegTSFilter *filter, · 675 unmodified lines
676676 code == 0x1be) /* padding_stream */
677677 goto skip;
678678
679−#if FF_API_MAX_STREAMS
680− if (!pes->st && pes->stream->nb_streams == MAX_STREAMS)
681− goto skip;
682−#endif
683−
684679 /* stream not present in PMT */
685680 if (!pes->st) {
686681 pes->st = av_new_stream(ts->stream, pes->pid);
libavformat/nutdec.c+0−4
@@ -30,11 +30,7 @@ · 29 unmodified lines
3030 #undef NDEBUG
3131 #include <assert.h>
3232
33−#if FF_API_MAX_STREAMS
34−#define NUT_MAX_STREAMS MAX_STREAMS
35−#else
3633 #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */
37−#endif
3834
3935 static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){
4036 unsigned int len= ffio_read_varlen(bc);
libavformat/options.c+0−11
@@ -50,10 +50,6 @@ static const AVOption options[]={ · 49 unmodified lines
5050 {"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_NOPARSE, INT_MIN, INT_MAX, D, "fflags"},
5151 {"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNDTS, INT_MIN, INT_MAX, D, "fflags"},
5252 {"rtphint", "add rtp hinting", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_RTP_HINT, INT_MIN, INT_MAX, E, "fflags"},
53−#if FF_API_OLD_METADATA
54−{"track", " set the track number", OFFSET(track), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, E},
55−{"year", "set the year", OFFSET(year), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, E},
56−#endif
5753 {"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, 5*AV_TIME_BASE, 0, INT_MAX, D},
5854 {"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D},
5955 {"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, 1<<20, 0, INT_MAX, D},
@@ -88,10 +84,3 @@ AVFormatContext *avformat_alloc_context(void) · 28 unmodified lines
8884 ic->av_class = &av_format_context_class;
8985 return ic;
9086 }
91−
92−#if FF_API_ALLOC_FORMAT_CONTEXT
93−AVFormatContext *av_alloc_format_context(void)
94−{
95− return avformat_alloc_context();
96−}
97−#endif
libavformat/output-example.c+1−1
@@ -492,7 +492,7 @@ int main(int argc, char **argv) · 491 unmodified lines
492492
493493 /* open the output file, if needed */
494494 if (!(fmt->flags & AVFMT_NOFILE)) {
495− if (avio_open(&oc->pb, filename, AVIO_WRONLY) < 0) {
495+ if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
496496 fprintf(stderr, "Could not open '%s'\n", filename);
497497 exit(1);
498498 }
libavformat/rtmpproto.c+28−35
@@ -38,13 +38,6 @@ · 37 unmodified lines
3838 #include "rtmppkt.h"
3939 #include "url.h"
4040
41−/* we can't use av_log() with URLContext yet... */
42−#if FF_API_URL_CLASS
43−#define LOG_CONTEXT s
44−#else
45−#define LOG_CONTEXT NULL
46−#endif
47−
4841 //#define DEBUG
4942
5043 /** RTMP protocol handler state */
@@ -166,7 +159,7 @@ static void gen_release_stream(URLContext *s, RTMPContext *rt) · 115 unmodified lines
166159 ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
167160 29 + strlen(rt->playpath));
168161
169− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Releasing stream...\n");
162+ av_log(s, AV_LOG_DEBUG, "Releasing stream...\n");
170163 p = pkt.data;
171164 ff_amf_write_string(&p, "releaseStream");
172165 ff_amf_write_number(&p, 2.0);
@@ -189,7 +182,7 @@ static void gen_fcpublish_stream(URLContext *s, RTMPContext *rt) · 16 unmodified lines
189182 ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
190183 25 + strlen(rt->playpath));
191184
192− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FCPublish stream...\n");
185+ av_log(s, AV_LOG_DEBUG, "FCPublish stream...\n");
193186 p = pkt.data;
194187 ff_amf_write_string(&p, "FCPublish");
195188 ff_amf_write_number(&p, 3.0);
@@ -212,7 +205,7 @@ static void gen_fcunpublish_stream(URLContext *s, RTMPContext *rt) · 16 unmodified lines
212205 ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0,
213206 27 + strlen(rt->playpath));
214207
215− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "UnPublishing stream...\n");
208+ av_log(s, AV_LOG_DEBUG, "UnPublishing stream...\n");
216209 p = pkt.data;
217210 ff_amf_write_string(&p, "FCUnpublish");
218211 ff_amf_write_number(&p, 5.0);
@@ -232,7 +225,7 @@ static void gen_create_stream(URLContext *s, RTMPContext *rt) · 13 unmodified lines
232225 RTMPPacket pkt;
233226 uint8_t *p;
234227
235− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Creating stream...\n");
228+ av_log(s, AV_LOG_DEBUG, "Creating stream...\n");
236229 ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 25);
237230
238231 p = pkt.data;
@@ -254,7 +247,7 @@ static void gen_delete_stream(URLContext *s, RTMPContext *rt) · 15 unmodified lines
254247 RTMPPacket pkt;
255248 uint8_t *p;
256249
257− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Deleting stream...\n");
250+ av_log(s, AV_LOG_DEBUG, "Deleting stream...\n");
258251 ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 34);
259252
260253 p = pkt.data;
@@ -276,7 +269,7 @@ static void gen_play(URLContext *s, RTMPContext *rt) · 15 unmodified lines
276269 RTMPPacket pkt;
277270 uint8_t *p;
278271
279− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath);
272+ av_log(s, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath);
280273 ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0,
281274 20 + strlen(rt->playpath));
282275 pkt.extra = rt->main_channel_id;
@@ -310,7 +303,7 @@ static void gen_publish(URLContext *s, RTMPContext *rt) · 27 unmodified lines
310303 RTMPPacket pkt;
311304 uint8_t *p;
312305
313− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending publish command for '%s'\n", rt->playpath);
306+ av_log(s, AV_LOG_DEBUG, "Sending publish command for '%s'\n", rt->playpath);
314307 ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE, 0,
315308 30 + strlen(rt->playpath));
316309 pkt.extra = rt->main_channel_id;
@@ -478,7 +471,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 161 unmodified lines
478471 int server_pos, client_pos;
479472 uint8_t digest[32];
480473
481− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Handshaking...\n");
474+ av_log(s, AV_LOG_DEBUG, "Handshaking...\n");
482475
483476 av_lfg_init(&rnd, 0xDEADC0DE);
484477 // generate handshake packet - 1536 bytes of pseudorandom data
@@ -489,16 +482,16 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 4 unmodified lines
489482 ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE + 1);
490483 i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1);
491484 if (i != RTMP_HANDSHAKE_PACKET_SIZE + 1) {
492− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
485+ av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
493486 return -1;
494487 }
495488 i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE);
496489 if (i != RTMP_HANDSHAKE_PACKET_SIZE) {
497− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
490+ av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
498491 return -1;
499492 }
500493
501− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n",
494+ av_log(s, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n",
502495 serverdata[5], serverdata[6], serverdata[7], serverdata[8]);
503496
504497 if (rt->is_input && serverdata[5] >= 3) {
@@ -506,7 +499,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 1 unmodified line
506499 if (!server_pos) {
507500 server_pos = rtmp_validate_digest(serverdata + 1, 8);
508501 if (!server_pos) {
509− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Server response validating failed\n");
502+ av_log(s, AV_LOG_ERROR, "Server response validating failed\n");
510503 return -1;
511504 }
512505 }
@@ -518,7 +511,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 5 unmodified lines
518511 digest, 32,
519512 digest);
520513 if (memcmp(digest, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
521− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Signature mismatch\n");
514+ av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
522515 return -1;
523516 }
524517
@@ -552,13 +545,13 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 27 unmodified lines
552545 const uint8_t *data_end = pkt->data + pkt->data_size;
553546
554547 #ifdef DEBUG
555− ff_rtmp_packet_dump(LOG_CONTEXT, pkt);
548+ ff_rtmp_packet_dump(s, pkt);
556549 #endif
557550
558551 switch (pkt->type) {
559552 case RTMP_PT_CHUNK_SIZE:
560553 if (pkt->data_size != 4) {
561− av_log(LOG_CONTEXT, AV_LOG_ERROR,
554+ av_log(s, AV_LOG_ERROR,
562555 "Chunk size change packet is not 4 bytes long (%d)\n", pkt->data_size);
563556 return -1;
564557 }
@@ -566,10 +559,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 1 unmodified line
566559 ff_rtmp_packet_write(rt->stream, pkt, rt->chunk_size, rt->prev_pkt[1]);
567560 rt->chunk_size = AV_RB32(pkt->data);
568561 if (rt->chunk_size <= 0) {
569− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Incorrect chunk size %d\n", rt->chunk_size);
562+ av_log(s, AV_LOG_ERROR, "Incorrect chunk size %d\n", rt->chunk_size);
570563 return -1;
571564 }
572− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "New chunk size = %d\n", rt->chunk_size);
565+ av_log(s, AV_LOG_DEBUG, "New chunk size = %d\n", rt->chunk_size);
573566 break;
574567 case RTMP_PT_PING:
575568 t = AV_RB16(pkt->data);
@@ -578,12 +571,12 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 2 unmodified lines
578571 break;
579572 case RTMP_PT_CLIENT_BW:
580573 if (pkt->data_size < 4) {
581− av_log(LOG_CONTEXT, AV_LOG_ERROR,
574+ av_log(s, AV_LOG_ERROR,
582575 "Client bandwidth report packet is less than 4 bytes long (%d)\n",
583576 pkt->data_size);
584577 return -1;
585578 }
586− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Client bandwidth = %d\n", AV_RB32(pkt->data));
579+ av_log(s, AV_LOG_DEBUG, "Client bandwidth = %d\n", AV_RB32(pkt->data));
587580 rt->client_report_size = AV_RB32(pkt->data) >> 1;
588581 break;
589582 case RTMP_PT_INVOKE:
@@ -593,7 +586,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 3 unmodified lines
593586
594587 if (!ff_amf_get_field_value(pkt->data + 9, data_end,
595588 "description", tmpstr, sizeof(tmpstr)))
596− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
589+ av_log(s, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
597590 return -1;
598591 } else if (!memcmp(pkt->data, "\002\000\007_result", 10)) {
599592 switch (rt->state) {
@@ -624,7 +617,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 24 unmodified lines
624617 case STATE_CONNECTING:
625618 //extract a number from the result
626619 if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
627− av_log(LOG_CONTEXT, AV_LOG_WARNING, "Unexpected reply on connect()\n");
620+ av_log(s, AV_LOG_WARNING, "Unexpected reply on connect()\n");
628621 } else {
629622 rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21));
630623 }
@@ -651,7 +644,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 20 unmodified lines
651644 if (!t && !strcmp(tmpstr, "error")) {
652645 if (!ff_amf_get_field_value(ptr, data_end,
653646 "description", tmpstr, sizeof(tmpstr)))
654− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
647+ av_log(s, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
655648 return -1;
656649 }
657650 t = ff_amf_get_field_value(ptr, data_end,
@@ -701,7 +694,7 @@ static int get_packet(URLContext *s, int for_header) · 43 unmodified lines
701694 }
702695 rt->bytes_read += ret;
703696 if (rt->bytes_read > rt->last_bytes_read + rt->client_report_size) {
704− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending bytes read report\n");
697+ av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n");
705698 gen_bytes_read(s, rt, rpkt.timestamp + 1);
706699 rt->last_bytes_read = rt->bytes_read;
707700 }
@@ -812,7 +805,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 104 unmodified lines
812805 if (!rt)
813806 return AVERROR(ENOMEM);
814807 s->priv_data = rt;
815− rt->is_input = !(flags & AVIO_WRONLY);
808+ rt->is_input = !(flags & AVIO_FLAG_WRITE);
816809
817810 av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
818811 path, sizeof(path), s->filename);
@@ -821,8 +814,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 2 unmodified lines
821814 port = RTMP_DEFAULT_PORT;
822815 ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
823816
824− if (ffurl_open(&rt->stream, buf, AVIO_RDWR) < 0) {
825− av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot open connection %s\n", buf);
817+ if (ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE) < 0) {
818+ av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf);
826819 goto fail;
827820 }
828821
@@ -866,7 +859,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 37 unmodified lines
866859 rt->bytes_read = 0;
867860 rt->last_bytes_read = 0;
868861
869− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Proto = %s, path = %s, app = %s, fname = %s\n",
862+ av_log(s, AV_LOG_DEBUG, "Proto = %s, path = %s, app = %s, fname = %s\n",
870863 proto, path, rt->app, rt->playpath);
871864 gen_connect(s, rt, proto, hostname, port);
872865
@@ -933,7 +926,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size) · 60 unmodified lines
933926 const uint8_t *buf_temp = buf;
934927
935928 if (size < 11) {
936− av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
929+ av_log(s, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
937930 return 0;
938931 }
939932
libavformat/rtpproto.c+1−1
@@ -145,7 +145,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags) · 144 unmodified lines
145145 char path[1024];
146146 const char *p;
147147
148− is_output = (flags & AVIO_WRONLY);
148+ is_output = (flags & AVIO_FLAG_WRITE);
149149
150150 s = av_mallocz(sizeof(RTPContext));
151151 if (!s)
libavformat/rtsp.c+8−8
@@ -1116,14 +1116,14 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 1115 unmodified lines
11161116 "?localport=%d", j);
11171117 /* we will use two ports per rtp stream (rtp and rtcp) */
11181118 j += 2;
1119− if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_RDWR) == 0)
1119+ if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE) == 0)
11201120 goto rtp_opened;
11211121 }
11221122 }
11231123
11241124 #if 0
11251125 /* then try on any port */
1126− if (ffurl_open(&rtsp_st->rtp_handle, "rtp://", AVIO_RDONLY) < 0) {
1126+ if (ffurl_open(&rtsp_st->rtp_handle, "rtp://", AVIO_FLAG_READ) < 0) {
11271127 err = AVERROR_INVALIDDATA;
11281128 goto fail;
11291129 }
@@ -1269,7 +1269,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 139 unmodified lines
12691269 namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
12701270 ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
12711271 port, "?ttl=%d", ttl);
1272− if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_RDWR) < 0) {
1272+ if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE) < 0) {
12731273 err = AVERROR_INVALIDDATA;
12741274 goto fail;
12751275 }
@@ -1396,7 +1396,7 @@ redirect: · 120 unmodified lines
13961396 av_get_random_seed(), av_get_random_seed());
13971397
13981398 /* GET requests */
1399− if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_RDONLY) < 0) {
1399+ if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ) < 0) {
14001400 err = AVERROR(EIO);
14011401 goto fail;
14021402 }
@@ -1417,7 +1417,7 @@ redirect: · 14 unmodified lines
14171417 }
14181418
14191419 /* POST requests */
1420− if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_WRONLY) < 0 ) {
1420+ if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE) < 0 ) {
14211421 err = AVERROR(EIO);
14221422 goto fail;
14231423 }
@@ -1460,7 +1460,7 @@ redirect: · 36 unmodified lines
14601460 } else {
14611461 /* open the tcp connection */
14621462 ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL);
1463− if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_RDWR) < 0) {
1463+ if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE) < 0) {
14641464 err = AVERROR(EIO);
14651465 goto fail;
14661466 }
@@ -1807,7 +1807,7 @@ static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) · 340 unmodified lines
18071807 namebuf, rtsp_st->sdp_port,
18081808 "?localport=%d&ttl=%d", rtsp_st->sdp_port,
18091809 rtsp_st->sdp_ttl);
1810− if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_RDWR) < 0) {
1810+ if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE) < 0) {
18111811 err = AVERROR_INVALIDDATA;
18121812 goto fail;
18131813 }
@@ -1863,7 +1863,7 @@ static int rtp_read_header(AVFormatContext *s, · 49 unmodified lines
18631863 if (!ff_network_init())
18641864 return AVERROR(EIO);
18651865
1866− ret = ffurl_open(&in, s->filename, AVIO_RDONLY);
1866+ ret = ffurl_open(&in, s->filename, AVIO_FLAG_READ);
18671867 if (ret)
18681868 goto fail;
18691869
libavformat/sapdec.c+1−1
@@ -85,7 +85,7 @@ static int sap_read_header(AVFormatContext *s, · 84 unmodified lines
8585
8686 ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d",
8787 port);
88− ret = ffurl_open(&sap->ann_fd, url, AVIO_RDONLY);
88+ ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_READ);
8989 if (ret)
9090 goto fail;
9191
libavformat/sapenc.c+2−2
@@ -146,7 +146,7 @@ static int sap_write_header(AVFormatContext *s) · 145 unmodified lines
146146 "?ttl=%d", ttl);
147147 if (!same_port)
148148 base_port += 2;
149− ret = ffurl_open(&fd, url, AVIO_WRONLY);
149+ ret = ffurl_open(&fd, url, AVIO_FLAG_WRITE);
150150 if (ret) {
151151 ret = AVERROR(EIO);
152152 goto fail;
@@ -158,7 +158,7 @@ static int sap_write_header(AVFormatContext *s) · 5 unmodified lines
158158
159159 ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port,
160160 "?ttl=%d&connect=1", ttl);
161− ret = ffurl_open(&sap->ann_fd, url, AVIO_WRONLY);
161+ ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_WRITE);
162162 if (ret) {
163163 ret = AVERROR(EIO);
164164 goto fail;
libavformat/udp.c+7−10
@@ -292,10 +292,7 @@ int ff_udp_get_local_port(URLContext *h) · 291 unmodified lines
292292 * streams at the same time.
293293 * @param h media file context
294294 */
295−#if !FF_API_UDP_GET_FILE
296−static
297−#endif
298−int udp_get_file_handle(URLContext *h)
295+static int udp_get_file_handle(URLContext *h)
299296 {
300297 UDPContext *s = h->priv_data;
301298 return s->udp_fd;
@@ -318,7 +315,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 16 unmodified lines
318315 h->is_streamed = 1;
319316 h->max_packet_size = 1472;
320317
321− is_output = (flags & AVIO_WRONLY);
318+ is_output = (flags & AVIO_FLAG_WRITE);
322319
323320 s = av_mallocz(sizeof(UDPContext));
324321 if (!s)
@@ -361,14 +358,14 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 36 unmodified lines
361358 /* XXX: fix av_url_split */
362359 if (hostname[0] == '\0' || hostname[0] == '?') {
363360 /* only accepts null hostname if input */
364− if (flags & AVIO_WRONLY)
361+ if (flags & AVIO_FLAG_WRITE)
365362 goto fail;
366363 } else {
367364 if (ff_udp_set_remote_url(h, uri) < 0)
368365 goto fail;
369366 }
370367
371− if (s->is_multicast && !(h->flags & AVIO_WRONLY))
368+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE))
372369 s->local_port = port;
373370 udp_fd = udp_socket_create(s, &my_addr, &len);
374371 if (udp_fd < 0)
@@ -385,7 +382,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 10 unmodified lines
385382
386383 /* the bind is needed to give a port to the socket now */
387384 /* if multicast, try the multicast address bind first */
388− if (s->is_multicast && !(h->flags & AVIO_WRONLY)) {
385+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) {
389386 bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len);
390387 }
391388 /* bind to the local address if not multicast or if the multicast
@@ -398,7 +395,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 6 unmodified lines
398395 s->local_port = udp_port(&my_addr, len);
399396
400397 if (s->is_multicast) {
401− if (h->flags & AVIO_WRONLY) {
398+ if (h->flags & AVIO_FLAG_WRITE) {
402399 /* output */
403400 if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
404401 goto fail;
@@ -481,7 +478,7 @@ static int udp_close(URLContext *h) · 76 unmodified lines
481478 {
482479 UDPContext *s = h->priv_data;
483480
484− if (s->is_multicast && !(h->flags & AVIO_WRONLY))
481+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE))
485482 udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
486483 closesocket(s->udp_fd);
487484 av_free(s);
libavformat/utils.c+3−135
@@ -116,15 +116,9 @@ static void av_frac_add(AVFrac *f, int64_t incr) · 115 unmodified lines
116116 }
117117
118118 /** head of registered input format linked list */
119−#if !FF_API_FIRST_FORMAT
120−static
121−#endif
122−AVInputFormat *first_iformat = NULL;
119+static AVInputFormat *first_iformat = NULL;
123120 /** head of registered output format linked list */
124−#if !FF_API_FIRST_FORMAT
125−static
126−#endif
127−AVOutputFormat *first_oformat = NULL;
121+static AVOutputFormat *first_oformat = NULL;
128122
129123 AVInputFormat *av_iformat_next(AVInputFormat *f)
130124 {
@@ -201,14 +195,6 @@ static int match_format(const char *name, const char *names) · 70 unmodified lines
201195 return !strcasecmp(name, names);
202196 }
203197
204−#if FF_API_GUESS_FORMAT
205−AVOutputFormat *guess_format(const char *short_name, const char *filename,
206− const char *mime_type)
207−{
208− return av_guess_format(short_name, filename, mime_type);
209−}
210−#endif
211−
212198 AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
213199 const char *mime_type)
214200 {
@@ -244,27 +230,6 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename, · 29 unmodified lines
244230 return fmt_found;
245231 }
246232
247−#if FF_API_GUESS_FORMAT
248−AVOutputFormat *guess_stream_format(const char *short_name, const char *filename,
249− const char *mime_type)
250−{
251− AVOutputFormat *fmt = av_guess_format(short_name, filename, mime_type);
252−
253− if (fmt) {
254− AVOutputFormat *stream_fmt;
255− char stream_format_name[64];
256−
257− snprintf(stream_format_name, sizeof(stream_format_name), "%s_stream", fmt->name);
258− stream_fmt = av_guess_format(stream_format_name, NULL, NULL);
259−
260− if (stream_fmt)
261− fmt = stream_fmt;
262− }
263−
264− return fmt;
265−}
266−#endif
267−
268233 enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
269234 const char *filename, const char *mime_type, enum AVMediaType type){
270235 if(type == AVMEDIA_TYPE_VIDEO){
@@ -296,38 +261,6 @@ AVInputFormat *av_find_input_format(const char *short_name) · 25 unmodified lines
296261 return NULL;
297262 }
298263
299−#if FF_API_SYMVER && CONFIG_SHARED && HAVE_SYMVER
300−FF_SYMVER(void, av_destruct_packet_nofree, (AVPacket *pkt), "LIBAVFORMAT_52")
301−{
302− av_destruct_packet_nofree(pkt);
303−}
304−
305−FF_SYMVER(void, av_destruct_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
306−{
307− av_destruct_packet(pkt);
308−}
309−
310−FF_SYMVER(int, av_new_packet, (AVPacket *pkt, int size), "LIBAVFORMAT_52")
311−{
312− return av_new_packet(pkt, size);
313−}
314−
315−FF_SYMVER(int, av_dup_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
316−{
317− return av_dup_packet(pkt);
318−}
319−
320−FF_SYMVER(void, av_free_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
321−{
322− av_free_packet(pkt);
323−}
324−
325−FF_SYMVER(void, av_init_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
326−{
327− av_log(NULL, AV_LOG_WARNING, "Diverting av_*_packet function calls to libavcodec. Recompile to improve performance\n");
328− av_init_packet(pkt);
329−}
330−#endif
331264
332265 int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
333266 {
@@ -513,10 +446,6 @@ int av_open_input_stream(AVFormatContext **ic_ptr, · 179 unmodified lines
513446 if (pb && !ic->data_offset)
514447 ic->data_offset = avio_tell(ic->pb);
515448
516−#if FF_API_OLD_METADATA
517− ff_metadata_demux_compat(ic);
518−#endif
519−
520449 ic->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
521450
522451 *ic_ptr = ic;
@@ -637,7 +566,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, · 114 unmodified lines
637566 hack needed to handle RTSP/TCP */
638567 if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
639568 /* if no file needed do not try to open one */
640− if ((err=avio_open(&pb, filename, AVIO_RDONLY)) < 0) {
569+ if ((err=avio_open(&pb, filename, AVIO_FLAG_READ)) < 0) {
641570 goto fail;
642571 }
643572 if (buf_size > 0) {
@@ -2639,18 +2568,11 @@ void avformat_free_context(AVFormatContext *s) · 1995 unmodified lines
26392568 av_free(st->codec->extradata);
26402569 av_free(st->codec->subtitle_header);
26412570 av_free(st->codec);
2642−#if FF_API_OLD_METADATA
2643− av_free(st->filename);
2644−#endif
26452571 av_free(st->priv_data);
26462572 av_free(st->info);
26472573 av_free(st);
26482574 }
26492575 for(i=s->nb_programs-1; i>=0; i--) {
2650−#if FF_API_OLD_METADATA
2651− av_freep(&s->programs[i]->provider_name);
2652− av_freep(&s->programs[i]->name);
2653−#endif
26542576 av_metadata_free(&s->programs[i]->metadata);
26552577 av_freep(&s->programs[i]->stream_index);
26562578 av_freep(&s->programs[i]);
@@ -2658,9 +2580,6 @@ void avformat_free_context(AVFormatContext *s) · 1 unmodified line
26582580 av_freep(&s->programs);
26592581 av_freep(&s->priv_data);
26602582 while(s->nb_chapters--) {
2661−#if FF_API_OLD_METADATA
2662− av_free(s->chapters[s->nb_chapters]->title);
2663−#endif
26642583 av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
26652584 av_free(s->chapters[s->nb_chapters]);
26662585 }
@@ -2682,13 +2601,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) · 15 unmodified lines
26822601 {
26832602 AVStream *st;
26842603 int i;
2685−
2686−#if FF_API_MAX_STREAMS
2687− if (s->nb_streams >= MAX_STREAMS){
2688− av_log(s, AV_LOG_ERROR, "Too many streams\n");
2689− return NULL;
2690− }
2691−#else
26922604 AVStream **streams;
26932605
26942606 if (s->nb_streams >= INT_MAX/sizeof(*streams))
@@ -2697,7 +2609,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) · 2 unmodified lines
26972609 if (!streams)
26982610 return NULL;
26992611 s->streams = streams;
2700−#endif
27012612
27022613 st = av_mallocz(sizeof(AVStream));
27032614 if (!st)
@@ -2777,9 +2688,6 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6 · 73 unmodified lines
27772688 return NULL;
27782689 dynarray_add(&s->chapters, &s->nb_chapters, chapter);
27792690 }
2780−#if FF_API_OLD_METADATA
2781− av_free(chapter->title);
2782−#endif
27832691 av_metadata_set2(&chapter->metadata, "title", title, 0);
27842692 chapter->id = id;
27852693 chapter->time_base= time_base;
@@ -2917,10 +2825,6 @@ int av_write_header(AVFormatContext *s) · 131 unmodified lines
29172825 return AVERROR(ENOMEM);
29182826 }
29192827
2920−#if FF_API_OLD_METADATA
2921− ff_metadata_mux_compat(s);
2922−#endif
2923−
29242828 /* set muxer identification string */
29252829 if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
29262830 av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
@@ -3408,24 +3312,6 @@ void av_dump_format(AVFormatContext *ic, · 481 unmodified lines
34083312 av_free(printed);
34093313 }
34103314
3411−#if FF_API_PARSE_FRAME_PARAM
3412−#include "libavutil/parseutils.h"
3413−
3414−int parse_image_size(int *width_ptr, int *height_ptr, const char *str)
3415−{
3416− return av_parse_video_size(width_ptr, height_ptr, str);
3417−}
3418−
3419−int parse_frame_rate(int *frame_rate_num, int *frame_rate_den, const char *arg)
3420−{
3421− AVRational frame_rate;
3422− int ret = av_parse_video_rate(&frame_rate, arg);
3423− *frame_rate_num= frame_rate.num;
3424− *frame_rate_den= frame_rate.den;
3425− return ret;
3426−}
3427−#endif
3428−
34293315 int64_t av_gettime(void)
34303316 {
34313317 struct timeval tv;
@@ -3605,24 +3491,6 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, · 173 unmodified lines
36053491 pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
36063492 }
36073493
3608−#if FF_API_URL_SPLIT
3609−attribute_deprecated
3610−void ff_url_split(char *proto, int proto_size,
3611− char *authorization, int authorization_size,
3612− char *hostname, int hostname_size,
3613− int *port_ptr,
3614− char *path, int path_size,
3615− const char *url)
3616−{
3617− av_url_split(proto, proto_size,
3618− authorization, authorization_size,
3619− hostname, hostname_size,
3620− port_ptr,
3621− path, path_size,
3622− url);
3623−}
3624−#endif
3625−
36263494 void av_url_split(char *proto, int proto_size,
36273495 char *authorization, int authorization_size,
36283496 char *hostname, int hostname_size,
libavformat/version.h+2−47
@@ -23,8 +23,8 @@ · 22 unmodified lines
2323
2424 #include "libavutil/avutil.h"
2525
26−#define LIBAVFORMAT_VERSION_MAJOR 52
27−#define LIBAVFORMAT_VERSION_MINOR 108
26+#define LIBAVFORMAT_VERSION_MAJOR 53
27+#define LIBAVFORMAT_VERSION_MINOR 0
2828 #define LIBAVFORMAT_VERSION_MICRO 0
2929
3030 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -41,60 +41,15 @@ · 10 unmodified lines
4141 * Those FF_API_* defines are not part of public API.
4242 * They may change, break or disappear at any time.
4343 */
44−#ifndef FF_API_MAX_STREAMS
45−#define FF_API_MAX_STREAMS (LIBAVFORMAT_VERSION_MAJOR < 53)
46−#endif
47−#ifndef FF_API_OLD_METADATA
48−#define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53)
49−#endif
5044 #ifndef FF_API_OLD_METADATA2
5145 #define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54)
5246 #endif
53−#ifndef FF_API_URL_CLASS
54−#define FF_API_URL_CLASS (LIBAVFORMAT_VERSION_MAJOR >= 53)
55−#endif
56−#ifndef FF_API_URL_RESETBUF
57−#define FF_API_URL_RESETBUF (LIBAVFORMAT_VERSION_MAJOR < 53)
58−#endif
59−#ifndef FF_API_REGISTER_PROTOCOL
60−#define FF_API_REGISTER_PROTOCOL (LIBAVFORMAT_VERSION_MAJOR < 53)
61−#endif
62−#ifndef FF_API_GUESS_FORMAT
63−#define FF_API_GUESS_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 53)
64−#endif
65−#ifndef FF_API_UDP_GET_FILE
66−#define FF_API_UDP_GET_FILE (LIBAVFORMAT_VERSION_MAJOR < 53)
67−#endif
68−#ifndef FF_API_URL_SPLIT
69−#define FF_API_URL_SPLIT (LIBAVFORMAT_VERSION_MAJOR < 53)
70−#endif
71−#ifndef FF_API_ALLOC_FORMAT_CONTEXT
72−#define FF_API_ALLOC_FORMAT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 53)
73−#endif
74−#ifndef FF_API_PARSE_FRAME_PARAM
75−#define FF_API_PARSE_FRAME_PARAM (LIBAVFORMAT_VERSION_MAJOR < 53)
76−#endif
7747 #ifndef FF_API_READ_SEEK
7848 #define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54)
7949 #endif
80−#ifndef FF_API_LAVF_UNUSED
81−#define FF_API_LAVF_UNUSED (LIBAVFORMAT_VERSION_MAJOR < 53)
82−#endif
83−#ifndef FF_API_PARAMETERS_CODEC_ID
84−#define FF_API_PARAMETERS_CODEC_ID (LIBAVFORMAT_VERSION_MAJOR < 53)
85−#endif
86−#ifndef FF_API_FIRST_FORMAT
87−#define FF_API_FIRST_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 53)
88−#endif
89−#ifndef FF_API_SYMVER
90−#define FF_API_SYMVER (LIBAVFORMAT_VERSION_MAJOR < 53)
91−#endif
9250 #ifndef FF_API_OLD_AVIO
9351 #define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54)
9452 #endif
95−#ifndef FF_API_INDEX_BUILT
96−#define FF_API_INDEX_BUILT (LIBAVFORMAT_VERSION_MAJOR < 53)
97−#endif
9853 #ifndef FF_API_DUMP_FORMAT
9954 #define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54)
10055 #endif
libavutil/avutil.h+4−12
@@ -39,9 +39,9 @@ · 38 unmodified lines
3939 #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
4040 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
4141
42−#define LIBAVUTIL_VERSION_MAJOR 50
43−#define LIBAVUTIL_VERSION_MINOR 40
44−#define LIBAVUTIL_VERSION_MICRO 1
42+#define LIBAVUTIL_VERSION_MAJOR 51
43+#define LIBAVUTIL_VERSION_MINOR 0
44+#define LIBAVUTIL_VERSION_MICRO 0
4545
4646 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
4747 LIBAVUTIL_VERSION_MINOR, \
@@ -58,7 +58,7 @@ · 10 unmodified lines
5858 * They may change, break or disappear at any time.
5959 */
6060 #ifndef FF_API_OLD_EVAL_NAMES
61−#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 51)
61+#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
6262 #endif
6363
6464 /**
@@ -97,14 +97,6 @@ enum AVMediaType { · 32 unmodified lines
9797 #define AV_TIME_BASE 1000000
9898 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
9999
100−/**
101− * Those FF_API_* defines are not part of public API.
102− * They may change, break or disappear at any time.
103− */
104−#ifndef FF_API_OLD_IMAGE_NAMES
105−#define FF_API_OLD_IMAGE_NAMES (LIBAVUTIL_VERSION_MAJOR < 51)
106−#endif
107−
108100 #include "common.h"
109101 #include "error.h"
110102 #include "mathematics.h"
libavutil/error.h+0−6
@@ -37,25 +37,19 @@ · 36 unmodified lines
3737 #define AVUNERROR(e) (e)
3838 #endif
3939
40−#if LIBAVUTIL_VERSION_MAJOR < 51
41−#define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input
4240 #define AVERROR_IO AVERROR(EIO) ///< I/O error
4341 #define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory
4442 #define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format
4543 #define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory
4644 #define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported
47−#define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename
4845 #define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error
49−#endif
5046
5147 #define AVERROR_EOF AVERROR(EPIPE) ///< End of file
5248
5349 #define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
5450
55−#if LIBAVUTIL_VERSION_MAJOR > 50
5651 #define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
5752 #define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
58−#endif
5953
6054 #define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
6155 #define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
libavutil/file.c+1−2
@@ -47,7 +47,6 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, · 46 unmodified lines
4747 av_unused void *ptr;
4848 off_t off_size;
4949 char errbuf[128];
50− size_t max_size = HAVE_MMAP ? SIZE_MAX : FF_INTERNAL_MEM_TYPE_MAX_VALUE;
5150 *bufptr = NULL;
5251
5352 if (fd < 0) {
@@ -66,7 +65,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, · 12 unmodified lines
6665 }
6766
6867 off_size = st.st_size;
69− if (off_size > max_size) {
68+ if (off_size > SIZE_MAX) {
7069 av_log(&file_log_ctx, AV_LOG_ERROR,
7170 "File size for file '%s' is too big\n", filename);
7271 close(fd);
libavutil/imgutils.c+0−29
@@ -266,32 +266,3 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], · 265 unmodified lines
266266 }
267267 }
268268 }
269−
270−#if FF_API_OLD_IMAGE_NAMES
271−void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
272− const AVPixFmtDescriptor *pixdesc)
273−{
274− av_image_fill_max_pixsteps(max_pixsteps, max_pixstep_comps, pixdesc);
275−}
276−
277−int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane)
278−{
279− return av_image_get_linesize(pix_fmt, width, plane);
280−}
281−
282−int av_fill_image_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width)
283−{
284− return av_image_fill_linesizes(linesizes, pix_fmt, width);
285−}
286−
287−int av_fill_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
288− uint8_t *ptr, const int linesizes[4])
289−{
290− return av_image_fill_pointers(data, pix_fmt, height, ptr, linesizes);
291−}
292−
293−int av_check_image_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
294−{
295− return av_image_check_size(w, h, log_offset, log_ctx);
296−}
297−#endif
libavutil/imgutils.h+0−19
@@ -127,23 +127,4 @@ int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *lo · 126 unmodified lines
127127
128128 int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);
129129
130−#if FF_API_OLD_IMAGE_NAMES
131−attribute_deprecated
132−void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
133− const AVPixFmtDescriptor *pixdesc);
134−
135−attribute_deprecated
136−int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane);
137−
138−attribute_deprecated
139−int av_fill_image_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width);
140−
141−attribute_deprecated
142−int av_fill_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
143− uint8_t *ptr, const int linesizes[4]);
144−
145−attribute_deprecated
146−int av_check_image_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
147−#endif
148−
149130 #endif /* AVUTIL_IMGUTILS_H */
libavutil/log.c+1−4
@@ -29,10 +29,7 @@ · 28 unmodified lines
2929 #include "avutil.h"
3030 #include "log.h"
3131
32−#if LIBAVUTIL_VERSION_MAJOR > 50
33−static
34−#endif
35−int av_log_level = AV_LOG_INFO;
32+static int av_log_level = AV_LOG_INFO;
3633 static int flags;
3734
3835 #if defined(_WIN32) && !defined(__MINGW32CE__)
libavutil/mem.c+3−3
@@ -61,7 +61,7 @@ void free(void *ptr); · 60 unmodified lines
6161 memory allocator. You do not need to suppress this file because the
6262 linker will do it automatically. */
6363
64−void *av_malloc(FF_INTERNAL_MEM_TYPE size)
64+void *av_malloc(size_t size)
6565 {
6666 void *ptr = NULL;
6767 #if CONFIG_MEMALIGN_HACK
@@ -116,7 +116,7 @@ void *av_malloc(FF_INTERNAL_MEM_TYPE size) · 48 unmodified lines
116116 return ptr;
117117 }
118118
119−void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
119+void *av_realloc(void *ptr, size_t size)
120120 {
121121 #if CONFIG_MEMALIGN_HACK
122122 int diff;
@@ -153,7 +153,7 @@ void av_freep(void *arg) · 30 unmodified lines
153153 *ptr = NULL;
154154 }
155155
156−void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
156+void *av_mallocz(size_t size)
157157 {
158158 void *ptr = av_malloc(size);
159159 if (ptr)
libavutil/mem.h+3−11
@@ -62,14 +62,6 @@ · 61 unmodified lines
6262 #define av_alloc_size(n)
6363 #endif
6464
65−#if LIBAVUTIL_VERSION_MAJOR < 51
66−# define FF_INTERNAL_MEM_TYPE unsigned int
67−# define FF_INTERNAL_MEM_TYPE_MAX_VALUE UINT_MAX
68−#else
69−# define FF_INTERNAL_MEM_TYPE size_t
70−# define FF_INTERNAL_MEM_TYPE_MAX_VALUE SIZE_MAX
71−#endif
72−
7365 /**
7466 * Allocate a block of size bytes with alignment suitable for all
7567 * memory accesses (including vectors if available on the CPU).
@@ -78,7 +70,7 @@ · 2 unmodified lines
7870 * be allocated.
7971 * @see av_mallocz()
8072 */
81−void *av_malloc(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
73+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
8274
8375 /**
8476 * Allocate or reallocate a block of memory.
@@ -92,7 +84,7 @@ void *av_malloc(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1); · 7 unmodified lines
9284 * cannot be reallocated or the function is used to free the memory block.
9385 * @see av_fast_realloc()
9486 */
95−void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) av_alloc_size(2);
87+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
9688
9789 /**
9890 * Free a memory block which has been allocated with av_malloc(z)() or
@@ -112,7 +104,7 @@ void av_free(void *ptr); · 13 unmodified lines
112104 * @return Pointer to the allocated block, NULL if it cannot be allocated.
113105 * @see av_malloc()
114106 */
115−void *av_mallocz(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
107+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
116108
117109 /**
118110 * Duplicate the string s.
libswscale/options.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020
2121 #include "libavutil/avutil.h"
2222 #include "libavutil/pixfmt.h"
23−#include "libavcodec/opt.h"
23+#include "libavutil/opt.h"
2424 #include "swscale.h"
2525 #include "swscale_internal.h"
2626

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t