forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutputStream.hpp
More file actions
43 lines (32 loc) · 1.44 KB
/
Copy pathOutputStream.hpp
File metadata and controls
43 lines (32 loc) · 1.44 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
#ifndef _AV_TRANSCODER_STREAM_OUTPUT_STREAM_HPP_
#define _AV_TRANSCODER_STREAM_OUTPUT_STREAM_HPP_
#include "IOutputStream.hpp"
struct AVStream;
namespace avtranscoder
{
class OutputFile;
class AvExport OutputStream : public IOutputStream
{
public:
OutputStream(OutputFile& outputFile, const size_t streamIndex);
size_t getStreamIndex() const { return _streamIndex; }
float getStreamDuration() const;
size_t getNbFrames() const; ///< If audio stream, returns number of packets
int getStreamPTS() const; ///< Get current AVStream PTS
bool isPTSGenerated() const { return _isPTSGenerated; }
IOutputStream::EWrappingStatus wrap(const CodedData& data);
private:
OutputFile& _outputFile; ///< Has link (no ownership)
const AVStream& _outputAVStream; ///< Has link (no ownership)
size_t _streamIndex; ///< Index of the stream in the output file
//@{
// @brief These attributes will help us to get the stream duration.
// @see ffmpeg hack: https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mux.c#L585
// @see getStreamDuration
size_t _wrappedPacketsDuration; //< the addition of the duration of all packets wrapped by this stream.
int _lastWrappedPacketDuration; //< The duration of the last packet wrapped by this stream.
bool _isPTSGenerated; //< Is the PTS generated by ffmpeg/libav (in case of generator for example)
//@}
};
}
#endif