[FFmpeg-cvslog] avformat: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:55:45 2017 +0700| [9f030ee00f049a09cb3b74dbd0314bcf626bef10] | committer: Muhammad Faiz avformat: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f030ee00f049a09cb3b74dbd0314bcf626bef10 --- libavformat/mux.c| 2 +- libavformat/uncodedframecrcenc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 3a5e876913..4e21083a2b 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1422,7 +1422,7 @@ static int av_write_uncoded_frame_internal(AVFormatContext *s, int stream_index, pkt.size = UNCODED_FRAME_PACKET_SIZE; pkt.pts = pkt.dts = frame->pts; -pkt.duration = av_frame_get_pkt_duration(frame); +pkt.duration = frame->pkt_duration; pkt.stream_index = stream_index; pkt.flags |= AV_PKT_FLAG_UNCODED_FRAME; } diff --git a/libavformat/uncodedframecrcenc.c b/libavformat/uncodedframecrcenc.c index ecc42d2869..2f1a14ca97 100644 --- a/libavformat/uncodedframecrcenc.c +++ b/libavformat/uncodedframecrcenc.c @@ -79,7 +79,7 @@ static void audio_frame_cksum(AVBPrint *bp, AVFrame *frame) int nb_planes, nb_samples, p; const char *name; -nb_planes = av_frame_get_channels(frame); +nb_planes = frame->channels; nb_samples = frame->nb_samples; if (!av_sample_fmt_is_planar(frame->format)) { nb_samples *= nb_planes; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:54:58 2017 +0700| [31f61b0d4f8d452becb44f044c739f9057900159] | committer: Muhammad Faiz avcodec: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31f61b0d4f8d452becb44f044c739f9057900159 --- libavcodec/ac3dec.c | 2 +- libavcodec/cpia.c| 8 +++ libavcodec/crystalhd.c | 6 +++--- libavcodec/cuvid.c | 6 +++--- libavcodec/decode.c | 50 +--- libavcodec/encode.c | 2 +- libavcodec/exr.c | 2 +- libavcodec/gifdec.c | 2 +- libavcodec/mjpegdec.c| 2 +- libavcodec/pngdec.c | 2 +- libavcodec/proresdec2.c | 2 +- libavcodec/rawdec.c | 4 ++-- libavcodec/tiff.c| 8 +++ libavcodec/videotoolboxenc.c | 8 +++ libavcodec/webp.c| 2 +- 15 files changed, 52 insertions(+), 54 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 4a0d8bbcc7..7e2cbce90b 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1622,7 +1622,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, } } -av_frame_set_decode_error_flags(frame, err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0); +frame->decode_error_flags = err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0; /* keep last block for error concealment in next frame */ for (ch = 0; ch < s->out_channels; ch++) diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index 07cdd50368..58833b2f26 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -113,12 +113,12 @@ static int cpia_decode_frame(AVCodecContext *avctx, src += 2; if (src_size < linelength) { -av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM); +frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM; av_log(avctx, AV_LOG_WARNING, "Frame ended unexpectedly!\n"); break; } if (src[linelength - 1] != EOL) { -av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM); +frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM; av_log(avctx, AV_LOG_WARNING, "Wrong line length %d or line not terminated properly (found 0x%02x)!\n", linelength, src[linelength - 1]); break; } @@ -139,7 +139,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, */ for (j = 0; j < linelength - 1; j++) { if (y > y_end) { -av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM); +frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM; av_log(avctx, AV_LOG_WARNING, "Decoded data exceeded linesize!\n"); break; } @@ -159,7 +159,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, */ for (j = 0; j < linelength - 4; ) { if (y + 1 > y_end || u > u_end || v > v_end) { -av_frame_set_decode_error_flags(frame, FF_DECODE_ERROR_INVALID_BITSTREAM); +frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM; av_log(avctx, AV_LOG_WARNING, "Decoded data exceeded linesize!\n"); break; } diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index b1e5c64829..8ccd6ff8bd 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -634,9 +634,9 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif } -av_frame_set_pkt_pos(frame, -1); -av_frame_set_pkt_duration(frame, 0); -av_frame_set_pkt_size(frame, -1); +frame->pkt_pos = -1; +frame->pkt_duration = 0; +frame->pkt_size = -1; if (!priv->need_second_field) { *got_frame = 1; diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c index 4d96cf0204..288083423e 100644 --- a/libavcodec/cuvid.c +++ b/libavcodec/cuvid.c @@ -604,9 +604,9 @@ FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_pts = frame->pts; FF_ENABLE_DEPRECATION_WARNINGS #endif -av_frame_set_pkt_pos(frame, -1); -av_frame_set_pkt_duration(frame, 0); -av_frame_set_pkt_size(frame, -1); +frame->pkt_pos = -1; +frame->pkt_duration = 0; +frame->pkt_size = -1; frame->interlaced_frame = !parsed_frame.is_deinterlacing && !parsed_frame.dispinfo.progressive_frame; diff --git a/libavcodec/decode.c b/libavcodec/decode.c index cf2f615eb1..e63384b910 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -151,7 +151,7 @@ static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame) memcpy(frame->data, avci->to_free->data, sizeof(frame->data)); memcpy(frame->linesize, avci->to_free->line
[FFmpeg-cvslog] examples: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:58:37 2017 +0700| [327a1c0dee05efff74b1fe18144a6543c44975fa] | committer: Muhammad Faiz examples: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=327a1c0dee05efff74b1fe18144a6543c44975fa --- doc/examples/filtering_audio.c | 2 +- doc/examples/filtering_video.c | 2 +- doc/examples/transcoding.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c index 679218c82f..9fc4f1cb7e 100644 --- a/doc/examples/filtering_audio.c +++ b/doc/examples/filtering_audio.c @@ -201,7 +201,7 @@ end: static void print_frame(const AVFrame *frame) { -const int n = frame->nb_samples * av_get_channel_layout_nb_channels(av_frame_get_channel_layout(frame)); +const int n = frame->nb_samples * av_get_channel_layout_nb_channels(frame->channel_layout); const uint16_t *p = (uint16_t*)frame->data[0]; const uint16_t *p_end = p + n; diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c index 4d973024f1..4e09c6fba4 100644 --- a/doc/examples/filtering_video.c +++ b/doc/examples/filtering_video.c @@ -253,7 +253,7 @@ int main(int argc, char **argv) } if (ret >= 0) { -frame->pts = av_frame_get_best_effort_timestamp(frame); +frame->pts = frame->best_effort_timestamp; /* push the decoded frame into the filtergraph */ if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c index 476ec69afe..fb15a2148d 100644 --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -558,7 +558,7 @@ int main(int argc, char **argv) } if (got_frame) { -frame->pts = av_frame_get_best_effort_timestamp(frame); +frame->pts = frame->best_effort_timestamp; ret = filter_encode_write_frame(frame, stream_index); av_frame_free(&frame); if (ret < 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ff*: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:58:03 2017 +0700| [8893c943a9bdbe8ed2c0f99ca986d6f662d58185] | committer: Muhammad Faiz ff*: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8893c943a9bdbe8ed2c0f99ca986d6f662d58185 --- ffmpeg.c| 10 +- ffmpeg_filter.c | 2 +- ffplay.c| 24 ffprobe.c | 22 +++--- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 75f5e592a9..70431e8808 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1062,8 +1062,8 @@ static void do_video_out(OutputFile *of, !ost->filters && next_picture && ist && -lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { -duration = lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); +lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { +duration = lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); } if (!next_picture) { @@ -1506,7 +1506,7 @@ static int reap_filters(int flush) break; case AVMEDIA_TYPE_AUDIO: if (!(enc->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE) && -enc->channels != av_frame_get_channels(filtered_frame)) { +enc->channels != filtered_frame->channels) { av_log(NULL, AV_LOG_ERROR, "Audio filter graph output is not normalized and encoder does not support parameter changes\n"); break; @@ -2126,7 +2126,7 @@ static void check_decode_result(InputStream *ist, int *got_output, int ret) exit_program(1); if (exit_on_error && *got_output && ist) { -if (av_frame_get_decode_error_flags(ist->decoded_frame) || (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) { +if (ist->decoded_frame->decode_error_flags || (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) { av_log(NULL, AV_LOG_FATAL, "%s: corrupt decoded frame in stream %d\n", input_files[ist->file_index]->ctx->filename, ist->st->index); exit_program(1); } @@ -2455,7 +2455,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int eo } ist->hwaccel_retrieved_pix_fmt = decoded_frame->format; -best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame); +best_effort_timestamp= decoded_frame->best_effort_timestamp; if (ist->framerate.num) best_effort_timestamp = ist->cfr_next_pts++; diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index 219e473f69..896161a869 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -1162,7 +1162,7 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) ifilter->sample_aspect_ratio = frame->sample_aspect_ratio; ifilter->sample_rate = frame->sample_rate; -ifilter->channels= av_frame_get_channels(frame); +ifilter->channels= frame->channels; ifilter->channel_layout = frame->channel_layout; if (frame->hw_frames_ctx) { diff --git a/ffplay.c b/ffplay.c index 763fd9e645..139da9f872 100644 --- a/ffplay.c +++ b/ffplay.c @@ -569,7 +569,7 @@ static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { ret = avcodec_receive_frame(d->avctx, frame); if (ret >= 0) { if (decoder_reorder_pts == -1) { -frame->pts = av_frame_get_best_effort_timestamp(frame); +frame->pts = frame->best_effort_timestamp; } else if (!decoder_reorder_pts) { frame->pts = frame->pkt_dts; } @@ -1981,11 +1981,11 @@ static int audio_thread(void *arg) tb = (AVRational){1, frame->sample_rate}; #if CONFIG_AVFILTER -dec_channel_layout = get_valid_channel_layout(frame->channel_layout, av_frame_get_channels(frame)); +dec_channel_layout = get_valid_channel_layout(frame->channel_layout, frame->channels); reconfigure = cmp_audio_fmts(is->audio_filter_src.fmt, is->audio_filter_src.channels, - frame->format, av_frame_get_channels(frame))|| + frame->format, frame->channels)|| is->audio_filter_src.channel_layout != dec_channel_layout || is->audio_filter_src.freq != frame->sample_rate || is->auddec.pkt_serial != last_serial; @@ -1997,10 +1997,10 @@ static int a
[FFmpeg-cvslog] avdevice: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:56:47 2017 +0700| [8103c595223613c08e44bcf56ae7098d3c31be8b] | committer: Muhammad Faiz avdevice: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8103c595223613c08e44bcf56ae7098d3c31be8b --- libavdevice/alsa_enc.c| 2 +- libavdevice/lavfi.c | 10 +- libavdevice/pulse_audio_enc.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c index bddc61f4aa..0bef625ea4 100644 --- a/libavdevice/alsa_enc.c +++ b/libavdevice/alsa_enc.c @@ -130,7 +130,7 @@ static int audio_write_frame(AVFormatContext *s1, int stream_index, pkt.data = (*frame)->data[0]; pkt.size = (*frame)->nb_samples * s->frame_size; pkt.dts = (*frame)->pkt_dts; -pkt.duration = av_frame_get_pkt_duration(*frame); +pkt.duration = (*frame)->pkt_duration; return audio_write_packet(s1, &pkt); } diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index eca3f15934..ede391f4d6 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -376,7 +376,7 @@ static int create_subcc_packet(AVFormatContext *avctx, AVFrame *frame, memcpy(lavfi->subcc_packet.data, sd->data, sd->size); lavfi->subcc_packet.stream_index = stream_idx; lavfi->subcc_packet.pts = frame->pts; -lavfi->subcc_packet.pos = av_frame_get_pkt_pos(frame); +lavfi->subcc_packet.pos = frame->pkt_pos; return 0; } @@ -440,15 +440,15 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) av_image_copy_to_buffer(pkt->data, size, (const uint8_t **)frame->data, frame->linesize, frame->format, frame->width, frame->height, 1); -} else if (av_frame_get_channels(frame) /* FIXME test audio */) { +} else if (frame->channels /* FIXME test audio */) { size = frame->nb_samples * av_get_bytes_per_sample(frame->format) * - av_frame_get_channels(frame); + frame->channels; if ((ret = av_new_packet(pkt, size)) < 0) return ret; memcpy(pkt->data, frame->data[0], size); } -frame_metadata = av_frame_get_metadata(frame); +frame_metadata = frame->metadata; if (frame_metadata) { uint8_t *metadata; AVDictionaryEntry *e = NULL; @@ -479,7 +479,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) pkt->stream_index = stream_idx; pkt->pts = frame->pts; -pkt->pos = av_frame_get_pkt_pos(frame); +pkt->pos = frame->pkt_pos; pkt->size = size; av_frame_unref(frame); return size; diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index 6fb634ee2b..0efcf0fe7e 100644 --- a/libavdevice/pulse_audio_enc.c +++ b/libavdevice/pulse_audio_enc.c @@ -681,9 +681,9 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index, AVERROR(EINVAL) : 0; pkt.data = (*frame)->data[0]; -pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * av_frame_get_channels(*frame); +pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->channels; pkt.dts = (*frame)->pkt_dts; -pkt.duration = av_frame_get_pkt_duration(*frame); +pkt.duration = (*frame)->pkt_duration; return pulse_write_packet(h, &pkt); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:57:18 2017 +0700| [6af050d7d0c3c73f3d62115152db82ebd2dc5d57] | committer: Muhammad Faiz avfilter: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6af050d7d0c3c73f3d62115152db82ebd2dc5d57 --- libavfilter/af_afade.c | 6 +++--- libavfilter/af_amerge.c| 2 +- libavfilter/af_apad.c | 2 +- libavfilter/af_aphaser.c | 2 +- libavfilter/af_aresample.c | 2 +- libavfilter/af_ashowinfo.c | 6 +++--- libavfilter/af_astats.c| 2 +- libavfilter/af_biquads.c | 2 +- libavfilter/af_channelmap.c| 2 +- libavfilter/af_channelsplit.c | 2 +- libavfilter/af_dynaudnorm.c| 6 +++--- libavfilter/af_join.c | 2 +- libavfilter/af_pan.c | 2 +- libavfilter/af_volume.c| 2 +- libavfilter/af_volumedetect.c | 2 +- libavfilter/asrc_flite.c | 4 ++-- libavfilter/avf_aphasemeter.c | 2 +- libavfilter/avf_showcqt.c | 4 ++-- libavfilter/avf_showspectrum.c | 2 +- libavfilter/avfilter.c | 8 libavfilter/buffersrc.c| 4 ++-- libavfilter/f_drawgraph.c | 2 +- libavfilter/f_loop.c | 4 ++-- libavfilter/f_metadata.c | 2 +- libavfilter/f_select.c | 6 +++--- libavfilter/fifo.c | 2 +- libavfilter/framepool.c| 2 +- libavfilter/setpts.c | 2 +- libavfilter/src_movie.c| 2 +- libavfilter/vf_bbox.c | 2 +- libavfilter/vf_blackdetect.c | 4 ++-- libavfilter/vf_blackframe.c| 2 +- libavfilter/vf_colormatrix.c | 12 ++-- libavfilter/vf_crop.c | 4 ++-- libavfilter/vf_cropdetect.c| 2 +- libavfilter/vf_deflicker.c | 2 +- libavfilter/vf_deinterlace_vaapi.c | 2 +- libavfilter/vf_drawtext.c | 2 +- libavfilter/vf_eq.c| 2 +- libavfilter/vf_idet.c | 2 +- libavfilter/vf_ocr.c | 2 +- libavfilter/vf_overlay.c | 2 +- libavfilter/vf_psnr.c | 2 +- libavfilter/vf_readeia608.c| 4 ++-- libavfilter/vf_readvitc.c | 4 ++-- libavfilter/vf_scale.c | 8 libavfilter/vf_showinfo.c | 2 +- libavfilter/vf_ssim.c | 2 +- libavfilter/vf_swaprect.c | 2 +- libavfilter/vf_vectorscope.c | 2 +- libavfilter/vf_waveform.c | 2 +- libavfilter/vsrc_testsrc.c | 4 ++-- 52 files changed, 80 insertions(+), 80 deletions(-) diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index 9acadc51c5..3a6266f0cd 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -291,7 +291,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) if ((!s->type && (cur_sample + nb_samples < s->start_sample)) || ( s->type && (s->start_sample + s->nb_samples < cur_sample))) { av_samples_set_silence(out_buf->extended_data, 0, nb_samples, - av_frame_get_channels(out_buf), out_buf->format); + out_buf->channels, out_buf->format); } else { int64_t start; @@ -301,7 +301,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) start = s->start_sample + s->nb_samples - cur_sample; s->fade_samples(out_buf->extended_data, buf->extended_data, -nb_samples, av_frame_get_channels(buf), +nb_samples, buf->channels, s->type ? -1 : 1, start, s->nb_samples, s->curve); } @@ -498,7 +498,7 @@ static int acrossfade_filter_frame(AVFilterLink *inlink, AVFrame *in) s->crossfade_samples(out->extended_data, cf[0]->extended_data, cf[1]->extended_data, - s->nb_samples, av_frame_get_channels(in), + s->nb_samples, in->channels, s->curve, s->curve2); out->pts = s->pts; s->pts += av_rescale_q(s->nb_samples, diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c index 8ea01e206b..3cf36b3038 100644 --- a/libavfilter/af_amerge.c +++ b/libavfilter/af_amerge.c @@ -280,7 +280,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) outbuf->nb_samples = nb_samples; outbuf->channel_layout = outlink->channel_layout; -av_frame_set_channels(outbuf, outlink->channels); +outbuf->channels = outlink->channels; while (nb_samples) { ns = nb_samples; diff --git a/libavfilter/af_apad.c b/libavfilter/af_apad.c index 0a2d4206a9..8171f2a3d4 100644 --- a/libavfilter/af_apad.c +++ b/libavfilter/af_apad.c @@ -119,7 +119,7 @
[FFmpeg-cvslog] tests: do not use AVFrame accessor
ffmpeg | branch: master | Muhammad Faiz | Sat Apr 22 15:59:09 2017 +0700| [cdd3048134b8b032b69d3c076d73d24e329dc9ba] | committer: Muhammad Faiz tests: do not use AVFrame accessor Reviewed-by: wm4 Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cdd3048134b8b032b69d3c076d73d24e329dc9ba --- tests/api/api-flac-test.c | 4 ++-- tests/api/api-h264-test.c | 2 +- tests/api/api-seek-test.c | 2 +- tests/api/api-threadmessage-test.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c index 7b480594b7..c5a37f03e1 100644 --- a/tests/api/api-flac-test.c +++ b/tests/api/api-flac-test.c @@ -156,7 +156,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate, enc_ctx->channels, enc_ctx->frame_size); -in_frame_bytes = in_frame->nb_samples * av_frame_get_channels(in_frame) * sizeof(uint16_t); +in_frame_bytes = in_frame->nb_samples * in_frame->channels * sizeof(uint16_t); if (in_frame_bytes > in_frame->linesize[0]) { av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n"); return 1; @@ -197,7 +197,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n"); return AVERROR_UNKNOWN; } -out_frame_bytes = out_frame->nb_samples * av_frame_get_channels(out_frame) * sizeof(uint16_t); +out_frame_bytes = out_frame->nb_samples * out_frame->channels * sizeof(uint16_t); if (out_frame_bytes > out_frame->linesize[0]) { av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n"); return 1; diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c index 7bdf92bb89..52282e0007 100644 --- a/tests/api/api-h264-test.c +++ b/tests/api/api-h264-test.c @@ -132,7 +132,7 @@ static int video_decode_example(const char *input_filename) return number_of_written_bytes; } printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 0x%08lx\n", video_stream, -fr->pts, fr->pkt_dts, av_frame_get_pkt_duration(fr), +fr->pts, fr->pkt_dts, fr->pkt_duration, number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes)); } av_packet_unref(&pkt); diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c index 4fd1e6ea04..2b32cb9e4f 100644 --- a/tests/api/api-seek-test.c +++ b/tests/api/api-seek-test.c @@ -145,7 +145,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream, } av_packet_unref(&pkt); av_init_packet(&pkt); -} while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + av_frame_get_pkt_duration(fr) <= ts_end))); +} while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end))); av_packet_unref(&pkt); av_freep(&byte_buffer); diff --git a/tests/api/api-threadmessage-test.c b/tests/api/api-threadmessage-test.c index 3e0ac5cf19..05a8062b8c 100644 --- a/tests/api/api-threadmessage-test.c +++ b/tests/api/api-threadmessage-test.c @@ -95,7 +95,7 @@ static void *sender_thread(void *arg) av_frame_free(&msg.frame); break; } -av_frame_set_metadata(msg.frame, meta); +msg.frame->metadata = meta; /* allocate a real frame in order to simulate "real" work */ msg.frame->format = AV_PIX_FMT_RGBA; @@ -141,7 +141,7 @@ static void *receiver_thread(void *arg) if (ret < 0) break; av_assert0(msg.magic == MAGIC); -meta = av_frame_get_metadata(msg.frame); +meta = msg.frame->metadata; e = av_dict_get(meta, "sig", NULL, 0); av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame); av_frame_free(&msg.frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dnxhd_parser: fix parsing interlaced video, simplify code
ffmpeg | branch: master | Paul B Mahol | Sun Apr 23 11:53:57 2017 +0200| [ac30754a148df58822a272555d1f6f860e42037e] | committer: Paul B Mahol avcodec/dnxhd_parser: fix parsing interlaced video, simplify code There appears to be no need to treat interlaced videos differently, also that code is flawed, as for at least one input cur_field would be always 0. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac30754a148df58822a272555d1f6f860e42037e --- libavcodec/dnxhd_parser.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c index de1cf5a041..d9914121a0 100644 --- a/libavcodec/dnxhd_parser.c +++ b/libavcodec/dnxhd_parser.c @@ -29,8 +29,6 @@ typedef struct { ParseContext pc; -int interlaced; -int cur_field; /* first field is 0, second is 1 */ int cur_byte; int remaining; int w, h; @@ -43,8 +41,6 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, uint64_t state = pc->state64; int pic_found = pc->frame_start_found; int i = 0; -int interlaced = dctx->interlaced; -int cur_field = dctx->cur_field; if (!pic_found) { for (i = 0; i < buf_size; i++) { @@ -52,8 +48,6 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, if (ff_dnxhd_check_header_prefix(state & 0xff00LL) != 0) { i++; pic_found = 1; -interlaced = (state&2)>>1; /* byte following the 5-byte header prefix */ -cur_field = state&1; dctx->cur_byte = 0; dctx->remaining = 0; break; @@ -84,13 +78,11 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, if (dctx->remaining <= 0) return dctx->remaining; } -if (buf_size - i >= dctx->remaining && (!dctx->interlaced || dctx->cur_field)) { +if (buf_size - i + 47 >= dctx->remaining) { int remaining = dctx->remaining; pc->frame_start_found = 0; pc->state64 = -1; -dctx->interlaced = interlaced; -dctx->cur_field = 0; dctx->cur_byte = 0; dctx->remaining = 0; return remaining; @@ -107,8 +99,6 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, pc->frame_start_found = 0; pc->state64 = -1; -dctx->interlaced = interlaced; -dctx->cur_field = 0; dctx->cur_byte = 0; dctx->remaining = 0; return remaining; @@ -116,8 +106,6 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx, } pc->frame_start_found = pic_found; pc->state64 = state; -dctx->interlaced = interlaced; -dctx->cur_field = cur_field; return END_NOT_FOUND; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: do not report EOF on filters as an error.
ffmpeg | branch: master | Nicolas George | Sun Apr 23 14:22:22 2017 +0200| [0dfb4d4b438b7203b3aaef9fc6ffebc57df140d8] | committer: Nicolas George ffmpeg: do not report EOF on filters as an error. Also print the error message in case of real error. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0dfb4d4b438b7203b3aaef9fc6ffebc57df140d8 --- ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 70431e8808..bf04a6c683 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2213,7 +2213,8 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame) ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, AV_BUFFERSRC_FLAG_PUSH); if (ret < 0) { -av_log(NULL, AV_LOG_ERROR, "Error while filtering\n"); +if (ret != AVERROR_EOF) +av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret)); return ret; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'
On Sat, Apr 22, 2017 at 11:32:41PM +, James Almer wrote: > ffmpeg | branch: master | James Almer | Sat Apr 22 > 20:08:42 2017 -0300| [bddb2343b6e594e312dadb5d21b408702929ae04] | committer: > James Almer > > Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09' > > * commit '061a0c14bb5767bca72e3a7227ca400de439ba09': > decode: restructure the core decoding code > > CUVID decoder adapted by wm4. > > Merged-by: James Almer > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bddb2343b6e594e312dadb5d21b408702929ae04 > --- This breaks ffprobe packet sizes ./ffprobe-ref -show_frames ~/tickets/1905/FLCL_Ending_My.wav | grep pkt_size | head -10 http://samples.mplayerhq.hu/A-codecs/WMA/wav/FLCL_Ending_My.wav before: pkt_size=4092 pkt_size=3720 pkt_size=3348 pkt_size=2976 pkt_size=2604 pkt_size=2232 pkt_size=1860 pkt_size=1488 pkt_size=1116 pkt_size=744 pkt_size=372 pkt_size=4092 pkt_size=3720 pkt_size=3348 pkt_size=2976 pkt_size=2604 pkt_size=2232 pkt_size=1860 pkt_size=1488 pkt_size=1116 after: pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 pkt_size=4092 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato signature.asc Description: Digital signature ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_maskedclamp: limit overshot and undershot to UINT16_MAX
ffmpeg | branch: master | Paul B Mahol | Sun Apr 23 17:36:33 2017 +0200| [0699722ad050344c8bb04a7027849ec9e6e3ab90] | committer: Paul B Mahol avfilter/vf_maskedclamp: limit overshot and undershot to UINT16_MAX Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0699722ad050344c8bb04a7027849ec9e6e3ab90 --- libavfilter/vf_maskedclamp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c index 3e720b1972..3238e5146e 100644 --- a/libavfilter/vf_maskedclamp.c +++ b/libavfilter/vf_maskedclamp.c @@ -50,9 +50,9 @@ typedef struct MaskedClampContext { } MaskedClampContext; static const AVOption maskedclamp_options[] = { -{ "undershoot", "set undershoot", OFFSET(undershoot), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS }, -{ "overshoot", "set overshoot", OFFSET(overshoot), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS }, -{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, +{ "undershoot", "set undershoot", OFFSET(undershoot), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, +{ "overshoot", "set overshoot", OFFSET(overshoot), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, +{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF,FLAGS }, { NULL } }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/decode: also update consumed bytes on last_pkt_props->size
ffmpeg | branch: master | James Almer | Sun Apr 23 12:51:52 2017 -0300| [16c88465a1c1c2cb003590d667c4341c8da9372a] | committer: James Almer avcodec/decode: also update consumed bytes on last_pkt_props->size > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16c88465a1c1c2cb003590d667c4341c8da9372a --- libavcodec/decode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index e63384b910..debbe36e0f 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -580,6 +580,7 @@ FF_ENABLE_DEPRECATION_WARNINGS pkt->data+= consumed; pkt->size-= consumed; +avci->last_pkt_props->size -= consumed; // See extract_packet_props() comment. pkt->pts = AV_NOPTS_VALUE; pkt->dts = AV_NOPTS_VALUE; avci->last_pkt_props->pts = AV_NOPTS_VALUE; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_premultiply: add planes option
ffmpeg | branch: master | Paul B Mahol | Sun Apr 23 18:19:40 2017 +0200| [710c97d5f6a880597701ea7b3ad56920cd0fb731] | committer: Paul B Mahol avfilter/vf_premultiply: add planes option Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=710c97d5f6a880597701ea7b3ad56920cd0fb731 --- doc/filters.texi | 8 libavfilter/vf_premultiply.c | 13 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index ac32995dea..4c733f016e 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11077,6 +11077,14 @@ of second stream as alpha. Both streams must have same dimensions and same pixel format. +The filter accepts the following option: + +@table @option +@item planes +Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +@end table + @section prewitt Apply prewitt operator to input video stream. diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c index e1b79ab779..8a5f9eac64 100644 --- a/libavfilter/vf_premultiply.c +++ b/libavfilter/vf_premultiply.c @@ -30,6 +30,7 @@ typedef struct PreMultiplyContext { const AVClass *class; int width[4], height[4]; +int linesize[4]; int nb_planes; int planes; int half, depth, offset; @@ -47,6 +48,7 @@ typedef struct PreMultiplyContext { #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption premultiply_options[] = { +{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, { NULL } }; @@ -269,6 +271,12 @@ static int process_frame(FFFrameSync *fs) } for (p = 0; p < s->nb_planes; p++) { +if (!((1 << p) & s->planes)) { +av_image_copy_plane(out->data[p], out->linesize[p], base->data[p], base->linesize[p], +s->linesize[p], s->height[p]); +continue; +} + s->premultiply[p](base->data[p], alpha->data[0], out->data[p], base->linesize[p], alpha->linesize[0], @@ -287,10 +295,13 @@ static int config_input(AVFilterLink *inlink) AVFilterContext *ctx = inlink->dst; PreMultiplyContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); -int vsub, hsub; +int vsub, hsub, ret; s->nb_planes = av_pix_fmt_count_planes(inlink->format); +if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0) +return ret; + hsub = desc->log2_chroma_w; vsub = desc->log2_chroma_h; s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_maskedclamp: fix bug when copying >8bit plane(s)
ffmpeg | branch: master | Paul B Mahol | Sun Apr 23 18:01:00 2017 +0200| [9d1f9ba582aa8b62d08922a126fe36784d434003] | committer: Paul B Mahol avfilter/vf_maskedclamp: fix bug when copying >8bit plane(s) Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d1f9ba582aa8b62d08922a126fe36784d434003 --- libavfilter/vf_maskedclamp.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c index 3238e5146e..25c1a73be0 100644 --- a/libavfilter/vf_maskedclamp.c +++ b/libavfilter/vf_maskedclamp.c @@ -37,6 +37,7 @@ typedef struct MaskedClampContext { int undershoot; int overshoot; +int linesize[4]; int width[4], height[4]; int nb_planes; int depth; @@ -112,7 +113,7 @@ static int process_frame(FFFrameSync *fs) for (p = 0; p < s->nb_planes; p++) { if (!((1 << p) & s->planes)) { av_image_copy_plane(out->data[p], out->linesize[p], base->data[p], base->linesize[p], -s->width[p], s->height[p]); +s->linesize[p], s->height[p]); continue; } @@ -195,10 +196,13 @@ static int config_input(AVFilterLink *inlink) AVFilterContext *ctx = inlink->dst; MaskedClampContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); -int vsub, hsub; +int vsub, hsub, ret; s->nb_planes = av_pix_fmt_count_planes(inlink->format); +if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0) +return ret; + hsub = desc->log2_chroma_w; vsub = desc->log2_chroma_h; s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_maskedmerge: fix bug when copying >8bit plane(s)
ffmpeg | branch: master | Paul B Mahol | Sun Apr 23 18:31:05 2017 +0200| [f4218d93efaefb2fb1a1dfcf45d6917a397e96ed] | committer: Paul B Mahol avfilter/vf_maskedmerge: fix bug when copying >8bit plane(s) Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f4218d93efaefb2fb1a1dfcf45d6917a397e96ed --- libavfilter/maskedmerge.h| 1 + libavfilter/vf_maskedmerge.c | 5 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/maskedmerge.h b/libavfilter/maskedmerge.h index a8c7551bad..8e2b1cf676 100644 --- a/libavfilter/maskedmerge.h +++ b/libavfilter/maskedmerge.h @@ -27,6 +27,7 @@ typedef struct MaskedMergeContext { const AVClass *class; int width[4], height[4]; +int linesize[4]; int nb_planes; int planes; int half, depth; diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c index 2c42d62d8a..cf8a56814e 100644 --- a/libavfilter/vf_maskedmerge.c +++ b/libavfilter/vf_maskedmerge.c @@ -91,7 +91,7 @@ static int process_frame(FFFrameSync *fs) for (p = 0; p < s->nb_planes; p++) { if (!((1 << p) & s->planes)) { av_image_copy_plane(out->data[p], out->linesize[p], base->data[p], base->linesize[p], -s->width[p], s->height[p]); +s->linesize[p], s->height[p]); continue; } @@ -229,6 +229,9 @@ static int config_output(AVFilterLink *outlink) outlink->sample_aspect_ratio = base->sample_aspect_ratio; outlink->frame_rate = base->frame_rate; +if ((ret = av_image_fill_linesizes(s->linesize, outlink->format, outlink->w)) < 0) +return ret; + if ((ret = ff_framesync_init(&s->fs, ctx, 3)) < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/crystalhd: Switch to the new generic filtering mechanism
ffmpeg | branch: master | Philip Langdale | Sat Apr 22 20:03:27 2017 -0700| [41b0561dc7246b72a834067da539ae98b1ec6631] | committer: Philip Langdale avcodec/crystalhd: Switch to the new generic filtering mechanism This lets us drop all the code for handling the mp4toannexb conversion. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41b0561dc7246b72a834067da539ae98b1ec6631 --- libavcodec/crystalhd.c | 134 - 1 file changed, 9 insertions(+), 125 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 8ccd6ff8bd..8956ca4bfb 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -92,15 +92,7 @@ typedef struct { AVCodecContext *avctx; HANDLE dev; -uint8_t *orig_extradata; -uint32_t orig_extradata_size; - -AVBSFContext *bsfc; - uint8_t is_70012; -uint8_t *sps_pps_buf; -uint32_t sps_pps_size; -uint8_t is_nal; uint8_t need_second_field; uint8_t draining; @@ -140,7 +132,7 @@ static inline BC_MEDIA_SUBTYPE id2subtype(CHDContext *priv, enum AVCodecID id) case AV_CODEC_ID_WMV3: return BC_MSUBTYPE_WMV3; case AV_CODEC_ID_H264: -return priv->is_nal ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264; +return BC_MSUBTYPE_H264; default: return BC_MSUBTYPE_INVALID; } @@ -295,25 +287,6 @@ static av_cold int uninit(AVCodecContext *avctx) DtsCloseDecoder(device); DtsDeviceClose(device); -/* - * Restore original extradata, so that if the decoder is - * reinitialised, the bitstream detection and filtering - * will work as expected. - */ -if (priv->orig_extradata) { -av_free(avctx->extradata); -avctx->extradata = priv->orig_extradata; -avctx->extradata_size = priv->orig_extradata_size; -priv->orig_extradata = NULL; -priv->orig_extradata_size = 0; -} - -if (priv->bsfc) { -av_bsf_free(&priv->bsfc); -} - -av_freep(&priv->sps_pps_buf); - if (priv->head) { OpaqueList *node = priv->head; while (node) { @@ -326,60 +299,9 @@ static av_cold int uninit(AVCodecContext *avctx) return 0; } - -static av_cold int init_bsf(AVCodecContext *avctx, const char *bsf_name) -{ -CHDContext *priv = avctx->priv_data; -const AVBitStreamFilter *bsf; -int avret; -void *extradata = NULL; -size_t size = 0; - -bsf = av_bsf_get_by_name(bsf_name); -if (!bsf) { -av_log(avctx, AV_LOG_ERROR, - "Cannot open the %s BSF!\n", bsf_name); -return AVERROR_BSF_NOT_FOUND; -} - -avret = av_bsf_alloc(bsf, &priv->bsfc); -if (avret != 0) { -return avret; -} - -avret = avcodec_parameters_from_context(priv->bsfc->par_in, avctx); -if (avret != 0) { -return avret; -} - -avret = av_bsf_init(priv->bsfc); -if (avret != 0) { -return avret; -} - -/* Back up the extradata so it can be restored at close time. */ -priv->orig_extradata = avctx->extradata; -priv->orig_extradata_size = avctx->extradata_size; - -size = priv->bsfc->par_out->extradata_size; -extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); -if (!extradata) { -av_log(avctx, AV_LOG_ERROR, - "Failed to allocate copy of extradata\n"); -return AVERROR(ENOMEM); -} -memcpy(extradata, priv->bsfc->par_out->extradata, size); - -avctx->extradata = extradata; -avctx->extradata_size = size; - -return 0; -} - static av_cold int init(AVCodecContext *avctx) { CHDContext* priv; -int avret; BC_STATUS ret; BC_INFO_CRYSTAL version; BC_INPUT_FORMAT format = { @@ -407,21 +329,10 @@ static av_cold int init(AVCodecContext *avctx) /* Initialize the library */ priv = avctx->priv_data; priv->avctx= avctx; -priv->is_nal = avctx->extradata_size > 0 && *(avctx->extradata) == 1; priv->draining = 0; subtype = id2subtype(priv, avctx->codec->id); switch (subtype) { -case BC_MSUBTYPE_AVC1: -avret = init_bsf(avctx, "h264_mp4toannexb"); -if (avret != 0) { -return avret; -} -subtype = BC_MSUBTYPE_H264; -format.startCodeSz = 4; -format.pMetaData = avctx->extradata; -format.metaDataSz = avctx->extradata_size; -break; case BC_MSUBTYPE_H264: format.startCodeSz = 4; // Fall-through @@ -781,34 +692,6 @@ static int crystalhd_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt) priv->bframe_bug = 0; } -if (priv->bsfc) { -AVPacket filter_packet = { 0 }; - -ret = av_packet_ref(&filter_packet, avpkt); -if (ret < 0) { -av_log(avctx, AV_LOG_ERROR, "CrystalHD: mpv4toannexb filter " - "failed to ref input packet\n"); -goto exit; -
[FFmpeg-cvslog] webm_dash_manifest_demuxer: Fix UB in cue timestamp string code and make it actually work
ffmpeg | branch: master | Derek Buitenhuis | Thu Apr 20 15:02:54 2017 +0100| [8e6b9ef4733be91b32c8b7becd95124340b92334] | committer: Derek Buitenhuis webm_dash_manifest_demuxer: Fix UB in cue timestamp string code and make it actually work Output was apparently not tested for correctness. Passing overlapping memory to snprintf causes undefined behavior, and usually resulted in only the very last timestamp being written to metadata, and not a list at all. Signed-off-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e6b9ef4733be91b32c8b7becd95124340b92334 --- libavformat/matroskadec.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 9adca8dcc0..320d8bfeac 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3823,6 +3823,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s) char *buf; int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth; int i; +int end = 0; // determine cues start and end positions for (i = 0; i < seekhead_list->nb_elem; i++) @@ -3868,10 +3869,17 @@ static int webm_dash_manifest_cues(AVFormatContext *s) if (!buf) return -1; strcpy(buf, ""); for (i = 0; i < s->streams[0]->nb_index_entries; i++) { -snprintf(buf, (i + 1) * 20 * sizeof(char), - "%s%" PRId64, buf, s->streams[0]->index_entries[i].timestamp); -if (i != s->streams[0]->nb_index_entries - 1) +int ret = snprintf(buf + end, 20 * sizeof(char), + "%" PRId64, s->streams[0]->index_entries[i].timestamp); +if (ret <= 0 || (ret == 20 && i == s->streams[0]->nb_index_entries - 1)) { +av_log(s, AV_LOG_ERROR, "timestamp too long.\n"); +return AVERROR_INVALIDDATA; +} +end += ret; +if (i != s->streams[0]->nb_index_entries - 1) { strncat(buf, ",", sizeof(char)); +end++; +} } av_dict_set(&s->streams[0]->metadata, CUE_TIMESTAMPS, buf, 0); av_free(buf); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] webm_dash_manifest_demuxer: Fix initialization range for files with cues at the front
ffmpeg | branch: master | Derek Buitenhuis | Fri Apr 21 16:40:35 2017 +0100| [6ba1c9bf7e8a92cf1977ca11ce595a5872d0ce40] | committer: Derek Buitenhuis webm_dash_manifest_demuxer: Fix initialization range for files with cues at the front The WebM DASH spec states: The Initialization Segment shall not contain Clusters or Cues. The Segment Index corresponds to the Cues. Previously, it included the cues if they were at the front. Signed-off-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ba1c9bf7e8a92cf1977ca11ce595a5872d0ce40 --- libavformat/matroskadec.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 320d8bfeac..47873cccd8 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3815,7 +3815,7 @@ static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t return (int64_t)bandwidth; } -static int webm_dash_manifest_cues(AVFormatContext *s) +static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range) { MatroskaDemuxContext *matroska = s->priv_data; EbmlList *seekhead_list = &matroska->seekhead; @@ -3855,6 +3855,11 @@ static int webm_dash_manifest_cues(AVFormatContext *s) // cues end av_dict_set_int(&s->streams[0]->metadata, CUES_END, cues_end, 0); +// if the file has cues at the start, fix up the init range so tht +// it does not include it +if (cues_start <= init_range) +av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, cues_start - 1, 0); + // bandwidth bandwidth = webm_dash_manifest_compute_bandwidth(s, cues_start); if (bandwidth < 0) return -1; @@ -3891,6 +3896,7 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) { char *buf; int ret = matroska_read_header(s); +int64_t init_range; MatroskaTrack *tracks; MatroskaDemuxContext *matroska = s->priv_data; if (ret) { @@ -3911,7 +3917,8 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) // initialization range // 5 is the offset of Cluster ID. -av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, avio_tell(s->pb) - 5, 0); +init_range = avio_tell(s->pb) - 5; +av_dict_set_int(&s->streams[0]->metadata, INITIALIZATION_RANGE, init_range, 0); } // basename of the file @@ -3924,7 +3931,7 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) // parse the cues and populate Cue related fields if (!matroska->is_live) { -ret = webm_dash_manifest_cues(s); +ret = webm_dash_manifest_cues(s, init_range); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Error parsing Cues\n"); return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/movtextenc: Ignore unmatched closing style tags
ffmpeg | branch: master | Philip Langdale | Sun Apr 23 10:42:25 2017 -0700| [f95c81ce104554b6860d94724a681a1bac0c4fbd] | committer: Philip Langdale avcodec/movtextenc: Ignore unmatched closing style tags The existing code will segfault if a closing tag shows up when there was never an opening tag. This isn't a well formed style, but it's also not a reason to crash. Fixes: https://trac.ffmpeg.org/ticket/6303 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f95c81ce104554b6860d94724a681a1bac0c4fbd --- libavcodec/movtextenc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 20e01e206e..d795e317c3 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -57,6 +57,8 @@ typedef struct { } HilightcolorBox; typedef struct { +AVCodecContext *avctx; + ASSSplitContext *ass_ctx; AVBPrint buffer; StyleBox **style_attributes; @@ -187,6 +189,7 @@ static av_cold int mov_text_encode_init(AVCodecContext *avctx) }; MovTextContext *s = avctx->priv_data; +s->avctx = avctx; avctx->extradata_size = sizeof text_sample_entry; avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); @@ -247,6 +250,9 @@ static void mov_text_style_cb(void *priv, const char style, int close) s->style_attributes_temp->style_flag |= STYLE_FLAG_UNDERLINE; break; } +} else if (!s->style_attributes_temp) { +av_log(s->avctx, AV_LOG_WARNING, "Ignoring unmatched close tag\n"); +return; } else { s->style_attributes_temp->style_end = AV_RB16(&s->text_pos); av_dynarray_add(&s->style_attributes, &s->count, s->style_attributes_temp); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'
On Sat, Apr 22, 2017 at 11:32:41PM +, James Almer wrote: > ffmpeg | branch: master | James Almer | Sat Apr 22 > 20:08:42 2017 -0300| [bddb2343b6e594e312dadb5d21b408702929ae04] | committer: > James Almer > > Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09' > > * commit '061a0c14bb5767bca72e3a7227ca400de439ba09': > decode: restructure the core decoding code > > CUVID decoder adapted by wm4. > > Merged-by: James Almer > [...] > +static int compat_decode(AVCodecContext *avctx, AVFrame *frame, > + int *got_frame, const AVPacket *pkt) > +{ > +AVCodecInternal *avci = avctx->internal; > +int ret; > + > +av_assert0(avci->compat_decode_consumed == 0); > + > +*got_frame = 0; > +avci->compat_decode = 1; > + > +if (avci->compat_decode_partial_size > 0 && > +avci->compat_decode_partial_size != pkt->size) { > +av_log(avctx, AV_LOG_ERROR, > + "Got unexpected packet size after a partial decode\n"); > +ret = AVERROR(EINVAL); > +goto finish; > +} > + > +if (!avci->compat_decode_partial_size) { > +ret = avcodec_send_packet(avctx, pkt); > +if (ret == AVERROR_EOF) > +ret = 0; > +else if (ret == AVERROR(EAGAIN)) { > +/* we fully drain all the output in each decode call, so this > should not > + * ever happen */ > +ret = AVERROR_BUG; > +goto finish; > +} else if (ret < 0) > +goto finish; > +} > + > +while (ret >= 0) { ret is uninitialized if compat_decode_partial_size != 0 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein signature.asc Description: Digital signature ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] decode: Initialize ret before using it
ffmpeg | branch: master | Vittorio Giovara | Mon Apr 3 21:58:15 2017 +0200| [960b4d47612ec89cfdf0ff8b83bc7424ad4c754a] | committer: James Almer decode: Initialize ret before using it libavcodec/decode.c:608:9: warning: variable 'ret' is used uninitialized whenever 'if' condition is false (cherry picked from libav commit efddf2c09aed7400c73ecf327f86a4d0452b94b5) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=960b4d47612ec89cfdf0ff8b83bc7424ad4c754a --- libavcodec/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index debbe36e0f..6ff3c401ba 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -695,7 +695,7 @@ static int compat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, const AVPacket *pkt) { AVCodecInternal *avci = avctx->internal; -int ret; +int ret = 0; av_assert0(avci->compat_decode_consumed == 0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/crystalhd: Another attempt at using mpeg4_unpack_bframes bsf
ffmpeg | branch: master | Philip Langdale | Sun Apr 23 15:31:55 2017 -0700| [dd49eff93095110d2e878bbcc81b0062590d865f] | committer: Philip Langdale avcodec/crystalhd: Another attempt at using mpeg4_unpack_bframes bsf I tried doing this before, but it resulted in weird behaviour with certain samples. I want to say I think I've got it sorted out now, and the new autobsf stuff makes it trivial to turn on. The native support for packed bframes is buggy and I think buggy in ways beyond what I already try to account for, so this should be a net improvements. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd49eff93095110d2e878bbcc81b0062590d865f --- libavcodec/crystalhd.c | 28 +--- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index a22dfe16ea..83bc8bf364 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -101,7 +101,6 @@ typedef struct { /* Options */ uint32_t sWidth; -uint8_t bframe_bug; } CHDContext; static const AVOption options[] = { @@ -631,16 +630,6 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, } else if (ret == BC_STS_SUCCESS) { int copy_ret = -1; if (output.PoutFlags & BC_POUT_FLAGS_PIB_VALID) { -if (avctx->codec->id == AV_CODEC_ID_MPEG4 && -output.PicInfo.timeStamp == 0 && priv->bframe_bug) { -if (!priv->bframe_bug) { -av_log(avctx, AV_LOG_VERBOSE, - "CrystalHD: Not returning packed frame twice.\n"); -} -DtsReleaseOutputBuffs(dev, NULL, FALSE); -return RET_COPY_AGAIN; -} - print_frame_info(priv, &output); copy_ret = copy_frame(avctx, &output, frame, got_frame); @@ -675,21 +664,6 @@ static int crystalhd_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt) if (avpkt && avpkt->size) { uint64_t pts; -if (!priv->bframe_bug && (avpkt->size == 6 || avpkt->size == 7)) { -/* - * Drop frames trigger the bug - */ -av_log(avctx, AV_LOG_WARNING, - "CrystalHD: Enabling work-around for packed b-frame bug\n"); -priv->bframe_bug = 1; -} else if (priv->bframe_bug && avpkt->size == 8) { -/* - * Delay frames don't trigger the bug - */ -av_log(avctx, AV_LOG_WARNING, - "CrystalHD: Disabling work-around for packed b-frame bug\n"); -priv->bframe_bug = 0; -} /* * Despite being notionally opaque, either libcrystalhd or @@ -825,7 +799,7 @@ DEFINE_CRYSTALHD_DECODER(mpeg2, MPEG2VIDEO, NULL) #endif #if CONFIG_MPEG4_CRYSTALHD_DECODER -DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, NULL) +DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, "mpeg4_unpack_bframes") #endif #if CONFIG_MSMPEG4_CRYSTALHD_DECODER ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/crystalhd: Explicitly set frame pts at all times
ffmpeg | branch: master | Philip Langdale | Sun Apr 23 14:34:03 2017 -0700| [181aa1be493416c38c8adf0ce21e7fdac64a039e] | committer: Philip Langdale avcodec/crystalhd: Explicitly set frame pts at all times Previously, the pts value was initialised to AV_NOPTS_VALUE and so it was not necessary to always set it. Now, with the new-new decode API, this is no longer true. I'm not sure why I avoided setting the pts when the decoder value was also AV_NOPTS_VALUE - it clearly wouldn't have changed anything previously, but here we are. Failing to do this, means the frame pts will be some random uninitalised value. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=181aa1be493416c38c8adf0ce21e7fdac64a039e --- libavcodec/crystalhd.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 8956ca4bfb..a22dfe16ea 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -537,14 +537,13 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, if (interlaced) frame->top_field_first = !bottom_first; -if (pkt_pts != AV_NOPTS_VALUE) { -frame->pts = pkt_pts; +frame->pts = pkt_pts; #if FF_API_PKT_PTS FF_DISABLE_DEPRECATION_WARNINGS -frame->pkt_pts = pkt_pts; +frame->pkt_pts = pkt_pts; FF_ENABLE_DEPRECATION_WARNINGS #endif -} + frame->pkt_pos = -1; frame->pkt_duration = 0; frame->pkt_size = -1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog