@@ -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,6 +22,7 @@
*/
#include "avformat.h"
+#include "demux.h"
#include "internal.h"
#include "isom.h"
#include "libavcodec/mpeg4audio.h"
@@ -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 {
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> --- libavformat/aaxdec.c | 1 + libavformat/acm.c | 1 + libavformat/adxdec.c | 1 + libavformat/aiffdec.c | 1 + libavformat/aixdec.c | 1 + libavformat/anm.c | 1 + libavformat/apc.c | 2 +- libavformat/bfi.c | 1 + libavformat/bink.c | 1 + libavformat/cafdec.c | 1 + libavformat/demux.h | 9 +++++++++ libavformat/demux_utils.c | 17 +++++++++++++++++ libavformat/internal.h | 9 --------- libavformat/isom.c | 1 + libavformat/mpc.c | 1 + libavformat/nuv.c | 1 + libavformat/riffdec.c | 1 + libavformat/rl2.c | 1 + libavformat/rsd.c | 1 + libavformat/utils.c | 16 ---------------- libavformat/vc1test.c | 1 + libavformat/westwood_vqa.c | 1 + libavformat/yop.c | 1 + 23 files changed, 45 insertions(+), 26 deletions(-)