Commit Graph

27 Commits

Author SHA1 Message Date
Andreas Rheinhardt 423b6a7e49 avutil/imgutils: Add wrapper for av_image_copy() to avoid casts
av_image_copy() accepts const uint8_t* const * as source;
lots of user have uint8_t* const * and therefore either
cast (the majority) or copy the array of pointers.

This commit changes this by adding a static inline wrapper
for av_image_copy() that casts between the two types
so that we do not need to add casts everywhere else.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-12 09:42:27 +02:00
Anton Khirnov 5d920255aa lavfi/lavfutils: include required headers explicitly 2021-06-10 16:51:44 +02:00
Andreas Rheinhardt 56450a0ee4 avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Andreas Rheinhardt 2869d71493 avfilter/lavfutils.h: Don't include avformat.h
Only lavfutils.c needs avformat.h, not lavfutils.h.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-25 22:03:32 +01:00
Anton Khirnov e1c4a3ea7d lavfi/lavfutils: switch to the new decoding API 2020-11-20 15:20:24 +01:00
Andreas Rheinhardt 0086432fc7 fftools, libavcodec, libavfilter: Add const to some AVCodec *
The user has no business modifying the underlying AVCodec.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:42:36 +02:00
Andreas Rheinhardt 98171d14c5 avfilter/lavfutils: Avoid initializing packet
av_read_frame() can handle uninitialized packets.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:40:58 +02:00
Andreas Rheinhardt f38926ec24 avfilter/lavfutils: Fix memleak when avformat_find_stream_info() fails
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:40:34 +02:00
Andreas Rheinhardt 3d1a9824b8 avfilter/lavfutils: Don't use uninitialized pointers for freeing
Happened on several error conditions, e.g. if there is just no decoder
for the format (like with svg images).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-11 14:39:38 +02:00
Josh de Kock 89029bd2c7 lav*,tests: remove several register_all calls
avdevice_register_all() is still required to register devices into
lavf (this is required due to lavd being somewhat of a hack).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
James Almer 9a174d203a avfilter/lavfutils: remove usage of AVStream->codec
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-05 14:21:41 -03:00
Muhammad Faiz e061826eb2 avfilter/lavfutils: use image2pipe demuxer on ff_load_image
allow protocols other than file to be used
for example, use data protocol to embed a file in script

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-29 01:23:25 +07:00
Hendrik Leppkes c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
Michael Niedermayer d2184bf3b6 avfilter/lavfutils: disable frame threads when decoding a single image
The image decoding code does expect the image to be decoded immedeatly

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-30 03:48:33 +02:00
Clément Bœsch 17cb05fe06 avfilter/lavfutils: use av_frame_free for freeing an AVFrame 2015-03-02 21:27:21 +01:00
Michael Niedermayer 65f05eff0a avfilter/lavfutils/ff_load_image: Return error if no frame could be decoded
Based-on suggestion by JULIAN GARDNER <joolzg@btinternet.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-16 01:34:34 +02:00
Michael Niedermayer 17fef17f67 avfilter/lavfutils: remove redundant variable init
Found-by: CSA
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-02 20:03:10 +02:00
Michael Niedermayer de96e20be9 avfilter/lavfutils: call av_find_stream_info() before reading various information about the stream
No testcase with unmodified source is known

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-28 17:29:26 +01:00
Michael Niedermayer 0ee905e243 Merge commit '5b9c3b4505206143d85398c1410949319fa1180f'
* commit '5b9c3b4505206143d85398c1410949319fa1180f':
  Replace all instances of avcodec_alloc_frame() with av_frame_alloc().

Conflicts:
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	libavcodec/alacenc.c
	libavcodec/libopenjpegenc.c
	libavcodec/libvpxenc.c
	libavcodec/pcm.c
	libavcodec/xbmenc.c
	libavcodec/xwdenc.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-16 23:54:10 +01:00
Michael Niedermayer aeddc6e3a5 avfilter/lavfutils: fix memleak of avpacket
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-12 11:52:10 +02:00
Michael Niedermayer 657998b5ee libavfilter/lavfutils: remove useless NULL check on format context
Fixes: CID733804
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 20:00:31 +02:00
Michael Niedermayer fd9e88fe60 libavfilter/lavfutils: remove useless NULL check on codec context
The code would crash before if it was NULL

Fixes CID733804
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 20:00:20 +02:00
Michael Niedermayer ac627b3d38 Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
  Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Conflicts:
	doc/examples/muxing.c
	ffmpeg.h
	ffmpeg_filter.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	libavcodec/8bps.c
	libavcodec/aasc.c
	libavcodec/aura.c
	libavcodec/avcodec.h
	libavcodec/avs.c
	libavcodec/bfi.c
	libavcodec/bmp.c
	libavcodec/bmpenc.c
	libavcodec/c93.c
	libavcodec/cscd.c
	libavcodec/cyuv.c
	libavcodec/dpx.c
	libavcodec/dpxenc.c
	libavcodec/eatgv.c
	libavcodec/escape124.c
	libavcodec/ffv1.c
	libavcodec/flashsv.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/huffyuv.c
	libavcodec/iff.c
	libavcodec/imgconvert.c
	libavcodec/indeo3.c
	libavcodec/kmvc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c
	libavcodec/motionpixels.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pamenc.c
	libavcodec/pcxenc.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/pnm.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/ptx.c
	libavcodec/qdrw.c
	libavcodec/qpeg.c
	libavcodec/qtrleenc.c
	libavcodec/raw.c
	libavcodec/rawdec.c
	libavcodec/rl2.c
	libavcodec/sgidec.c
	libavcodec/sgienc.c
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavcodec/sunrast.c
	libavcodec/targa.c
	libavcodec/targaenc.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/tmv.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/vb.c
	libavcodec/vp3.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/xwddec.c
	libavcodec/xwdenc.c
	libavcodec/yop.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_format.c
	libavfilter/vf_hflip.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/movenc.c
	libavformat/mxf.h
	libavformat/utils.c
	libavformat/yuv4mpeg.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libswscale/input.c
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	libswscale/x86/yuv2rgb.c
	libswscale/x86/yuv2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Michael Niedermayer 6d401effc4 lavfutils: fix incompatible pointer type warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-26 20:45:59 +02:00
Michael Niedermayer d5802a59f7 lavfutils: fix copyright
git blame:
     77 Stefano Sabatini
      1 Michael Niedermayer

Initial commit:
commit 2f83681c79
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Sat Mar 10 14:01:28 2012 +0100

    lavfi: port libmpcodecs remove-logo filter

    The code is based on the remove-logo filter in MPlayer/libmpcodecs, by
    Robert Edele, relicensed to LGPL with consent of the author.

    Address trac issue #249.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-24 05:08:49 +02:00
Michael Niedermayer 44391f706b lavfutils: ff_load_image: Initialize context
should fix  ticket1264

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-11 15:07:26 +02:00
Stefano Sabatini 2f83681c79 lavfi: port libmpcodecs remove-logo filter
The code is based on the remove-logo filter in MPlayer/libmpcodecs, by
Robert Edele, relicensed to LGPL with consent of the author.

Address trac issue #249.
2012-04-07 13:57:39 +02:00