Skip to content

Commit

Permalink
[API] Removed balancing and multicast group types (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored May 2, 2022
1 parent 94ff168 commit 042df34
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
35 changes: 5 additions & 30 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ CUDTGroup::CUDTGroup(SRT_GROUP_TYPE gtype)
// Set this data immediately during creation before
// two or more sockets start arguing about it.
m_iLastSchedSeqNo = CUDT::generateISN();

m_bSyncOnMsgNo = (gtype == SRT_GTYPE_BALANCING);
}

CUDTGroup::~CUDTGroup()
Expand Down Expand Up @@ -576,38 +574,15 @@ void CUDTGroup::deriveSettings(CUDT* u)
#undef IMF
}

bool CUDTGroup::applyFlags(uint32_t flags, HandshakeSide hsd)
bool CUDTGroup::applyFlags(uint32_t flags, HandshakeSide)
{
bool synconmsg = IsSet(flags, SRT_GFLAG_SYNCONMSG);

if (m_type == SRT_GTYPE_BALANCING)
{
// We support only TRUE for this flag
if (!synconmsg)
{
HLOGP(gmlog.Debug, "GROUP: Balancing mode implemented only with sync on msgno - overridden request");
return true; // accept, but override
}

// We have this flag set; change it in yourself, if needed.
if (hsd == HSD_INITIATOR && !m_bSyncOnMsgNo)
{
// With this you can change in future the default value to false.
HLOGP(gmlog.Debug, "GROUP: Balancing requrested msgno-sync, OVERRIDING original setting");
m_bSyncOnMsgNo = true;
return true;
}
}
else
const bool synconmsg = IsSet(flags, SRT_GFLAG_SYNCONMSG);
if (synconmsg)
{
if (synconmsg)
{
LOGP(gmlog.Error, "GROUP: non-balancing type requested sync on msgno - IPE/EPE?");
return false;
}
LOGP(gmlog.Error, "GROUP: requested sync on msgno - not supported.");
return false;
}

// Ignore the flag anyway. This can change in future versions though.
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion srtcore/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class CUDTGroup
void erase(gli_t it);
};
GroupContainer m_Group;
bool m_bSyncOnMsgNo;
const bool m_bSyncOnMsgNo; // It goes into a dedicated HS field. Could be true for balancing groups (not implemented).
SRT_GROUP_TYPE m_type;
CUDTSocket* m_listener; // A "group" can only have one listener.
srt::sync::atomic<int> m_iBusy;
Expand Down
2 changes: 0 additions & 2 deletions srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,6 @@ typedef enum SRT_GROUP_TYPE
SRT_GTYPE_UNDEFINED,
SRT_GTYPE_BROADCAST,
SRT_GTYPE_BACKUP,
SRT_GTYPE_BALANCING,
SRT_GTYPE_MULTICAST,
// ...
SRT_GTYPE_E_END
} SRT_GROUP_TYPE;
Expand Down
2 changes: 0 additions & 2 deletions testing/testmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,6 @@ void SrtCommon::OpenGroupClient()
type = SRT_GTYPE_BROADCAST;
else if (m_group_type == "backup")
type = SRT_GTYPE_BACKUP;
else if (m_group_type == "balancing")
type = SRT_GTYPE_BALANCING;
else
{
Error("With //group, type='" + m_group_type + "' undefined");
Expand Down

0 comments on commit 042df34

Please sign in to comment.