[FFmpeg-cvslog] avformat/http: fix chunked response w/ multiple_requests=1
ffmpeg | branch: master | Aman Gupta | Mon Nov 13 11:34:50 2017 -0800| [91a565e20f0c220a6bc37e58c11cea4a3590149c] | committer: Aman Gupta avformat/http: fix chunked response w/ multiple_requests=1 Currently if you use the multiple_requests=1 option and try to receive a chunked-encoded response, http_buf_read() will hang forever. After this patch, EOF is emulated once a 0-byte final chunk is received by setting a new flag. This flag is reset in ff_http_do_new_request(), which is used to make additional requests on the open socket. Reviewed-by: Ronald S. Bultje Signed-off-by: Aman Gupta > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91a565e20f0c220a6bc37e58c11cea4a3590149c --- libavformat/http.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 29635eb546..056d5f6583 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -66,6 +66,7 @@ typedef struct HTTPContext { int http_code; /* Used if "Transfer-Encoding: chunked" otherwise -1. */ uint64_t chunksize; +int chunkend; uint64_t off, end_off, filesize; char *location; HTTPAuthState auth_state; @@ -305,6 +306,7 @@ int ff_http_do_new_request(URLContext *h, const char *uri) AVDictionary *options = NULL; int ret; +s->chunkend = 0; s->off = 0; s->icy_data_read = 0; av_free(s->location); @@ -1281,6 +1283,9 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size) int len; if (s->chunksize != UINT64_MAX) { +if (s->chunkend) { +return AVERROR_EOF; +} if (!s->chunksize) { char line[32]; int err; @@ -1296,7 +1301,12 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size) "Chunked encoding data size: %"PRIu64"\n", s->chunksize); -if (!s->chunksize) { +if (!s->chunksize && s->multiple_requests) { +http_get_line(s, line, sizeof(line)); // read empty chunk +s->chunkend = 1; +return 0; +} +else if (!s->chunksize) { av_log(h, AV_LOG_DEBUG, "Last chunk received, closing conn\n"); ffurl_closep(&s->hd); return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: fix whitespace on AVPanScan struct definition
ffmpeg | branch: master | Aman Gupta | Tue Nov 14 10:02:20 2017 -0800| [034e1f82d924bb3038873798b2cc8d84f9701f62] | committer: Aman Gupta avcodec: fix whitespace on AVPanScan struct definition > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=034e1f82d924bb3038873798b2cc8d84f9701f62 --- libavcodec/avcodec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 74b097cdd8..0875ae3ba0 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1049,7 +1049,7 @@ typedef struct RcOverride{ * This specifies the area which should be displayed. * Note there may be multiple such areas for one frame. */ -typedef struct AVPanScan{ +typedef struct AVPanScan { /** * id * - encoding: Set by user. @@ -1071,7 +1071,7 @@ typedef struct AVPanScan{ * - decoding: Set by libavcodec. */ int16_t position[3][2]; -}AVPanScan; +} AVPanScan; /** * This structure describes the bitrate properties of an encoded bitstream. It ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mips: Improve hevc non-uni hz and vt mc msa functions
ffmpeg | branch: master | Kaustubh Raste | Thu Nov 9 15:57:49 2017 +0530| [143fc5f6e20b05ba5b45c807c990acaa87134e8b] | committer: Michael Niedermayer avcodec/mips: Improve hevc non-uni hz and vt mc msa functions Use mask buffer. Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=143fc5f6e20b05ba5b45c807c990acaa87134e8b --- libavcodec/mips/hevcdsp_msa.c | 541 -- 1 file changed, 312 insertions(+), 229 deletions(-) diff --git a/libavcodec/mips/hevcdsp_msa.c b/libavcodec/mips/hevcdsp_msa.c index b17127c5f6..81db62b876 100644 --- a/libavcodec/mips/hevcdsp_msa.c +++ b/libavcodec/mips/hevcdsp_msa.c @@ -456,7 +456,7 @@ static void hevc_hz_8t_4w_msa(uint8_t *src, int32_t src_stride, v16i8 vec0, vec1, vec2, vec3; v8i16 dst0, dst1, dst2, dst3; v8i16 filter_vec, const_vec; -v16i8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20 }; +v16i8 mask0 = LD_SB(ff_hevc_mask_arr + 16); src -= 3; const_vec = __msa_ldi_h(128); @@ -511,7 +511,7 @@ static void hevc_hz_8t_8w_msa(uint8_t *src, int32_t src_stride, v16i8 vec0, vec1, vec2, vec3; v8i16 dst0, dst1, dst2, dst3; v8i16 filter_vec, const_vec; -v16i8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 }; +v16i8 mask0 = LD_SB(ff_hevc_mask_arr); src -= 3; const_vec = __msa_ldi_h(128); @@ -559,8 +559,75 @@ static void hevc_hz_8t_12w_msa(uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { -hevc_hz_8t_8w_msa(src, src_stride, dst, dst_stride, filter, height); -hevc_hz_8t_4w_msa(src + 8, src_stride, dst + 8, dst_stride, filter, height); +uint32_t loop_cnt; +int64_t res0, res1, res2, res3; +v16i8 src0, src1, src2, src3, src4, src5, src6, src7; +v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; +v16i8 vec0, vec1, vec2, vec3, vec4, vec5; +v8i16 filt0, filt1, filt2, filt3, dst0, dst1, dst2, dst3, dst4, dst5; +v8i16 filter_vec, const_vec; + +src -= 3; +const_vec = __msa_ldi_h(128); +const_vec <<= 6; + +filter_vec = LD_SH(filter); +SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + +mask0 = LD_SB(ff_hevc_mask_arr); +mask1 = mask0 + 2; +mask2 = mask0 + 4; +mask3 = mask0 + 6; +mask4 = LD_SB(ff_hevc_mask_arr + 16); +mask5 = mask4 + 2; +mask6 = mask4 + 4; +mask7 = mask4 + 6; + +for (loop_cnt = 4; loop_cnt--;) { +LD_SB4(src, src_stride, src0, src1, src2, src3); +LD_SB4(src + 8, src_stride, src4, src5, src6, src7); +src += (4 * src_stride); +XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); + +dst0 = const_vec; +dst1 = const_vec; +dst2 = const_vec; +dst3 = const_vec; +dst4 = const_vec; +dst5 = const_vec; +VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec1); +VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec2, vec3); +VSHF_B2_SB(src4, src5, src6, src7, mask4, mask4, vec4, vec5); +DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, dst0, + dst1, dst2, dst3); +DPADD_SB2_SH(vec4, vec5, filt0, filt0, dst4, dst5); +VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec0, vec1); +VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec2, vec3); +VSHF_B2_SB(src4, src5, src6, src7, mask5, mask5, vec4, vec5); +DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt1, filt1, filt1, filt1, dst0, + dst1, dst2, dst3); +DPADD_SB2_SH(vec4, vec5, filt1, filt1, dst4, dst5); +VSHF_B2_SB(src0, src0, src1, src1, mask2, mask2, vec0, vec1); +VSHF_B2_SB(src2, src2, src3, src3, mask2, mask2, vec2, vec3); +VSHF_B2_SB(src4, src5, src6, src7, mask6, mask6, vec4, vec5); +DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt2, filt2, filt2, filt2, dst0, + dst1, dst2, dst3); +DPADD_SB2_SH(vec4, vec5, filt2, filt2, dst4, dst5); +VSHF_B2_SB(src0, src0, src1, src1, mask3, mask3, vec0, vec1); +VSHF_B2_SB(src2, src2, src3, src3, mask3, mask3, vec2, vec3); +VSHF_B2_SB(src4, src5, src6, src7, mask7, mask7, vec4, vec5); +DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt3, filt3, filt3, filt3, dst0, + dst1, dst2, dst3); +DPADD_SB2_SH(vec4, vec5, filt3, filt3, dst4, dst5); + +res0 = __msa_copy_s_d((v2i64) dst4, 0); +res1 = __msa_copy_s_d((v2i64) dst4, 1); +res2 = __msa_copy_s_d((v2i64) dst5, 0); +res3 = __msa_copy_s_d((v2i64) dst5, 1); +ST_SH4(dst0, dst1, dst2, dst3, dst, dst_stride); +SD4(res0, res1, res2, res3, (dst + 8), dst_stride); +dst += (4 * dst_stride); +} } stati
[FFmpeg-cvslog] fate/mov: add test for overlapping fragments
ffmpeg | branch: master | John Stebbins | Mon Nov 13 08:09:30 2017 -0800| [57a422ea4c27dc699baf18ecf7f20353bec36090] | committer: Michael Niedermayer fate/mov: add test for overlapping fragments Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57a422ea4c27dc699baf18ecf7f20353bec36090 --- tests/fate/mov.mak | 4 ++ tests/ref/fate/mov-frag-overlap | 105 2 files changed, 109 insertions(+) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 76f66ff498..a98372c5e1 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -11,6 +11,7 @@ FATE_MOV = fate-mov-3elist \ fate-mov-440hz-10ms \ fate-mov-ibi-elst-starts-b \ fate-mov-elst-ends-betn-b-and-i \ + fate-mov-frag-overlap \ FATE_MOV_FFPROBE = fate-mov-aac-2048-priming \ fate-mov-zombie \ @@ -59,6 +60,9 @@ fate-mov-invalid-elst-entry-count: CMD = framemd5 -flags +bitexact -i $(TARGET_S # i.e. Pts Order: I-B-I fate-mov-ibi-elst-starts-b: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES)/mov/mov_ibi_elst_starts_b.mov +# Makes sure that we handle overlapping framgments +fate-mov-frag-overlap: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/frag_overlap.mp4 + fate-mov-aac-2048-priming: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_packets -print_format compact $(TARGET_SAMPLES)/mov/aac-2048-priming.mov fate-mov-zombie: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams -show_packets -show_frames -bitexact -print_format compact $(TARGET_SAMPLES)/mov/white_zombie_scrunch-part.mov diff --git a/tests/ref/fate/mov-frag-overlap b/tests/ref/fate/mov-frag-overlap new file mode 100644 index 00..265a93d7e6 --- /dev/null +++ b/tests/ref/fate/mov-frag-overlap @@ -0,0 +1,105 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#tb 0: 1001/24000 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 640x360 +#sar 0: 1/1 +#stream#, dts,pts, duration, size, hash +0, 0, 0,1, 345600, bb5e1ec37e1cb5a4ef2399c7b1c0ed08 +0, 1, 1,1, 345600, 40455fa94b1f3b1cd199f127401fe187 +0, 2, 2,1, 345600, 9147b59915250de3508f062b45dda499 +0, 3, 3,1, 345600, bb9b9109ea61622f491c1e2aa21c503e +0, 4, 4,1, 345600, eaceff4d694212b2eb6abf5e090d7b4c +0, 5, 5,1, 345600, eaceff4d694212b2eb6abf5e090d7b4c +0, 6, 6,1, 345600, f04ca4f64e7e990874c7ac9264ebbe65 +0, 7, 7,1, 345600, f195d115e0ad6d5c240b08226d312cef +0, 8, 8,1, 345600, 7585f3f325cc82028701fcd2360610e0 +0, 9, 9,1, 345600, 7585f3f325cc82028701fcd2360610e0 +0, 10, 10,1, 345600, 4e4a2d2d47881b238c4f423917c29182 +0, 11, 11,1, 345600, 72609b459bde5644fe5815bb88fa537e +0, 12, 12,1, 345600, 67569df185a64ec08498d71e94ab0197 +0, 13, 13,1, 345600, 352e1d41fd8d5fb0a92b722782591066 +0, 14, 14,1, 345600, f50f96f0ff0ee58ef8577cb9ce218be4 +0, 15, 15,1, 345600, 9681c998992d20055388ae6c0d4f40e6 +0, 16, 16,1, 345600, 4cd9c3056c0d1b2d6ed666d2fbabef45 +0, 17, 17,1, 345600, 88d0c13cff5acb1746e7bb227e7ec81a +0, 18, 18,1, 345600, 37a15a2d1d055a9c157a82d77cf48328 +0, 19, 19,1, 345600, f30e43818a41242ca75caec4be7f366d +0, 20, 20,1, 345600, e0441ca5e4137910ed94ea2d67f506ad +0, 21, 21,1, 345600, 61cae30cdb5512610ba1ffb7b372be51 +0, 22, 22,1, 345600, 28832e6ec917fece50ab94f8d6883d4b +0, 23, 23,1, 345600, 07cfd60c53a4ede0de4f5eba749abae0 +0, 24, 24,1, 345600, 254b072e2fe7017933738b8d43cd3f2e +0, 25, 25,1, 345600, aa2ceef866576011653fc9e4add8c852 +0, 26, 26,1, 345600, d5507e992763f69ef7da06bca2e5e0e4 +0, 27, 27,1, 345600, 3d7fd83fab12dc9ca1bb5c0d09104174 +0, 28, 28,1, 345600, 1fdc34d30f94bfa2acd5ab4791b3b6be +0, 29, 29,1, 345600, a993a348279f71db20e48a879c718096 +0, 30, 30,1, 345600, b999b6a51b3bdeb99df80aa88f2c43ff +0, 31, 31,1, 345600, 2c851f444aaf1dd6f149ee8e6e1bdfa4 +0, 32, 32,1, 345600, a50301d48d283e9881d142cd87128d86 +0, 33, 33,1, 345600, 0ddffa560c6310a2ad1cb534336472ac +0, 34, 34,1, 345600, 5f5565daeb737f3543a5d07ff9115d4a +0, 35, 35,1, 345600, 91640f9887d074221e4e08f9a97a938b +0, 36, 36,1,
[FFmpeg-cvslog] avcodec/mips: cleanup unused macros
ffmpeg | branch: master | Kaustubh Raste | Thu Nov 9 11:05:28 2017 +0530| [e5f66a9ea40cf463ef40631b4704607182ceee3c] | committer: Michael Niedermayer avcodec/mips: cleanup unused macros Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5f66a9ea40cf463ef40631b4704607182ceee3c --- libavcodec/mips/hevc_macros_msa.h | 37 - 1 file changed, 37 deletions(-) diff --git a/libavcodec/mips/hevc_macros_msa.h b/libavcodec/mips/hevc_macros_msa.h index 27c69ff89a..ea53812b64 100644 --- a/libavcodec/mips/hevc_macros_msa.h +++ b/libavcodec/mips/hevc_macros_msa.h @@ -21,43 +21,6 @@ #ifndef AVCODEC_MIPS_HEVC_MACROS_MSA_H #define AVCODEC_MIPS_HEVC_MACROS_MSA_H -#define HEVC_PCK_SW_SB2(in0, in1, out)\ -{ \ -v8i16 tmp0_m; \ - \ -tmp0_m = __msa_pckev_h((v8i16) in0, (v8i16) in1); \ -out = (v4i32) __msa_pckev_b((v16i8) tmp0_m, (v16i8) tmp0_m); \ -} - -#define HEVC_PCK_SW_SB4(in0, in1, in2, in3, out) \ -{ \ -v8i16 tmp0_m, tmp1_m; \ - \ -PCKEV_H2_SH(in0, in1, in2, in3, tmp0_m, tmp1_m); \ -out = (v4i32) __msa_pckev_b((v16i8) tmp1_m, (v16i8) tmp0_m); \ -} - -#define HEVC_PCK_SW_SB8(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1) \ -{\ -v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m;\ - \ -PCKEV_H4_SH(in0, in1, in2, in3, in4, in5, in6, in7, \ -tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ -PCKEV_B2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \ -} - -#define HEVC_PCK_SW_SB12(in0, in1, in2, in3, in4, in5, in6, in7, \ - in8, in9, in10, in11, out0, out1, out2) \ -{ \ -v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m, tmp4_m, tmp5_m; \ - \ -PCKEV_H4_SH(in0, in1, in2, in3, in4, in5, in6, in7,\ -tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ -PCKEV_H2_SH(in8, in9, in10, in11, tmp4_m, tmp5_m); \ -PCKEV_B2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \ -out2 = (v4i32) __msa_pckev_b((v16i8) tmp5_m, (v16i8) tmp4_m); \ -} - #define HEVC_FILT_8TAP_SH(in0, in1, in2, in3,\ filt0, filt1, filt2, filt3)\ ( { \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Avoid corrupting diagnostic state with _Pragma changes.
ffmpeg | branch: master | Dale Curtis | Fri Nov 3 17:10:55 2017 -0700| [01763144dcc1bc47fa4967d91d3fedb25e3ef556] | committer: Michael Niedermayer Avoid corrupting diagnostic state with _Pragma changes. The macros for ICC and MSVC correctly push and pop the diagnostic state of the compiler when disabling deprecation warnings. The ones for clang/gcc should do the same. Without this, if a blanket deprecation warning is applied to the code base it'll be flipped back on incorrectly with FF_ENABLE_DEPRECATION_WARNINGS. Signed-off-by: Dale Curtis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01763144dcc1bc47fa4967d91d3fedb25e3ef556 --- libavutil/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/internal.h b/libavutil/internal.h index fef5089097..72ae0ad89b 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -81,8 +81,8 @@ #define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996)) #define FF_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop)) #else -#define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"") +#define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic pop") #endif #else #define FF_DISABLE_DEPRECATION_WARNINGS ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/mov.c: Don't correct edit list start to zero, when we can't find a frame before edit list start.
ffmpeg | branch: master | Sasi Inguva | Mon Nov 13 18:09:28 2017 -0800| [54f8ac199fe38b2837146621963bb543868130be] | committer: Michael Niedermayer lavf/mov.c: Don't correct edit list start to zero, when we can't find a frame before edit list start. After c2a8f0fcbe57ea9ccaa864130f078af10516c3c1 this can happen on normal edit lists starting on a B-frame. Signed-off-by: Sasi Inguva Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=54f8ac199fe38b2837146621963bb543868130be --- libavformat/mov.c| 4 +- tests/fate/mov.mak | 6 + tests/ref/fate/mov-bbi-elst-starts-b | 391 +++ 3 files changed, 398 insertions(+), 3 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index fd170baa57..79023ef369 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3380,13 +3380,11 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) if (find_prev_closest_index(st, e_old, nb_old, ctts_data_old, ctts_count_old, search_timestamp, AVSEEK_FLAG_ANY, &index, &ctts_index_old, &ctts_sample_old) < 0) { av_log(mov->fc, AV_LOG_WARNING, - "st: %d edit list %"PRId64" Cannot find an index entry before timestamp: %"PRId64".\n" - "Rounding edit list media time to zero.\n", + "st: %d edit list %"PRId64" Cannot find an index entry before timestamp: %"PRId64".\n", st->index, edit_list_index, search_timestamp); index = 0; ctts_index_old = 0; ctts_sample_old = 0; -edit_list_media_time = 0; } } current = e_old + index; diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index a98372c5e1..680baea773 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -12,6 +12,7 @@ FATE_MOV = fate-mov-3elist \ fate-mov-ibi-elst-starts-b \ fate-mov-elst-ends-betn-b-and-i \ fate-mov-frag-overlap \ + fate-mov-bbi-elst-starts-b \ FATE_MOV_FFPROBE = fate-mov-aac-2048-priming \ fate-mov-zombie \ @@ -63,6 +64,11 @@ fate-mov-ibi-elst-starts-b: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES) # Makes sure that we handle overlapping framgments fate-mov-frag-overlap: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/frag_overlap.mp4 +# Makes sure that we pick the right frames according to edit list when there is no keyframe with PTS < edit list start. +# For example, when video starts on a B-frame, and edit list starts on that B-frame too. +# GOP structure : B B I in presentation order. +fate-mov-bbi-elst-starts-b: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES)/h264/twofields_packet.mp4 + fate-mov-aac-2048-priming: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_packets -print_format compact $(TARGET_SAMPLES)/mov/aac-2048-priming.mov fate-mov-zombie: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams -show_packets -show_frames -bitexact -print_format compact $(TARGET_SAMPLES)/mov/white_zombie_scrunch-part.mov diff --git a/tests/ref/fate/mov-bbi-elst-starts-b b/tests/ref/fate/mov-bbi-elst-starts-b new file mode 100644 index 00..d3ede1a86c --- /dev/null +++ b/tests/ref/fate/mov-bbi-elst-starts-b @@ -0,0 +1,391 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#tb 0: 1001/3 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 1920x1080 +#sar 0: 1/1 +#tb 1: 1/48000 +#media_type 1: audio +#codec_id 1: pcm_s16le +#sample_rate 1: 48000 +#channel_layout 1: 3 +#channel_layout_name 1: stereo +#stream#, dts,pts, duration, size, hash +0, 0, 0,1, 3110400, e9454409af76038dbe56e834921d2fa8 +1, 0, 0, 1024, 4096, 620f0b67a91f7f74151bc5be745b7110 +1, 1024, 1024, 1024, 4096, 8ab1a8e40b154f577914e43ec6cdc674 +0, 1, 1,1, 3110400, 37aa620e494d22ba248feea9a5a869a0 +1, 2048, 2048, 1024, 4096, 41f09b125271955596ef56436e5ae7b3 +1, 3072, 3072, 1024, 4096, e4934aa9fbaf7dcd578fe9f404bfdd39 +0, 2, 2,1, 3110400, 7b8be9619e4e1d618ab1ed85aff3957b +1, 4096, 4096, 1024, 4096, 5321f9a453ff71e420b592c9188560f4 +0, 3, 3,1, 3110400, 756a4551420853bc3ae444e6b86169f3 +1, 5120, 5120, 1024, 4096, fa45be5ec01b9c0ae78f876f290602e2 +1, 6144, 6144, 1024, 4096, bce7b47534cf6ae5db1fa27805fd52a6 +0, 4, 4,1, 3110400, 94a93c1669a96ebf41a7258177849396 +1, 7168, 7168, 1024, 4096, 15f899020d6e186b2f2a15b60034fa26 +0, 5, 5,1, 3110400, 5d1c49d3f43cd472683e4a039e376af5 +1, 8192, 8192, 1024, 4096, 9038d943078707eac0eff9126911b9d0 +1, 9216, 9216,
[FFmpeg-cvslog] avcodec: Don't assume separate u and v planes in ff_alloc_picture
ffmpeg | branch: master | Philip Langdale | Mon Nov 13 21:11:27 2017 -0800| [bb4c9d0a8ead02f7d943c2bae3e36b30e605b30b] | committer: Philip Langdale avcodec: Don't assume separate u and v planes in ff_alloc_picture alloc_frame_buffer in ff_alloc_picture asserts that the linesize of planes 1 and 2 are the same. If the pixfmt has a single uv plane, like NV12, this won't be true. So, let's only do this check if there are more than 2 planes. We never hit this with previous hw formats because they don't set linesize to meaningful values, but the cuda hw format sets the values based on the underlying data layout. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bb4c9d0a8ead02f7d943c2bae3e36b30e605b30b --- libavcodec/mpegpicture.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 9811a778b7..2b72346fb2 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -22,6 +22,7 @@ #include "libavutil/avassert.h" #include "libavutil/common.h" +#include "libavutil/pixdesc.h" #include "avcodec.h" #include "motion_est.h" @@ -155,7 +156,8 @@ static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic, return -1; } -if (pic->f->linesize[1] != pic->f->linesize[2]) { +if (av_pix_fmt_count_planes(pic->f->format) > 2 && +pic->f->linesize[1] != pic->f->linesize[2]) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed (uv stride mismatch)\n"); ff_mpeg_unref_picture(avctx, pic); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: Implement vc1 nvdec hwaccel
ffmpeg | branch: master | Philip Langdale | Mon Nov 13 21:09:27 2017 -0800| [912ceba61b0d45caa8ba8664ddf7b18e2121ddf3] | committer: Philip Langdale avcodec: Implement vc1 nvdec hwaccel This hwaccel is interesting because it also works for wmv3/9 content, which is not supported by the nvidia parser used by cuviddec. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=912ceba61b0d45caa8ba8664ddf7b18e2121ddf3 --- Changelog | 2 +- configure | 3 + libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 2 + libavcodec/nvdec.c | 2 + libavcodec/nvdec_vc1.c | 184 + libavcodec/vc1dec.c| 3 + libavcodec/version.h | 2 +- 8 files changed, 197 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 68829f22a4..d2b5530ad7 100644 --- a/Changelog +++ b/Changelog @@ -13,7 +13,7 @@ version : - PCE support for extended channel layouts in the AAC encoder - native aptX encoder and decoder - Raw aptX muxer and demuxer -- NVIDIA NVDEC-accelerated H.264, HEVC and VP9 hwaccel decoding +- NVIDIA NVDEC-accelerated H.264, HEVC, VC1 and VP9 hwaccel decoding - Intel QSV-accelerated overlay filter diff --git a/configure b/configure index 3788f26956..934ac3abfd 100755 --- a/configure +++ b/configure @@ -2740,6 +2740,8 @@ vc1_d3d11va2_hwaccel_select="vc1_decoder" vc1_dxva2_hwaccel_deps="dxva2" vc1_dxva2_hwaccel_select="vc1_decoder" vc1_mmal_hwaccel_deps="mmal" +vc1_nvdec_hwaccel_deps="nvdec" +vc1_nvdec_hwaccel_select="vc1_decoder" vc1_qsv_hwaccel_deps="libmfx" vc1_vaapi_hwaccel_deps="vaapi" vc1_vaapi_hwaccel_select="vc1_decoder" @@ -2763,6 +2765,7 @@ vp9_vaapi_hwaccel_select="vp9_decoder" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel" wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" +wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel" wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 2476aecc40..6315672573 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -864,6 +864,7 @@ OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL)+= vdpau_mpeg4.o OBJS-$(CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o OBJS-$(CONFIG_VC1_D3D11VA_HWACCEL)+= dxva2_vc1.o OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o +OBJS-$(CONFIG_VC1_NVDEC_HWACCEL) += nvdec_vc1.o OBJS-$(CONFIG_VC1_QSV_HWACCEL)+= qsvdec_other.o OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 0781862de5..e213f3757c 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -111,6 +111,7 @@ static void register_all(void) REGISTER_HWACCEL(VC1_D3D11VA, vc1_d3d11va); REGISTER_HWACCEL(VC1_D3D11VA2, vc1_d3d11va2); REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2); +REGISTER_HWACCEL(VC1_NVDEC, vc1_nvdec); REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi); REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau); REGISTER_HWACCEL(VC1_MMAL, vc1_mmal); @@ -128,6 +129,7 @@ static void register_all(void) REGISTER_HWACCEL(WMV3_D3D11VA, wmv3_d3d11va); REGISTER_HWACCEL(WMV3_D3D11VA2, wmv3_d3d11va2); REGISTER_HWACCEL(WMV3_DXVA2,wmv3_dxva2); +REGISTER_HWACCEL(WMV3_NVDEC,wmv3_nvdec); REGISTER_HWACCEL(WMV3_VAAPI,wmv3_vaapi); REGISTER_HWACCEL(WMV3_VDPAU,wmv3_vdpau); diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index ac68faca99..20d7c3db27 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -54,7 +54,9 @@ static int map_avcodec_id(enum AVCodecID id) switch (id) { case AV_CODEC_ID_H264: return cudaVideoCodec_H264; case AV_CODEC_ID_HEVC: return cudaVideoCodec_HEVC; +case AV_CODEC_ID_VC1: return cudaVideoCodec_VC1; case AV_CODEC_ID_VP9: return cudaVideoCodec_VP9; +case AV_CODEC_ID_WMV3: return cudaVideoCodec_VC1; } return -1; } diff --git a/libavcodec/nvdec_vc1.c b/libavcodec/nvdec_vc1.c new file mode 100644 index 00..cf75ba5aca --- /dev/null +++ b/libavcodec/nvdec_vc1.c @@ -0,0 +1,184 @@ +/* + * VC1 HW decode acceleration through NVDEC + * + * Copyright (c) 2017 Philip Langdale + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received
[FFmpeg-cvslog] ffplay: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:10:49 2017 -0300| [e61825d5b4c3ffb981c21bee23f6372a65218e9b] | committer: James Almer ffplay: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e61825d5b4c3ffb981c21bee23f6372a65218e9b --- fftools/ffplay.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index bd1457c7e3..10a917194d 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -609,7 +609,7 @@ static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { if (ret >= 0) { AVRational tb = (AVRational){1, frame->sample_rate}; if (frame->pts != AV_NOPTS_VALUE) -frame->pts = av_rescale_q(frame->pts, av_codec_get_pkt_timebase(d->avctx), tb); +frame->pts = av_rescale_q(frame->pts, d->avctx->pkt_timebase, tb); else if (d->next_pts != AV_NOPTS_VALUE) frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, tb); if (frame->pts != AV_NOPTS_VALUE) { @@ -2563,7 +2563,7 @@ static int stream_component_open(VideoState *is, int stream_index) ret = avcodec_parameters_to_context(avctx, ic->streams[stream_index]->codecpar); if (ret < 0) goto fail; -av_codec_set_pkt_timebase(avctx, ic->streams[stream_index]->time_base); +avctx->pkt_timebase = ic->streams[stream_index]->time_base; codec = avcodec_find_decoder(avctx->codec_id); @@ -2584,12 +2584,12 @@ static int stream_component_open(VideoState *is, int stream_index) } avctx->codec_id = codec->id; -if(stream_lowres > av_codec_get_max_lowres(codec)){ +if (stream_lowres > codec->max_lowres) { av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", -av_codec_get_max_lowres(codec)); -stream_lowres = av_codec_get_max_lowres(codec); +codec->max_lowres); +stream_lowres = codec->max_lowres; } -av_codec_set_lowres(avctx, stream_lowres); +avctx->lowres = stream_lowres; if (fast) avctx->flags2 |= AV_CODEC_FLAG2_FAST; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:10:21 2017 -0300| [e9025beacb86dd4390a8448fb38671699d40e24c] | committer: James Almer ffmpeg: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9025beacb86dd4390a8448fb38671699d40e24c --- fftools/ffmpeg.c | 2 +- fftools/ffmpeg_opt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index db391f7f7d..babd85f7bc 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2877,7 +2877,7 @@ static int init_input_stream(int ist_index, char *error, int error_len) /* Useful for subtitles retiming by lavf (FIXME), skipping samples in * audio, and video decoders such as cuvid or mediacodec */ -av_codec_set_pkt_timebase(ist->dec_ctx, ist->st->time_base); +ist->dec_ctx->pkt_timebase = ist->st->time_base; if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0)) av_dict_set(&ist->decoder_opts, "threads", "auto", 0); diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index e50895e64c..47d384166c 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -794,8 +794,8 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) if(!ist->dec) ist->dec = avcodec_find_decoder(par->codec_id); #if FF_API_LOWRES -if (av_codec_get_lowres(st->codec)) { -av_codec_set_lowres(ist->dec_ctx, av_codec_get_lowres(st->codec)); +if (st->codec->lowres) { +ist->dec_ctx->lowres = st->codec->lowres; ist->dec_ctx->width = st->codec->width; ist->dec_ctx->height = st->codec->height; ist->dec_ctx->coded_width = st->codec->coded_width; @@ -1663,7 +1663,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for intra matrix.\n"); exit_program(1); } -av_codec_set_chroma_intra_matrix(video_enc, p); +video_enc->chroma_intra_matrix = p; parse_matrix_coeffs(p, chroma_intra_matrix); } MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_subtitles: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:11:34 2017 -0300| [03dae121c0508bddeac30245042485420a0a3370] | committer: James Almer avfilter/vf_subtitles: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03dae121c0508bddeac30245042485420a0a3370 --- libavfilter/vf_subtitles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 66a564699a..a7b02461f2 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -413,7 +413,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx) * * That API is old and needs to be reworked to match behaviour with A/V. */ -av_codec_set_pkt_timebase(dec_ctx, st->time_base); +dec_ctx->pkt_timebase = st->time_base; ret = avcodec_open2(dec_ctx, NULL, &codec_opts); if (ret < 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:11:52 2017 -0300| [d8ea66ab33252a19eaa8ef83bec70e3b4e9e003b] | committer: James Almer avformat/utils: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8ea66ab33252a19eaa8ef83bec70e3b4e9e003b --- libavformat/utils.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 87887063be..ff5e14df6c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4028,11 +4028,13 @@ FF_ENABLE_DEPRECATION_WARNINGS ret = avcodec_parameters_from_context(st->codecpar, st->internal->avctx); if (ret < 0) goto find_stream_info_err; +#if FF_API_LOWRES // The decoder might reduce the video size by the lowres factor. -if (av_codec_get_lowres(st->internal->avctx) && orig_w) { +if (st->internal->avctx->lowres && orig_w) { st->codecpar->width = orig_w; st->codecpar->height = orig_h; } +#endif } #if FF_API_LAVF_AVCTX @@ -4041,13 +4043,15 @@ FF_DISABLE_DEPRECATION_WARNINGS if (ret < 0) goto find_stream_info_err; +#if FF_API_LOWRES // The old API (AVStream.codec) "requires" the resolution to be adjusted // by the lowres factor. -if (av_codec_get_lowres(st->internal->avctx) && st->internal->avctx->width) { -av_codec_set_lowres(st->codec, av_codec_get_lowres(st->internal->avctx)); +if (st->internal->avctx->lowres && st->internal->avctx->width) { +st->codec->lowres = st->internal->avctx->lowres; st->codec->width = st->internal->avctx->width; st->codec->height = st->internal->avctx->height; } +#endif if (st->codec->codec_tag != MKTAG('t','m','c','d')) { st->codec->time_base = st->internal->avctx->time_base; @@ -4763,10 +4767,10 @@ void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, s->time_base = new_tb; #if FF_API_LAVF_AVCTX FF_DISABLE_DEPRECATION_WARNINGS -av_codec_set_pkt_timebase(s->codec, new_tb); +s->codec->pkt_timebase = new_tb; FF_ENABLE_DEPRECATION_WARNINGS #endif -av_codec_set_pkt_timebase(s->internal->avctx, new_tb); +s->internal->avctx->pkt_timebase = new_tb; s->pts_wrap_bits = pts_wrap_bits; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffprobe: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:10:45 2017 -0300| [b2731bcd1dc7587d20b4b2ceee0bcbade29a6ea2] | committer: James Almer ffprobe: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2731bcd1dc7587d20b4b2ceee0bcbade29a6ea2 --- fftools/ffprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 07ca842efa..0e7a771517 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2910,7 +2910,7 @@ static int open_input_file(InputFile *ifile, const char *filename) av_dict_set(&codec_opts, "threads", "1", 0); } -av_codec_set_pkt_timebase(ist->dec_ctx, stream->time_base); +ist->dec_ctx->pkt_timebase = stream->time_base; ist->dec_ctx->framerate = stream->avg_frame_rate; if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pthread_frame: remove usage of AVCodecContext accessors
ffmpeg | branch: master | James Almer | Mon Nov 13 00:11:15 2017 -0300| [21add0c228e00b8ea89dd13082faa3dcb37912fb] | committer: James Almer avcodec/pthread_frame: remove usage of AVCodecContext accessors Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21add0c228e00b8ea89dd13082faa3dcb37912fb --- libavcodec/pthread_frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index ddfd07d292..e6e6d1f599 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -246,7 +246,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, { int err = 0; -if (dst != src && (for_user || !(av_codec_get_codec_descriptor(src)->props & AV_CODEC_PROP_INTRA_ONLY))) { +if (dst != src && (for_user || !(src->codec_descriptor->props & AV_CODEC_PROP_INTRA_ONLY))) { dst->time_base = src->time_base; dst->framerate = src->framerate; dst->width = src->width; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: deprecate getters and setters for AVCodecContext and AVCodec fields
ffmpeg | branch: master | James Almer | Sun Nov 12 23:57:38 2017 -0300| [c4131a0613c4b2c30c01b2550b41068815d27799] | committer: James Almer avcodec: deprecate getters and setters for AVCodecContext and AVCodec fields The fields can be accessed directly, so these are not needed anymore. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4131a0613c4b2c30c01b2550b41068815d27799 --- libavcodec/avcodec.h | 22 ++ libavcodec/utils.c | 2 ++ libavcodec/version.h | 3 +++ 3 files changed, 27 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 0875ae3ba0..442b558d4b 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3235,22 +3235,41 @@ typedef struct AVCodecContext { int apply_cropping; } AVCodecContext; +#if FF_API_CODEC_GET_SET +/** + * Accessors for some AVCodecContext fields. These used to be provided for ABI + * compatibility, and do not need to be used anymore. + */ +attribute_deprecated AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); +attribute_deprecated void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational val); +attribute_deprecated const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx); +attribute_deprecated void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc); +attribute_deprecated unsigned av_codec_get_codec_properties(const AVCodecContext *avctx); +#if FF_API_LOWRES +attribute_deprecated int av_codec_get_lowres(const AVCodecContext *avctx); +attribute_deprecated void av_codec_set_lowres(AVCodecContext *avctx, int val); +#endif +attribute_deprecated int av_codec_get_seek_preroll(const AVCodecContext *avctx); +attribute_deprecated void av_codec_set_seek_preroll(AVCodecContext *avctx, int val); +attribute_deprecated uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx); +attribute_deprecated void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val); +#endif /** * AVProfile. @@ -3387,7 +3406,10 @@ typedef struct AVCodec { const char *bsfs; } AVCodec; +#if FF_API_CODEC_GET_SET +attribute_deprecated int av_codec_get_max_lowres(const AVCodec *codec); +#endif struct MpegEncContext; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b3a578110b..e50de6e89b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -552,6 +552,7 @@ enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, return AV_PIX_FMT_NONE; } +#if FF_API_CODEC_GET_SET MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase) MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor) MAKE_ACCESSORS(AVCodecContext, codec, int, lowres) @@ -567,6 +568,7 @@ int av_codec_get_max_lowres(const AVCodec *codec) { return codec->max_lowres; } +#endif int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ return !!(codec->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); diff --git a/libavcodec/version.h b/libavcodec/version.h index 88500e343f..a75c885768 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -120,6 +120,9 @@ #ifndef FF_API_GETCHROMA #define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59) #endif +#ifndef FF_API_CODEC_GET_SET +#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59) +#endif #endif /* AVCODEC_VERSION_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog