Skip to content
Snippets Groups Projects
Commit 0e36d0b3 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Adrien Béraud
Browse files

plugin: modify preview source

Change-Id: I26660bccd3ab150687c118e22edc27d9e9f9e333
parent 3b7ecd22
No related branches found
No related tags found
No related merge requests found
...@@ -68,9 +68,13 @@ VideoInput::VideoInput(VideoInputMode inputMode, const std::string& id_) ...@@ -68,9 +68,13 @@ VideoInput::VideoInput(VideoInputMode inputMode, const std::string& id_)
inputMode_ = VideoInputMode::ManagedByDaemon; inputMode_ = VideoInputMode::ManagedByDaemon;
#endif #endif
} }
#ifdef __ANDROID__
sink_ = Manager::instance().createSinkClient(id_);
#else
if (inputMode_ == VideoInputMode::ManagedByDaemon) { if (inputMode_ == VideoInputMode::ManagedByDaemon) {
sink_ = Manager::instance().createSinkClient(id_); sink_ = Manager::instance().createSinkClient(id_);
} }
#endif
} }
VideoInput::~VideoInput() VideoInput::~VideoInput()
...@@ -591,6 +595,23 @@ VideoInput::setSink(const std::string& sinkId) ...@@ -591,6 +595,23 @@ VideoInput::setSink(const std::string& sinkId)
sink_ = Manager::instance().createSinkClient(sinkId); sink_ = Manager::instance().createSinkClient(sinkId);
} }
void VideoInput::setFrameSize(const int width, const int height)
{
/* Signal the client about readable sink */
sink_->setFrameSize(width, height);
}
void VideoInput::setupSink()
{
setup();
}
void VideoInput::stopSink()
{
detach(sink_.get());
sink_->stop();
}
void void
VideoInput::updateStartTime(int64_t startTime) VideoInput::updateStartTime(int64_t startTime)
{ {
......
...@@ -75,6 +75,9 @@ public: ...@@ -75,6 +75,9 @@ public:
paused_ = paused; paused_ = paused;
} }
void setSeekTime(int64_t time); void setSeekTime(int64_t time);
void setFrameSize(const int width, const int height);
void setupSink();
void stopSink();
std::shared_future<DeviceParams> switchInput(const std::string& resource); std::shared_future<DeviceParams> switchInput(const std::string& resource);
#if VIDEO_CLIENT_INPUT #if VIDEO_CLIENT_INPUT
......
...@@ -120,6 +120,13 @@ void VideoRtpSession::startSender() ...@@ -120,6 +120,13 @@ void VideoRtpSession::startSender()
JAMI_WARN("Can't lock video input"); JAMI_WARN("Can't lock video input");
return; return;
} }
#ifdef __ANDROID__
if (auto input1 = std::static_pointer_cast<VideoInput>(videoLocal_)) {
input1->setupSink();
input1->setFrameSize(localVideoParams_.width, localVideoParams_.height);
}
#endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment