aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-27 12:14:33 +0200
committerwm4 <nfxjfg@googlemail.com>2017-03-03 08:45:43 +0100
commitaf1761f7b5b1b72197dc40934953b775c2d951cc (patch)
tree46941e97c792c8331d288639e4f39231bcb0f017 /ffmpeg.h
parent4ee5aed122ba7d289c1686eca6eba161d5d62304 (diff)
downloadffmpeg-af1761f7b5b1b72197dc40934953b775c2d951cc.tar.gz
ffmpeg: init filtergraphs only after we have a frame on each input
This makes sure the actual stream parameters are used, which is important mainly for hardware decoding+filtering cases, which would previously require various weird workarounds to handle the fact that a fake software graph has to be constructed, but never used. This should also improve behaviour in rare cases where avformat_find_stream_info() does not provide accurate information. This merges Libav commit a3a0230. It was previously skipped. The code in flush_encoders() which sets up a "fake" format wasn't in Libav. I'm not sure if it's a good idea, but it tends to give behavior closer to the old one in certain corner cases. The vp8-size-change gives different result, because now the size of the first frame is used. libavformat reported the size of the largest frame for some reason. The exr tests now use the sample aspect ratio of the first frame. For some reason libavformat determines 0/1 as aspect ratio, while the decoder returns the correct one. The ffm and mxf tests change the field_order values. I'm assuming another libavformat/decoding mismatch. Signed-off-by: wm4 <nfxjfg@googlemail.com>
Diffstat (limited to 'ffmpeg.h')
-rw-r--r--ffmpeg.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/ffmpeg.h b/ffmpeg.h
index ca35ccc260..56e35ebb9c 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -233,6 +233,9 @@ typedef struct InputFilter {
struct InputStream *ist;
struct FilterGraph *graph;
uint8_t *name;
+ enum AVMediaType type; // AVMEDIA_TYPE_SUBTITLE for sub2video
+
+ AVFifoBuffer *frame_queue;
// parameters configured for this input
int format;
@@ -321,14 +324,6 @@ typedef struct InputStream {
int guess_layout_max;
int autorotate;
- int resample_height;
- int resample_width;
- int resample_pix_fmt;
-
- int resample_sample_fmt;
- int resample_sample_rate;
- int resample_channels;
- uint64_t resample_channel_layout;
int fix_sub_duration;
struct { /* previous decoded subtitle and related variables */
@@ -379,6 +374,8 @@ typedef struct InputStream {
int64_t *dts_buffer;
int nb_dts_buffer;
+
+ int got_output;
} InputStream;
typedef struct InputFile {
@@ -507,6 +504,8 @@ typedef struct OutputStream {
// parameters are set in the AVStream.
int initialized;
+ int inputs_done;
+
const char *attachment_filename;
int copy_initial_nonkeyframes;
int copy_prior_start;
@@ -636,7 +635,6 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
int init_complex_filtergraph(FilterGraph *fg);
int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
-int ifilter_parameters_from_decoder(InputFilter *ifilter, const AVCodecContext *avctx);
int ffmpeg_parse_options(int argc, char **argv);
@@ -645,7 +643,6 @@ int dxva2_init(AVCodecContext *s);
int vda_init(AVCodecContext *s);
int videotoolbox_init(AVCodecContext *s);
int qsv_init(AVCodecContext *s);
-int qsv_transcode_init(OutputStream *ost);
int vaapi_decode_init(AVCodecContext *avctx);
int vaapi_device_init(const char *device);
int cuvid_init(AVCodecContext *s);