-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathIEncoder.hpp
More file actions
49 lines (41 loc) · 1.4 KB
/
IEncoder.hpp
File metadata and controls
49 lines (41 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _AV_TRANSCODER_ESSENCE_STREAM_IENCODER_HPP_
#define _AV_TRANSCODER_ESSENCE_STREAM_IENCODER_HPP_
#include <AvTranscoder/data/decoded/IFrame.hpp>
#include <AvTranscoder/data/coded/CodedData.hpp>
#include <AvTranscoder/codec/ICodec.hpp>
#include <AvTranscoder/profile/ProfileLoader.hpp>
namespace avtranscoder
{
class AvExport IEncoder
{
public:
virtual ~IEncoder() {}
/**
* @brief Setup the encoder
* @param profile: set encoder parameters from the given profile
* @note Open the encoder.
*/
virtual void setupEncoder(const ProfileLoader::Profile& profile = ProfileLoader::Profile()) = 0;
/**
* @brief Encode a new frame, and get coded frame
* @param sourceFrame: frame that needs to be encoded
* @param codedFrame: output encoded coded data (first frames can be delayed)
* @return status of encoding
* @throw runtime_error if the encoded process failed.
*/
virtual bool encodeFrame(const IFrame& sourceFrame, CodedData& codedFrame) = 0;
/**
* @brief Get the frames remaining into the encoder
* @param codedFrame: output encoded data
* @return status of encoding
* @throw runtime_error if the encoded process failed.
*/
virtual bool encodeFrame(CodedData& codedFrame) = 0;
/**
* @brief Get codec used for encoding.
* @return a reference to the codec
*/
virtual ICodec& getCodec() = 0;
};
}
#endif