Skip to content
Snippets Groups Projects
Commit d2df0bb4 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud
Browse files

media input: set up device name

For macOS for open video/audio input device name is used.
This patch adds device name in addition to input when initializing
screen capture or file streaming.

Change-Id: Ibf580028049a1d81872b026c12c01cf7a5346a7c
parent 616e2df7
Branches
No related tags found
No related merge requests found
...@@ -149,6 +149,7 @@ AudioInput::initFile(const std::string& path) ...@@ -149,6 +149,7 @@ AudioInput::initFile(const std::string& path)
devOpts_ = {}; devOpts_ = {};
devOpts_.input = path; devOpts_.input = path;
devOpts_.name = path;
devOpts_.loop = "1"; devOpts_.loop = "1";
// sets devOpts_'s sample rate and number of channels // sets devOpts_'s sample rate and number of channels
if (!createDecoder()) { if (!createDecoder()) {
......
...@@ -332,6 +332,7 @@ VideoInput::initAVFoundation(const std::string& display) ...@@ -332,6 +332,7 @@ VideoInput::initAVFoundation(const std::string& display)
clearOptions(); clearOptions();
decOpts_.format = "avfoundation"; decOpts_.format = "avfoundation";
decOpts_.pixel_format = "nv12"; decOpts_.pixel_format = "nv12";
decOpts_.name = "Capture screen 0";
decOpts_.input = "Capture screen 0"; decOpts_.input = "Capture screen 0";
decOpts_.framerate = 30; decOpts_.framerate = 30;
...@@ -394,6 +395,7 @@ VideoInput::initFile(std::string path) ...@@ -394,6 +395,7 @@ VideoInput::initFile(std::string path)
// would break the promise returned in switchInput // would break the promise returned in switchInput
DeviceParams p; DeviceParams p;
p.input = path; p.input = path;
p.name = path;
auto dec = std::make_unique<MediaDecoder>(); auto dec = std::make_unique<MediaDecoder>();
if (dec->openInput(p) < 0 || dec->setupVideo() < 0) { if (dec->openInput(p) < 0 || dec->setupVideo() < 0) {
return initCamera(jami::getVideoDeviceMonitor().getDefaultDevice()); return initCamera(jami::getVideoDeviceMonitor().getDefaultDevice());
...@@ -402,6 +404,7 @@ VideoInput::initFile(std::string path) ...@@ -402,6 +404,7 @@ VideoInput::initFile(std::string path)
clearOptions(); clearOptions();
emulateRate_ = true; emulateRate_ = true;
decOpts_.input = path; decOpts_.input = path;
decOpts_.name = path;
decOpts_.loop = "1"; decOpts_.loop = "1";
// Force 1fps for static image // Force 1fps for static image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment