39#include <asio/steady_timer.hpp>
49struct AVFormatContext;
80class MediaDemuxer :
public std::enable_shared_from_this<MediaDemuxer>
105 if (streams_.size() <= stream)
106 streams_.resize(stream + 1);
107 streams_[stream] = std::move(
cb);
118 if (stream >= inputCtx_->nb_streams) {
119 JAMI_ERR(
"Stream index is out of range: %u", stream);
122 return inputCtx_->streams[stream];
134 bool streamInfoFound_ {
false};
135 std::unique_ptr<asio::steady_timer> streamInfoTimer_;
137 std::vector<StreamCallback> streams_;
139 int64_t lastReadPacketTime_ {};
140 DeviceParams inputParams_;
143 std::mutex inputCtxMutex_ {};
144 std::mutex audioBufferMutex_ {};
145 std::mutex videoBufferMutex_ {};
148 std::function<
void()> needFrameCb_;
149 std::function<
void(
bool)> fileFinishedCb_;
150 std::function<
void()> keyFrameRequestCb_;
205 void setFEC(
bool enable) { fecEnabled_ = enable; }
209 firstDecode_.exchange(
true);
210 contextCallback_ =
cb;
220 std::shared_ptr<MediaDemuxer> demuxer_;
222 const AVCodec* inputDecoder_ =
nullptr;
225 bool emulateRate_ =
false;
229 DeviceParams inputParams_;
234 bool fallback_ =
false;
238 std::unique_ptr<video::HardwareAccel>
accel_;
242 int prepareDecoderContext();
244 void resetSeekTime() { seekTime_ = -1; }
245 std::function<
void(
int,
int)> resolutionChangedCallback_;
250 bool fecEnabled_ {
false};
252 std::function<
void()> contextCallback_;
253 std::atomic_bool firstDecode_ {
true};
Naive implementation of the boost::rational interface, described here: https://www....
void emitSignal(Args... args)
libjami::VideoFrame VideoFrame
std::function< void(std::shared_ptr< MediaFrame > &&)> MediaObserver
libjami::AudioFrame AudioFrame
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
DeviceParams Parameters used by MediaDecoder and MediaEncoder to open a LibAV device/stream.