ffmpeg.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef FFTOOLS_FFMPEG_H
  19. #define FFTOOLS_FFMPEG_H
  20. #include "config.h"
  21. #include <stdint.h>
  22. #include <stdio.h>
  23. #include <signal.h>
  24. #include "cmdutils.h"
  25. #include "libavformat/avformat.h"
  26. #include "libavformat/avio.h"
  27. #include "libavcodec/avcodec.h"
  28. #include "libavfilter/avfilter.h"
  29. #include "libavutil/avutil.h"
  30. #include "libavutil/dict.h"
  31. #include "libavutil/eval.h"
  32. #include "libavutil/fifo.h"
  33. #include "libavutil/hwcontext.h"
  34. #include "libavutil/pixfmt.h"
  35. #include "libavutil/rational.h"
  36. #include "libavutil/thread.h"
  37. #include "libavutil/threadmessage.h"
  38. #include "libswresample/swresample.h"
  39. #define VSYNC_AUTO -1
  40. #define VSYNC_PASSTHROUGH 0
  41. #define VSYNC_CFR 1
  42. #define VSYNC_VFR 2
  43. #define VSYNC_VSCFR 0xfe
  44. #define VSYNC_DROP 0xff
  45. #define MAX_STREAMS 1024 /* arbitrary sanity check value */
  46. enum HWAccelID {
  47. HWACCEL_NONE = 0,
  48. HWACCEL_AUTO,
  49. HWACCEL_GENERIC,
  50. HWACCEL_VIDEOTOOLBOX,
  51. HWACCEL_QSV,
  52. };
  53. typedef struct HWAccel {
  54. const char *name;
  55. int (*init)(AVCodecContext *s);
  56. enum HWAccelID id;
  57. enum AVPixelFormat pix_fmt;
  58. } HWAccel;
  59. typedef struct HWDevice {
  60. const char *name;
  61. enum AVHWDeviceType type;
  62. AVBufferRef *device_ref;
  63. } HWDevice;
  64. /* select an input stream for an output stream */
  65. typedef struct StreamMap {
  66. int disabled; /* 1 is this mapping is disabled by a negative map */
  67. int file_index;
  68. int stream_index;
  69. int sync_file_index;
  70. int sync_stream_index;
  71. char *linklabel; /* name of an output link, for mapping lavfi outputs */
  72. } StreamMap;
  73. typedef struct {
  74. int file_idx, stream_idx, channel_idx; // input
  75. int ofile_idx, ostream_idx; // output
  76. } AudioChannelMap;
  77. typedef struct OptionsContext {
  78. OptionGroup *g;
  79. /* input/output options */
  80. int64_t start_time;
  81. int64_t start_time_eof;
  82. int seek_timestamp;
  83. const char *format;
  84. SpecifierOpt *codec_names;
  85. int nb_codec_names;
  86. SpecifierOpt *audio_channels;
  87. int nb_audio_channels;
  88. SpecifierOpt *audio_sample_rate;
  89. int nb_audio_sample_rate;
  90. SpecifierOpt *frame_rates;
  91. int nb_frame_rates;
  92. SpecifierOpt *frame_sizes;
  93. int nb_frame_sizes;
  94. SpecifierOpt *frame_pix_fmts;
  95. int nb_frame_pix_fmts;
  96. /* input options */
  97. int64_t input_ts_offset;
  98. int loop;
  99. int rate_emu;
  100. int accurate_seek;
  101. int thread_queue_size;
  102. SpecifierOpt *ts_scale;
  103. int nb_ts_scale;
  104. SpecifierOpt *dump_attachment;
  105. int nb_dump_attachment;
  106. SpecifierOpt *hwaccels;
  107. int nb_hwaccels;
  108. SpecifierOpt *hwaccel_devices;
  109. int nb_hwaccel_devices;
  110. SpecifierOpt *hwaccel_output_formats;
  111. int nb_hwaccel_output_formats;
  112. SpecifierOpt *autorotate;
  113. int nb_autorotate;
  114. /* output options */
  115. StreamMap *stream_maps;
  116. int nb_stream_maps;
  117. AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */
  118. int nb_audio_channel_maps; /* number of (valid) -map_channel settings */
  119. int metadata_global_manual;
  120. int metadata_streams_manual;
  121. int metadata_chapters_manual;
  122. const char **attachments;
  123. int nb_attachments;
  124. int chapters_input_file;
  125. int64_t recording_time;
  126. int64_t stop_time;
  127. uint64_t limit_filesize;
  128. float mux_preload;
  129. float mux_max_delay;
  130. int shortest;
  131. int bitexact;
  132. int video_disable;
  133. int audio_disable;
  134. int subtitle_disable;
  135. int data_disable;
  136. /* indexed by output file stream index */
  137. int *streamid_map;
  138. int nb_streamid_map;
  139. SpecifierOpt *metadata;
  140. int nb_metadata;
  141. SpecifierOpt *max_frames;
  142. int nb_max_frames;
  143. SpecifierOpt *bitstream_filters;
  144. int nb_bitstream_filters;
  145. SpecifierOpt *codec_tags;
  146. int nb_codec_tags;
  147. SpecifierOpt *sample_fmts;
  148. int nb_sample_fmts;
  149. SpecifierOpt *qscale;
  150. int nb_qscale;
  151. SpecifierOpt *forced_key_frames;
  152. int nb_forced_key_frames;
  153. SpecifierOpt *force_fps;
  154. int nb_force_fps;
  155. SpecifierOpt *frame_aspect_ratios;
  156. int nb_frame_aspect_ratios;
  157. SpecifierOpt *rc_overrides;
  158. int nb_rc_overrides;
  159. SpecifierOpt *intra_matrices;
  160. int nb_intra_matrices;
  161. SpecifierOpt *inter_matrices;
  162. int nb_inter_matrices;
  163. SpecifierOpt *chroma_intra_matrices;
  164. int nb_chroma_intra_matrices;
  165. SpecifierOpt *top_field_first;
  166. int nb_top_field_first;
  167. SpecifierOpt *metadata_map;
  168. int nb_metadata_map;
  169. SpecifierOpt *presets;
  170. int nb_presets;
  171. SpecifierOpt *copy_initial_nonkeyframes;
  172. int nb_copy_initial_nonkeyframes;
  173. SpecifierOpt *copy_prior_start;
  174. int nb_copy_prior_start;
  175. SpecifierOpt *filters;
  176. int nb_filters;
  177. SpecifierOpt *filter_scripts;
  178. int nb_filter_scripts;
  179. SpecifierOpt *reinit_filters;
  180. int nb_reinit_filters;
  181. SpecifierOpt *fix_sub_duration;
  182. int nb_fix_sub_duration;
  183. SpecifierOpt *canvas_sizes;
  184. int nb_canvas_sizes;
  185. SpecifierOpt *pass;
  186. int nb_pass;
  187. SpecifierOpt *passlogfiles;
  188. int nb_passlogfiles;
  189. SpecifierOpt *max_muxing_queue_size;
  190. int nb_max_muxing_queue_size;
  191. SpecifierOpt *guess_layout_max;
  192. int nb_guess_layout_max;
  193. SpecifierOpt *apad;
  194. int nb_apad;
  195. SpecifierOpt *discard;
  196. int nb_discard;
  197. SpecifierOpt *disposition;
  198. int nb_disposition;
  199. SpecifierOpt *program;
  200. int nb_program;
  201. SpecifierOpt *time_bases;
  202. int nb_time_bases;
  203. SpecifierOpt *enc_time_bases;
  204. int nb_enc_time_bases;
  205. SpecifierOpt *autoscale;
  206. int nb_autoscale;
  207. } OptionsContext;
  208. typedef struct InputFilter {
  209. AVFilterContext *filter;
  210. struct InputStream *ist;
  211. struct FilterGraph *graph;
  212. uint8_t *name;
  213. enum AVMediaType type; // AVMEDIA_TYPE_SUBTITLE for sub2video
  214. AVFifoBuffer *frame_queue;
  215. // parameters configured for this input
  216. int format;
  217. int width, height;
  218. AVRational sample_aspect_ratio;
  219. int sample_rate;
  220. int channels;
  221. uint64_t channel_layout;
  222. AVBufferRef *hw_frames_ctx;
  223. int eof;
  224. } InputFilter;
  225. typedef struct OutputFilter {
  226. AVFilterContext *filter;
  227. struct OutputStream *ost;
  228. struct FilterGraph *graph;
  229. uint8_t *name;
  230. /* temporary storage until stream maps are processed */
  231. AVFilterInOut *out_tmp;
  232. enum AVMediaType type;
  233. /* desired output stream properties */
  234. int width, height;
  235. AVRational frame_rate;
  236. int format;
  237. int sample_rate;
  238. uint64_t channel_layout;
  239. // those are only set if no format is specified and the encoder gives us multiple options
  240. int *formats;
  241. uint64_t *channel_layouts;
  242. int *sample_rates;
  243. } OutputFilter;
  244. typedef struct FilterGraph {
  245. int index;
  246. const char *graph_desc;
  247. AVFilterGraph *graph;
  248. int reconfiguration;
  249. InputFilter **inputs;
  250. int nb_inputs;
  251. OutputFilter **outputs;
  252. int nb_outputs;
  253. } FilterGraph;
  254. typedef struct InputStream {
  255. int file_index;
  256. AVStream *st;
  257. int discard; /* true if stream data should be discarded */
  258. int user_set_discard;
  259. int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
  260. #define DECODING_FOR_OST 1
  261. #define DECODING_FOR_FILTER 2
  262. AVCodecContext *dec_ctx;
  263. AVCodec *dec;
  264. AVFrame *decoded_frame;
  265. AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
  266. int64_t start; /* time when read started */
  267. /* predicted dts of the next packet read for this stream or (when there are
  268. * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
  269. int64_t next_dts;
  270. int64_t dts; ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
  271. int64_t next_pts; ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
  272. int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units)
  273. int wrap_correction_done;
  274. int64_t filter_in_rescale_delta_last;
  275. int64_t min_pts; /* pts with the smallest value in a current stream */
  276. int64_t max_pts; /* pts with the higher value in a current stream */
  277. // when forcing constant input framerate through -r,
  278. // this contains the pts that will be given to the next decoded frame
  279. int64_t cfr_next_pts;
  280. int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */
  281. double ts_scale;
  282. int saw_first_ts;
  283. AVDictionary *decoder_opts;
  284. AVRational framerate; /* framerate forced with -r */
  285. int top_field_first;
  286. int guess_layout_max;
  287. int autorotate;
  288. int fix_sub_duration;
  289. struct { /* previous decoded subtitle and related variables */
  290. int got_output;
  291. int ret;
  292. AVSubtitle subtitle;
  293. } prev_sub;
  294. struct sub2video {
  295. int64_t last_pts;
  296. int64_t end_pts;
  297. AVFifoBuffer *sub_queue; ///< queue of AVSubtitle* before filter init
  298. AVFrame *frame;
  299. int w, h;
  300. unsigned int initialize; ///< marks if sub2video_update should force an initialization
  301. } sub2video;
  302. int dr1;
  303. /* decoded data from this stream goes into all those filters
  304. * currently video and audio only */
  305. InputFilter **filters;
  306. int nb_filters;
  307. int reinit_filters;
  308. /* hwaccel options */
  309. enum HWAccelID hwaccel_id;
  310. enum AVHWDeviceType hwaccel_device_type;
  311. char *hwaccel_device;
  312. enum AVPixelFormat hwaccel_output_format;
  313. /* hwaccel context */
  314. void *hwaccel_ctx;
  315. void (*hwaccel_uninit)(AVCodecContext *s);
  316. int (*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags);
  317. int (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
  318. enum AVPixelFormat hwaccel_pix_fmt;
  319. enum AVPixelFormat hwaccel_retrieved_pix_fmt;
  320. AVBufferRef *hw_frames_ctx;
  321. /* stats */
  322. // combined size of all the packets read
  323. uint64_t data_size;
  324. /* number of packets successfully read for this stream */
  325. uint64_t nb_packets;
  326. // number of frames/samples retrieved from the decoder
  327. uint64_t frames_decoded;
  328. uint64_t samples_decoded;
  329. int64_t *dts_buffer;
  330. int nb_dts_buffer;
  331. int got_output;
  332. } InputStream;
  333. typedef struct InputFile {
  334. AVFormatContext *ctx;
  335. int eof_reached; /* true if eof reached */
  336. int eagain; /* true if last read attempt returned EAGAIN */
  337. int ist_index; /* index of first stream in input_streams */
  338. int loop; /* set number of times input stream should be looped */
  339. int64_t duration; /* actual duration of the longest stream in a file
  340. at the moment when looping happens */
  341. AVRational time_base; /* time base of the duration */
  342. int64_t input_ts_offset;
  343. int64_t ts_offset;
  344. int64_t last_ts;
  345. int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
  346. int seek_timestamp;
  347. int64_t recording_time;
  348. int nb_streams; /* number of stream that ffmpeg is aware of; may be different
  349. from ctx.nb_streams if new streams appear during av_read_frame() */
  350. int nb_streams_warn; /* number of streams that the user was warned of */
  351. int rate_emu;
  352. int accurate_seek;
  353. #if HAVE_THREADS
  354. AVThreadMessageQueue *in_thread_queue;
  355. pthread_t thread; /* thread reading from this file */
  356. int non_blocking; /* reading packets from the thread should not block */
  357. int joined; /* the thread has been joined */
  358. int thread_queue_size; /* maximum number of queued packets */
  359. #endif
  360. } InputFile;
  361. enum forced_keyframes_const {
  362. FKF_N,
  363. FKF_N_FORCED,
  364. FKF_PREV_FORCED_N,
  365. FKF_PREV_FORCED_T,
  366. FKF_T,
  367. FKF_NB
  368. };
  369. #define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
  370. #define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1)
  371. extern const char *const forced_keyframes_const_names[];
  372. typedef enum {
  373. ENCODER_FINISHED = 1,
  374. MUXER_FINISHED = 2,
  375. } OSTFinished ;
  376. typedef struct OutputStream {
  377. int file_index; /* file index */
  378. int index; /* stream index in the output file */
  379. int source_index; /* InputStream index */
  380. AVStream *st; /* stream in the output file */
  381. int encoding_needed; /* true if encoding needed for this stream */
  382. int frame_number;
  383. /* input pts and corresponding output pts
  384. for A/V sync */
  385. struct InputStream *sync_ist; /* input stream to sync against */
  386. int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
  387. /* pts of the first frame encoded for this stream, used for limiting
  388. * recording time */
  389. int64_t first_pts;
  390. /* dts of the last packet sent to the muxer */
  391. int64_t last_mux_dts;
  392. // the timebase of the packets sent to the muxer
  393. AVRational mux_timebase;
  394. AVRational enc_timebase;
  395. AVBSFContext *bsf_ctx;
  396. AVCodecContext *enc_ctx;
  397. AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */
  398. AVCodec *enc;
  399. int64_t max_frames;
  400. AVFrame *filtered_frame;
  401. AVFrame *last_frame;
  402. int last_dropped;
  403. int last_nb0_frames[3];
  404. void *hwaccel_ctx;
  405. /* video only */
  406. AVRational frame_rate;
  407. int is_cfr;
  408. int force_fps;
  409. int top_field_first;
  410. int rotate_overridden;
  411. int autoscale;
  412. double rotate_override_value;
  413. AVRational frame_aspect_ratio;
  414. /* forced key frames */
  415. int64_t forced_kf_ref_pts;
  416. int64_t *forced_kf_pts;
  417. int forced_kf_count;
  418. int forced_kf_index;
  419. char *forced_keyframes;
  420. AVExpr *forced_keyframes_pexpr;
  421. double forced_keyframes_expr_const_values[FKF_NB];
  422. /* audio only */
  423. int *audio_channels_map; /* list of the channels id to pick from the source stream */
  424. int audio_channels_mapped; /* number of channels in audio_channels_map */
  425. char *logfile_prefix;
  426. FILE *logfile;
  427. OutputFilter *filter;
  428. char *avfilter;
  429. char *filters; ///< filtergraph associated to the -filter option
  430. char *filters_script; ///< filtergraph script associated to the -filter_script option
  431. AVDictionary *encoder_opts;
  432. AVDictionary *sws_dict;
  433. AVDictionary *swr_opts;
  434. AVDictionary *resample_opts;
  435. char *apad;
  436. OSTFinished finished; /* no more packets should be written for this stream */
  437. int unavailable; /* true if the steram is unavailable (possibly temporarily) */
  438. int stream_copy;
  439. // init_output_stream() has been called for this stream
  440. // The encoder and the bitstream filters have been initialized and the stream
  441. // parameters are set in the AVStream.
  442. int initialized;
  443. int inputs_done;
  444. const char *attachment_filename;
  445. int copy_initial_nonkeyframes;
  446. int copy_prior_start;
  447. char *disposition;
  448. int keep_pix_fmt;
  449. /* stats */
  450. // combined size of all the packets written
  451. uint64_t data_size;
  452. // number of packets send to the muxer
  453. uint64_t packets_written;
  454. // number of frames/samples sent to the encoder
  455. uint64_t frames_encoded;
  456. uint64_t samples_encoded;
  457. /* packet quality factor */
  458. int quality;
  459. int max_muxing_queue_size;
  460. /* the packets are buffered here until the muxer is ready to be initialized */
  461. AVFifoBuffer *muxing_queue;
  462. /* packet picture type */
  463. int pict_type;
  464. /* frame encode sum of squared error values */
  465. int64_t error[4];
  466. } OutputStream;
  467. typedef struct OutputFile {
  468. AVFormatContext *ctx;
  469. AVDictionary *opts;
  470. int ost_index; /* index of the first stream in output_streams */
  471. int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
  472. int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
  473. uint64_t limit_filesize; /* filesize limit expressed in bytes */
  474. int shortest;
  475. int header_written;
  476. } OutputFile;
  477. extern InputStream **input_streams;
  478. extern int nb_input_streams;
  479. extern InputFile **input_files;
  480. extern int nb_input_files;
  481. extern OutputStream **output_streams;
  482. extern int nb_output_streams;
  483. extern OutputFile **output_files;
  484. extern int nb_output_files;
  485. extern FilterGraph **filtergraphs;
  486. extern int nb_filtergraphs;
  487. extern char *vstats_filename;
  488. extern char *sdp_filename;
  489. extern float audio_drift_threshold;
  490. extern float dts_delta_threshold;
  491. extern float dts_error_threshold;
  492. extern int audio_volume;
  493. extern int audio_sync_method;
  494. extern int video_sync_method;
  495. extern float frame_drop_threshold;
  496. extern int do_benchmark;
  497. extern int do_benchmark_all;
  498. extern int do_deinterlace;
  499. extern int do_hex_dump;
  500. extern int do_pkt_dump;
  501. extern int copy_ts;
  502. extern int start_at_zero;
  503. extern int copy_tb;
  504. extern int debug_ts;
  505. extern int exit_on_error;
  506. extern int abort_on_flags;
  507. extern int print_stats;
  508. extern int qp_hist;
  509. extern int stdin_interaction;
  510. extern int frame_bits_per_raw_sample;
  511. extern AVIOContext *progress_avio;
  512. extern float max_error_rate;
  513. extern char *videotoolbox_pixfmt;
  514. extern int filter_nbthreads;
  515. extern int filter_complex_nbthreads;
  516. extern int vstats_version;
  517. extern const AVIOInterruptCB int_cb;
  518. extern const OptionDef options[];
  519. extern const HWAccel hwaccels[];
  520. #if CONFIG_QSV
  521. extern char *qsv_device;
  522. #endif
  523. extern HWDevice *filter_hw_device;
  524. void term_init(void);
  525. void term_exit(void);
  526. void reset_options(OptionsContext *o, int is_input);
  527. void show_usage(void);
  528. void opt_output_file(void *optctx, const char *filename);
  529. void remove_avoptions(AVDictionary **a, AVDictionary *b);
  530. void assert_avoptions(AVDictionary *m);
  531. int guess_input_channel_layout(InputStream *ist);
  532. enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target);
  533. void choose_sample_fmt(AVStream *st, AVCodec *codec);
  534. int configure_filtergraph(FilterGraph *fg);
  535. int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
  536. void check_filter_outputs(void);
  537. int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
  538. int filtergraph_is_simple(FilterGraph *fg);
  539. int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
  540. int init_complex_filtergraph(FilterGraph *fg);
  541. void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
  542. int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
  543. int ffmpeg_parse_options(int argc, char **argv);
  544. int videotoolbox_init(AVCodecContext *s);
  545. int qsv_init(AVCodecContext *s);
  546. HWDevice *hw_device_get_by_name(const char *name);
  547. int hw_device_init_from_string(const char *arg, HWDevice **dev);
  548. void hw_device_free_all(void);
  549. int hw_device_setup_for_decode(InputStream *ist);
  550. int hw_device_setup_for_encode(OutputStream *ost);
  551. int hw_device_setup_for_filter(FilterGraph *fg);
  552. int hwaccel_decode_init(AVCodecContext *avctx);
  553. #endif /* FFTOOLS_FFMPEG_H */