* 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 ...
Unified · Split
| @@ -38,7 +38,7 @@ · 37 unmodified lines | |||
| 38 | #include "libavutil/parseutils.h" | 38 | #include "libavutil/parseutils.h" |
| 39 | #include "libavutil/pixdesc.h" | 39 | #include "libavutil/pixdesc.h" |
| 40 | #include "libavutil/eval.h" | 40 | #include "libavutil/eval.h" |
| 41 | #include "libavcodec/opt.h" | 41 | #include "libavutil/opt.h" |
| 42 | #include "cmdutils.h" | 42 | #include "cmdutils.h" |
| 43 | #include "version.h" | 43 | #include "version.h" |
| 44 | #if CONFIG_NETWORK | 44 | #if CONFIG_NETWORK |
| @@ -12,6 +12,11 @@ libavutil: 2009-03-08 · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | API changes, most recent first: | 13 | API changes, most recent first: |
| 14 | 14 | ||
| 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 | |||
| 15 | 2011-04-12 - lavf 52.107.0 - avio.h | 20 | 2011-04-12 - lavf 52.107.0 - avio.h |
| 16 | Avio cleanup, part II - deprecate the entire URLContext API: | 21 | Avio cleanup, part II - deprecate the entire URLContext API: |
| 17 | 175389c add avio_check as a replacement for url_exist | 22 | 175389c add avio_check as a replacement for url_exist |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include "libavformat/avformat.h" | 34 | #include "libavformat/avformat.h" |
| 35 | #include "libavdevice/avdevice.h" | 35 | #include "libavdevice/avdevice.h" |
| 36 | #include "libswscale/swscale.h" | 36 | #include "libswscale/swscale.h" |
| 37 | #include "libavcodec/opt.h" | 37 | #include "libavutil/opt.h" |
| 38 | #include "libavcodec/audioconvert.h" | 38 | #include "libavcodec/audioconvert.h" |
| 39 | #include "libavutil/audioconvert.h" | 39 | #include "libavutil/audioconvert.h" |
| 40 | #include "libavutil/parseutils.h" | 40 | #include "libavutil/parseutils.h" |
| @@ -113,9 +113,7 @@ typedef struct AVChapterMap { · 72 unmodified lines | |||
| 113 | static const OptionDef options[]; | 113 | static const OptionDef options[]; |
| 114 | 114 | ||
| 115 | #define MAX_FILES 100 | 115 | #define MAX_FILES 100 |
| 116 | #if !FF_API_MAX_STREAMS | ||
| 117 | #define MAX_STREAMS 1024 /* arbitrary sanity check value */ | 116 | #define MAX_STREAMS 1024 /* arbitrary sanity check value */ |
| 118 | #endif | ||
| 119 | 117 | ||
| 120 | static const char *last_asked_format = NULL; | 118 | static const char *last_asked_format = NULL; |
| 121 | static AVFormatContext *input_files[MAX_FILES]; | 119 | static AVFormatContext *input_files[MAX_FILES]; |
| @@ -3869,7 +3867,7 @@ static void opt_output_file(const char *filename) · 3747 unmodified lines | |||
| 3869 | (strchr(filename, ':') == NULL || | 3867 | (strchr(filename, ':') == NULL || |
| 3870 | filename[1] == ':' || | 3868 | filename[1] == ':' || |
| 3871 | av_strstart(filename, "file:", NULL))) { | 3869 | av_strstart(filename, "file:", NULL))) { |
| 3872 | if (url_exist(filename)) { | 3870 | if (avio_check(filename, 0) == 0) { |
| 3873 | if (!using_stdin) { | 3871 | if (!using_stdin) { |
| 3874 | fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); | 3872 | fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); |
| 3875 | fflush(stderr); | 3873 | fflush(stderr); |
| @@ -3886,7 +3884,7 @@ static void opt_output_file(const char *filename) · 10 unmodified lines | |||
| 3886 | } | 3884 | } |
| 3887 | 3885 | ||
| 3888 | /* open the file */ | 3886 | /* 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) { |
| 3890 | print_error(filename, err); | 3888 | print_error(filename, err); |
| 3891 | ffmpeg_exit(1); | 3889 | ffmpeg_exit(1); |
| 3892 | } | 3890 | } |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | |||
| 36 | #include "libavdevice/avdevice.h" | 36 | #include "libavdevice/avdevice.h" |
| 37 | #include "libswscale/swscale.h" | 37 | #include "libswscale/swscale.h" |
| 38 | #include "libavcodec/audioconvert.h" | 38 | #include "libavcodec/audioconvert.h" |
| 39 | #include "libavcodec/opt.h" | 39 | #include "libavutil/opt.h" |
| 40 | #include "libavcodec/avfft.h" | 40 | #include "libavcodec/avfft.h" |
| 41 | 41 | ||
| 42 | #if CONFIG_AVFILTER | 42 | #if CONFIG_AVFILTER |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | 23 | ||
| 24 | #include "libavformat/avformat.h" | 24 | #include "libavformat/avformat.h" |
| 25 | #include "libavcodec/avcodec.h" | 25 | #include "libavcodec/avcodec.h" |
| 26 | #include "libavcodec/opt.h" | 26 | #include "libavutil/opt.h" |
| 27 | #include "libavutil/pixdesc.h" | 27 | #include "libavutil/pixdesc.h" |
| 28 | #include "libavdevice/avdevice.h" | 28 | #include "libavdevice/avdevice.h" |
| 29 | #include "cmdutils.h" | 29 | #include "cmdutils.h" |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | |||
| 40 | #include "libavutil/lfg.h" | 40 | #include "libavutil/lfg.h" |
| 41 | #include "libavutil/random_seed.h" | 41 | #include "libavutil/random_seed.h" |
| 42 | #include "libavutil/parseutils.h" | 42 | #include "libavutil/parseutils.h" |
| 43 | #include "libavcodec/opt.h" | 43 | #include "libavutil/opt.h" |
| 44 | #include <stdarg.h> | 44 | #include <stdarg.h> |
| 45 | #include <unistd.h> | 45 | #include <unistd.h> |
| 46 | #include <fcntl.h> | 46 | #include <fcntl.h> |
| @@ -95,9 +95,7 @@ static const char *http_state[] = { · 48 unmodified lines | |||
| 95 | "RTSP_SEND_PACKET", | 95 | "RTSP_SEND_PACKET", |
| 96 | }; | 96 | }; |
| 97 | 97 | ||
| 98 | #if !FF_API_MAX_STREAMS | ||
| 99 | #define MAX_STREAMS 20 | 98 | #define MAX_STREAMS 20 |
| 100 | #endif | ||
| 101 | 99 | ||
| 102 | #define IOBUFFER_INIT_SIZE 8192 | 100 | #define IOBUFFER_INIT_SIZE 8192 |
| 103 | 101 | ||
| @@ -2944,11 +2942,9 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, · 2840 unmodified lines | |||
| 2944 | snprintf(avc->filename, 1024, "rtp://0.0.0.0"); | 2942 | snprintf(avc->filename, 1024, "rtp://0.0.0.0"); |
| 2945 | } | 2943 | } |
| 2946 | 2944 | ||
| 2947 | #if !FF_API_MAX_STREAMS | ||
| 2948 | if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) || | 2945 | if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) || |
| 2949 | !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams)))) | 2946 | !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams)))) |
| 2950 | goto sdp_done; | 2947 | goto sdp_done; |
| 2951 | #endif | ||
| 2952 | if (avc->nb_streams >= INT_MAX/sizeof(*avs) || | 2948 | if (avc->nb_streams >= INT_MAX/sizeof(*avs) || |
| 2953 | !(avs = av_malloc(avc->nb_streams * sizeof(*avs)))) | 2949 | !(avs = av_malloc(avc->nb_streams * sizeof(*avs)))) |
| 2954 | goto sdp_done; | 2950 | goto sdp_done; |
| @@ -2961,9 +2957,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, · 6 unmodified lines | |||
| 2961 | av_sdp_create(&avc, 1, *pbuffer, 2048); | 2957 | av_sdp_create(&avc, 1, *pbuffer, 2048); |
| 2962 | 2958 | ||
| 2963 | sdp_done: | 2959 | sdp_done: |
| 2964 | #if !FF_API_MAX_STREAMS | ||
| 2965 | av_free(avc->streams); | 2960 | av_free(avc->streams); |
| 2966 | #endif | ||
| 2967 | av_metadata_free(&avc->metadata); | 2961 | av_metadata_free(&avc->metadata); |
| 2968 | av_free(avc); | 2962 | av_free(avc); |
| 2969 | av_free(avs); | 2963 | av_free(avs); |
| @@ -3428,7 +3422,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 458 unmodified lines | |||
| 3428 | "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port)); | 3422 | "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port)); |
| 3429 | } | 3423 | } |
| 3430 | 3424 | ||
| 3431 | if (url_open(&h, ctx->filename, AVIO_WRONLY) < 0) | 3425 | if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0) |
| 3432 | goto fail; | 3426 | goto fail; |
| 3433 | c->rtp_handles[stream_index] = h; | 3427 | c->rtp_handles[stream_index] = h; |
| 3434 | max_packet_size = url_get_max_packet_size(h); | 3428 | max_packet_size = url_get_max_packet_size(h); |
| @@ -3685,7 +3679,7 @@ static void build_feed_streams(void) · 250 unmodified lines | |||
| 3685 | for(feed = first_feed; feed != NULL; feed = feed->next_feed) { | 3679 | for(feed = first_feed; feed != NULL; feed = feed->next_feed) { |
| 3686 | int fd; | 3680 | int fd; |
| 3687 | 3681 | ||
| 3688 | if (url_exist(feed->feed_filename)) { | 3682 | if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) { |
| 3689 | /* See if it matches */ | 3683 | /* See if it matches */ |
| 3690 | AVFormatContext *s; | 3684 | AVFormatContext *s; |
| 3691 | int matches = 0; | 3685 | int matches = 0; |
| @@ -3758,7 +3752,7 @@ static void build_feed_streams(void) · 66 unmodified lines | |||
| 3758 | unlink(feed->feed_filename); | 3752 | unlink(feed->feed_filename); |
| 3759 | } | 3753 | } |
| 3760 | } | 3754 | } |
| 3761 | if (!url_exist(feed->feed_filename)) { | 3755 | if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) { |
| 3762 | AVFormatContext s1 = {0}, *s = &s1; | 3756 | AVFormatContext s1 = {0}, *s = &s1; |
| 3763 | 3757 | ||
| 3764 | if (feed->readonly) { | 3758 | if (feed->readonly) { |
| @@ -3768,7 +3762,7 @@ static void build_feed_streams(void) · 3 unmodified lines | |||
| 3768 | } | 3762 | } |
| 3769 | 3763 | ||
| 3770 | /* only write the header of the ffm file */ | 3764 | /* 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) { |
| 3772 | http_log("Could not open output feed file '%s'\n", | 3766 | http_log("Could not open output feed file '%s'\n", |
| 3773 | feed->feed_filename); | 3767 | feed->feed_filename); |
| 3774 | exit(1); | 3768 | exit(1); |
| @@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak · 2 unmodified lines | |||
| 3 | NAME = avcodec | 3 | NAME = avcodec |
| 4 | FFLIBS = avutil | 4 | FFLIBS = avutil |
| 5 | 5 | ||
| 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 |
| 7 | 7 | ||
| 8 | OBJS = allcodecs.o \ | 8 | OBJS = allcodecs.o \ |
| 9 | audioconvert.o \ | 9 | audioconvert.o \ |
| @@ -15,7 +15,6 @@ OBJS = allcodecs.o \ · 5 unmodified lines | |||
| 15 | fmtconvert.o \ | 15 | fmtconvert.o \ |
| 16 | imgconvert.o \ | 16 | imgconvert.o \ |
| 17 | jrevdct.o \ | 17 | jrevdct.o \ |
| 18 | opt.o \ | ||
| 19 | options.o \ | 18 | options.o \ |
| 20 | parser.o \ | 19 | parser.o \ |
| 21 | raw.o \ | 20 | raw.o \ |
| @@ -33,12 +33,6 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | #include "libavcodec/version.h" | 34 | #include "libavcodec/version.h" |
| 35 | 35 | ||
| 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 | |||
| 42 | /** | 36 | /** |
| 43 | * Identify the syntax and semantics of the bitstream. | 37 | * Identify the syntax and semantics of the bitstream. |
| 44 | * The principle is roughly: | 38 | * The principle is roughly: |
| @@ -117,9 +111,6 @@ enum CodecID { · 72 unmodified lines | |||
| 117 | CODEC_ID_QDRAW, | 111 | CODEC_ID_QDRAW, |
| 118 | CODEC_ID_VIXL, | 112 | CODEC_ID_VIXL, |
| 119 | CODEC_ID_QPEG, | 113 | CODEC_ID_QPEG, |
| 120 | #if LIBAVCODEC_VERSION_MAJOR < 53 | ||
| 121 | CODEC_ID_XVID, | ||
| 122 | #endif | ||
| 123 | CODEC_ID_PNG, | 114 | CODEC_ID_PNG, |
| 124 | CODEC_ID_PPM, | 115 | CODEC_ID_PPM, |
| 125 | CODEC_ID_PBM, | 116 | CODEC_ID_PBM, |
| @@ -366,18 +357,6 @@ enum CodecID { · 240 unmodified lines | |||
| 366 | CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information. | 357 | CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information. |
| 367 | }; | 358 | }; |
| 368 | 359 | ||
| 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 | |||
| 381 | #if FF_API_OLD_SAMPLE_FMT | 360 | #if FF_API_OLD_SAMPLE_FMT |
| 382 | #define SampleFormat AVSampleFormat | 361 | #define SampleFormat AVSampleFormat |
| 383 | 362 | ||
| @@ -1112,9 +1091,6 @@ typedef struct AVPacket { · 728 unmodified lines | |||
| 1112 | int64_t convergence_duration; | 1091 | int64_t convergence_duration; |
| 1113 | } AVPacket; | 1092 | } AVPacket; |
| 1114 | #define AV_PKT_FLAG_KEY 0x0001 | 1093 | #define AV_PKT_FLAG_KEY 0x0001 |
| 1115 | #if LIBAVCODEC_VERSION_MAJOR < 53 | ||
| 1116 | #define PKT_FLAG_KEY AV_PKT_FLAG_KEY | ||
| 1117 | #endif | ||
| 1118 | 1094 | ||
| 1119 | /** | 1095 | /** |
| 1120 | * Audio Video Frame. | 1096 | * Audio Video Frame. |
| @@ -1289,9 +1265,6 @@ typedef struct AVCodecContext { · 168 unmodified lines | |||
| 1289 | */ | 1265 | */ |
| 1290 | int frame_size; | 1266 | int frame_size; |
| 1291 | int frame_number; ///< audio or video frame number | 1267 | 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 | ||
| 1295 | 1268 | ||
| 1296 | /** | 1269 | /** |
| 1297 | * Number of frames the decoded output will be delayed relative to | 1270 | * Number of frames the decoded output will be delayed relative to |
| @@ -1476,9 +1449,6 @@ typedef struct AVCodecContext { · 178 unmodified lines | |||
| 1476 | #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. | 1449 | #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. |
| 1477 | #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. | 1450 | #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. |
| 1478 | #define FF_COMPLIANCE_NORMAL 0 | 1451 | #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 | ||
| 1482 | #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions | 1452 | #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions |
| 1483 | #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. | 1453 | #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. |
| 1484 | 1454 | ||
| @@ -1752,25 +1722,6 @@ typedef struct AVCodecContext { · 267 unmodified lines | |||
| 1752 | */ | 1722 | */ |
| 1753 | unsigned dsp_mask; | 1723 | unsigned dsp_mask; |
| 1754 | 1724 | ||
| 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 | |||
| 1774 | /** | 1725 | /** |
| 1775 | * bits per sample/pixel from the demuxer (needed for huffyuv). | 1726 | * bits per sample/pixel from the demuxer (needed for huffyuv). |
| 1776 | * - encoding: Set by libavcodec. | 1727 | * - encoding: Set by libavcodec. |
| @@ -2562,16 +2513,6 @@ typedef struct AVCodecContext { · 785 unmodified lines | |||
| 2562 | int compression_level; | 2513 | int compression_level; |
| 2563 | #define FF_COMPRESSION_DEFAULT -1 | 2514 | #define FF_COMPRESSION_DEFAULT -1 |
| 2564 | 2515 | ||
| 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 | |||
| 2575 | /** | 2516 | /** |
| 2576 | * LPC coefficient precision - used by FLAC encoder | 2517 | * LPC coefficient precision - used by FLAC encoder |
| 2577 | * - encoding: Set by user. | 2518 | * - encoding: Set by user. |
| @@ -3269,14 +3210,6 @@ struct AVResampleContext; · 691 unmodified lines | |||
| 3269 | 3210 | ||
| 3270 | typedef struct ReSampleContext ReSampleContext; | 3211 | typedef struct ReSampleContext ReSampleContext; |
| 3271 | 3212 | ||
| 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 | |||
| 3280 | /** | 3213 | /** |
| 3281 | * Initialize audio resampling context. | 3214 | * Initialize audio resampling context. |
| 3282 | * | 3215 | * |
| @@ -3436,23 +3369,6 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); · 153 unmodified lines | |||
| 3436 | 3369 | ||
| 3437 | void avcodec_set_dimensions(AVCodecContext *s, int width, int height); | 3370 | void avcodec_set_dimensions(AVCodecContext *s, int width, int height); |
| 3438 | 3371 | ||
| 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 | |||
| 3456 | /** | 3372 | /** |
| 3457 | * Return a value representing the fourCC code associated to the | 3373 | * Return a value representing the fourCC code associated to the |
| 3458 | * pixel format pix_fmt, or 0 if no associated fourCC code can be | 3374 | * 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 | |||
| 3521 | enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, | 3437 | enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, |
| 3522 | int has_alpha, int *loss_ptr); | 3438 | int has_alpha, int *loss_ptr); |
| 3523 | 3439 | ||
| 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 | |||
| 3532 | #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ | 3440 | #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ |
| 3533 | #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ | 3441 | #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ |
| 3534 | 3442 | ||
| @@ -3579,13 +3487,6 @@ const char *avcodec_license(void); · 44 unmodified lines | |||
| 3579 | */ | 3487 | */ |
| 3580 | void avcodec_init(void); | 3488 | void avcodec_init(void); |
| 3581 | 3489 | ||
| 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 | |||
| 3589 | /** | 3490 | /** |
| 3590 | * Register the codec codec and initialize libavcodec. | 3491 | * Register the codec codec and initialize libavcodec. |
| 3591 | * | 3492 | * |
| @@ -3730,24 +3631,8 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); · 138 unmodified lines | |||
| 3730 | void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, | 3631 | void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, |
| 3731 | int linesize_align[4]); | 3632 | int linesize_align[4]); |
| 3732 | 3633 | ||
| 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 | |||
| 3741 | enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); | 3634 | enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); |
| 3742 | 3635 | ||
| 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 | ||
| 3751 | int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); | 3636 | int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); |
| 3752 | int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); | 3637 | int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); |
| 3753 | //FIXME func typedef | 3638 | //FIXME func typedef |
| @@ -3781,25 +3666,6 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, · 27 unmodified lines | |||
| 3781 | */ | 3666 | */ |
| 3782 | int avcodec_open(AVCodecContext *avctx, AVCodec *codec); | 3667 | int avcodec_open(AVCodecContext *avctx, AVCodec *codec); |
| 3783 | 3668 | ||
| 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 | |||
| 3803 | /** | 3669 | /** |
| 3804 | * Decode the audio frame of size avpkt->size from avpkt->data into samples. | 3670 | * Decode the audio frame of size avpkt->size from avpkt->data into samples. |
| 3805 | * Some decoders may support multiple frames in a single AVPacket, such | 3671 | * 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 | |||
| 3843 | int *frame_size_ptr, | 3709 | int *frame_size_ptr, |
| 3844 | AVPacket *avpkt); | 3710 | AVPacket *avpkt); |
| 3845 | 3711 | ||
| 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 | |||
| 3865 | /** | 3712 | /** |
| 3866 | * Decode the video frame of size avpkt->size from avpkt->data into picture. | 3713 | * Decode the video frame of size avpkt->size from avpkt->data into picture. |
| 3867 | * Some decoders may support multiple frames in a single AVPacket, such | 3714 | * 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 | |||
| 3906 | int *got_picture_ptr, | 3753 | int *got_picture_ptr, |
| 3907 | AVPacket *avpkt); | 3754 | AVPacket *avpkt); |
| 3908 | 3755 | ||
| 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 | |||
| 3918 | /** | 3756 | /** |
| 3919 | * Decode a subtitle message. | 3757 | * Decode a subtitle message. |
| 3920 | * Return a negative value on error, otherwise return the number of bytes used. | 3758 | * 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 | |||
| 4179 | void av_register_codec_parser(AVCodecParser *parser); | 4017 | void av_register_codec_parser(AVCodecParser *parser); |
| 4180 | AVCodecParserContext *av_parser_init(int codec_id); | 4018 | AVCodecParserContext *av_parser_init(int codec_id); |
| 4181 | 4019 | ||
| 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 | |||
| 4191 | /** | 4020 | /** |
| 4192 | * Parse a packet. | 4021 | * Parse a packet. |
| 4193 | * | 4022 | * |
| @@ -4266,7 +4095,7 @@ AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f); · 72 unmodified lines | |||
| 4266 | * | 4095 | * |
| 4267 | * @see av_realloc | 4096 | * @see av_realloc |
| 4268 | */ | 4097 | */ |
| 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); |
| 4270 | 4099 | ||
| 4271 | /** | 4100 | /** |
| 4272 | * Allocate a buffer, reusing the given one if large enough. | 4101 | * 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 | |||
| 4280 | * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and | 4109 | * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and |
| 4281 | * *size 0 if an error occurred. | 4110 | * *size 0 if an error occurred. |
| 4282 | */ | 4111 | */ |
| 4283 | void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size); | 4112 | void av_fast_malloc(void *ptr, unsigned int *size, size_t 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 | ||
| 4294 | 4113 | ||
| 4295 | /** | 4114 | /** |
| 4296 | * Copy image src to dst. Wraps av_picture_data_copy() above. | 4115 | * 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 | |||
| 4319 | */ | 4138 | */ |
| 4320 | unsigned int av_xiphlacing(unsigned char *s, unsigned int v); | 4139 | unsigned int av_xiphlacing(unsigned char *s, unsigned int v); |
| 4321 | 4140 | ||
| 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 | |||
| 4338 | /** | 4141 | /** |
| 4339 | * Logs a generic warning message about a missing feature. This function is | 4142 | * Logs a generic warning message about a missing feature. This function is |
| 4340 | * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) | 4143 | * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) |
| @@ -120,14 +120,6 @@ void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); · 119 unmodified lines | |||
| 120 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); | 120 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); |
| 121 | 121 | ||
| 122 | /* 1/2^n downscaling functions from imgconvert.c */ | 122 | /* 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 | |||
| 131 | void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); | 123 | void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); |
| 132 | void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); | 124 | void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); |
| 133 | void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); | 125 | void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); |
| @@ -285,17 +285,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) · 284 unmodified lines | |||
| 285 | s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level]; | 285 | s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level]; |
| 286 | 286 | ||
| 287 | /* set compression option overrides from AVCodecContext */ | 287 | /* 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 | ||
| 299 | if (avctx->lpc_type > AV_LPC_TYPE_DEFAULT) { | 288 | if (avctx->lpc_type > AV_LPC_TYPE_DEFAULT) { |
| 300 | if (avctx->lpc_type > AV_LPC_TYPE_CHOLESKY) { | 289 | if (avctx->lpc_type > AV_LPC_TYPE_CHOLESKY) { |
| 301 | av_log(avctx, AV_LOG_ERROR, "unknown lpc type: %d\n", avctx->lpc_type); | 290 | av_log(avctx, AV_LOG_ERROR, "unknown lpc type: %d\n", avctx->lpc_type); |
| @@ -425,40 +425,11 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt) · 424 unmodified lines | |||
| 425 | return av_pix_fmt_descriptors[pix_fmt].name; | 425 | return av_pix_fmt_descriptors[pix_fmt].name; |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 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 | |||
| 440 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) | 428 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) |
| 441 | { | 429 | { |
| 442 | return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL; | 430 | return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL; |
| 443 | } | 431 | } |
| 444 | 432 | ||
| 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 | |||
| 462 | int avpicture_fill(AVPicture *picture, uint8_t *ptr, | 433 | int avpicture_fill(AVPicture *picture, uint8_t *ptr, |
| 463 | enum PixelFormat pix_fmt, int width, int height) | 434 | enum PixelFormat pix_fmt, int width, int height) |
| 464 | { | 435 | { |
| @@ -693,28 +664,6 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma · 228 unmodified lines | |||
| 693 | return dst_pix_fmt; | 664 | return dst_pix_fmt; |
| 694 | } | 665 | } |
| 695 | 666 | ||
| 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 | |||
| 718 | void av_picture_copy(AVPicture *dst, const AVPicture *src, | 667 | void av_picture_copy(AVPicture *dst, const AVPicture *src, |
| 719 | enum PixelFormat pix_fmt, int width, int height) | 668 | enum PixelFormat pix_fmt, int width, int height) |
| 720 | { | 669 | { |
| @@ -59,7 +59,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 58 unmodified lines | |||
| 59 | if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, ¶ms) | 59 | if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, ¶ms) |
| 60 | != VO_ERR_NONE) { | 60 | != VO_ERR_NONE) { |
| 61 | av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n"); | 61 | av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n"); |
| 62 | return AVERROR_UNKNOWN; | 62 | return AVERROR(EINVAL); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | for (index = 0; index < 16; index++) | 65 | for (index = 0; index < 16; index++) |
| @@ -68,7 +68,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 2 unmodified lines | |||
| 68 | if (index == 16) { | 68 | if (index == 16) { |
| 69 | av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", | 69 | av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", |
| 70 | avctx->sample_rate); | 70 | avctx->sample_rate); |
| 71 | return AVERROR_NOTSUPP; | 71 | return AVERROR(ENOSYS); |
| 72 | } | 72 | } |
| 73 | if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { | 73 | if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { |
| 74 | avctx->extradata_size = 2; | 74 | avctx->extradata_size = 2; |
| @@ -110,14 +110,14 @@ static int aac_encode_frame(AVCodecContext *avctx, · 35 unmodified lines | |||
| 110 | if (s->codec_api.GetOutputData(s->handle, &output, &output_info) | 110 | if (s->codec_api.GetOutputData(s->handle, &output, &output_info) |
| 111 | != VO_ERR_NONE) { | 111 | != VO_ERR_NONE) { |
| 112 | av_log(avctx, AV_LOG_ERROR, "Unable to encode frame\n"); | 112 | av_log(avctx, AV_LOG_ERROR, "Unable to encode frame\n"); |
| 113 | return AVERROR_UNKNOWN; | 113 | return AVERROR(EINVAL); |
| 114 | } | 114 | } |
| 115 | return output.Length; | 115 | return output.Length; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | AVCodec ff_libvo_aacenc_encoder = { | 118 | AVCodec ff_libvo_aacenc_encoder = { |
| 119 | "libvo_aacenc", | 119 | "libvo_aacenc", |
| 120 | CODEC_TYPE_AUDIO, | 120 | AVMEDIA_TYPE_AUDIO, |
| 121 | CODEC_ID_AAC, | 121 | CODEC_ID_AAC, |
| 122 | sizeof(AACContext), | 122 | sizeof(AACContext), |
| 123 | aac_encode_init, | 123 | aac_encode_init, |
| @@ -119,7 +119,7 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, · 118 unmodified lines | |||
| 119 | 119 | ||
| 120 | AVCodec ff_libvo_amrwbenc_encoder = { | 120 | AVCodec ff_libvo_amrwbenc_encoder = { |
| 121 | "libvo_amrwbenc", | 121 | "libvo_amrwbenc", |
| 122 | CODEC_TYPE_AUDIO, | 122 | AVMEDIA_TYPE_AUDIO, |
| 123 | CODEC_ID_AMR_WB, | 123 | CODEC_ID_AMR_WB, |
| 124 | sizeof(AMRWBContext), | 124 | sizeof(AMRWBContext), |
| 125 | amr_wb_encode_init, | 125 | amr_wb_encode_init, |
| @@ -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 | ||
| @@ -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 */ | ||
| @@ -113,9 +113,6 @@ static const AVOption options[]={ · 112 unmodified lines | |||
| 113 | {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E}, | 113 | {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E}, |
| 114 | {"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E}, | 114 | {"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E}, |
| 115 | {"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, | 115 | {"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 | ||
| 119 | {"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, | 116 | {"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| 120 | {"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, 0.5, -FLT_MAX, FLT_MAX, V|E}, | 117 | {"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, 0.5, -FLT_MAX, FLT_MAX, V|E}, |
| 121 | {"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), FF_OPT_TYPE_FLOAT, 0.5, 0, FLT_MAX, V|E}, | 118 | {"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 | |||
| 164 | {"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"}, | 161 | {"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"}, |
| 165 | {"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"}, | 162 | {"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"}, |
| 166 | {"normal", NULL, 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_NORMAL, INT_MIN, INT_MAX, V|D|E, "strict"}, | 163 | {"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 | ||
| 170 | {"unofficial", "allow unofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_UNOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"}, | 164 | {"unofficial", "allow unofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_UNOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"}, |
| 171 | {"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|D|E, "strict"}, | 165 | {"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|D|E, "strict"}, |
| 172 | {"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}, | 166 | {"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 | |||
| 396 | {"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"}, | 390 | {"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"}, |
| 397 | {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E}, | 391 | {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E}, |
| 398 | {"compression_level", NULL, OFFSET(compression_level), FF_OPT_TYPE_INT, FF_COMPRESSION_DEFAULT, INT_MIN, INT_MAX, V|A|E}, | 392 | {"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 | ||
| 402 | {"lpc_coeff_precision", "LPC coefficient precision (FLAC)", OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|E}, | 393 | {"lpc_coeff_precision", "LPC coefficient precision (FLAC)", OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|E}, |
| 403 | {"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E}, | 394 | {"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E}, |
| 404 | {"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E}, | 395 | {"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E}, |
| @@ -105,43 +105,6 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){ · 104 unmodified lines | |||
| 105 | } | 105 | } |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 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 | |||
| 145 | int av_parser_parse2(AVCodecParserContext *s, | 108 | int av_parser_parse2(AVCodecParserContext *s, |
| 146 | AVCodecContext *avctx, | 109 | AVCodecContext *avctx, |
| 147 | uint8_t **poutbuf, int *poutbuf_size, | 110 | uint8_t **poutbuf, int *poutbuf_size, |
| @@ -71,7 +71,7 @@ static av_cold int pcm_encode_close(AVCodecContext *avctx) · 70 unmodified lines | |||
| 71 | * @param offset Sample value offset | 71 | * @param offset Sample value offset |
| 72 | */ | 72 | */ |
| 73 | #define ENCODE(type, endian, src, dst, n, shift, offset) \ | 73 | #define ENCODE(type, endian, src, dst, n, shift, offset) \ |
| 74 | samples_##type = (type*)src; \ | 74 | samples_##type = (const type*) src; \ |
| 75 | for(;n>0;n--) { \ | 75 | for(;n>0;n--) { \ |
| 76 | register type v = (*samples_##type++ >> shift) + offset; \ | 76 | register type v = (*samples_##type++ >> shift) + offset; \ |
| 77 | bytestream_put_##endian(&dst, v); \ | 77 | bytestream_put_##endian(&dst, v); \ |
| @@ -218,17 +218,6 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, · 217 unmodified lines | |||
| 218 | return s; | 218 | return s; |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 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 | |||
| 232 | /* resample audio. 'nb_samples' is the number of input samples */ | 221 | /* resample audio. 'nb_samples' is the number of input samples */ |
| 233 | /* XXX: optimize it ! */ | 222 | /* XXX: optimize it ! */ |
| 234 | int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples) | 223 | int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples) |
| @@ -48,7 +48,7 @@ static int volatile entangled_thread_counter=0; · 47 unmodified lines | |||
| 48 | static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op); | 48 | static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op); |
| 49 | static void *codec_mutex; | 49 | static void *codec_mutex; |
| 50 | 50 | ||
| 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) |
| 52 | { | 52 | { |
| 53 | if(min_size < *size) | 53 | if(min_size < *size) |
| 54 | return ptr; | 54 | return ptr; |
| @@ -64,7 +64,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_s · 9 unmodified lines | |||
| 64 | return ptr; | 64 | return ptr; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 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) |
| 68 | { | 68 | { |
| 69 | void **p = ptr; | 69 | void **p = ptr; |
| 70 | if (min_size < *size) | 70 | if (min_size < *size) |
| @@ -94,13 +94,6 @@ void avcodec_register(AVCodec *codec) · 23 unmodified lines | |||
| 94 | codec->next = NULL; | 94 | codec->next = NULL; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | #if LIBAVCODEC_VERSION_MAJOR < 53 | ||
| 98 | void register_avcodec(AVCodec *codec) | ||
| 99 | { | ||
| 100 | avcodec_register(codec); | ||
| 101 | } | ||
| 102 | #endif | ||
| 103 | |||
| 104 | unsigned avcodec_get_edge_width(void) | 97 | unsigned avcodec_get_edge_width(void) |
| 105 | { | 98 | { |
| 106 | return EDGE_WIDTH; | 99 | return EDGE_WIDTH; |
| @@ -224,12 +217,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ · 117 unmodified lines | |||
| 224 | *width=FFALIGN(*width, align); | 217 | *width=FFALIGN(*width, align); |
| 225 | } | 218 | } |
| 226 | 219 | ||
| 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 | |||
| 233 | int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ | 220 | int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ |
| 234 | int i; | 221 | int i; |
| 235 | int w= s->width; | 222 | int w= s->width; |
| @@ -482,7 +469,7 @@ static void avcodec_get_subtitle_defaults(AVSubtitle *sub) · 246 unmodified lines | |||
| 482 | 469 | ||
| 483 | int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) | 470 | int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) |
| 484 | { | 471 | { |
| 485 | int ret= -1; | 472 | int ret = 0; |
| 486 | 473 | ||
| 487 | /* If there is a user-supplied mutex locking routine, call it. */ | 474 | /* If there is a user-supplied mutex locking routine, call it. */ |
| 488 | if (ff_lockmgr_cb) { | 475 | if (ff_lockmgr_cb) { |
| @@ -493,11 +480,14 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 4 unmodified lines | |||
| 493 | entangled_thread_counter++; | 480 | entangled_thread_counter++; |
| 494 | if(entangled_thread_counter != 1){ | 481 | if(entangled_thread_counter != 1){ |
| 495 | av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); | 482 | av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); |
| 483 | ret = -1; | ||
| 496 | goto end; | 484 | goto end; |
| 497 | } | 485 | } |
| 498 | 486 | ||
| 499 | if(avctx->codec || !codec) | 487 | if(avctx->codec || !codec) { |
| 488 | ret = AVERROR(EINVAL); | ||
| 500 | goto end; | 489 | goto end; |
| 490 | } | ||
| 501 | 491 | ||
| 502 | if (codec->priv_data_size > 0) { | 492 | if (codec->priv_data_size > 0) { |
| 503 | if(!avctx->priv_data){ | 493 | if(!avctx->priv_data){ |
| @@ -547,6 +537,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 43 unmodified lines | |||
| 547 | if (avctx->codec_id != codec->id || (avctx->codec_type != codec->type | 537 | if (avctx->codec_id != codec->id || (avctx->codec_type != codec->type |
| 548 | && avctx->codec_type != AVMEDIA_TYPE_ATTACHMENT)) { | 538 | && avctx->codec_type != AVMEDIA_TYPE_ATTACHMENT)) { |
| 549 | av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n"); | 539 | av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n"); |
| 540 | ret = AVERROR(EINVAL); | ||
| 550 | goto free_and_end; | 541 | goto free_and_end; |
| 551 | } | 542 | } |
| 552 | avctx->frame_number = 0; | 543 | avctx->frame_number = 0; |
| @@ -561,6 +552,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) · 8 unmodified lines | |||
| 561 | if (avctx->codec->max_lowres < avctx->lowres) { | 552 | if (avctx->codec->max_lowres < avctx->lowres) { |
| 562 | av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n", | 553 | av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n", |
| 563 | avctx->codec->max_lowres); | 554 | avctx->codec->max_lowres); |
| 555 | ret = AVERROR(EINVAL); | ||
| 564 | goto free_and_end; | 556 | goto free_and_end; |
| 565 | } | 557 | } |
| 566 | if (avctx->codec->sample_fmts && avctx->codec->encode) { | 558 | 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 | |||
| 570 | break; | 562 | break; |
| 571 | if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { | 563 | if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { |
| 572 | av_log(avctx, AV_LOG_ERROR, "Specified sample_fmt is not supported.\n"); | 564 | av_log(avctx, AV_LOG_ERROR, "Specified sample_fmt is not supported.\n"); |
| 565 | ret = AVERROR(EINVAL); | ||
| 573 | goto free_and_end; | 566 | goto free_and_end; |
| 574 | } | 567 | } |
| 575 | } | 568 | } |
| @@ -736,20 +729,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi · 160 unmodified lines | |||
| 736 | return ret; | 729 | return ret; |
| 737 | } | 730 | } |
| 738 | 731 | ||
| 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 | |||
| 753 | int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, | 732 | int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, |
| 754 | int *frame_size_ptr, | 733 | int *frame_size_ptr, |
| 755 | AVPacket *avpkt) | 734 | AVPacket *avpkt) |
| @@ -779,20 +758,6 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa · 23 unmodified lines | |||
| 779 | return ret; | 758 | return ret; |
| 780 | } | 759 | } |
| 781 | 760 | ||
| 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 | |||
| 796 | int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, | 761 | int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, |
| 797 | int *got_sub_ptr, | 762 | int *got_sub_ptr, |
| 798 | AVPacket *avpkt) | 763 | AVPacket *avpkt) |
| @@ -1225,20 +1190,6 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v) · 426 unmodified lines | |||
| 1225 | return n; | 1190 | return n; |
| 1226 | } | 1191 | } |
| 1227 | 1192 | ||
| 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 | |||
| 1242 | int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b){ | 1193 | int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b){ |
| 1243 | int i; | 1194 | int i; |
| 1244 | for(i=0; i<size && !(tab[i][0]==a && tab[i][1]==b); i++); | 1195 | 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 | |||
| 1344 | } | 1295 | } |
| 1345 | 1296 | ||
| 1346 | #endif | 1297 | #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 | ||
| @@ -20,8 +20,8 @@ · 19 unmodified lines | |||
| 20 | #ifndef AVCODEC_VERSION_H | 20 | #ifndef AVCODEC_VERSION_H |
| 21 | #define AVCODEC_VERSION_H | 21 | #define AVCODEC_VERSION_H |
| 22 | 22 | ||
| 23 | #define LIBAVCODEC_VERSION_MAJOR 52 | 23 | #define LIBAVCODEC_VERSION_MAJOR 53 |
| 24 | #define LIBAVCODEC_VERSION_MINOR 120 | 24 | #define LIBAVCODEC_VERSION_MINOR 0 |
| 25 | #define LIBAVCODEC_VERSION_MICRO 0 | 25 | #define LIBAVCODEC_VERSION_MICRO 0 |
| 26 | 26 | ||
| 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| @@ -41,30 +41,6 @@ · 13 unmodified lines | |||
| 41 | #ifndef FF_API_PALETTE_CONTROL | 41 | #ifndef FF_API_PALETTE_CONTROL |
| 42 | #define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54) | 42 | #define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54) |
| 43 | #endif | 43 | #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 | ||
| 68 | #ifndef FF_API_OLD_SAMPLE_FMT | 44 | #ifndef FF_API_OLD_SAMPLE_FMT |
| 69 | #define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54) | 45 | #define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54) |
| 70 | #endif | 46 | #endif |
| @@ -25,11 +25,6 @@ · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | #include "avcodec.h" | 26 | #include "avcodec.h" |
| 27 | 27 | ||
| 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 | ||
| 33 | #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct | 28 | #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct |
| 34 | the number is 1337 speak for the letters IDCT MCo (motion compensation) */ | 29 | the number is 1337 speak for the letters IDCT MCo (motion compensation) */ |
| 35 | 30 | ||
| @@ -151,22 +146,6 @@ struct xvmc_pix_fmt { · 115 unmodified lines | |||
| 151 | of coded blocks it contains. | 146 | of coded blocks it contains. |
| 152 | */ | 147 | */ |
| 153 | int next_free_data_block_num; | 148 | 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 | ||
| 170 | }; | 149 | }; |
| 171 | 150 | ||
| 172 | #endif /* AVCODEC_XVMC_H */ | 151 | #endif /* AVCODEC_XVMC_H */ |
| @@ -21,8 +21,8 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | #include "libavutil/avutil.h" | 22 | #include "libavutil/avutil.h" |
| 23 | 23 | ||
| 24 | #define LIBAVDEVICE_VERSION_MAJOR 52 | 24 | #define LIBAVDEVICE_VERSION_MAJOR 53 |
| 25 | #define LIBAVDEVICE_VERSION_MINOR 4 | 25 | #define LIBAVDEVICE_VERSION_MINOR 0 |
| 26 | #define LIBAVDEVICE_VERSION_MICRO 0 | 26 | #define LIBAVDEVICE_VERSION_MICRO 0 |
| 27 | 27 | ||
| 28 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ | 28 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ |
| @@ -25,9 +25,9 @@ · 24 unmodified lines | |||
| 25 | #include "libavutil/avutil.h" | 25 | #include "libavutil/avutil.h" |
| 26 | #include "libavutil/samplefmt.h" | 26 | #include "libavutil/samplefmt.h" |
| 27 | 27 | ||
| 28 | #define LIBAVFILTER_VERSION_MAJOR 1 | 28 | #define LIBAVFILTER_VERSION_MAJOR 2 |
| 29 | #define LIBAVFILTER_VERSION_MINOR 79 | 29 | #define LIBAVFILTER_VERSION_MINOR 0 |
| 30 | #define LIBAVFILTER_VERSION_MICRO 1 | 30 | #define LIBAVFILTER_VERSION_MICRO 0 |
| 31 | 31 | ||
| 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| 33 | LIBAVFILTER_VERSION_MINOR, \ | 33 | LIBAVFILTER_VERSION_MINOR, \ |
| @@ -10,7 +10,6 @@ OBJS = allformats.o \ · 9 unmodified lines | |||
| 10 | id3v1.o \ | 10 | id3v1.o \ |
| 11 | id3v2.o \ | 11 | id3v2.o \ |
| 12 | metadata.o \ | 12 | metadata.o \ |
| 13 | metadata_compat.o \ | ||
| 14 | options.o \ | 13 | options.o \ |
| 15 | os_support.o \ | 14 | os_support.o \ |
| 16 | sdp.o \ | 15 | sdp.o \ |
| @@ -170,7 +170,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url, · 169 unmodified lines | |||
| 170 | 170 | ||
| 171 | if (!in) { | 171 | if (!in) { |
| 172 | close_in = 1; | 172 | close_in = 1; |
| 173 | if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0) | 173 | if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0) |
| 174 | return ret; | 174 | return ret; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| @@ -293,7 +293,7 @@ reload: · 116 unmodified lines | |||
| 293 | 293 | ||
| 294 | ret = ffurl_open(&v->input, | 294 | ret = ffurl_open(&v->input, |
| 295 | v->segments[v->cur_seq_no - v->start_seq_no]->url, | 295 | v->segments[v->cur_seq_no - v->start_seq_no]->url, |
| 296 | AVIO_RDONLY); | 296 | AVIO_FLAG_READ); |
| 297 | if (ret < 0) | 297 | if (ret < 0) |
| 298 | return ret; | 298 | return ret; |
| 299 | } | 299 | } |
| @@ -115,7 +115,7 @@ static int parse_playlist(URLContext *h, const char *url) · 114 unmodified lines | |||
| 115 | char line[1024]; | 115 | char line[1024]; |
| 116 | const char *ptr; | 116 | const char *ptr; |
| 117 | 117 | ||
| 118 | if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0) | 118 | if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0) |
| 119 | return ret; | 119 | return ret; |
| 120 | 120 | ||
| 121 | read_chomp_line(in, line, sizeof(line)); | 121 | 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 | |||
| 180 | int ret, i; | 180 | int ret, i; |
| 181 | const char *nested_url; | 181 | const char *nested_url; |
| 182 | 182 | ||
| 183 | if (flags & (AVIO_WRONLY | AVIO_RDWR)) | 183 | if (flags & AVIO_FLAG_WRITE) |
| 184 | return AVERROR(ENOSYS); | 184 | return AVERROR(ENOSYS); |
| 185 | 185 | ||
| 186 | s = av_mallocz(sizeof(AppleHTTPContext)); | 186 | s = av_mallocz(sizeof(AppleHTTPContext)); |
| @@ -275,7 +275,7 @@ retry: · 88 unmodified lines | |||
| 275 | } | 275 | } |
| 276 | url = s->segments[s->cur_seq_no - s->start_seq_no]->url, | 276 | url = s->segments[s->cur_seq_no - s->start_seq_no]->url, |
| 277 | av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url); | 277 | 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); |
| 279 | if (ret < 0) { | 279 | if (ret < 0) { |
| 280 | if (url_interrupt_cb()) | 280 | if (url_interrupt_cb()) |
| 281 | return AVERROR_EXIT; | 281 | return AVERROR_EXIT; |
| @@ -133,20 +133,6 @@ typedef struct AVMetadataConv AVMetadataConv; · 132 unmodified lines | |||
| 133 | AVMetadataTag * | 133 | AVMetadataTag * |
| 134 | av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); | 134 | av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); |
| 135 | 135 | ||
| 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 | |||
| 150 | /** | 136 | /** |
| 151 | * Set the given tag in *pm, overwriting an existing tag. | 137 | * Set the given tag in *pm, overwriting an existing tag. |
| 152 | * | 138 | * |
| @@ -256,10 +242,6 @@ typedef struct AVFormatParameters { · 103 unmodified lines | |||
| 256 | unsigned int initial_pause:1; /**< Do not begin to play the stream | 242 | unsigned int initial_pause:1; /**< Do not begin to play the stream |
| 257 | immediately (RTSP only). */ | 243 | immediately (RTSP only). */ |
| 258 | unsigned int prealloced_context:1; | 244 | 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 | ||
| 263 | } AVFormatParameters; | 245 | } AVFormatParameters; |
| 264 | 246 | ||
| 265 | //! Demuxer will use avio_open, no opened file should be provided by the caller. | 247 | //! Demuxer will use avio_open, no opened file should be provided by the caller. |
| @@ -546,10 +528,6 @@ typedef struct AVStream { · 280 unmodified lines | |||
| 546 | */ | 528 | */ |
| 547 | int64_t duration; | 529 | int64_t duration; |
| 548 | 530 | ||
| 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 | |||
| 553 | /* av_read_frame() support */ | 531 | /* av_read_frame() support */ |
| 554 | enum AVStreamParseType need_parsing; | 532 | enum AVStreamParseType need_parsing; |
| 555 | struct AVCodecParserContext *parser; | 533 | struct AVCodecParserContext *parser; |
| @@ -565,14 +543,6 @@ typedef struct AVStream { · 9 unmodified lines | |||
| 565 | 543 | ||
| 566 | int64_t nb_frames; ///< number of frames in this stream if known or 0 | 544 | int64_t nb_frames; ///< number of frames in this stream if known or 0 |
| 567 | 545 | ||
| 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 | |||
| 576 | int disposition; /**< AV_DISPOSITION_* bit field */ | 546 | int disposition; /**< AV_DISPOSITION_* bit field */ |
| 577 | 547 | ||
| 578 | AVProbeData probe_data; | 548 | AVProbeData probe_data; |
| @@ -656,10 +626,6 @@ typedef struct AVStream { · 77 unmodified lines | |||
| 656 | */ | 626 | */ |
| 657 | typedef struct AVProgram { | 627 | typedef struct AVProgram { |
| 658 | int id; | 628 | 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 | ||
| 663 | int flags; | 629 | int flags; |
| 664 | enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller | 630 | enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller |
| 665 | unsigned int *stream_index; | 631 | unsigned int *stream_index; |
| @@ -674,16 +640,9 @@ typedef struct AVChapter { · 8 unmodified lines | |||
| 674 | int id; ///< unique ID to identify the chapter | 640 | int id; ///< unique ID to identify the chapter |
| 675 | AVRational time_base; ///< time base in which the start/end timestamps are specified | 641 | AVRational time_base; ///< time base in which the start/end timestamps are specified |
| 676 | int64_t start, end; ///< chapter start/end time in time_base units | 642 | 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 | ||
| 680 | AVMetadata *metadata; | 643 | AVMetadata *metadata; |
| 681 | } AVChapter; | 644 | } AVChapter; |
| 682 | 645 | ||
| 683 | #if FF_API_MAX_STREAMS | ||
| 684 | #define MAX_STREAMS 20 | ||
| 685 | #endif | ||
| 686 | |||
| 687 | /** | 646 | /** |
| 688 | * Format I/O context. | 647 | * Format I/O context. |
| 689 | * New fields can be added to the end with minor version bumps. | 648 | * New fields can be added to the end with minor version bumps. |
| @@ -699,24 +658,10 @@ typedef struct AVFormatContext { · 9 unmodified lines | |||
| 699 | void *priv_data; | 658 | void *priv_data; |
| 700 | AVIOContext *pb; | 659 | AVIOContext *pb; |
| 701 | unsigned int nb_streams; | 660 | unsigned int nb_streams; |
| 702 | #if FF_API_MAX_STREAMS | ||
| 703 | AVStream *streams[MAX_STREAMS]; | ||
| 704 | #else | ||
| 705 | AVStream **streams; | 661 | AVStream **streams; |
| 706 | #endif | ||
| 707 | char filename[1024]; /**< input or output filename */ | 662 | char filename[1024]; /**< input or output filename */ |
| 708 | /* stream info */ | 663 | /* stream info */ |
| 709 | int64_t timestamp; | 664 | 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 | ||
| 720 | 665 | ||
| 721 | int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ | 666 | int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ |
| 722 | /* private data for pts handling (do not modify directly). */ | 667 | /* private data for pts handling (do not modify directly). */ |
| @@ -756,17 +701,9 @@ typedef struct AVFormatContext { · 33 unmodified lines | |||
| 756 | 701 | ||
| 757 | /* av_read_frame() support */ | 702 | /* av_read_frame() support */ |
| 758 | AVStream *cur_st; | 703 | 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 | ||
| 764 | 704 | ||
| 765 | /* av_seek_frame() support */ | 705 | /* av_seek_frame() support */ |
| 766 | int64_t data_offset; /**< offset of the first packet */ | 706 | int64_t data_offset; /**< offset of the first packet */ |
| 767 | #if FF_API_INDEX_BUILT | ||
| 768 | attribute_deprecated int index_built; | ||
| 769 | #endif | ||
| 770 | 707 | ||
| 771 | int mux_rate; | 708 | int mux_rate; |
| 772 | unsigned int packet_size; | 709 | unsigned int packet_size; |
| @@ -888,11 +825,6 @@ typedef struct AVPacketList { · 115 unmodified lines | |||
| 888 | struct AVPacketList *next; | 825 | struct AVPacketList *next; |
| 889 | } AVPacketList; | 826 | } AVPacketList; |
| 890 | 827 | ||
| 891 | #if FF_API_FIRST_FORMAT | ||
| 892 | attribute_deprecated extern AVInputFormat *first_iformat; | ||
| 893 | attribute_deprecated extern AVOutputFormat *first_oformat; | ||
| 894 | #endif | ||
| 895 | |||
| 896 | /** | 828 | /** |
| 897 | * If f is NULL, returns the first registered input format, | 829 | * If f is NULL, returns the first registered input format, |
| 898 | * if f is non-NULL, returns the next registered input format after f | 830 | * 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 | |||
| 917 | /* utils.c */ | 849 | /* utils.c */ |
| 918 | void av_register_input_format(AVInputFormat *format); | 850 | void av_register_input_format(AVInputFormat *format); |
| 919 | void av_register_output_format(AVOutputFormat *format); | 851 | 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 | ||
| 932 | 852 | ||
| 933 | /** | 853 | /** |
| 934 | * Return the output format in the list of registered output formats | 854 | * 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 | |||
| 1119 | int buf_size, | 1039 | int buf_size, |
| 1120 | AVFormatParameters *ap); | 1040 | AVFormatParameters *ap); |
| 1121 | 1041 | ||
| 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 | |||
| 1129 | /** | 1042 | /** |
| 1130 | * Allocate an AVFormatContext. | 1043 | * Allocate an AVFormatContext. |
| 1131 | * avformat_free_context() can be used to free the context and everything | 1044 | * 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 | |||
| 1492 | const char *url, | 1405 | const char *url, |
| 1493 | int is_output); | 1406 | int is_output); |
| 1494 | 1407 | ||
| 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 | |||
| 1511 | #if FF_API_PARSE_DATE | 1408 | #if FF_API_PARSE_DATE |
| 1512 | /** | 1409 | /** |
| 1513 | * Parse datestr and return a corresponding number of microseconds. | 1410 | * Parse datestr and return a corresponding number of microseconds. |
| @@ -31,7 +31,6 @@ · 30 unmodified lines | |||
| 31 | #endif | 31 | #endif |
| 32 | #include "url.h" | 32 | #include "url.h" |
| 33 | 33 | ||
| 34 | #if FF_API_URL_CLASS | ||
| 35 | /** @name Logging context. */ | 34 | /** @name Logging context. */ |
| 36 | /*@{*/ | 35 | /*@{*/ |
| 37 | static const char *urlcontext_to_name(void *ptr) | 36 | static const char *urlcontext_to_name(void *ptr) |
| @@ -44,7 +43,6 @@ static const AVOption options[] = {{NULL}}; · 6 unmodified lines | |||
| 44 | static const AVClass urlcontext_class = | 43 | static const AVClass urlcontext_class = |
| 45 | { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT }; | 44 | { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT }; |
| 46 | /*@}*/ | 45 | /*@}*/ |
| 47 | #endif | ||
| 48 | 46 | ||
| 49 | static int default_interrupt_cb(void); | 47 | static int default_interrupt_cb(void); |
| 50 | 48 | ||
| @@ -82,29 +80,6 @@ int ffurl_register_protocol(URLProtocol *protocol, int size) · 31 unmodified lines | |||
| 82 | return 0; | 80 | return 0; |
| 83 | } | 81 | } |
| 84 | 82 | ||
| 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 | |||
| 108 | static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, | 83 | static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, |
| 109 | const char *filename, int flags) | 84 | const char *filename, int flags) |
| 110 | { | 85 | { |
| @@ -120,9 +95,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, · 9 unmodified lines | |||
| 120 | err = AVERROR(ENOMEM); | 95 | err = AVERROR(ENOMEM); |
| 121 | goto fail; | 96 | goto fail; |
| 122 | } | 97 | } |
| 123 | #if FF_API_URL_CLASS | ||
| 124 | uc->av_class = &urlcontext_class; | 98 | uc->av_class = &urlcontext_class; |
| 125 | #endif | ||
| 126 | uc->filename = (char *) &uc[1]; | 99 | uc->filename = (char *) &uc[1]; |
| 127 | strcpy(uc->filename, filename); | 100 | strcpy(uc->filename, filename); |
| 128 | uc->prot = up; | 101 | uc->prot = up; |
| @@ -154,7 +127,7 @@ int ffurl_connect(URLContext* uc) · 25 unmodified lines | |||
| 154 | return err; | 127 | return err; |
| 155 | uc->is_connected = 1; | 128 | uc->is_connected = 1; |
| 156 | //We must be careful here as ffurl_seek() could be slow, for example for http | 129 | //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) |
| 158 | || !strcmp(uc->prot->name, "file")) | 131 | || !strcmp(uc->prot->name, "file")) |
| 159 | if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0) | 132 | if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0) |
| 160 | uc->is_streamed= 1; | 133 | uc->is_streamed= 1; |
| @@ -314,21 +287,21 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int · 153 unmodified lines | |||
| 314 | 287 | ||
| 315 | int ffurl_read(URLContext *h, unsigned char *buf, int size) | 288 | int ffurl_read(URLContext *h, unsigned char *buf, int size) |
| 316 | { | 289 | { |
| 317 | if (h->flags & AVIO_WRONLY) | 290 | if (h->flags & AVIO_FLAG_WRITE) |
| 318 | return AVERROR(EIO); | 291 | return AVERROR(EIO); |
| 319 | return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read); | 292 | return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read); |
| 320 | } | 293 | } |
| 321 | 294 | ||
| 322 | int ffurl_read_complete(URLContext *h, unsigned char *buf, int size) | 295 | int ffurl_read_complete(URLContext *h, unsigned char *buf, int size) |
| 323 | { | 296 | { |
| 324 | if (h->flags & AVIO_WRONLY) | 297 | if (h->flags & AVIO_FLAG_WRITE) |
| 325 | return AVERROR(EIO); | 298 | return AVERROR(EIO); |
| 326 | return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read); | 299 | return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read); |
| 327 | } | 300 | } |
| 328 | 301 | ||
| 329 | int ffurl_write(URLContext *h, const unsigned char *buf, int size) | 302 | int ffurl_write(URLContext *h, const unsigned char *buf, int size) |
| 330 | { | 303 | { |
| 331 | if (!(h->flags & (AVIO_WRONLY | AVIO_RDWR))) | 304 | if (!(h->flags & AVIO_FLAG_WRITE)) |
| 332 | return AVERROR(EIO); | 305 | return AVERROR(EIO); |
| 333 | /* avoid sending too big packets */ | 306 | /* avoid sending too big packets */ |
| 334 | if (h->max_packet_size && size > h->max_packet_size) | 307 | if (h->max_packet_size && size > h->max_packet_size) |
| @@ -367,7 +340,7 @@ int ffurl_close(URLContext *h) · 32 unmodified lines | |||
| 367 | int url_exist(const char *filename) | 340 | int url_exist(const char *filename) |
| 368 | { | 341 | { |
| 369 | URLContext *h; | 342 | URLContext *h; |
| 370 | if (ffurl_open(&h, filename, AVIO_RDONLY) < 0) | 343 | if (ffurl_open(&h, filename, AVIO_FLAG_READ) < 0) |
| 371 | return 0; | 344 | return 0; |
| 372 | ffurl_close(h); | 345 | ffurl_close(h); |
| 373 | return 1; | 346 | return 1; |
| @@ -101,9 +101,7 @@ typedef struct { · 100 unmodified lines | |||
| 101 | * @deprecated This struct will be made private | 101 | * @deprecated This struct will be made private |
| 102 | */ | 102 | */ |
| 103 | typedef struct URLContext { | 103 | typedef struct URLContext { |
| 104 | #if FF_API_URL_CLASS | ||
| 105 | const AVClass *av_class; ///< information for av_log(). Set by url_open(). | 104 | const AVClass *av_class; ///< information for av_log(). Set by url_open(). |
| 106 | #endif | ||
| 107 | struct URLProtocol *prot; | 105 | struct URLProtocol *prot; |
| 108 | int flags; | 106 | int flags; |
| 109 | int is_streamed; /**< true if streamed (no seek possible), default = false */ | 107 | 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 | |||
| 346 | #endif // FF_API_OLD_AVIO | 344 | #endif // FF_API_OLD_AVIO |
| 347 | 345 | ||
| 348 | /** | 346 | /** |
| 349 | * Return AVIO_* access flags corresponding to the access permissions | 347 | * Return AVIO_FLAG_* access flags corresponding to the access permissions |
| 350 | * of the resource in url, or a negative value corresponding to an | 348 | * of the resource in url, or a negative value corresponding to an |
| 351 | * AVERROR code in case of failure. The returned access flags are | 349 | * AVERROR code in case of failure. The returned access flags are |
| 352 | * masked by the value in flags. | 350 | * masked by the value in flags. |
| @@ -356,9 +354,6 @@ attribute_deprecated int url_exist(const char *url); · 3 unmodified lines | |||
| 356 | * one call to another. Thus you should not trust the returned value, | 354 | * one call to another. Thus you should not trust the returned value, |
| 357 | * unless you are sure that no other processes are accessing the | 355 | * unless you are sure that no other processes are accessing the |
| 358 | * checked resource. | 356 | * 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. | ||
| 362 | */ | 357 | */ |
| 363 | int avio_check(const char *url, int flags); | 358 | int avio_check(const char *url, int flags); |
| 364 | 359 | ||
| @@ -370,22 +365,6 @@ int avio_check(const char *url, int flags); · 5 unmodified lines | |||
| 370 | */ | 365 | */ |
| 371 | void avio_set_interrupt_cb(int (*interrupt_cb)(void)); | 366 | void avio_set_interrupt_cb(int (*interrupt_cb)(void)); |
| 372 | 367 | ||
| 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 | |||
| 389 | /** | 368 | /** |
| 390 | * Allocate and initialize an AVIOContext for buffered I/O. It must be later | 369 | * Allocate and initialize an AVIOContext for buffered I/O. It must be later |
| 391 | * freed with av_free(). | 370 | * freed with av_free(). |
| @@ -542,29 +521,15 @@ int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen); · 150 unmodified lines | |||
| 542 | int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); | 521 | int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); |
| 543 | 522 | ||
| 544 | 523 | ||
| 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 | |||
| 553 | /** | 524 | /** |
| 554 | * @defgroup open_modes URL open modes | 525 | * @defgroup open_modes URL open modes |
| 555 | * The flags argument to avio_open must be one of the following | 526 | * The flags argument to avio_open must be one of the following |
| 556 | * constants, optionally ORed with other flags. | 527 | * constants, optionally ORed with other flags. |
| 557 | * @{ | 528 | * @{ |
| 558 | */ | 529 | */ |
| 559 | #if LIBAVFORMAT_VERSION_MAJOR < 53 | 530 | #define AVIO_FLAG_READ 1 /**< read-only */ |
| 560 | #define AVIO_RDONLY 0 /**< read-only */ | 531 | #define AVIO_FLAG_WRITE 2 /**< write-only */ |
| 561 | #define AVIO_WRONLY 1 /**< write-only */ | 532 | #define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */ |
| 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 | ||
| 568 | /** | 533 | /** |
| 569 | * @} | 534 | * @} |
| 570 | */ | 535 | */ |
| @@ -581,11 +546,7 @@ int url_resetbuf(AVIOContext *s, int flags); · 10 unmodified lines | |||
| 581 | * Warning: non-blocking protocols is work-in-progress; this flag may be | 546 | * Warning: non-blocking protocols is work-in-progress; this flag may be |
| 582 | * silently ignored. | 547 | * silently ignored. |
| 583 | */ | 548 | */ |
| 584 | #if LIBAVFORMAT_VERSION_MAJOR < 53 | ||
| 585 | #define AVIO_FLAG_NONBLOCK 4 | ||
| 586 | #else | ||
| 587 | #define AVIO_FLAG_NONBLOCK 8 | 549 | #define AVIO_FLAG_NONBLOCK 8 |
| 588 | #endif | ||
| 589 | 550 | ||
| 590 | /** | 551 | /** |
| 591 | * Create and initialize a AVIOContext for accessing the | 552 | * Create and initialize a AVIOContext for accessing the |
| @@ -629,10 +590,6 @@ int avio_open_dyn_buf(AVIOContext **s); · 37 unmodified lines | |||
| 629 | */ | 590 | */ |
| 630 | int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); | 591 | int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); |
| 631 | 592 | ||
| 632 | #if FF_API_UDP_GET_FILE | ||
| 633 | int udp_get_file_handle(URLContext *h); | ||
| 634 | #endif | ||
| 635 | |||
| 636 | /** | 593 | /** |
| 637 | * Iterate through names of available protocols. | 594 | * Iterate through names of available protocols. |
| 638 | * @note it is recommanded to use av_protocol_next() instead of this | 595 | * @note it is recommanded to use av_protocol_next() instead of this |
| @@ -38,9 +38,7 @@ · 37 unmodified lines | |||
| 38 | #define SHORT_SEEK_THRESHOLD 4096 | 38 | #define SHORT_SEEK_THRESHOLD 4096 |
| 39 | 39 | ||
| 40 | static void fill_buffer(AVIOContext *s); | 40 | static void fill_buffer(AVIOContext *s); |
| 41 | #if !FF_API_URL_RESETBUF | ||
| 42 | static int url_resetbuf(AVIOContext *s, int flags); | 41 | static int url_resetbuf(AVIOContext *s, int flags); |
| 43 | #endif | ||
| 44 | 42 | ||
| 45 | int ffio_init_context(AVIOContext *s, | 43 | int ffio_init_context(AVIOContext *s, |
| 46 | unsigned char *buffer, | 44 | unsigned char *buffer, |
| @@ -55,7 +53,7 @@ int ffio_init_context(AVIOContext *s, · 8 unmodified lines | |||
| 55 | s->buffer_size = buffer_size; | 53 | s->buffer_size = buffer_size; |
| 56 | s->buf_ptr = buffer; | 54 | s->buf_ptr = buffer; |
| 57 | s->opaque = opaque; | 55 | 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); |
| 59 | s->write_packet = write_packet; | 57 | s->write_packet = write_packet; |
| 60 | s->read_packet = read_packet; | 58 | s->read_packet = read_packet; |
| 61 | s->seek = seek; | 59 | s->seek = seek; |
| @@ -854,7 +852,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) · 792 unmodified lines | |||
| 854 | } | 852 | } |
| 855 | 853 | ||
| 856 | if (ffio_init_context(*s, buffer, buffer_size, | 854 | 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, |
| 858 | ffurl_read, ffurl_write, ffurl_seek) < 0) { | 856 | ffurl_read, ffurl_write, ffurl_seek) < 0) { |
| 859 | av_free(buffer); | 857 | av_free(buffer); |
| 860 | av_freep(s); | 858 | av_freep(s); |
| @@ -883,24 +881,15 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) · 22 unmodified lines | |||
| 883 | s->buffer = buffer; | 881 | s->buffer = buffer; |
| 884 | s->buffer_size = buf_size; | 882 | s->buffer_size = buf_size; |
| 885 | s->buf_ptr = buffer; | 883 | 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); |
| 887 | return 0; | 885 | return 0; |
| 888 | } | 886 | } |
| 889 | 887 | ||
| 890 | #if FF_API_URL_RESETBUF | ||
| 891 | int url_resetbuf(AVIOContext *s, int flags) | ||
| 892 | #else | ||
| 893 | static int url_resetbuf(AVIOContext *s, int flags) | 888 | static int url_resetbuf(AVIOContext *s, int flags) |
| 894 | #endif | ||
| 895 | { | 889 | { |
| 896 | #if FF_API_URL_RESETBUF | 890 | assert(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ); |
| 897 | if (flags & AVIO_RDWR) | ||
| 898 | return AVERROR(EINVAL); | ||
| 899 | #else | ||
| 900 | assert(flags == AVIO_WRONLY || flags == AVIO_RDONLY); | ||
| 901 | #endif | ||
| 902 | 891 | ||
| 903 | if (flags & AVIO_WRONLY) { | 892 | if (flags & AVIO_FLAG_WRITE) { |
| 904 | s->buf_end = s->buffer + s->buffer_size; | 893 | s->buf_end = s->buffer + s->buffer_size; |
| 905 | s->write_flag = 1; | 894 | s->write_flag = 1; |
| 906 | } else { | 895 | } else { |
| @@ -1058,7 +1047,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags) · 151 unmodified lines | |||
| 1058 | if(!*s) | 1047 | if(!*s) |
| 1059 | return AVERROR(ENOMEM); | 1048 | return AVERROR(ENOMEM); |
| 1060 | ret = ffio_init_context(*s, buf, buf_size, | 1049 | ret = ffio_init_context(*s, buf, buf_size, |
| 1061 | (flags & AVIO_WRONLY || flags & AVIO_RDWR), | 1050 | flags & AVIO_FLAG_WRITE, |
| 1062 | NULL, NULL, NULL, NULL); | 1051 | NULL, NULL, NULL, NULL); |
| 1063 | if(ret != 0) | 1052 | if(ret != 0) |
| 1064 | av_freep(s); | 1053 | av_freep(s); |
| @@ -60,9 +60,9 @@ static int file_open(URLContext *h, const char *filename, int flags) · 59 unmodified lines | |||
| 60 | 60 | ||
| 61 | av_strstart(filename, "file:", &filename); | 61 | av_strstart(filename, "file:", &filename); |
| 62 | 62 | ||
| 63 | if (flags & AVIO_RDWR) { | 63 | if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) { |
| 64 | access = O_CREAT | O_TRUNC | O_RDWR; | 64 | access = O_CREAT | O_TRUNC | O_RDWR; |
| 65 | } else if (flags & AVIO_WRONLY) { | 65 | } else if (flags & AVIO_FLAG_WRITE) { |
| 66 | access = O_CREAT | O_TRUNC | O_WRONLY; | 66 | access = O_CREAT | O_TRUNC | O_WRONLY; |
| 67 | } else { | 67 | } else { |
| 68 | access = O_RDONLY; | 68 | access = O_RDONLY; |
| @@ -102,9 +102,8 @@ static int file_check(URLContext *h, int mask) · 33 unmodified lines | |||
| 102 | if (ret < 0) | 102 | if (ret < 0) |
| 103 | return AVERROR(errno); | 103 | return AVERROR(errno); |
| 104 | 104 | ||
| 105 | ret |= st.st_mode&S_IRUSR ? mask&AVIO_RDONLY : 0; | 105 | ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0; |
| 106 | ret |= st.st_mode&S_IWUSR ? mask&AVIO_WRONLY : 0; | 106 | ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0; |
| 107 | ret |= st.st_mode&S_IWUSR && st.st_mode&S_IRUSR ? mask&AVIO_RDWR : 0; | ||
| 108 | 107 | ||
| 109 | return ret; | 108 | return ret; |
| 110 | } | 109 | } |
| @@ -132,7 +131,7 @@ static int pipe_open(URLContext *h, const char *filename, int flags) · 21 unmodified lines | |||
| 132 | 131 | ||
| 133 | fd = strtol(filename, &final, 10); | 132 | fd = strtol(filename, &final, 10); |
| 134 | if((filename == final) || *final ) {/* No digits found, or something like 10ab */ | 133 | if((filename == final) || *final ) {/* No digits found, or something like 10ab */ |
| 135 | if (flags & AVIO_WRONLY) { | 134 | if (flags & AVIO_FLAG_WRITE) { |
| 136 | fd = 1; | 135 | fd = 1; |
| 137 | } else { | 136 | } else { |
| 138 | fd = 0; | 137 | fd = 0; |
| @@ -100,7 +100,7 @@ static int gopher_open(URLContext *h, const char *uri, int flags) · 99 unmodified lines | |||
| 100 | ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL); | 100 | ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL); |
| 101 | 101 | ||
| 102 | s->hd = NULL; | 102 | s->hd = NULL; |
| 103 | err = ffurl_open(&s->hd, buf, AVIO_RDWR); | 103 | err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE); |
| 104 | if (err < 0) | 104 | if (err < 0) |
| 105 | goto fail; | 105 | goto fail; |
| 106 | 106 | ||
| @@ -124,7 +124,7 @@ static int http_open_cnx(URLContext *h) · 123 unmodified lines | |||
| 124 | port = 80; | 124 | port = 80; |
| 125 | 125 | ||
| 126 | ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL); | 126 | 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); |
| 128 | if (err < 0) | 128 | if (err < 0) |
| 129 | goto fail; | 129 | goto fail; |
| 130 | 130 | ||
| @@ -296,7 +296,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, · 165 unmodified lines | |||
| 296 | 296 | ||
| 297 | 297 | ||
| 298 | /* send http header */ | 298 | /* send http header */ |
| 299 | post = h->flags & AVIO_WRONLY; | 299 | post = h->flags & AVIO_FLAG_WRITE; |
| 300 | authstr = ff_http_auth_create_response(&s->auth_state, auth, path, | 300 | authstr = ff_http_auth_create_response(&s->auth_state, auth, path, |
| 301 | post ? "POST" : "GET"); | 301 | post ? "POST" : "GET"); |
| 302 | 302 | ||
| @@ -451,7 +451,7 @@ static int http_close(URLContext *h) · 148 unmodified lines | |||
| 451 | HTTPContext *s = h->priv_data; | 451 | HTTPContext *s = h->priv_data; |
| 452 | 452 | ||
| 453 | /* signal end of chunked encoding if used */ | 453 | /* 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) { |
| 455 | ret = ffurl_write(s->hd, footer, sizeof(footer) - 1); | 455 | ret = ffurl_write(s->hd, footer, sizeof(footer) - 1); |
| 456 | ret = ret > 0 ? 0 : ret; | 456 | ret = ret > 0 ? 0 : ret; |
| 457 | } | 457 | } |
| @@ -133,11 +133,11 @@ static int find_image_range(int *pfirst_index, int *plast_index, · 132 unmodified lines | |||
| 133 | if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){ | 133 | if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){ |
| 134 | *pfirst_index = | 134 | *pfirst_index = |
| 135 | *plast_index = 1; | 135 | *plast_index = 1; |
| 136 | if(url_exist(buf)) | 136 | if (avio_check(buf, AVIO_FLAG_READ) > 0) |
| 137 | return 0; | 137 | return 0; |
| 138 | return -1; | 138 | return -1; |
| 139 | } | 139 | } |
| 140 | if (url_exist(buf)) | 140 | if (avio_check(buf, AVIO_FLAG_READ) > 0) |
| 141 | break; | 141 | break; |
| 142 | } | 142 | } |
| 143 | if (first_index == 5) | 143 | if (first_index == 5) |
| @@ -155,7 +155,7 @@ static int find_image_range(int *pfirst_index, int *plast_index, · 11 unmodified lines | |||
| 155 | if (av_get_frame_filename(buf, sizeof(buf), path, | 155 | if (av_get_frame_filename(buf, sizeof(buf), path, |
| 156 | last_index + range1) < 0) | 156 | last_index + range1) < 0) |
| 157 | goto fail; | 157 | goto fail; |
| 158 | if (!url_exist(buf)) | 158 | if (avio_check(buf, AVIO_FLAG_READ) <= 0) |
| 159 | break; | 159 | break; |
| 160 | range = range1; | 160 | range = range1; |
| 161 | /* just in case... */ | 161 | /* just in case... */ |
| @@ -282,7 +282,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt) · 120 unmodified lines | |||
| 282 | s->path, s->img_number)<0 && s->img_number > 1) | 282 | s->path, s->img_number)<0 && s->img_number > 1) |
| 283 | return AVERROR(EIO); | 283 | return AVERROR(EIO); |
| 284 | for(i=0; i<3; i++){ | 284 | 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) { |
| 286 | if(i==1) | 286 | if(i==1) |
| 287 | break; | 287 | break; |
| 288 | av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename); | 288 | 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 | |||
| 369 | return AVERROR(EIO); | 369 | return AVERROR(EIO); |
| 370 | } | 370 | } |
| 371 | for(i=0; i<3; i++){ | 371 | 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) { |
| 373 | av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename); | 373 | av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename); |
| 374 | return AVERROR(EIO); | 374 | return AVERROR(EIO); |
| 375 | } | 375 | } |
| @@ -79,18 +79,6 @@ void ff_read_frame_flush(AVFormatContext *s); · 78 unmodified lines | |||
| 79 | /** Get the current time since NTP epoch in microseconds. */ | 79 | /** Get the current time since NTP epoch in microseconds. */ |
| 80 | uint64_t ff_ntp_time(void); | 80 | uint64_t ff_ntp_time(void); |
| 81 | 81 | ||
| 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 | |||
| 94 | /** | 82 | /** |
| 95 | * Assemble a URL string from components. This is the reverse operation | 83 | * Assemble a URL string from components. This is the reverse operation |
| 96 | * of av_url_split. | 84 | * of av_url_split. |
| @@ -94,7 +94,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 93 unmodified lines | |||
| 94 | goto fail; | 94 | goto fail; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | if (flags & AVIO_WRONLY) | 97 | if (flags & AVIO_FLAG_WRITE) |
| 98 | RTMP_EnableWrite(r); | 98 | RTMP_EnableWrite(r); |
| 99 | 99 | ||
| 100 | if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) { | 100 | if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) { |
| @@ -1334,7 +1334,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) · 1333 unmodified lines | |||
| 1334 | && track->codec_priv.data != NULL) { | 1334 | && track->codec_priv.data != NULL) { |
| 1335 | int ret; | 1335 | int ret; |
| 1336 | ffio_init_context(&b, track->codec_priv.data, track->codec_priv.size, | 1336 | 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); |
| 1338 | ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size); | 1338 | ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size); |
| 1339 | if (ret < 0) | 1339 | if (ret < 0) |
| 1340 | return ret; | 1340 | return ret; |
| @@ -36,7 +36,7 @@ static int md5_open(URLContext *h, const char *filename, int flags) · 35 unmodified lines | |||
| 36 | return -1; | 36 | return -1; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | if (flags != AVIO_WRONLY) | 39 | if (!flags & AVIO_FLAG_WRITE) |
| 40 | return AVERROR(EINVAL); | 40 | return AVERROR(EINVAL); |
| 41 | 41 | ||
| 42 | av_md5_init(h->priv_data); | 42 | av_md5_init(h->priv_data); |
| @@ -65,7 +65,7 @@ static int md5_close(URLContext *h) · 22 unmodified lines | |||
| 65 | av_strstart(filename, "md5:", &filename); | 65 | av_strstart(filename, "md5:", &filename); |
| 66 | 66 | ||
| 67 | if (*filename) { | 67 | if (*filename) { |
| 68 | err = ffurl_open(&out, filename, AVIO_WRONLY); | 68 | err = ffurl_open(&out, filename, AVIO_FLAG_WRITE); |
| 69 | if (err) | 69 | if (err) |
| 70 | return err; | 70 | return err; |
| 71 | err = ffurl_write(out, buf, i*2+1); | 71 | err = ffurl_write(out, buf, i*2+1); |
| @@ -86,13 +86,6 @@ int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int fl · 85 unmodified lines | |||
| 86 | return 0; | 86 | return 0; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 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 | |||
| 96 | #if FF_API_OLD_METADATA2 | 89 | #if FF_API_OLD_METADATA2 |
| 97 | void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv, | 90 | void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv, |
| 98 | const AVMetadataConv *s_conv) | 91 | const AVMetadataConv *s_conv) |
| @@ -43,11 +43,6 @@ struct AVMetadataConv{ · 42 unmodified lines | |||
| 43 | typedef struct AVMetadataConv AVMetadataConv; | 43 | typedef struct AVMetadataConv AVMetadataConv; |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 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 | |||
| 51 | void ff_metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, | 46 | void ff_metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, |
| 52 | const AVMetadataConv *s_conv); | 47 | const AVMetadataConv *s_conv); |
| 53 | void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv, | 48 | void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv, |
| @@ -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 */ | ||
| @@ -24,11 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include "asf.h" | 24 | #include "asf.h" |
| 25 | #include "libavutil/intreadwrite.h" | 25 | #include "libavutil/intreadwrite.h" |
| 26 | 26 | ||
| 27 | #if FF_API_MAX_STREAMS | ||
| 28 | #define MMS_MAX_STREAMS MAX_STREAMS | ||
| 29 | #else | ||
| 30 | #define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */ | 27 | #define MMS_MAX_STREAMS 256 /**< arbitrary sanity check value */ |
| 31 | #endif | ||
| 32 | 28 | ||
| 33 | int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size) | 29 | int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size) |
| 34 | { | 30 | { |
| @@ -233,7 +233,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) · 232 unmodified lines | |||
| 233 | port = 80; // default mmsh protocol port | 233 | port = 80; // default mmsh protocol port |
| 234 | ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, path); | 234 | ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, path); |
| 235 | 235 | ||
| 236 | if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_RDONLY) < 0) { | 236 | if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ) < 0) { |
| 237 | return AVERROR(EIO); | 237 | return AVERROR(EIO); |
| 238 | } | 238 | } |
| 239 | 239 | ||
| @@ -261,7 +261,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) · 21 unmodified lines | |||
| 261 | // close the socket and then reopen it for sending the second play request. | 261 | // close the socket and then reopen it for sending the second play request. |
| 262 | ffurl_close(mms->mms_hd); | 262 | ffurl_close(mms->mms_hd); |
| 263 | memset(headers, 0, sizeof(headers)); | 263 | 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) { |
| 265 | return AVERROR(EIO); | 265 | return AVERROR(EIO); |
| 266 | } | 266 | } |
| 267 | stream_selection = av_mallocz(mms->stream_num * 19 + 1); | 267 | stream_selection = av_mallocz(mms->stream_num * 19 + 1); |
| @@ -523,7 +523,7 @@ static int mms_open(URLContext *h, const char *uri, int flags) · 522 unmodified lines | |||
| 523 | 523 | ||
| 524 | // establish tcp connection. | 524 | // establish tcp connection. |
| 525 | ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL); | 525 | 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); |
| 527 | if (err) | 527 | if (err) |
| 528 | goto fail; | 528 | goto fail; |
| 529 | 529 | ||
| @@ -1721,7 +1721,7 @@ static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref) · 1720 unmodified lines | |||
| 1721 | 1721 | ||
| 1722 | av_strlcat(filename, ref->path + l + 1, 1024); | 1722 | av_strlcat(filename, ref->path + l + 1, 1024); |
| 1723 | 1723 | ||
| 1724 | if (!avio_open(pb, filename, AVIO_RDONLY)) | 1724 | if (!avio_open(pb, filename, AVIO_FLAG_READ)) |
| 1725 | return 0; | 1725 | return 0; |
| 1726 | } | 1726 | } |
| 1727 | } | 1727 | } |
| @@ -676,11 +676,6 @@ static int mpegts_push_data(MpegTSFilter *filter, · 675 unmodified lines | |||
| 676 | code == 0x1be) /* padding_stream */ | 676 | code == 0x1be) /* padding_stream */ |
| 677 | goto skip; | 677 | goto skip; |
| 678 | 678 | ||
| 679 | #if FF_API_MAX_STREAMS | ||
| 680 | if (!pes->st && pes->stream->nb_streams == MAX_STREAMS) | ||
| 681 | goto skip; | ||
| 682 | #endif | ||
| 683 | |||
| 684 | /* stream not present in PMT */ | 679 | /* stream not present in PMT */ |
| 685 | if (!pes->st) { | 680 | if (!pes->st) { |
| 686 | pes->st = av_new_stream(ts->stream, pes->pid); | 681 | pes->st = av_new_stream(ts->stream, pes->pid); |
| @@ -30,11 +30,7 @@ · 29 unmodified lines | |||
| 30 | #undef NDEBUG | 30 | #undef NDEBUG |
| 31 | #include <assert.h> | 31 | #include <assert.h> |
| 32 | 32 | ||
| 33 | #if FF_API_MAX_STREAMS | ||
| 34 | #define NUT_MAX_STREAMS MAX_STREAMS | ||
| 35 | #else | ||
| 36 | #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ | 33 | #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ |
| 37 | #endif | ||
| 38 | 34 | ||
| 39 | static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){ | 35 | static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){ |
| 40 | unsigned int len= ffio_read_varlen(bc); | 36 | unsigned int len= ffio_read_varlen(bc); |
| @@ -50,10 +50,6 @@ static const AVOption options[]={ · 49 unmodified lines | |||
| 50 | {"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_NOPARSE, INT_MIN, INT_MAX, D, "fflags"}, | 50 | {"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_NOPARSE, INT_MIN, INT_MAX, D, "fflags"}, |
| 51 | {"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNDTS, INT_MIN, INT_MAX, D, "fflags"}, | 51 | {"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_IGNDTS, INT_MIN, INT_MAX, D, "fflags"}, |
| 52 | {"rtphint", "add rtp hinting", 0, FF_OPT_TYPE_CONST, AVFMT_FLAG_RTP_HINT, INT_MIN, INT_MAX, E, "fflags"}, | 52 | {"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 | ||
| 57 | {"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}, | 53 | {"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}, |
| 58 | {"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D}, | 54 | {"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, 0, 0, 0, D}, |
| 59 | {"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, 1<<20, 0, INT_MAX, D}, | 55 | {"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 | |||
| 88 | ic->av_class = &av_format_context_class; | 84 | ic->av_class = &av_format_context_class; |
| 89 | return ic; | 85 | return ic; |
| 90 | } | 86 | } |
| 91 | |||
| 92 | #if FF_API_ALLOC_FORMAT_CONTEXT | ||
| 93 | AVFormatContext *av_alloc_format_context(void) | ||
| 94 | { | ||
| 95 | return avformat_alloc_context(); | ||
| 96 | } | ||
| 97 | #endif | ||
| @@ -492,7 +492,7 @@ int main(int argc, char **argv) · 491 unmodified lines | |||
| 492 | 492 | ||
| 493 | /* open the output file, if needed */ | 493 | /* open the output file, if needed */ |
| 494 | if (!(fmt->flags & AVFMT_NOFILE)) { | 494 | 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) { |
| 496 | fprintf(stderr, "Could not open '%s'\n", filename); | 496 | fprintf(stderr, "Could not open '%s'\n", filename); |
| 497 | exit(1); | 497 | exit(1); |
| 498 | } | 498 | } |
| @@ -38,13 +38,6 @@ · 37 unmodified lines | |||
| 38 | #include "rtmppkt.h" | 38 | #include "rtmppkt.h" |
| 39 | #include "url.h" | 39 | #include "url.h" |
| 40 | 40 | ||
| 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 | |||
| 48 | //#define DEBUG | 41 | //#define DEBUG |
| 49 | 42 | ||
| 50 | /** RTMP protocol handler state */ | 43 | /** RTMP protocol handler state */ |
| @@ -166,7 +159,7 @@ static void gen_release_stream(URLContext *s, RTMPContext *rt) · 115 unmodified lines | |||
| 166 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, | 159 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, |
| 167 | 29 + strlen(rt->playpath)); | 160 | 29 + strlen(rt->playpath)); |
| 168 | 161 | ||
| 169 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Releasing stream...\n"); | 162 | av_log(s, AV_LOG_DEBUG, "Releasing stream...\n"); |
| 170 | p = pkt.data; | 163 | p = pkt.data; |
| 171 | ff_amf_write_string(&p, "releaseStream"); | 164 | ff_amf_write_string(&p, "releaseStream"); |
| 172 | ff_amf_write_number(&p, 2.0); | 165 | ff_amf_write_number(&p, 2.0); |
| @@ -189,7 +182,7 @@ static void gen_fcpublish_stream(URLContext *s, RTMPContext *rt) · 16 unmodified lines | |||
| 189 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, | 182 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, |
| 190 | 25 + strlen(rt->playpath)); | 183 | 25 + strlen(rt->playpath)); |
| 191 | 184 | ||
| 192 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "FCPublish stream...\n"); | 185 | av_log(s, AV_LOG_DEBUG, "FCPublish stream...\n"); |
| 193 | p = pkt.data; | 186 | p = pkt.data; |
| 194 | ff_amf_write_string(&p, "FCPublish"); | 187 | ff_amf_write_string(&p, "FCPublish"); |
| 195 | ff_amf_write_number(&p, 3.0); | 188 | ff_amf_write_number(&p, 3.0); |
| @@ -212,7 +205,7 @@ static void gen_fcunpublish_stream(URLContext *s, RTMPContext *rt) · 16 unmodified lines | |||
| 212 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, | 205 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, |
| 213 | 27 + strlen(rt->playpath)); | 206 | 27 + strlen(rt->playpath)); |
| 214 | 207 | ||
| 215 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "UnPublishing stream...\n"); | 208 | av_log(s, AV_LOG_DEBUG, "UnPublishing stream...\n"); |
| 216 | p = pkt.data; | 209 | p = pkt.data; |
| 217 | ff_amf_write_string(&p, "FCUnpublish"); | 210 | ff_amf_write_string(&p, "FCUnpublish"); |
| 218 | ff_amf_write_number(&p, 5.0); | 211 | ff_amf_write_number(&p, 5.0); |
| @@ -232,7 +225,7 @@ static void gen_create_stream(URLContext *s, RTMPContext *rt) · 13 unmodified lines | |||
| 232 | RTMPPacket pkt; | 225 | RTMPPacket pkt; |
| 233 | uint8_t *p; | 226 | uint8_t *p; |
| 234 | 227 | ||
| 235 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Creating stream...\n"); | 228 | av_log(s, AV_LOG_DEBUG, "Creating stream...\n"); |
| 236 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 25); | 229 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 25); |
| 237 | 230 | ||
| 238 | p = pkt.data; | 231 | p = pkt.data; |
| @@ -254,7 +247,7 @@ static void gen_delete_stream(URLContext *s, RTMPContext *rt) · 15 unmodified lines | |||
| 254 | RTMPPacket pkt; | 247 | RTMPPacket pkt; |
| 255 | uint8_t *p; | 248 | uint8_t *p; |
| 256 | 249 | ||
| 257 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Deleting stream...\n"); | 250 | av_log(s, AV_LOG_DEBUG, "Deleting stream...\n"); |
| 258 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 34); | 251 | ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE, 0, 34); |
| 259 | 252 | ||
| 260 | p = pkt.data; | 253 | p = pkt.data; |
| @@ -276,7 +269,7 @@ static void gen_play(URLContext *s, RTMPContext *rt) · 15 unmodified lines | |||
| 276 | RTMPPacket pkt; | 269 | RTMPPacket pkt; |
| 277 | uint8_t *p; | 270 | uint8_t *p; |
| 278 | 271 | ||
| 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); |
| 280 | ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0, | 273 | ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0, |
| 281 | 20 + strlen(rt->playpath)); | 274 | 20 + strlen(rt->playpath)); |
| 282 | pkt.extra = rt->main_channel_id; | 275 | pkt.extra = rt->main_channel_id; |
| @@ -310,7 +303,7 @@ static void gen_publish(URLContext *s, RTMPContext *rt) · 27 unmodified lines | |||
| 310 | RTMPPacket pkt; | 303 | RTMPPacket pkt; |
| 311 | uint8_t *p; | 304 | uint8_t *p; |
| 312 | 305 | ||
| 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); |
| 314 | ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE, 0, | 307 | ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE, 0, |
| 315 | 30 + strlen(rt->playpath)); | 308 | 30 + strlen(rt->playpath)); |
| 316 | pkt.extra = rt->main_channel_id; | 309 | pkt.extra = rt->main_channel_id; |
| @@ -478,7 +471,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 161 unmodified lines | |||
| 478 | int server_pos, client_pos; | 471 | int server_pos, client_pos; |
| 479 | uint8_t digest[32]; | 472 | uint8_t digest[32]; |
| 480 | 473 | ||
| 481 | av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Handshaking...\n"); | 474 | av_log(s, AV_LOG_DEBUG, "Handshaking...\n"); |
| 482 | 475 | ||
| 483 | av_lfg_init(&rnd, 0xDEADC0DE); | 476 | av_lfg_init(&rnd, 0xDEADC0DE); |
| 484 | // generate handshake packet - 1536 bytes of pseudorandom data | 477 | // generate handshake packet - 1536 bytes of pseudorandom data |
| @@ -489,16 +482,16 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 4 unmodified lines | |||
| 489 | ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE + 1); | 482 | ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE + 1); |
| 490 | i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1); | 483 | i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1); |
| 491 | if (i != RTMP_HANDSHAKE_PACKET_SIZE + 1) { | 484 | 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"); |
| 493 | return -1; | 486 | return -1; |
| 494 | } | 487 | } |
| 495 | i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE); | 488 | i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE); |
| 496 | if (i != RTMP_HANDSHAKE_PACKET_SIZE) { | 489 | 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"); |
| 498 | return -1; | 491 | return -1; |
| 499 | } | 492 | } |
| 500 | 493 | ||
| 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", |
| 502 | serverdata[5], serverdata[6], serverdata[7], serverdata[8]); | 495 | serverdata[5], serverdata[6], serverdata[7], serverdata[8]); |
| 503 | 496 | ||
| 504 | if (rt->is_input && serverdata[5] >= 3) { | 497 | if (rt->is_input && serverdata[5] >= 3) { |
| @@ -506,7 +499,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 1 unmodified line | |||
| 506 | if (!server_pos) { | 499 | if (!server_pos) { |
| 507 | server_pos = rtmp_validate_digest(serverdata + 1, 8); | 500 | server_pos = rtmp_validate_digest(serverdata + 1, 8); |
| 508 | if (!server_pos) { | 501 | 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"); |
| 510 | return -1; | 503 | return -1; |
| 511 | } | 504 | } |
| 512 | } | 505 | } |
| @@ -518,7 +511,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) · 5 unmodified lines | |||
| 518 | digest, 32, | 511 | digest, 32, |
| 519 | digest); | 512 | digest); |
| 520 | if (memcmp(digest, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) { | 513 | 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"); |
| 522 | return -1; | 515 | return -1; |
| 523 | } | 516 | } |
| 524 | 517 | ||
| @@ -552,13 +545,13 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 27 unmodified lines | |||
| 552 | const uint8_t *data_end = pkt->data + pkt->data_size; | 545 | const uint8_t *data_end = pkt->data + pkt->data_size; |
| 553 | 546 | ||
| 554 | #ifdef DEBUG | 547 | #ifdef DEBUG |
| 555 | ff_rtmp_packet_dump(LOG_CONTEXT, pkt); | 548 | ff_rtmp_packet_dump(s, pkt); |
| 556 | #endif | 549 | #endif |
| 557 | 550 | ||
| 558 | switch (pkt->type) { | 551 | switch (pkt->type) { |
| 559 | case RTMP_PT_CHUNK_SIZE: | 552 | case RTMP_PT_CHUNK_SIZE: |
| 560 | if (pkt->data_size != 4) { | 553 | if (pkt->data_size != 4) { |
| 561 | av_log(LOG_CONTEXT, AV_LOG_ERROR, | 554 | av_log(s, AV_LOG_ERROR, |
| 562 | "Chunk size change packet is not 4 bytes long (%d)\n", pkt->data_size); | 555 | "Chunk size change packet is not 4 bytes long (%d)\n", pkt->data_size); |
| 563 | return -1; | 556 | return -1; |
| 564 | } | 557 | } |
| @@ -566,10 +559,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 1 unmodified line | |||
| 566 | ff_rtmp_packet_write(rt->stream, pkt, rt->chunk_size, rt->prev_pkt[1]); | 559 | ff_rtmp_packet_write(rt->stream, pkt, rt->chunk_size, rt->prev_pkt[1]); |
| 567 | rt->chunk_size = AV_RB32(pkt->data); | 560 | rt->chunk_size = AV_RB32(pkt->data); |
| 568 | if (rt->chunk_size <= 0) { | 561 | 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); |
| 570 | return -1; | 563 | return -1; |
| 571 | } | 564 | } |
| 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); |
| 573 | break; | 566 | break; |
| 574 | case RTMP_PT_PING: | 567 | case RTMP_PT_PING: |
| 575 | t = AV_RB16(pkt->data); | 568 | t = AV_RB16(pkt->data); |
| @@ -578,12 +571,12 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 2 unmodified lines | |||
| 578 | break; | 571 | break; |
| 579 | case RTMP_PT_CLIENT_BW: | 572 | case RTMP_PT_CLIENT_BW: |
| 580 | if (pkt->data_size < 4) { | 573 | if (pkt->data_size < 4) { |
| 581 | av_log(LOG_CONTEXT, AV_LOG_ERROR, | 574 | av_log(s, AV_LOG_ERROR, |
| 582 | "Client bandwidth report packet is less than 4 bytes long (%d)\n", | 575 | "Client bandwidth report packet is less than 4 bytes long (%d)\n", |
| 583 | pkt->data_size); | 576 | pkt->data_size); |
| 584 | return -1; | 577 | return -1; |
| 585 | } | 578 | } |
| 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)); |
| 587 | rt->client_report_size = AV_RB32(pkt->data) >> 1; | 580 | rt->client_report_size = AV_RB32(pkt->data) >> 1; |
| 588 | break; | 581 | break; |
| 589 | case RTMP_PT_INVOKE: | 582 | case RTMP_PT_INVOKE: |
| @@ -593,7 +586,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 3 unmodified lines | |||
| 593 | 586 | ||
| 594 | if (!ff_amf_get_field_value(pkt->data + 9, data_end, | 587 | if (!ff_amf_get_field_value(pkt->data + 9, data_end, |
| 595 | "description", tmpstr, sizeof(tmpstr))) | 588 | "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); |
| 597 | return -1; | 590 | return -1; |
| 598 | } else if (!memcmp(pkt->data, "\002\000\007_result", 10)) { | 591 | } else if (!memcmp(pkt->data, "\002\000\007_result", 10)) { |
| 599 | switch (rt->state) { | 592 | switch (rt->state) { |
| @@ -624,7 +617,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 24 unmodified lines | |||
| 624 | case STATE_CONNECTING: | 617 | case STATE_CONNECTING: |
| 625 | //extract a number from the result | 618 | //extract a number from the result |
| 626 | if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) { | 619 | 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"); |
| 628 | } else { | 621 | } else { |
| 629 | rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21)); | 622 | rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21)); |
| 630 | } | 623 | } |
| @@ -651,7 +644,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 20 unmodified lines | |||
| 651 | if (!t && !strcmp(tmpstr, "error")) { | 644 | if (!t && !strcmp(tmpstr, "error")) { |
| 652 | if (!ff_amf_get_field_value(ptr, data_end, | 645 | if (!ff_amf_get_field_value(ptr, data_end, |
| 653 | "description", tmpstr, sizeof(tmpstr))) | 646 | "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); |
| 655 | return -1; | 648 | return -1; |
| 656 | } | 649 | } |
| 657 | t = ff_amf_get_field_value(ptr, data_end, | 650 | 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 | |||
| 701 | } | 694 | } |
| 702 | rt->bytes_read += ret; | 695 | rt->bytes_read += ret; |
| 703 | if (rt->bytes_read > rt->last_bytes_read + rt->client_report_size) { | 696 | 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"); |
| 705 | gen_bytes_read(s, rt, rpkt.timestamp + 1); | 698 | gen_bytes_read(s, rt, rpkt.timestamp + 1); |
| 706 | rt->last_bytes_read = rt->bytes_read; | 699 | rt->last_bytes_read = rt->bytes_read; |
| 707 | } | 700 | } |
| @@ -812,7 +805,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 104 unmodified lines | |||
| 812 | if (!rt) | 805 | if (!rt) |
| 813 | return AVERROR(ENOMEM); | 806 | return AVERROR(ENOMEM); |
| 814 | s->priv_data = rt; | 807 | s->priv_data = rt; |
| 815 | rt->is_input = !(flags & AVIO_WRONLY); | 808 | rt->is_input = !(flags & AVIO_FLAG_WRITE); |
| 816 | 809 | ||
| 817 | av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port, | 810 | av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port, |
| 818 | path, sizeof(path), s->filename); | 811 | path, sizeof(path), s->filename); |
| @@ -821,8 +814,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 2 unmodified lines | |||
| 821 | port = RTMP_DEFAULT_PORT; | 814 | port = RTMP_DEFAULT_PORT; |
| 822 | ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL); | 815 | ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL); |
| 823 | 816 | ||
| 824 | if (ffurl_open(&rt->stream, buf, AVIO_RDWR) < 0) { | 817 | if (ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE) < 0) { |
| 825 | av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot open connection %s\n", buf); | 818 | av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf); |
| 826 | goto fail; | 819 | goto fail; |
| 827 | } | 820 | } |
| 828 | 821 | ||
| @@ -866,7 +859,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) · 37 unmodified lines | |||
| 866 | rt->bytes_read = 0; | 859 | rt->bytes_read = 0; |
| 867 | rt->last_bytes_read = 0; | 860 | rt->last_bytes_read = 0; |
| 868 | 861 | ||
| 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", |
| 870 | proto, path, rt->app, rt->playpath); | 863 | proto, path, rt->app, rt->playpath); |
| 871 | gen_connect(s, rt, proto, hostname, port); | 864 | gen_connect(s, rt, proto, hostname, port); |
| 872 | 865 | ||
| @@ -933,7 +926,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size) · 60 unmodified lines | |||
| 933 | const uint8_t *buf_temp = buf; | 926 | const uint8_t *buf_temp = buf; |
| 934 | 927 | ||
| 935 | if (size < 11) { | 928 | 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); |
| 937 | return 0; | 930 | return 0; |
| 938 | } | 931 | } |
| 939 | 932 | ||
| @@ -145,7 +145,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags) · 144 unmodified lines | |||
| 145 | char path[1024]; | 145 | char path[1024]; |
| 146 | const char *p; | 146 | const char *p; |
| 147 | 147 | ||
| 148 | is_output = (flags & AVIO_WRONLY); | 148 | is_output = (flags & AVIO_FLAG_WRITE); |
| 149 | 149 | ||
| 150 | s = av_mallocz(sizeof(RTPContext)); | 150 | s = av_mallocz(sizeof(RTPContext)); |
| 151 | if (!s) | 151 | if (!s) |
| @@ -1116,14 +1116,14 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 1115 unmodified lines | |||
| 1116 | "?localport=%d", j); | 1116 | "?localport=%d", j); |
| 1117 | /* we will use two ports per rtp stream (rtp and rtcp) */ | 1117 | /* we will use two ports per rtp stream (rtp and rtcp) */ |
| 1118 | j += 2; | 1118 | 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) |
| 1120 | goto rtp_opened; | 1120 | goto rtp_opened; |
| 1121 | } | 1121 | } |
| 1122 | } | 1122 | } |
| 1123 | 1123 | ||
| 1124 | #if 0 | 1124 | #if 0 |
| 1125 | /* then try on any port */ | 1125 | /* 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) { |
| 1127 | err = AVERROR_INVALIDDATA; | 1127 | err = AVERROR_INVALIDDATA; |
| 1128 | goto fail; | 1128 | goto fail; |
| 1129 | } | 1129 | } |
| @@ -1269,7 +1269,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 139 unmodified lines | |||
| 1269 | namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); | 1269 | namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); |
| 1270 | ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, | 1270 | ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, |
| 1271 | port, "?ttl=%d", ttl); | 1271 | 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) { |
| 1273 | err = AVERROR_INVALIDDATA; | 1273 | err = AVERROR_INVALIDDATA; |
| 1274 | goto fail; | 1274 | goto fail; |
| 1275 | } | 1275 | } |
| @@ -1396,7 +1396,7 @@ redirect: · 120 unmodified lines | |||
| 1396 | av_get_random_seed(), av_get_random_seed()); | 1396 | av_get_random_seed(), av_get_random_seed()); |
| 1397 | 1397 | ||
| 1398 | /* GET requests */ | 1398 | /* 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) { |
| 1400 | err = AVERROR(EIO); | 1400 | err = AVERROR(EIO); |
| 1401 | goto fail; | 1401 | goto fail; |
| 1402 | } | 1402 | } |
| @@ -1417,7 +1417,7 @@ redirect: · 14 unmodified lines | |||
| 1417 | } | 1417 | } |
| 1418 | 1418 | ||
| 1419 | /* POST requests */ | 1419 | /* 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 ) { |
| 1421 | err = AVERROR(EIO); | 1421 | err = AVERROR(EIO); |
| 1422 | goto fail; | 1422 | goto fail; |
| 1423 | } | 1423 | } |
| @@ -1460,7 +1460,7 @@ redirect: · 36 unmodified lines | |||
| 1460 | } else { | 1460 | } else { |
| 1461 | /* open the tcp connection */ | 1461 | /* open the tcp connection */ |
| 1462 | ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL); | 1462 | 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) { |
| 1464 | err = AVERROR(EIO); | 1464 | err = AVERROR(EIO); |
| 1465 | goto fail; | 1465 | goto fail; |
| 1466 | } | 1466 | } |
| @@ -1807,7 +1807,7 @@ static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) · 340 unmodified lines | |||
| 1807 | namebuf, rtsp_st->sdp_port, | 1807 | namebuf, rtsp_st->sdp_port, |
| 1808 | "?localport=%d&ttl=%d", rtsp_st->sdp_port, | 1808 | "?localport=%d&ttl=%d", rtsp_st->sdp_port, |
| 1809 | rtsp_st->sdp_ttl); | 1809 | 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) { |
| 1811 | err = AVERROR_INVALIDDATA; | 1811 | err = AVERROR_INVALIDDATA; |
| 1812 | goto fail; | 1812 | goto fail; |
| 1813 | } | 1813 | } |
| @@ -1863,7 +1863,7 @@ static int rtp_read_header(AVFormatContext *s, · 49 unmodified lines | |||
| 1863 | if (!ff_network_init()) | 1863 | if (!ff_network_init()) |
| 1864 | return AVERROR(EIO); | 1864 | return AVERROR(EIO); |
| 1865 | 1865 | ||
| 1866 | ret = ffurl_open(&in, s->filename, AVIO_RDONLY); | 1866 | ret = ffurl_open(&in, s->filename, AVIO_FLAG_READ); |
| 1867 | if (ret) | 1867 | if (ret) |
| 1868 | goto fail; | 1868 | goto fail; |
| 1869 | 1869 | ||
| @@ -85,7 +85,7 @@ static int sap_read_header(AVFormatContext *s, · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d", | 86 | ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d", |
| 87 | port); | 87 | port); |
| 88 | ret = ffurl_open(&sap->ann_fd, url, AVIO_RDONLY); | 88 | ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_READ); |
| 89 | if (ret) | 89 | if (ret) |
| 90 | goto fail; | 90 | goto fail; |
| 91 | 91 | ||
| @@ -146,7 +146,7 @@ static int sap_write_header(AVFormatContext *s) · 145 unmodified lines | |||
| 146 | "?ttl=%d", ttl); | 146 | "?ttl=%d", ttl); |
| 147 | if (!same_port) | 147 | if (!same_port) |
| 148 | base_port += 2; | 148 | base_port += 2; |
| 149 | ret = ffurl_open(&fd, url, AVIO_WRONLY); | 149 | ret = ffurl_open(&fd, url, AVIO_FLAG_WRITE); |
| 150 | if (ret) { | 150 | if (ret) { |
| 151 | ret = AVERROR(EIO); | 151 | ret = AVERROR(EIO); |
| 152 | goto fail; | 152 | goto fail; |
| @@ -158,7 +158,7 @@ static int sap_write_header(AVFormatContext *s) · 5 unmodified lines | |||
| 158 | 158 | ||
| 159 | ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port, | 159 | ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port, |
| 160 | "?ttl=%d&connect=1", ttl); | 160 | "?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); |
| 162 | if (ret) { | 162 | if (ret) { |
| 163 | ret = AVERROR(EIO); | 163 | ret = AVERROR(EIO); |
| 164 | goto fail; | 164 | goto fail; |
| @@ -292,10 +292,7 @@ int ff_udp_get_local_port(URLContext *h) · 291 unmodified lines | |||
| 292 | * streams at the same time. | 292 | * streams at the same time. |
| 293 | * @param h media file context | 293 | * @param h media file context |
| 294 | */ | 294 | */ |
| 295 | #if !FF_API_UDP_GET_FILE | 295 | static int udp_get_file_handle(URLContext *h) |
| 296 | static | ||
| 297 | #endif | ||
| 298 | int udp_get_file_handle(URLContext *h) | ||
| 299 | { | 296 | { |
| 300 | UDPContext *s = h->priv_data; | 297 | UDPContext *s = h->priv_data; |
| 301 | return s->udp_fd; | 298 | return s->udp_fd; |
| @@ -318,7 +315,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 16 unmodified lines | |||
| 318 | h->is_streamed = 1; | 315 | h->is_streamed = 1; |
| 319 | h->max_packet_size = 1472; | 316 | h->max_packet_size = 1472; |
| 320 | 317 | ||
| 321 | is_output = (flags & AVIO_WRONLY); | 318 | is_output = (flags & AVIO_FLAG_WRITE); |
| 322 | 319 | ||
| 323 | s = av_mallocz(sizeof(UDPContext)); | 320 | s = av_mallocz(sizeof(UDPContext)); |
| 324 | if (!s) | 321 | if (!s) |
| @@ -361,14 +358,14 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 36 unmodified lines | |||
| 361 | /* XXX: fix av_url_split */ | 358 | /* XXX: fix av_url_split */ |
| 362 | if (hostname[0] == '\0' || hostname[0] == '?') { | 359 | if (hostname[0] == '\0' || hostname[0] == '?') { |
| 363 | /* only accepts null hostname if input */ | 360 | /* only accepts null hostname if input */ |
| 364 | if (flags & AVIO_WRONLY) | 361 | if (flags & AVIO_FLAG_WRITE) |
| 365 | goto fail; | 362 | goto fail; |
| 366 | } else { | 363 | } else { |
| 367 | if (ff_udp_set_remote_url(h, uri) < 0) | 364 | if (ff_udp_set_remote_url(h, uri) < 0) |
| 368 | goto fail; | 365 | goto fail; |
| 369 | } | 366 | } |
| 370 | 367 | ||
| 371 | if (s->is_multicast && !(h->flags & AVIO_WRONLY)) | 368 | if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) |
| 372 | s->local_port = port; | 369 | s->local_port = port; |
| 373 | udp_fd = udp_socket_create(s, &my_addr, &len); | 370 | udp_fd = udp_socket_create(s, &my_addr, &len); |
| 374 | if (udp_fd < 0) | 371 | if (udp_fd < 0) |
| @@ -385,7 +382,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 10 unmodified lines | |||
| 385 | 382 | ||
| 386 | /* the bind is needed to give a port to the socket now */ | 383 | /* the bind is needed to give a port to the socket now */ |
| 387 | /* if multicast, try the multicast address bind first */ | 384 | /* 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)) { |
| 389 | bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len); | 386 | bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len); |
| 390 | } | 387 | } |
| 391 | /* bind to the local address if not multicast or if the multicast | 388 | /* 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 | |||
| 398 | s->local_port = udp_port(&my_addr, len); | 395 | s->local_port = udp_port(&my_addr, len); |
| 399 | 396 | ||
| 400 | if (s->is_multicast) { | 397 | if (s->is_multicast) { |
| 401 | if (h->flags & AVIO_WRONLY) { | 398 | if (h->flags & AVIO_FLAG_WRITE) { |
| 402 | /* output */ | 399 | /* output */ |
| 403 | if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0) | 400 | if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0) |
| 404 | goto fail; | 401 | goto fail; |
| @@ -481,7 +478,7 @@ static int udp_close(URLContext *h) · 76 unmodified lines | |||
| 481 | { | 478 | { |
| 482 | UDPContext *s = h->priv_data; | 479 | UDPContext *s = h->priv_data; |
| 483 | 480 | ||
| 484 | if (s->is_multicast && !(h->flags & AVIO_WRONLY)) | 481 | if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) |
| 485 | udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); | 482 | udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); |
| 486 | closesocket(s->udp_fd); | 483 | closesocket(s->udp_fd); |
| 487 | av_free(s); | 484 | av_free(s); |
| @@ -116,15 +116,9 @@ static void av_frac_add(AVFrac *f, int64_t incr) · 115 unmodified lines | |||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | /** head of registered input format linked list */ | 118 | /** head of registered input format linked list */ |
| 119 | #if !FF_API_FIRST_FORMAT | 119 | static AVInputFormat *first_iformat = NULL; |
| 120 | static | ||
| 121 | #endif | ||
| 122 | AVInputFormat *first_iformat = NULL; | ||
| 123 | /** head of registered output format linked list */ | 120 | /** head of registered output format linked list */ |
| 124 | #if !FF_API_FIRST_FORMAT | 121 | static AVOutputFormat *first_oformat = NULL; |
| 125 | static | ||
| 126 | #endif | ||
| 127 | AVOutputFormat *first_oformat = NULL; | ||
| 128 | 122 | ||
| 129 | AVInputFormat *av_iformat_next(AVInputFormat *f) | 123 | AVInputFormat *av_iformat_next(AVInputFormat *f) |
| 130 | { | 124 | { |
| @@ -201,14 +195,6 @@ static int match_format(const char *name, const char *names) · 70 unmodified lines | |||
| 201 | return !strcasecmp(name, names); | 195 | return !strcasecmp(name, names); |
| 202 | } | 196 | } |
| 203 | 197 | ||
| 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 | |||
| 212 | AVOutputFormat *av_guess_format(const char *short_name, const char *filename, | 198 | AVOutputFormat *av_guess_format(const char *short_name, const char *filename, |
| 213 | const char *mime_type) | 199 | const char *mime_type) |
| 214 | { | 200 | { |
| @@ -244,27 +230,6 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename, · 29 unmodified lines | |||
| 244 | return fmt_found; | 230 | return fmt_found; |
| 245 | } | 231 | } |
| 246 | 232 | ||
| 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 | |||
| 268 | enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, | 233 | enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, |
| 269 | const char *filename, const char *mime_type, enum AVMediaType type){ | 234 | const char *filename, const char *mime_type, enum AVMediaType type){ |
| 270 | if(type == AVMEDIA_TYPE_VIDEO){ | 235 | if(type == AVMEDIA_TYPE_VIDEO){ |
| @@ -296,38 +261,6 @@ AVInputFormat *av_find_input_format(const char *short_name) · 25 unmodified lines | |||
| 296 | return NULL; | 261 | return NULL; |
| 297 | } | 262 | } |
| 298 | 263 | ||
| 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 | ||
| 331 | 264 | ||
| 332 | int av_get_packet(AVIOContext *s, AVPacket *pkt, int size) | 265 | int av_get_packet(AVIOContext *s, AVPacket *pkt, int size) |
| 333 | { | 266 | { |
| @@ -513,10 +446,6 @@ int av_open_input_stream(AVFormatContext **ic_ptr, · 179 unmodified lines | |||
| 513 | if (pb && !ic->data_offset) | 446 | if (pb && !ic->data_offset) |
| 514 | ic->data_offset = avio_tell(ic->pb); | 447 | ic->data_offset = avio_tell(ic->pb); |
| 515 | 448 | ||
| 516 | #if FF_API_OLD_METADATA | ||
| 517 | ff_metadata_demux_compat(ic); | ||
| 518 | #endif | ||
| 519 | |||
| 520 | ic->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE; | 449 | ic->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE; |
| 521 | 450 | ||
| 522 | *ic_ptr = ic; | 451 | *ic_ptr = ic; |
| @@ -637,7 +566,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, · 114 unmodified lines | |||
| 637 | hack needed to handle RTSP/TCP */ | 566 | hack needed to handle RTSP/TCP */ |
| 638 | if (!fmt || !(fmt->flags & AVFMT_NOFILE)) { | 567 | if (!fmt || !(fmt->flags & AVFMT_NOFILE)) { |
| 639 | /* if no file needed do not try to open one */ | 568 | /* 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) { |
| 641 | goto fail; | 570 | goto fail; |
| 642 | } | 571 | } |
| 643 | if (buf_size > 0) { | 572 | if (buf_size > 0) { |
| @@ -2639,18 +2568,11 @@ void avformat_free_context(AVFormatContext *s) · 1995 unmodified lines | |||
| 2639 | av_free(st->codec->extradata); | 2568 | av_free(st->codec->extradata); |
| 2640 | av_free(st->codec->subtitle_header); | 2569 | av_free(st->codec->subtitle_header); |
| 2641 | av_free(st->codec); | 2570 | av_free(st->codec); |
| 2642 | #if FF_API_OLD_METADATA | ||
| 2643 | av_free(st->filename); | ||
| 2644 | #endif | ||
| 2645 | av_free(st->priv_data); | 2571 | av_free(st->priv_data); |
| 2646 | av_free(st->info); | 2572 | av_free(st->info); |
| 2647 | av_free(st); | 2573 | av_free(st); |
| 2648 | } | 2574 | } |
| 2649 | for(i=s->nb_programs-1; i>=0; i--) { | 2575 | 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 | ||
| 2654 | av_metadata_free(&s->programs[i]->metadata); | 2576 | av_metadata_free(&s->programs[i]->metadata); |
| 2655 | av_freep(&s->programs[i]->stream_index); | 2577 | av_freep(&s->programs[i]->stream_index); |
| 2656 | av_freep(&s->programs[i]); | 2578 | av_freep(&s->programs[i]); |
| @@ -2658,9 +2580,6 @@ void avformat_free_context(AVFormatContext *s) · 1 unmodified line | |||
| 2658 | av_freep(&s->programs); | 2580 | av_freep(&s->programs); |
| 2659 | av_freep(&s->priv_data); | 2581 | av_freep(&s->priv_data); |
| 2660 | while(s->nb_chapters--) { | 2582 | while(s->nb_chapters--) { |
| 2661 | #if FF_API_OLD_METADATA | ||
| 2662 | av_free(s->chapters[s->nb_chapters]->title); | ||
| 2663 | #endif | ||
| 2664 | av_metadata_free(&s->chapters[s->nb_chapters]->metadata); | 2583 | av_metadata_free(&s->chapters[s->nb_chapters]->metadata); |
| 2665 | av_free(s->chapters[s->nb_chapters]); | 2584 | av_free(s->chapters[s->nb_chapters]); |
| 2666 | } | 2585 | } |
| @@ -2682,13 +2601,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) · 15 unmodified lines | |||
| 2682 | { | 2601 | { |
| 2683 | AVStream *st; | 2602 | AVStream *st; |
| 2684 | int i; | 2603 | 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 | ||
| 2692 | AVStream **streams; | 2604 | AVStream **streams; |
| 2693 | 2605 | ||
| 2694 | if (s->nb_streams >= INT_MAX/sizeof(*streams)) | 2606 | if (s->nb_streams >= INT_MAX/sizeof(*streams)) |
| @@ -2697,7 +2609,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id) · 2 unmodified lines | |||
| 2697 | if (!streams) | 2609 | if (!streams) |
| 2698 | return NULL; | 2610 | return NULL; |
| 2699 | s->streams = streams; | 2611 | s->streams = streams; |
| 2700 | #endif | ||
| 2701 | 2612 | ||
| 2702 | st = av_mallocz(sizeof(AVStream)); | 2613 | st = av_mallocz(sizeof(AVStream)); |
| 2703 | if (!st) | 2614 | if (!st) |
| @@ -2777,9 +2688,6 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6 · 73 unmodified lines | |||
| 2777 | return NULL; | 2688 | return NULL; |
| 2778 | dynarray_add(&s->chapters, &s->nb_chapters, chapter); | 2689 | dynarray_add(&s->chapters, &s->nb_chapters, chapter); |
| 2779 | } | 2690 | } |
| 2780 | #if FF_API_OLD_METADATA | ||
| 2781 | av_free(chapter->title); | ||
| 2782 | #endif | ||
| 2783 | av_metadata_set2(&chapter->metadata, "title", title, 0); | 2691 | av_metadata_set2(&chapter->metadata, "title", title, 0); |
| 2784 | chapter->id = id; | 2692 | chapter->id = id; |
| 2785 | chapter->time_base= time_base; | 2693 | chapter->time_base= time_base; |
| @@ -2917,10 +2825,6 @@ int av_write_header(AVFormatContext *s) · 131 unmodified lines | |||
| 2917 | return AVERROR(ENOMEM); | 2825 | return AVERROR(ENOMEM); |
| 2918 | } | 2826 | } |
| 2919 | 2827 | ||
| 2920 | #if FF_API_OLD_METADATA | ||
| 2921 | ff_metadata_mux_compat(s); | ||
| 2922 | #endif | ||
| 2923 | |||
| 2924 | /* set muxer identification string */ | 2828 | /* set muxer identification string */ |
| 2925 | if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { | 2829 | if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { |
| 2926 | av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0); | 2830 | av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0); |
| @@ -3408,24 +3312,6 @@ void av_dump_format(AVFormatContext *ic, · 481 unmodified lines | |||
| 3408 | av_free(printed); | 3312 | av_free(printed); |
| 3409 | } | 3313 | } |
| 3410 | 3314 | ||
| 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 | |||
| 3429 | int64_t av_gettime(void) | 3315 | int64_t av_gettime(void) |
| 3430 | { | 3316 | { |
| 3431 | struct timeval tv; | 3317 | struct timeval tv; |
| @@ -3605,24 +3491,6 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, · 173 unmodified lines | |||
| 3605 | pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base); | 3491 | pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base); |
| 3606 | } | 3492 | } |
| 3607 | 3493 | ||
| 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 | |||
| 3626 | void av_url_split(char *proto, int proto_size, | 3494 | void av_url_split(char *proto, int proto_size, |
| 3627 | char *authorization, int authorization_size, | 3495 | char *authorization, int authorization_size, |
| 3628 | char *hostname, int hostname_size, | 3496 | char *hostname, int hostname_size, |
| @@ -23,8 +23,8 @@ · 22 unmodified lines | |||
| 23 | 23 | ||
| 24 | #include "libavutil/avutil.h" | 24 | #include "libavutil/avutil.h" |
| 25 | 25 | ||
| 26 | #define LIBAVFORMAT_VERSION_MAJOR 52 | 26 | #define LIBAVFORMAT_VERSION_MAJOR 53 |
| 27 | #define LIBAVFORMAT_VERSION_MINOR 108 | 27 | #define LIBAVFORMAT_VERSION_MINOR 0 |
| 28 | #define LIBAVFORMAT_VERSION_MICRO 0 | 28 | #define LIBAVFORMAT_VERSION_MICRO 0 |
| 29 | 29 | ||
| 30 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ | 30 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
| @@ -41,60 +41,15 @@ · 10 unmodified lines | |||
| 41 | * Those FF_API_* defines are not part of public API. | 41 | * Those FF_API_* defines are not part of public API. |
| 42 | * They may change, break or disappear at any time. | 42 | * They may change, break or disappear at any time. |
| 43 | */ | 43 | */ |
| 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 | ||
| 50 | #ifndef FF_API_OLD_METADATA2 | 44 | #ifndef FF_API_OLD_METADATA2 |
| 51 | #define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) | 45 | #define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) |
| 52 | #endif | 46 | #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 | ||
| 77 | #ifndef FF_API_READ_SEEK | 47 | #ifndef FF_API_READ_SEEK |
| 78 | #define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54) | 48 | #define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54) |
| 79 | #endif | 49 | #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 | ||
| 92 | #ifndef FF_API_OLD_AVIO | 50 | #ifndef FF_API_OLD_AVIO |
| 93 | #define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) | 51 | #define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) |
| 94 | #endif | 52 | #endif |
| 95 | #ifndef FF_API_INDEX_BUILT | ||
| 96 | #define FF_API_INDEX_BUILT (LIBAVFORMAT_VERSION_MAJOR < 53) | ||
| 97 | #endif | ||
| 98 | #ifndef FF_API_DUMP_FORMAT | 53 | #ifndef FF_API_DUMP_FORMAT |
| 99 | #define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) | 54 | #define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) |
| 100 | #endif | 55 | #endif |
| @@ -39,9 +39,9 @@ · 38 unmodified lines | |||
| 39 | #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c | 39 | #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c |
| 40 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) | 40 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) |
| 41 | 41 | ||
| 42 | #define LIBAVUTIL_VERSION_MAJOR 50 | 42 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 43 | #define LIBAVUTIL_VERSION_MINOR 40 | 43 | #define LIBAVUTIL_VERSION_MINOR 0 |
| 44 | #define LIBAVUTIL_VERSION_MICRO 1 | 44 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 45 | 45 | ||
| 46 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 46 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 47 | LIBAVUTIL_VERSION_MINOR, \ | 47 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -58,7 +58,7 @@ · 10 unmodified lines | |||
| 58 | * They may change, break or disappear at any time. | 58 | * They may change, break or disappear at any time. |
| 59 | */ | 59 | */ |
| 60 | #ifndef FF_API_OLD_EVAL_NAMES | 60 | #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) |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | /** | 64 | /** |
| @@ -97,14 +97,6 @@ enum AVMediaType { · 32 unmodified lines | |||
| 97 | #define AV_TIME_BASE 1000000 | 97 | #define AV_TIME_BASE 1000000 |
| 98 | #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} | 98 | #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} |
| 99 | 99 | ||
| 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 | |||
| 108 | #include "common.h" | 100 | #include "common.h" |
| 109 | #include "error.h" | 101 | #include "error.h" |
| 110 | #include "mathematics.h" | 102 | #include "mathematics.h" |
| @@ -37,25 +37,19 @@ · 36 unmodified lines | |||
| 37 | #define AVUNERROR(e) (e) | 37 | #define AVUNERROR(e) (e) |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #if LIBAVUTIL_VERSION_MAJOR < 51 | ||
| 41 | #define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input | ||
| 42 | #define AVERROR_IO AVERROR(EIO) ///< I/O error | 40 | #define AVERROR_IO AVERROR(EIO) ///< I/O error |
| 43 | #define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory | 41 | #define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory |
| 44 | #define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format | 42 | #define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format |
| 45 | #define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory | 43 | #define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory |
| 46 | #define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported | 44 | #define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported |
| 47 | #define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename | ||
| 48 | #define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error | 45 | #define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error |
| 49 | #endif | ||
| 50 | 46 | ||
| 51 | #define AVERROR_EOF AVERROR(EPIPE) ///< End of file | 47 | #define AVERROR_EOF AVERROR(EPIPE) ///< End of file |
| 52 | 48 | ||
| 53 | #define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome | 49 | #define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome |
| 54 | 50 | ||
| 55 | #if LIBAVUTIL_VERSION_MAJOR > 50 | ||
| 56 | #define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input | 51 | #define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input |
| 57 | #define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename | 52 | #define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename |
| 58 | #endif | ||
| 59 | 53 | ||
| 60 | #define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found | 54 | #define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found |
| 61 | #define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found | 55 | #define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found |
| @@ -47,7 +47,6 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, · 46 unmodified lines | |||
| 47 | av_unused void *ptr; | 47 | av_unused void *ptr; |
| 48 | off_t off_size; | 48 | off_t off_size; |
| 49 | char errbuf[128]; | 49 | char errbuf[128]; |
| 50 | size_t max_size = HAVE_MMAP ? SIZE_MAX : FF_INTERNAL_MEM_TYPE_MAX_VALUE; | ||
| 51 | *bufptr = NULL; | 50 | *bufptr = NULL; |
| 52 | 51 | ||
| 53 | if (fd < 0) { | 52 | if (fd < 0) { |
| @@ -66,7 +65,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, · 12 unmodified lines | |||
| 66 | } | 65 | } |
| 67 | 66 | ||
| 68 | off_size = st.st_size; | 67 | off_size = st.st_size; |
| 69 | if (off_size > max_size) { | 68 | if (off_size > SIZE_MAX) { |
| 70 | av_log(&file_log_ctx, AV_LOG_ERROR, | 69 | av_log(&file_log_ctx, AV_LOG_ERROR, |
| 71 | "File size for file '%s' is too big\n", filename); | 70 | "File size for file '%s' is too big\n", filename); |
| 72 | close(fd); | 71 | close(fd); |
| @@ -266,32 +266,3 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], · 265 unmodified lines | |||
| 266 | } | 266 | } |
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 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 | ||
| @@ -127,23 +127,4 @@ int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *lo · 126 unmodified lines | |||
| 127 | 127 | ||
| 128 | int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt); | 128 | int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt); |
| 129 | 129 | ||
| 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 | |||
| 149 | #endif /* AVUTIL_IMGUTILS_H */ | 130 | #endif /* AVUTIL_IMGUTILS_H */ |
| @@ -29,10 +29,7 @@ · 28 unmodified lines | |||
| 29 | #include "avutil.h" | 29 | #include "avutil.h" |
| 30 | #include "log.h" | 30 | #include "log.h" |
| 31 | 31 | ||
| 32 | #if LIBAVUTIL_VERSION_MAJOR > 50 | 32 | static int av_log_level = AV_LOG_INFO; |
| 33 | static | ||
| 34 | #endif | ||
| 35 | int av_log_level = AV_LOG_INFO; | ||
| 36 | static int flags; | 33 | static int flags; |
| 37 | 34 | ||
| 38 | #if defined(_WIN32) && !defined(__MINGW32CE__) | 35 | #if defined(_WIN32) && !defined(__MINGW32CE__) |
| @@ -61,7 +61,7 @@ void free(void *ptr); · 60 unmodified lines | |||
| 61 | memory allocator. You do not need to suppress this file because the | 61 | memory allocator. You do not need to suppress this file because the |
| 62 | linker will do it automatically. */ | 62 | linker will do it automatically. */ |
| 63 | 63 | ||
| 64 | void *av_malloc(FF_INTERNAL_MEM_TYPE size) | 64 | void *av_malloc(size_t size) |
| 65 | { | 65 | { |
| 66 | void *ptr = NULL; | 66 | void *ptr = NULL; |
| 67 | #if CONFIG_MEMALIGN_HACK | 67 | #if CONFIG_MEMALIGN_HACK |
| @@ -116,7 +116,7 @@ void *av_malloc(FF_INTERNAL_MEM_TYPE size) · 48 unmodified lines | |||
| 116 | return ptr; | 116 | return ptr; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) | 119 | void *av_realloc(void *ptr, size_t size) |
| 120 | { | 120 | { |
| 121 | #if CONFIG_MEMALIGN_HACK | 121 | #if CONFIG_MEMALIGN_HACK |
| 122 | int diff; | 122 | int diff; |
| @@ -153,7 +153,7 @@ void av_freep(void *arg) · 30 unmodified lines | |||
| 153 | *ptr = NULL; | 153 | *ptr = NULL; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | void *av_mallocz(FF_INTERNAL_MEM_TYPE size) | 156 | void *av_mallocz(size_t size) |
| 157 | { | 157 | { |
| 158 | void *ptr = av_malloc(size); | 158 | void *ptr = av_malloc(size); |
| 159 | if (ptr) | 159 | if (ptr) |
| @@ -62,14 +62,6 @@ · 61 unmodified lines | |||
| 62 | #define av_alloc_size(n) | 62 | #define av_alloc_size(n) |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 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 | |||
| 73 | /** | 65 | /** |
| 74 | * Allocate a block of size bytes with alignment suitable for all | 66 | * Allocate a block of size bytes with alignment suitable for all |
| 75 | * memory accesses (including vectors if available on the CPU). | 67 | * memory accesses (including vectors if available on the CPU). |
| @@ -78,7 +70,7 @@ · 2 unmodified lines | |||
| 78 | * be allocated. | 70 | * be allocated. |
| 79 | * @see av_mallocz() | 71 | * @see av_mallocz() |
| 80 | */ | 72 | */ |
| 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); |
| 82 | 74 | ||
| 83 | /** | 75 | /** |
| 84 | * Allocate or reallocate a block of memory. | 76 | * 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 | |||
| 92 | * cannot be reallocated or the function is used to free the memory block. | 84 | * cannot be reallocated or the function is used to free the memory block. |
| 93 | * @see av_fast_realloc() | 85 | * @see av_fast_realloc() |
| 94 | */ | 86 | */ |
| 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); |
| 96 | 88 | ||
| 97 | /** | 89 | /** |
| 98 | * Free a memory block which has been allocated with av_malloc(z)() or | 90 | * 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 | |||
| 112 | * @return Pointer to the allocated block, NULL if it cannot be allocated. | 104 | * @return Pointer to the allocated block, NULL if it cannot be allocated. |
| 113 | * @see av_malloc() | 105 | * @see av_malloc() |
| 114 | */ | 106 | */ |
| 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); |
| 116 | 108 | ||
| 117 | /** | 109 | /** |
| 118 | * Duplicate the string s. | 110 | * Duplicate the string s. |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include "libavutil/avutil.h" | 21 | #include "libavutil/avutil.h" |
| 22 | #include "libavutil/pixfmt.h" | 22 | #include "libavutil/pixfmt.h" |
| 23 | #include "libavcodec/opt.h" | 23 | #include "libavutil/opt.h" |
| 24 | #include "swscale.h" | 24 | #include "swscale.h" |
| 25 | #include "swscale_internal.h" | 25 | #include "swscale_internal.h" |
| 26 | 26 | ||