Skip to content
Snippets Groups Projects
Commit 8fa83541 authored by Philippe Gorley's avatar Philippe Gorley Committed by Philippe Gorley
Browse files

encoder: get stream info parameters

Change-Id: I5f8fb9802290974a9cc74f535ff22365b56e50c6
parent 7226d738
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment