Skip to content
Snippets Groups Projects
Commit ba8e1cf4 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

conference macOS: use previously selected format

Change-Id: If84669cd16bd912ed0db92c50252159db43b95a3
parent ec56378d
Branches
No related tags found
No related merge requests found
......@@ -142,7 +142,7 @@ VideoMixer::process()
VideoFrame& output = getNewFrame();
try {
output.reserve(AV_PIX_FMT_YUV422P, width_, height_);
output.reserve(format_, width_, height_);
} catch (const std::bad_alloc& e) {
JAMI_ERR("VideoFrame::allocBuffer() failed");
return;
......@@ -217,12 +217,13 @@ VideoMixer::render_frame(VideoFrame& output, const VideoFrame& input,
}
void
VideoMixer::setDimensions(int width, int height)
VideoMixer::setParameters(int width, int height, AVPixelFormat format)
{
auto lock(rwMutex_.write());
width_ = width;
height_ = height;
format_ = format;
// cleanup the previous frame to have a nice copy in rendering method
std::shared_ptr<VideoFrame> previous_p(obtainLastFrame());
......@@ -268,6 +269,6 @@ VideoMixer::getHeight() const
AVPixelFormat
VideoMixer::getPixelFormat() const
{ return AV_PIX_FMT_YUYV422; }
{ return format_; }
}} // namespace jami::video
......@@ -43,7 +43,7 @@ public:
VideoMixer(const std::string& id);
~VideoMixer();
void setDimensions(int width, int height);
void setParameters(int width, int height, AVPixelFormat format = AV_PIX_FMT_YUV422P);
int getWidth() const override;
int getHeight() const override;
......@@ -70,6 +70,7 @@ private:
const std::string id_;
int width_ = 0;
int height_ = 0;
AVPixelFormat format_ = AV_PIX_FMT_YUV422P;
std::list<std::unique_ptr<VideoMixerSource>> sources_;
rw_mutex rwMutex_;
......
......@@ -300,7 +300,13 @@ VideoRtpSession::enterConference(Conference* conference)
if (send_.enabled or receiveThread_) {
videoMixer_ = conference->getVideoMixer();
videoMixer_->setDimensions(localVideoParams_.width, localVideoParams_.height);
#if defined(__APPLE__) && TARGET_OS_MAC
videoMixer_->setParameters(localVideoParams_.width,
localVideoParams_.height,
av_get_pix_fmt(localVideoParams_.pixel_format.c_str()));
#else
videoMixer_->setParameters(localVideoParams_.width, localVideoParams_.height);
#endif
setupConferenceVideoPipeline(*conference_);
}
}
......@@ -574,5 +580,3 @@ VideoRtpSession::getPonderateLoss(float lastLoss)
}} // namespace jami::video
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment