Commit 8fa83541 authored by Philippe Gorley's avatar Philippe Gorley Committed by Philippe Gorley

encoder: get stream info parameters

Change-Id: I5f8fb9802290974a9cc74f535ff22365b56e50c6
parent 7226d738
......@@ -636,4 +636,18 @@ MediaEncoder::getStreamCount() const
return 0;
}
MediaStream
MediaEncoder::getStream(const std::string& name, int streamIdx) const
{
// if streamIdx is negative, use currentStreamIdx_
if (streamIdx < 0)
streamIdx = currentStreamIdx_;
// make sure streamIdx is valid
if (getStreamCount() <= 0 || streamIdx < 0 || encoders_.size() < (unsigned)(streamIdx + 1))
return {};
auto enc = encoders_[streamIdx];
// TODO set firstTimestamp
return MediaStream(name, enc);
}
} // namespace ring
......@@ -32,6 +32,7 @@
#include "media_buffer.h"
#include "media_codec.h"
#include "media_device.h"
#include "media_stream.h"
#include <map>
#include <memory>
......@@ -97,6 +98,7 @@ public:
bool useCodec(const AccountCodecInfo* codec) const noexcept;
unsigned getStreamCount() const;
MediaStream getStream(const std::string& name, int streamIdx = -1) const;
private:
NON_COPYABLE(MediaEncoder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment