forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputStream.hpp
More file actions
59 lines (43 loc) · 1.39 KB
/
Copy pathInputStream.hpp
File metadata and controls
59 lines (43 loc) · 1.39 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
50
51
52
53
54
55
56
57
58
59
#ifndef _AV_TRANSCODER_STREAM_INPUT_STREAM_HPP_
#define _AV_TRANSCODER_STREAM_INPUT_STREAM_HPP_
#include "IInputStream.hpp"
#include <queue>
struct AVStream;
namespace avtranscoder
{
class InputFile;
class AvExport InputStream : public IInputStream
{
private:
InputStream( const InputStream& inputStream );
InputStream& operator=( const InputStream& inputStream );
public:
InputStream( InputFile& inputFile, const size_t streamIndex );
~InputStream( );
bool readNextPacket( CodedData& data );
size_t getStreamIndex() const { return _streamIndex; }
/// Get duration of the stream, in seconds
float getDuration() const;
AVMediaType getStreamType() const;
VideoCodec& getVideoCodec();
AudioCodec& getAudioCodec();
DataCodec& getDataCodec();
//@{
/**
* @brief Functions about buffering
* @see IInputStream methods
*/
void activate( const bool activate = true ){ _isActivated = activate; };
bool isActivated() const { return _isActivated; };
void addPacket( AVPacket& packet );
void clearBuffering();
//@}
private:
InputFile* _inputFile; ///< Has link (no ownership)
ICodec* _codec; ///< Has ownership
std::queue<CodedData> _streamCache; ///< Cache of packet data already read and corresponding to this stream
size_t _streamIndex; ///< Index of the stream in the input file
bool _isActivated; ///< If the stream is activated, data read from it will be buffered
};
}
#endif