Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion src/serviceapp/exteplayer3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const std::string EXT3_PLAYBACK_MPEGTS_PROGRAM = "mpegts_program_id";
const std::string EXT3_RTMP_PROTOCOL = "rtmpproto";
const std::string EXT3_NICE_VALUE = "nice";
const std::string EXT3_FFMPEG_SETTING_STRING = "ffmpeg_option";
const std::string EXT3_ARGS_LIST = "args"; // cmdline like list of exteplayer3 arguments in a form "-arg1=value1-arg2=value2"

SettingMap &ExtEplayer3Options::GetSettingMap()
{
Expand Down Expand Up @@ -55,6 +56,7 @@ ExtEplayer3Options::ExtEplayer3Options()
settingMap[EXT3_PLAYBACK_DASH_VIDEO_ID] = SettingEntry ("-0", "int");
settingMap[EXT3_PLAYBACK_DASH_AUDIO_ID] = SettingEntry ("-1", "int");
settingMap[EXT3_FFMPEG_SETTING_STRING] = SettingEntry ("-f", "string");
settingMap[EXT3_ARGS_LIST] = SettingEntry ("al", "argslist");
}

int ExtEplayer3Options::update(const std::string &key, const std::string &val)
Expand Down Expand Up @@ -109,6 +111,10 @@ int ExtEplayer3Options::update(const std::string &key, const std::string &val)
{
entry.setValue(val);
}
else if (entry.getType() == "argslist")
{
entry.setValue(val);
}
}
else
{
Expand Down Expand Up @@ -180,7 +186,40 @@ std::vector<std::string> ExtEplayer3::buildCommand()
if (i->second.getType() == "int" || i->second.getType() == "string")
{
args.push_back(i->second.getAppArg()); //add arg name to list of args
args.push_back(i->second.getValue()); //add value to list of args }
args.push_back(i->second.getValue()); //add value to list of args
}
if (i->second.getType() == "argslist")
{
std::stringstream ss(i->second.getValue());
std::string item;

while (std::getline(ss, item, '-'))
{
if (!item.empty())
{
if (item.find("exteplayer3") != std::string::npos)
{
args[0] = item;
}
else
{
// split arg=value
size_t eq = item.find('=');
if (eq != std::string::npos)
{
std::string key = item.substr(0, eq);
std::string value = item.substr(eq + 1);
args.push_back("-" + key);
args.push_back(value);
}
else
{
args.push_back(item);
}
}
}
}
}
}
return args;
}
Expand Down
Loading