Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Removed balancing and multicast group types #2323

Merged
Merged
Show file tree
Hide file tree
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
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