Skip to content

Commit

Permalink
[API] Removed unused srt_group_configure API function.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed May 4, 2022
1 parent 45acb74 commit c6b95f5
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 65 deletions.
16 changes: 0 additions & 16 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3302,22 +3302,6 @@ SRTSOCKET srt::CUDT::getGroupOfSocket(SRTSOCKET socket)
return s->m_GroupOf->id();
}

int srt::CUDT::configureGroup(SRTSOCKET groupid, const char* str)
{
if ((groupid & SRTGROUP_MASK) == 0)
{
return APIError(MJ_NOTSUP, MN_INVAL, 0);
}

CUDTUnited::GroupKeeper k(uglobal(), groupid, CUDTUnited::ERH_RETURN);
if (!k.group)
{
return APIError(MJ_NOTSUP, MN_INVAL, 0);
}

return k.group->configure(str);
}

int srt::CUDT::getGroupData(SRTSOCKET groupid, SRT_SOCKGROUPDATA* pdata, size_t* psize)
{
if ((groupid & SRTGROUP_MASK) == 0 || !psize)
Expand Down
1 change: 0 additions & 1 deletion srtcore/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class CUDT
static SRTSOCKET createGroup(SRT_GROUP_TYPE);
static SRTSOCKET getGroupOfSocket(SRTSOCKET socket);
static int getGroupData(SRTSOCKET groupid, SRT_SOCKGROUPDATA* pdata, size_t* psize);
static int configureGroup(SRTSOCKET groupid, const char* str);
static bool isgroup(SRTSOCKET sock) { return (sock & SRTGROUP_MASK) != 0; }
#endif
static int bind(SRTSOCKET u, const sockaddr* name, int namelen);
Expand Down
41 changes: 0 additions & 41 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4529,47 +4529,6 @@ void CUDTGroup::internalKeepalive(SocketData* gli)

CUDTGroup::BufferedMessageStorage CUDTGroup::BufferedMessage::storage(SRT_LIVE_MAX_PLSIZE /*, 1000*/);

int CUDTGroup::configure(const char* str)
{
string config = str;
switch (type())
{
/* TMP review stub case SRT_GTYPE_BALANCING:
// config contains the algorithm name
if (config == "" || config == "auto")
{
m_cbSelectLink.set(this, &CUDTGroup::linkSelect_window_fw);
HLOGC(gmlog.Debug, log << "group(balancing): WINDOW algorithm selected");
}
else if (config == "fixed")
{
m_cbSelectLink.set(this, &CUDTGroup::linkSelect_fixed_fw);
HLOGC(gmlog.Debug, log << "group(balancing): FIXED algorithm selected");
}
else
{
LOGC(gmlog.Error, log << "group(balancing): unknown selection algorithm '"
<< config << "'");
return CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0);
}
break;*/
case SRT_GTYPE_BROADCAST:
case SRT_GTYPE_BACKUP:
default:
if (config == "")
{
// You can always call the config with empty string,
// it should set defaults or do nothing, if not supported.
return 0;
}
LOGC(gmlog.Error, log << "this group type doesn't support any configuration");
return CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0);
}

return 0;
}

// Forwarder needed due to class definition order
int32_t CUDTGroup::generateISN()
{
Expand Down
1 change: 0 additions & 1 deletion srtcore/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ class CUDTGroup
void syncWithSocket(const srt::CUDT& core, const HandshakeSide side);
int getGroupData(SRT_SOCKGROUPDATA* pdata, size_t* psize);
int getGroupData_LOCKED(SRT_SOCKGROUPDATA* pdata, size_t* psize);
int configure(const char* str);

/// Predicted to be called from the reading function to fill
/// the group data array as requested.
Expand Down
1 change: 0 additions & 1 deletion srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ typedef struct SRT_GroupMemberConfig_
SRT_API SRTSOCKET srt_create_group(SRT_GROUP_TYPE);
SRT_API SRTSOCKET srt_groupof(SRTSOCKET socket);
SRT_API int srt_group_data(SRTSOCKET socketgroup, SRT_SOCKGROUPDATA* output, size_t* inoutlen);
SRT_API int srt_group_configure(SRTSOCKET socketgroup, const char* str);

SRT_API SRT_SOCKOPT_CONFIG* srt_create_config(void);
SRT_API void srt_delete_config(SRT_SOCKOPT_CONFIG* config /*nullable*/);
Expand Down
5 changes: 0 additions & 5 deletions srtcore/srt_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ int srt_group_data(SRTSOCKET socketgroup, SRT_SOCKGROUPDATA* output, size_t* ino
{
return CUDT::getGroupData(socketgroup, output, inoutlen);
}
int srt_group_configure(SRTSOCKET socketgroup, const char* str)
{
return CUDT::configureGroup(socketgroup, str);
}

SRT_SOCKOPT_CONFIG* srt_create_config()
{
Expand Down Expand Up @@ -101,7 +97,6 @@ int srt_connect_group(SRTSOCKET group,
SRTSOCKET srt_create_group(SRT_GROUP_TYPE) { return SRT_INVALID_SOCK; }
SRTSOCKET srt_groupof(SRTSOCKET) { return SRT_INVALID_SOCK; }
int srt_group_data(SRTSOCKET, SRT_SOCKGROUPDATA*, size_t*) { return srt::CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0); }
int srt_group_configure(SRTSOCKET, const char*) { return srt::CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0); }
SRT_SOCKOPT_CONFIG* srt_create_config() { return NULL; }
void srt_delete_config(SRT_SOCKOPT_CONFIG*) { return; }
int srt_config_add(SRT_SOCKOPT_CONFIG*, SRT_SOCKOPT, const void*, int) { return srt::CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0); }
Expand Down

0 comments on commit c6b95f5

Please sign in to comment.