Skip to content
Snippets Groups Projects
Commit 83a129c5 authored by Philippe Gorley's avatar Philippe Gorley
Browse files

smartools: avoid repeated calls

Resolution/codecs won't change without a SIP renegotiation.

Change-Id: Ie6d393caa5a3e631c7be14356a7929c0f11e781c
parent 619e143f
Branches
No related tags found
No related merge requests found
......@@ -137,6 +137,8 @@ AudioSender::setup(SocketPair& socketPair)
return false;
}
Smartools::getInstance().setLocalAudioCodec(audioEncoder_->getEncoderName());
#ifdef DEBUG_SDP
audioEncoder_->print_sdp();
#endif
......@@ -344,6 +346,8 @@ AudioReceiveThread::setup()
return false;
}
Smartools::getInstance().setRemoteAudioCodec(audioDecoder_->getDecoderName());
ringbuffer_ = Manager::instance().getRingBufferPool().getRingBuffer(id_);
return true;
}
......@@ -364,8 +368,6 @@ AudioReceiveThread::process()
}
audioDecoder_->writeToRingBuffer(decodedFrame, *ringbuffer_,
mainBuffFormat);
// Refresh the remote audio codec in the callback SmartInfo
Smartools::getInstance().setRemoteAudioCodec(audioDecoder_->getDecoderName());
return;
case MediaDecoder::Status::DecodeError:
......
......@@ -332,9 +332,6 @@ SinkClient::update(Observable<std::shared_ptr<VideoFrame>>* /*obs*/,
}
#endif
// Send the resolution in smartInfo
Smartools::getInstance().setResolution(id_, f.width(), f.height());
#if HAVE_SHM
shm_->renderFrame(f);
#endif
......
......@@ -138,6 +138,9 @@ bool VideoReceiveThread::setup()
// Send remote video codec in SmartInfo
Smartools::getInstance().setRemoteVideoCodec(videoDecoder_->getDecoderName(), id_);
// Send the resolution in smartInfo
Smartools::getInstance().setResolution(id_, dstWidth_, dstHeight_);
return true;
}
......
......@@ -50,6 +50,12 @@ VideoSender::VideoSender(const std::string& dest, const DeviceParams& dev,
videoEncoder_->startIO();
videoEncoder_->print_sdp();
// Send local video codec in SmartInfo
Smartools::getInstance().setLocalVideoCodec(videoEncoder_->getEncoderName());
// Send the resolution in smartInfo
Smartools::getInstance().setResolution("local", dev.width, dev.height);
}
VideoSender::~VideoSender()
......@@ -69,9 +75,6 @@ VideoSender::encodeAndSendVideo(VideoFrame& input_frame)
if (videoEncoder_->encode(input_frame, is_keyframe, frameNumber_++) < 0)
RING_ERR("encoding failed");
// Send local video codec in SmartInfo
Smartools::getInstance().setLocalVideoCodec(videoEncoder_->getEncoderName());
}
void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment