File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
src/AvTranscoder/EssenceStream Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ extern "C" {
14
14
#include < AvTranscoder/EssenceStructures/VideoFrame.hpp>
15
15
16
16
#include < stdexcept>
17
+ #include < iostream>
17
18
18
19
namespace avtranscoder
19
20
{
@@ -146,4 +147,26 @@ void InputVideo::flushDecoder()
146
147
avcodec_flush_buffers ( _codecContext );
147
148
}
148
149
150
+ void InputVideo::setProfile ( const Profile::ProfileDesc& desc )
151
+ {
152
+ VideoDesc videoDesc = CodedDesc ( *_codec, *_codecContext );
153
+
154
+ for ( Profile::ProfileDesc::const_iterator it = desc.begin (); it != desc.end (); ++it )
155
+ {
156
+ if ( (*it).first == Profile::avProfileIdentificator ||
157
+ (*it).first == Profile::avProfileIdentificatorHuman ||
158
+ (*it).first == Profile::avProfileType )
159
+ continue ;
160
+
161
+ try
162
+ {
163
+ videoDesc.set ( (*it).first , (*it).second );
164
+ }
165
+ catch ( std::exception& e )
166
+ {
167
+ std::cout << " warning: " << e.what () << std::endl;
168
+ }
169
+ }
170
+ }
171
+
149
172
}
Original file line number Diff line number Diff line change 3
3
4
4
#include " InputEssence.hpp"
5
5
6
+ #include < AvTranscoder/Profile.hpp>
7
+
6
8
class AVCodec ;
7
9
class AVCodecContext ;
8
10
class AVFrame ;
@@ -24,7 +26,9 @@ class AvExport InputVideo : public InputEssence
24
26
bool readNextFrame ( Frame& frameBuffer, const size_t subStreamIndex );
25
27
26
28
void flushDecoder ();
27
-
29
+
30
+ void setProfile ( const Profile::ProfileDesc& desc );
31
+
28
32
private:
29
33
AvInputStream* _inputStream;
30
34
AVCodec* _codec;
You can’t perform that action at this time.
0 commit comments