avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
codeccontext.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "avcompat.h"
4 
5 #include "ffmpeg.h"
6 #include "stream.h"
7 #include "avutils.h"
8 #include "averror.h"
9 #include "pixelformat.h"
10 #include "sampleformat.h"
11 #include "avlog.h"
12 #include "frame.h"
13 #include "codec.h"
14 #include "channellayout.h"
15 
16 extern "C" {
17 #include <libavcodec/avcodec.h>
18 }
19 
20 namespace av {
21 
22 namespace codec_context::audio {
23 void set_channels(AVCodecContext *obj, int channels);
24 void set_channel_layout_mask(AVCodecContext *obj, uint64_t mask);
25 int get_channels(const AVCodecContext *obj);
26 uint64_t get_channel_layout_mask(const AVCodecContext *obj);
27 }
28 
29 namespace codec_context::internal {
30 const int *get_supported_samplerates(const struct AVCodec *codec);
31 }
32 
33 class CodecContext2 : public FFWrapperPtr<AVCodecContext>, public noncopyable
34 {
35 protected:
36  void swap(CodecContext2 &other);
37 
38  //
39  // No directly created
40  //
41 
43  using BaseWrapper::BaseWrapper;
44 
45  CodecContext2();
46 
47  // Stream decoding/encoding
48 #if AVCPP_HAS_AVFORMAT
49  CodecContext2(const class Stream &st,
50  const class Codec& codec,
51  Direction direction,
52  AVMediaType type);
53 #endif // if AVCPP_HAS_AVFORMAT
54 
55  // Stream independ decoding/encoding
56  CodecContext2(const class Codec &codec, Direction direction, AVMediaType type);
57 
59 
60  void setCodec(const class Codec &codec, bool resetDefaults, Direction direction, AVMediaType type, OptionalErrorCode ec = throws());
61 
62  AVMediaType codecType(AVMediaType contextType) const noexcept;
63 
64 public:
65 
66  using BaseWrapper::_log;
67 
68  //
69  // Common
70  //
71 
72  void open(OptionalErrorCode ec = throws());
73  void open(const Codec &codec, OptionalErrorCode ec = throws());
74  void open(class Dictionary &options, OptionalErrorCode ec = throws());
75  void open(class Dictionary &&options, OptionalErrorCode ec = throws());
76  void open(class Dictionary &options, const Codec &codec, OptionalErrorCode ec = throws());
77  void open(class Dictionary &&options, const Codec &codec, OptionalErrorCode ec = throws());
78 
79  [[deprecated("Start from FFmpeg 4.0 it is recommended to destroy and recreate codec context insted of close")]]
80  void close(OptionalErrorCode ec = throws());
81 
82  bool isOpened() const noexcept;
83  bool isValid() const noexcept;
84 
93  void copyContextFrom(const CodecContext2 &other, OptionalErrorCode ec = throws());
95 
96  Rational timeBase() const noexcept;
97  void setTimeBase(const Rational &value) noexcept;
98 
99 #if AVCPP_HAS_AVFORMAT
100  const Stream& stream() const noexcept;
101 #endif // if AVCPP_HAS_AVFORMAT
102  Codec codec() const noexcept;
103 
104  void setOption(const std::string &key, const std::string &val, OptionalErrorCode ec = throws());
105  void setOption(const std::string &key, const std::string &val, int flags, OptionalErrorCode ec = throws());
106 
107  int frameSize() const noexcept;
108  int64_t frameNumber() const noexcept;
109 
110  // Note, set ref counted to enable for multithreaded processing
111  bool isRefCountedFrames() const noexcept;
112  void setRefCountedFrames(bool refcounted) const noexcept;
113 
114  int strict() const noexcept;
115  void setStrict(int strict) noexcept;
116 
117  int64_t bitRate() const noexcept;
118  std::pair<int64_t, int64_t> bitRateRange() const noexcept;
119  void setBitRate(int64_t bitRate) noexcept;
120  void setBitRateRange(const std::pair<int64_t, int64_t> &bitRateRange) noexcept;
121 
122  // Flags
125  void setFlags(int flags) noexcept;
126  void addFlags(int flags) noexcept;
127  void clearFlags(int flags) noexcept;
128  int flags() noexcept;
129  bool isFlags(int flags) noexcept;
131 
132  // Flags 2
135  void setFlags2(int flags) noexcept;
136  void addFlags2(int flags) noexcept;
137  void clearFlags2(int flags) noexcept;
138  int flags2() noexcept;
139  bool isFlags2(int flags) noexcept;
141 
142 
143 protected:
144 
145  bool isValidForEncode(Direction direction, AVMediaType type) const noexcept;
146 
147  bool checkCodec(const Codec& codec, Direction direction, AVMediaType type, OptionalErrorCode ec);
148 
149  void open(const Codec &codec, AVDictionary **options, OptionalErrorCode ec);
150 
151 
152  std::pair<int, const std::error_category*>
153  decodeCommon(AVFrame *outFrame, const class Packet &inPacket, size_t offset, int &frameFinished,
154  int (*decodeProc)(AVCodecContext*, AVFrame*,int *, const AVPacket *)) noexcept;
155 
156  std::pair<int, const std::error_category*>
157  encodeCommon(class Packet &outPacket, const AVFrame *inFrame, int &gotPacket,
158  int (*encodeProc)(AVCodecContext*, AVPacket*,const AVFrame*, int*)) noexcept;
159 
160 public:
161  template<typename T>
162  std::pair<int, const std::error_category*>
163  decodeCommon(T &outFrame,
164  const class Packet &inPacket,
165  size_t offset,
166  int &frameFinished,
167  int (*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *));
168 
169  template<typename T>
170  std::pair<int, const std::error_category*>
171  encodeCommon(class Packet &outPacket,
172  const T &inFrame,
173  int &gotPacket,
174  int (*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *));
175 
176 private:
177 #if AVCPP_HAS_AVFORMAT
178  Stream m_stream;
179 #endif // if AVCPP_HAS_AVFORMAT
180 };
181 
182 
191 {
192 protected:
194 
195 public:
196  GenericCodecContext() = default;
197 
198 #if AVCPP_HAS_AVFORMAT
199  GenericCodecContext(Stream st);
200 #endif // if AVCPP_HAS_AVFORMAT
201 
203 
205 
206  AVMediaType codecType() const noexcept;
207 };
208 
209 
210 template<typename Clazz, Direction _direction, AVMediaType _type>
212 {
213 protected:
214  Clazz& moveOperator(Clazz &&rhs)
215  {
216  if (this == &rhs)
217  return static_cast<Clazz&>(*this);
218  Clazz(std::forward<Clazz>(rhs)).swap(static_cast<Clazz&>(*this));
219  return static_cast<Clazz&>(*this);
220  }
221 
223 
224 public:
225 
226  using CodecContext2::_log;
227 
229  : CodecContext2()
230  {
231  }
232 
233  // Stream decoding/encoding
234 #if AVCPP_HAS_AVFORMAT
235  explicit CodecContextBase(const class Stream &st, const class Codec& codec = Codec())
236  : CodecContext2(st, codec, _direction, _type)
237  {
238  }
239 #endif // if AVCPP_HAS_AVFORMAT
240 
241  // Stream independ decoding/encoding
242  explicit CodecContextBase(const Codec &codec)
243  : CodecContext2(codec, _direction, _type)
244  {
245  }
246 
247  //
248  // Disable copy/Activate move
249  //
251  : CodecContextBase()
252  {
253  swap(other);
254  }
255  //
256 
257 
258  void setCodec(const Codec &codec, OptionalErrorCode ec = throws())
259  {
260  setCodec(codec, false, _direction, _type, ec);
261  }
262 
263  void setCodec(const Codec &codec, bool resetDefaults, OptionalErrorCode ec = throws())
264  {
265  setCodec(codec, resetDefaults, _direction, _type, ec);
266  }
267 
268  AVMediaType codecType() const noexcept
269  {
270  return CodecContext2::codecType(_type);
271  }
272 };
273 
274 
275 template<typename Clazz, Direction _direction>
276 class VideoCodecContext : public CodecContextBase<Clazz, _direction, AVMEDIA_TYPE_VIDEO>
277 {
278 public:
280  using Parent::Parent;
281  using Parent::isValid;
282  using Parent::isOpened;
283 
284  int width() const
285  {
286  return RAW_GET2(isValid(), width, 0);
287  }
288 
289  int height() const
290  {
291  return RAW_GET2(isValid(), height, 0);
292  }
293 
294  int codedWidth() const
295  {
296  return RAW_GET2(isValid(), coded_width, 0);
297  }
298 
299  int codedHeight() const
300  {
301  return RAW_GET2(isValid(), coded_height, 0);
302  }
303 
305  {
306  return RAW_GET2(isValid(), pix_fmt, AV_PIX_FMT_NONE);
307  }
308 
309  int32_t globalQuality() const
310  {
311  return RAW_GET2(isValid(), global_quality, FF_LAMBDA_MAX);
312  }
313 
314  int32_t gopSize() const
315  {
316  return RAW_GET2(isValid(), gop_size, 0);
317  }
318 
319  int bitRateTolerance() const
320  {
321  return RAW_GET2(isValid(), bit_rate_tolerance, 0);
322  }
323 
324  int maxBFrames() const
325  {
326  return RAW_GET2(isValid(), max_b_frames, 0);
327  }
328 
330  {
331  return RAW_GET(sample_aspect_ratio, AVRational());
332  }
333 
334  void setWidth(int w) // Note, it also sets coded_width
335  {
336  if (isValid() && !isOpened())
337  {
338  m_raw->width = w;
339  m_raw->coded_width = w;
340  }
341  }
342 
343  void setHeight(int h) // Note, it also sets coded_height
344  {
345  if (isValid() && !isOpened())
346  {
347  m_raw->height = h;
348  m_raw->coded_height = h;
349  }
350  }
351 
352  void setCodedWidth(int w)
353  {
354  RAW_SET2(isValid() && !isOpened(), coded_width, w);
355  }
356 
357  void setCodedHeight(int h)
358  {
359  RAW_SET2(isValid() && !isOpened(), coded_height, h);
360  }
361 
362  void setPixelFormat(PixelFormat pixelFormat)
363  {
364  RAW_SET2(isValid(), pix_fmt, pixelFormat);
365  }
366 
367  void setGlobalQuality(int32_t quality)
368  {
369  if (quality < 0 || quality > FF_LAMBDA_MAX)
370  quality = FF_LAMBDA_MAX;
371 
372  RAW_SET2(isValid(), global_quality, quality);
373  }
374 
375  void setGopSize(int32_t size)
376  {
377  RAW_SET2(isValid(), gop_size, size);
378  }
379 
380  void setBitRateTolerance(int bitRateTolerance)
381  {
382  RAW_SET2(isValid(), bit_rate_tolerance, bitRateTolerance);
383  }
384 
385  void setMaxBFrames(int maxBFrames)
386  {
387  RAW_SET2(isValid(), max_b_frames, maxBFrames);
388  }
389 
390  void setSampleAspectRatio(const Rational& sampleAspectRatio)
391  {
392  RAW_SET(sample_aspect_ratio, sampleAspectRatio);
393  }
394 
395 protected:
396  using Parent::moveOperator;
397  using Parent::m_raw;
398 };
399 
400 
401 class VideoDecoderContext : public VideoCodecContext<VideoDecoderContext, Direction::Decoding>
402 {
403 public:
405  using Parent::Parent;
406 
407  VideoDecoderContext() = default;
409 
411 
423  VideoFrame decode(const Packet &packet,
424  OptionalErrorCode ec = throws(),
425  bool autoAllocateFrame = true);
426 
440  VideoFrame decode(const Packet &packet,
441  size_t offset,
442  size_t &decodedBytes,
443  OptionalErrorCode ec = throws(),
444  bool autoAllocateFrame = true);
445 
446 
447 private:
448  VideoFrame decodeVideo(OptionalErrorCode ec,
449  const Packet &packet,
450  size_t offset,
451  size_t *decodedBytes,
452  bool autoAllocateFrame);
453 
454 };
455 
456 
457 class VideoEncoderContext : public VideoCodecContext<VideoEncoderContext, Direction::Encoding>
458 {
459 public:
461  using Parent::Parent;
462 
463  VideoEncoderContext() = default;
465 
467 
477  Packet encode(OptionalErrorCode ec = throws());
478 
490  Packet encode(const VideoFrame &inFrame, OptionalErrorCode ec = throws());
491 
492 };
493 
494 
495 template<typename Clazz, Direction _direction>
496 class AudioCodecContext : public CodecContextBase<Clazz, _direction, AVMEDIA_TYPE_AUDIO>
497 {
498 public:
500  using Parent::Parent;
501  using Parent::isValid;
502  using Parent::isOpened;
503  using Parent::_log;
504 
505  int sampleRate() const noexcept
506  {
507  return RAW_GET2(isValid(), sample_rate, 0);
508  }
509 
510  int channels() const noexcept
511  {
512  if (!isValid())
513  return 0;
515  }
516 
517  SampleFormat sampleFormat() const noexcept
518  {
519  return RAW_GET2(isValid(), sample_fmt, AV_SAMPLE_FMT_NONE);
520  }
521 
522  uint64_t channelLayout() const noexcept
523  {
524  if (!isValid())
525  return 0;
527  }
528 
529 #if AVCPP_API_NEW_CHANNEL_LAYOUT
530  ChannelLayoutView channelLayout2() const noexcept
531  {
532  if (!isValid())
533  return ChannelLayoutView{};
534  return ChannelLayoutView{m_raw->ch_layout};
535  }
536 #endif
537 
538  void setSampleRate(int sampleRate) noexcept
539  {
540  if (!isValid())
541  return;
542 #if AVCPP_CXX_STANDARD >= 20
543  int sr = guessValue(sampleRate, make_array_view_until<const int>(codec_context::internal::get_supported_samplerates(m_raw->codec), 0));
544 #else
546 #endif
547  if (sr != sampleRate)
548  {
549  fflog(AV_LOG_INFO, "Guess sample rate %d instead unsupported %d\n", sr, sampleRate);
550  }
551  if (sr > 0)
552  m_raw->sample_rate = sr;
553  }
554 
555  void setChannels(int channels) noexcept
556  {
557  if (!isValid() || channels <= 0)
558  return;
560  }
561 
562  void setSampleFormat(SampleFormat sampleFormat) noexcept
563  {
564  RAW_SET2(isValid(), sample_fmt, sampleFormat);
565  }
566 
567  void setChannelLayout(uint64_t layout) noexcept
568  {
569  if (!isValid() || layout == 0)
570  return;
572  }
573 
574 #if AVCPP_API_NEW_CHANNEL_LAYOUT
575  void setChannelLayout(ChannelLayout layout) noexcept
576  {
577  if (!isValid() || !layout.isValid())
578  return;
579  m_raw->ch_layout = *layout.raw();
580  layout.release(); // is controlled by the CodecContext
581  }
582 #endif
583 
584 protected:
585  using Parent::moveOperator;
586  using Parent::m_raw;
587 };
588 
589 
590 class AudioDecoderContext : public AudioCodecContext<AudioDecoderContext, Direction::Decoding>
591 {
592 public:
594  using Parent::Parent;
595 
596  AudioDecoderContext() = default;
598 
600 
601  AudioSamples decode(const Packet &inPacket, OptionalErrorCode ec = throws());
602  AudioSamples decode(const Packet &inPacket, size_t offset, OptionalErrorCode ec = throws());
603 
604 };
605 
606 
607 class AudioEncoderContext : public AudioCodecContext<AudioEncoderContext, Direction::Encoding>
608 {
609 public:
611  using Parent::Parent;
612 
613  AudioEncoderContext() = default;
615 
617 
618  Packet encode(OptionalErrorCode ec = throws());
619  Packet encode(const AudioSamples &inSamples, OptionalErrorCode ec = throws());
620 
621 };
622 
623 
624 } // namespace av
#define fflog(level, format,...)
Default in-class logger.
Definition: avlog.h:27
Definition: codeccontext.h:497
void setChannels(int channels) noexcept
Definition: codeccontext.h:555
uint64_t channelLayout() const noexcept
Definition: codeccontext.h:522
SampleFormat sampleFormat() const noexcept
Definition: codeccontext.h:517
void setChannelLayout(uint64_t layout) noexcept
Definition: codeccontext.h:567
int channels() const noexcept
Definition: codeccontext.h:510
void setSampleRate(int sampleRate) noexcept
Definition: codeccontext.h:538
void setSampleFormat(SampleFormat sampleFormat) noexcept
Definition: codeccontext.h:562
int sampleRate() const noexcept
Definition: codeccontext.h:505
Definition: codeccontext.h:591
Definition: codeccontext.h:608
Definition: frame.h:371
Definition: codeccontext.h:34
bool isValidForEncode(Direction direction, AVMediaType type) const noexcept
Definition: codeccontext.cpp:804
Codec codec() const noexcept
Definition: codeccontext.cpp:645
bool isValid() const noexcept
Definition: codeccontext.cpp:572
int64_t bitRate() const noexcept
Definition: codeccontext.cpp:719
void clearFlags(int flags) noexcept
Definition: codeccontext.cpp:757
AVMediaType codecType(AVMediaType contextType) const noexcept
Definition: codeccontext.cpp:453
std::pair< int, const std::error_category * > decodeCommon(AVFrame *outFrame, const class Packet &inPacket, size_t offset, int &frameFinished, int(*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *)) noexcept
void addFlags2(int flags) noexcept
Definition: codeccontext.cpp:780
void setOption(const std::string &key, const std::string &val, OptionalErrorCode ec=throws())
bool checkCodec(const Codec &codec, Direction direction, AVMediaType type, OptionalErrorCode ec)
Definition: codeccontext.cpp:845
Rational timeBase() const noexcept
Definition: codeccontext.cpp:628
void setBitRate(int64_t bitRate) noexcept
Definition: codeccontext.cpp:732
CodecContext2(const class Codec &codec, Direction direction, AVMediaType type)
int64_t frameNumber() const noexcept
Definition: codeccontext.cpp:679
void swap(CodecContext2 &other)
Definition: codeccontext.cpp:292
bool isOpened() const noexcept
Definition: codeccontext.cpp:567
~CodecContext2()
Definition: codeccontext.cpp:356
int flags() noexcept
Definition: codeccontext.cpp:763
void setBitRateRange(const std::pair< int64_t, int64_t > &bitRateRange) noexcept
Definition: codeccontext.cpp:737
void copyContextFrom(const CodecContext2 &other, OptionalErrorCode ec=throws())
Copy codec context from codec context associated with given stream or other codec context.
Definition: codeccontext.cpp:582
bool isFlags2(int flags) noexcept
Definition: codeccontext.cpp:797
std::pair< int, const std::error_category * > encodeCommon(class Packet &outPacket, const AVFrame *inFrame, int &gotPacket, int(*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *)) noexcept
Definition: codeccontext.cpp:909
void open(OptionalErrorCode ec=throws())
Definition: codeccontext.cpp:465
CodecContext2()
Definition: codeccontext.cpp:301
bool isRefCountedFrames() const noexcept
Definition: codeccontext.cpp:688
std::pair< int64_t, int64_t > bitRateRange() const noexcept
Definition: codeccontext.cpp:724
int strict() const noexcept
Definition: codeccontext.cpp:704
bool isFlags(int flags) noexcept
Definition: codeccontext.cpp:768
void setFlags2(int flags) noexcept
Access to CODEC_FLAG2_* flags.
Definition: codeccontext.cpp:775
void setStrict(int strict) noexcept
Definition: codeccontext.cpp:709
void setRefCountedFrames(bool refcounted) const noexcept
Definition: codeccontext.cpp:697
void addFlags(int flags) noexcept
Definition: codeccontext.cpp:751
void setTimeBase(const Rational &value) noexcept
Definition: codeccontext.cpp:633
int frameSize() const noexcept
Definition: codeccontext.cpp:674
void clearFlags2(int flags) noexcept
Definition: codeccontext.cpp:786
void close(OptionalErrorCode ec=throws())
Definition: codeccontext.cpp:554
void setFlags(int flags) noexcept
Access to CODEC_FLAG_* flags.
Definition: codeccontext.cpp:746
int flags2() noexcept
Definition: codeccontext.cpp:792
void setCodec(const class Codec &codec, bool resetDefaults, Direction direction, AVMediaType type, OptionalErrorCode ec=throws())
Definition: codeccontext.cpp:379
Definition: codeccontext.h:212
Clazz & moveOperator(Clazz &&rhs)
Definition: codeccontext.h:214
CodecContextBase()
Definition: codeccontext.h:228
void setCodec(const Codec &codec, OptionalErrorCode ec=throws())
Definition: codeccontext.h:258
void setCodec(const Codec &codec, bool resetDefaults, OptionalErrorCode ec=throws())
Definition: codeccontext.h:263
CodecContextBase(CodecContextBase &&other)
Definition: codeccontext.h:250
CodecContextBase(const Codec &codec)
Definition: codeccontext.h:242
AVMediaType codecType() const noexcept
Definition: codeccontext.h:268
Definition: codec.h:18
Implements interface to access to the AVDictionary entity.
Definition: dictionary.h:31
The GenericCodecContext class to copy contexts from input streams to output one.
Definition: codeccontext.h:191
AVMediaType codecType() const noexcept
Definition: codeccontext.cpp:59
GenericCodecContext & operator=(GenericCodecContext &&rhs)
Definition: codeccontext.cpp:51
Definition: averror.h:66
Definition: packet.h:52
The PixelFormat class is a simple wrapper for AVPixelFormat that allow to acces it it properties.
Definition: pixelformat.h:27
Definition: rational.h:26
The SampleFormat class is a simple proxy class for AVSampleFormat.
Definition: sampleformat.h:22
Definition: codeccontext.h:277
int bitRateTolerance() const
Definition: codeccontext.h:319
void setGopSize(int32_t size)
Definition: codeccontext.h:375
void setCodedHeight(int h)
Definition: codeccontext.h:357
int height() const
Definition: codeccontext.h:289
void setGlobalQuality(int32_t quality)
Definition: codeccontext.h:367
void setPixelFormat(PixelFormat pixelFormat)
Definition: codeccontext.h:362
PixelFormat pixelFormat() const
Definition: codeccontext.h:304
int codedHeight() const
Definition: codeccontext.h:299
void setCodedWidth(int w)
Definition: codeccontext.h:352
int codedWidth() const
Definition: codeccontext.h:294
void setSampleAspectRatio(const Rational &sampleAspectRatio)
Definition: codeccontext.h:390
void setWidth(int w)
Definition: codeccontext.h:334
void setBitRateTolerance(int bitRateTolerance)
Definition: codeccontext.h:380
void setMaxBFrames(int maxBFrames)
Definition: codeccontext.h:385
int maxBFrames() const
Definition: codeccontext.h:324
void setHeight(int h)
Definition: codeccontext.h:343
int32_t globalQuality() const
Definition: codeccontext.h:309
Rational sampleAspectRatio() const
Definition: codeccontext.h:329
int32_t gopSize() const
Definition: codeccontext.h:314
int width() const
Definition: codeccontext.h:284
Definition: codeccontext.h:402
Definition: codeccontext.h:458
Definition: frame.h:261
Definition: avutils.h:52
#define RAW_GET(field, def)
Definition: ffmpeg.h:47
#define RAW_SET(field, val)
Definition: ffmpeg.h:48
#define RAW_GET2(cond, field, def)
Definition: ffmpeg.h:50
#define RAW_SET2(cond, field, val)
Definition: ffmpeg.h:51
void set_channels(AVCodecContext *obj, int channels)
Definition: codeccontext.cpp:1122
int get_channels(const AVCodecContext *obj)
Definition: codeccontext.cpp:1158
uint64_t get_channel_layout_mask(const AVCodecContext *obj)
Definition: codeccontext.cpp:1174
void set_channel_layout_mask(AVCodecContext *obj, uint64_t mask)
Definition: codeccontext.cpp:1137
const int * get_supported_samplerates(const struct AVCodec *codec)
Definition: codeccontext.cpp:179
Definition: audioresampler.cpp:8
OptionalErrorCode throws()
Helper to construct null OptionalErrorCode object.
Definition: averror.h:181
Direction
Definition: codecparameters.h:16
T guessValue(const T &value, const L *list, C endListComparator)
Select more approptiate value from given value list.
Definition: avutils.h:565
Definition: averror.h:230
Definition: ffmpeg.h:22
void _log(int level, const char *fmt) const
Definition: ffmpeg.h:32
AVCodecContext * m_raw
Definition: ffmpeg.h:44
Definition: avutils.h:533