45 lines
825 B
C++
45 lines
825 B
C++
#include "Stream.h"
|
|
#include <stdexcept>
|
|
|
|
namespace ffcpp {
|
|
|
|
Stream::Stream(): _stream(nullptr) {
|
|
}
|
|
|
|
Stream::Stream(AVStream *stream): _stream(stream), _codec(_stream->codec, CodecType::Decoder) {
|
|
|
|
}
|
|
|
|
Stream::Stream(AVStream *stream, AVCodec* encoder): _stream(stream), _codec(stream->codec, encoder) {
|
|
|
|
}
|
|
|
|
Stream::operator AVStream*() const {
|
|
return _stream;
|
|
}
|
|
|
|
Codec& Stream::codec() {
|
|
return _codec;
|
|
}
|
|
|
|
AVRational Stream::timeBase() const {
|
|
return _stream->time_base;
|
|
}
|
|
|
|
void Stream::setTimeBase(AVRational timeBase) {
|
|
_stream->time_base = timeBase;
|
|
}
|
|
|
|
Stream::Stream(Stream&& stream) noexcept {
|
|
*this = std::move(stream);
|
|
}
|
|
|
|
Stream& Stream::operator=(Stream&& stream) noexcept {
|
|
_codec = std::move(stream._codec);
|
|
_stream = stream._stream;
|
|
stream._stream = nullptr;
|
|
return *this;
|
|
}
|
|
|
|
}
|