avformat/utils: Move ff_get_extradata to demux_utils.c

It is only used by demuxers (although it is hypothetically
possible that some day e.g. a protocol might need it, but
that is unlikely given that they don't deal with AVCodecParameters).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/5.1
Andreas Rheinhardt 3 years ago
parent aef16886dd
commit a085cfa654
  1. 1
      libavformat/aaxdec.c
  2. 1
      libavformat/acm.c
  3. 1
      libavformat/adxdec.c
  4. 1
      libavformat/aiffdec.c
  5. 1
      libavformat/aixdec.c
  6. 1
      libavformat/anm.c
  7. 2
      libavformat/apc.c
  8. 1
      libavformat/bfi.c
  9. 1
      libavformat/bink.c
  10. 1
      libavformat/cafdec.c
  11. 9
      libavformat/demux.h
  12. 17
      libavformat/demux_utils.c
  13. 9
      libavformat/internal.h
  14. 3
      libavformat/isom.c
  15. 1
      libavformat/mpc.c
  16. 1
      libavformat/nuv.c
  17. 1
      libavformat/riffdec.c
  18. 1
      libavformat/rl2.c
  19. 1
      libavformat/rsd.c
  20. 16
      libavformat/utils.c
  21. 1
      libavformat/vc1test.c
  22. 1
      libavformat/westwood_vqa.c
  23. 1
      libavformat/yop.c

@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
typedef struct AAXColumn {

@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "rawdec.h"
#include "internal.h"

@ -25,6 +25,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#define BLOCK_SIZE 18

@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "pcm.h"
#include "aiff.h"

@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
static int aix_probe(const AVProbeData *p)

@ -26,6 +26,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
typedef struct Page {

@ -23,7 +23,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "demux.h"
static int apc_probe(const AVProbeData *p)
{

@ -29,6 +29,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
typedef struct BFIContext {

@ -33,6 +33,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
enum BinkAudFlags {

@ -28,6 +28,7 @@
#include <inttypes.h>
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "isom.h"
#include "mov_chan.h"

@ -217,4 +217,13 @@ int ff_add_param_change(AVPacket *pkt, int32_t channels,
*/
int ff_generate_avci_extradata(AVStream *st);
/**
* Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0 and fill it from pb.
*
* @param size size of extradata
* @return >= 0 if OK, AVERROR_xxx on error
*/
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size);
#endif /* AVFORMAT_DEMUX_H */

@ -25,6 +25,7 @@
#include "libavcodec/bytestream.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
@ -350,3 +351,19 @@ int ff_generate_avci_extradata(AVStream *st)
return 0;
}
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
{
int ret = ff_alloc_extradata(par, size);
if (ret < 0)
return ret;
ret = ffio_read_size(pb, par->extradata, size);
if (ret < 0) {
av_freep(&par->extradata);
par->extradata_size = 0;
av_log(logctx, AV_LOG_ERROR, "Failed to read extradata of size %d\n", size);
return ret;
}
return ret;
}

@ -652,15 +652,6 @@ int ff_rename(const char *url_src, const char *url_dst, void *logctx);
*/
int ff_alloc_extradata(AVCodecParameters *par, int size);
/**
* Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0 and fill it from pb.
*
* @param size size of extradata
* @return >= 0 if OK, AVERROR_xxx on error
*/
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size);
/**
* Copies the whilelists from one context to the other
*/

@ -22,13 +22,12 @@
*/
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "isom.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/mpegaudiodata.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
/* http://www.mp4ra.org */
/* ordered by muxing preference */

@ -22,6 +22,7 @@
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "apetag.h"
#include "id3v1.h"

@ -25,6 +25,7 @@
#include "libavutil/intfloat.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
#include "riff.h"

@ -26,6 +26,7 @@
#include "libavutil/log.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "riff.h"
int ff_get_guid(AVIOContext *s, ff_asf_guid *g)

@ -37,6 +37,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr, palette

@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio.h"
#include "demux.h"
#include "internal.h"
static const AVCodecTag rsd_tags[] = {

@ -359,22 +359,6 @@ int ff_alloc_extradata(AVCodecParameters *par, int size)
return 0;
}
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
{
int ret = ff_alloc_extradata(par, size);
if (ret < 0)
return ret;
ret = ffio_read_size(pb, par->extradata, size);
if (ret < 0) {
av_freep(&par->extradata);
par->extradata_size = 0;
av_log(logctx, AV_LOG_ERROR, "Failed to read extradata of size %d\n", size);
return ret;
}
return ret;
}
AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s)
{
for (unsigned i = 0; i < ic->nb_programs; i++) {

@ -28,6 +28,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#define VC1_EXTRADATA_SIZE 4

@ -32,6 +32,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
#define FORM_TAG MKBETAG('F', 'O', 'R', 'M')

@ -25,6 +25,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
typedef struct yop_dec_context {

Loading…
Cancel
Save