avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
codecparameters.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "averror.h"
4 #include "ffmpeg.h"
5 #include "avutils.h"
6 #include "codec.h"
7 
8 extern "C" {
9 // codec_par.h included if needed
10 #include <libavcodec/avcodec.h>
11 }
12 
13 namespace av {
14 
20 class CodecParametersView : public FFWrapperPtr<AVCodecParameters>
21 {
22 public:
23  CodecParametersView(AVCodecParameters *codecpar = nullptr);
24  bool isValid() const;
25 
26  void copyFrom(CodecParametersView src, OptionalErrorCode ec = throws());
27  void copyTo(CodecParametersView dst, OptionalErrorCode ec = throws()) const;
28 
29  void copyFrom(const class CodecContext2& src, OptionalErrorCode ec = throws());
30  void copyTo(class CodecContext2& dst, OptionalErrorCode ec = throws()) const;
31 
32  int getAudioFrameDuration(int frame_bytes) const;
33 
34  // Getters & Setters
35 
36  AVMediaType codecType() const;
37  void codecType(AVMediaType codec_type);
38 
39  AVMediaType mediaType() const;
40  void mediaType(AVMediaType media_type);
41 
42  AVCodecID codecId() const;
43  void codecId(AVCodecID codec_id);
44 
45  Codec encodingCodec() const;
46  Codec decodingCodec() const;
47 
48  uint32_t codecTag() const;
49  void codecTag(uint32_t codec_tag);
50 
51  // TBD
52 };
53 
55 {
56 public:
59 };
60 
61 } // namespace av
averror.h
av::CodecParameters::CodecParameters
CodecParameters()
Definition: codecparameters.cpp:159
ffmpeg.h
FFWrapperPtr
Definition: ffmpeg.h:68
av::CodecParameters::~CodecParameters
~CodecParameters()
Definition: codecparameters.cpp:164
av::CodecParametersView::copyFrom
void copyFrom(CodecParametersView src, OptionalErrorCode ec=throws())
Definition: codecparameters.cpp:16
codec.h
av::OptionalErrorCode
Definition: averror.h:63
av::CodecParametersView
The CodecParametersView class.
Definition: codecparameters.h:20
avutils.h
av::CodecParameters
Definition: codecparameters.h:54
av::CodecParametersView::decodingCodec
Codec decodingCodec() const
Definition: codecparameters.cpp:142
av::CodecParametersView::copyTo
void copyTo(CodecParametersView dst, OptionalErrorCode ec=throws()) const
Definition: codecparameters.cpp:36
av::CodecParametersView::encodingCodec
Codec encodingCodec() const
Definition: codecparameters.cpp:137
av::CodecContext2
Definition: codeccontext.h:28
av::CodecParametersView::getAudioFrameDuration
int getAudioFrameDuration(int frame_bytes) const
Definition: codecparameters.cpp:96
av::CodecParametersView::mediaType
AVMediaType mediaType() const
Definition: codecparameters.cpp:115
av::CodecParametersView::CodecParametersView
CodecParametersView(AVCodecParameters *codecpar=nullptr)
Definition: codecparameters.cpp:6
av::CodecParametersView::codecType
AVMediaType codecType() const
Definition: codecparameters.cpp:103
av
Definition: audioresampler.cpp:8
av::noncopyable
Definition: avutils.h:69
av::Codec
Definition: codec.h:17
av::CodecParametersView::codecTag
uint32_t codecTag() const
Definition: codecparameters.cpp:147
av::CodecParametersView::isValid
bool isValid() const
Definition: codecparameters.cpp:11
av::CodecParametersView::codecId
AVCodecID codecId() const
Definition: codecparameters.cpp:126