File tree Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,60 @@ int CodecParametersView::getAudioFrameDuration(int frame_bytes) const
100
100
return av_get_audio_frame_duration2 (const_cast <AVCodecParameters*>(m_raw), frame_bytes);
101
101
}
102
102
103
+ AVMediaType CodecParametersView::codecType () const
104
+ {
105
+ return m_raw ? m_raw->codec_type : AVMEDIA_TYPE_UNKNOWN;
106
+ }
107
+
108
+ void CodecParametersView::codecType (AVMediaType codec_type)
109
+ {
110
+ if (m_raw)
111
+ m_raw->codec_type = codec_type;
112
+ }
113
+
114
+
115
+ AVMediaType CodecParametersView::mediaType () const
116
+ {
117
+ return codecType ();
118
+ }
119
+
120
+ void CodecParametersView::mediaType (AVMediaType media_type)
121
+ {
122
+ codecType (media_type);
123
+ }
124
+
125
+
126
+ AVCodecID CodecParametersView::codecId () const
127
+ {
128
+ return m_raw ? m_raw->codec_id : AV_CODEC_ID_NONE;
129
+ }
130
+
131
+ void CodecParametersView::codecId (AVCodecID codec_id)
132
+ {
133
+ if (m_raw)
134
+ m_raw->codec_id = codec_id;
135
+ }
136
+
137
+ Codec CodecParametersView::encodingCodec () const
138
+ {
139
+ return m_raw ? findEncodingCodec (m_raw->codec_id ) : Codec ();
140
+ }
141
+
142
+ Codec CodecParametersView::decodingCodec () const
143
+ {
144
+ return m_raw ? findDecodingCodec (m_raw->codec_id ) : Codec ();
145
+ }
146
+
147
+ uint32_t CodecParametersView::codecTag () const
148
+ {
149
+ return m_raw ? m_raw->codec_tag : 0u ;
150
+ }
151
+
152
+ void CodecParametersView::codecTag (uint32_t codec_tag)
153
+ {
154
+ if (m_raw)
155
+ m_raw->codec_tag = codec_tag;
156
+ }
103
157
104
158
105
159
CodecParameters::CodecParameters ()
Original file line number Diff line number Diff line change 3
3
#include " averror.h"
4
4
#include " ffmpeg.h"
5
5
#include " avutils.h"
6
+ #include " codec.h"
6
7
7
8
extern " C" {
8
9
#include < libavcodec/codec_par.h>
@@ -29,6 +30,25 @@ class CodecParametersView : public FFWrapperPtr<AVCodecParameters>
29
30
void copyTo (class CodecContext2 & dst, OptionalErrorCode ec = throws()) const ;
30
31
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
32
52
};
33
53
34
54
class CodecParameters : public CodecParametersView , public noncopyable
You can’t perform that action at this time.
0 commit comments