From d9ecf05ee87506b8ea005ab0e64923511b2f51d8 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 10:35:08 +0100 Subject: [PATCH 01/30] Changes for duplicate streams --- plugins/aoip info/aoip info.cbp | 8 + plugins/aoip info/aoipinfobuilder.cpp | 11 - plugins/aoip info/pnlAoIPInfo.cpp | 1033 +++---------------- plugins/aoip info/pnlAoIPInfo.h | 159 +-- plugins/aoip info/pnlQos.cpp | 447 ++++++++ plugins/aoip info/pnlQos.h | 129 +++ plugins/aoip info/pnlSubsession.cpp | 352 +++++++ plugins/aoip info/pnlSubsession.h | 105 ++ plugins/aoip info/wxsmith/pnlAoIPInfo.wxs | 798 -------------- plugins/aoip info/wxsmith/pnlQos.wxs | 432 ++++++++ plugins/aoip info/wxsmith/pnlSubsession.wxs | 404 ++++++++ 11 files changed, 2054 insertions(+), 1824 deletions(-) create mode 100644 plugins/aoip info/pnlQos.cpp create mode 100644 plugins/aoip info/pnlQos.h create mode 100644 plugins/aoip info/pnlSubsession.cpp create mode 100644 plugins/aoip info/pnlSubsession.h create mode 100644 plugins/aoip info/wxsmith/pnlQos.wxs create mode 100644 plugins/aoip info/wxsmith/pnlSubsession.wxs diff --git a/plugins/aoip info/aoip info.cbp b/plugins/aoip info/aoip info.cbp index 88a2543d..7a669ccf 100644 --- a/plugins/aoip info/aoip info.cbp +++ b/plugins/aoip info/aoip info.cbp @@ -145,13 +145,19 @@ + + + + + + @@ -167,6 +173,8 @@ + + diff --git a/plugins/aoip info/aoipinfobuilder.cpp b/plugins/aoip info/aoipinfobuilder.cpp index 7d5d9c2f..3035a728 100644 --- a/plugins/aoip info/aoipinfobuilder.cpp +++ b/plugins/aoip info/aoipinfobuilder.cpp @@ -20,10 +20,6 @@ m_pInfo(0) Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&AoIPInfoBuilder::OnSettingChanged); RegisterRemoteApiEnum("QoS", {{50, "50 ms"},{100, "100 ms"},{250, "250 ms"},{500, "500 ms"},{1000, "1000 ms"},{5000, "5000 ms"}}, 1000); - RegisterRemoteApiEnum("Graph", {"kBit/s", "Packet Gap", "Packet Loss", "Jitter", "Timestamp", "Timestamp Errors", "TS-DF", "Slip"}, "kBit/s"); - RegisterRemoteApiEnum("Type", {"Line Graph/s", "Bar Chart", "Histogram"}, "Line Graph/s"); - - } @@ -46,7 +42,6 @@ list AoIPInfoBuilder::CreateOptionPanels(wxWindow* pParent) { list lstOptionPanels; - lstOptionPanels.push_back(make_pair(wxT("Graph"), new pnlGraph(pParent, this))); lstOptionPanels.push_back(make_pair(wxT("Settings"), new pnlSettings(pParent, this))); return lstOptionPanels; @@ -57,12 +52,6 @@ list AoIPInfoBuilder::CreateOptionPanels(wxWindow* pParent) void AoIPInfoBuilder::LoadSettings() { - if(m_pInfo) - { - m_pInfo->ShowGraph(ReadSetting(wxT("Graph"), wxT("kBit/s"))); - m_pInfo->SetGraphType(ReadSetting("Type", "Graph")); - } - } void AoIPInfoBuilder::InputSession(const session& aSession) diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index b73f35c0..3e82d21b 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -38,84 +38,10 @@ const long pnlAoIPInfo::ID_M_PLBL64 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL65 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL66 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL75 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL76 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL77 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL78 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL79 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL80 = wxNewId(); const long pnlAoIPInfo::pnlSessionInfo = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL39 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL42 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL44 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL47 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL45 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL48 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL46 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL62 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL49 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL84 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL67 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL68 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL69 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL70 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL71 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL72 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL74 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL73 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL52 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL54 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL50 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL55 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL57 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL51 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL1 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL53 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL4 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL61 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL81 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL87 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL82 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL83 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL88 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL6 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL2 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL56 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL5 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL7 = wxNewId(); -const long pnlAoIPInfo::ID_PANEL1 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL8 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL9 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL10 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL11 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL13 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL12 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL14 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL15 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL16 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL17 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL18 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL19 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL20 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL21 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL22 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL23 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL24 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL25 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL26 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL27 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL28 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL29 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL30 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL31 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL32 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL85 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL35 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL89 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL90 = wxNewId(); -const long pnlAoIPInfo::ID_M_PLBL86 = wxNewId(); -const long pnlAoIPInfo::ID_CUSTOM12 = wxNewId(); -const long pnlAoIPInfo::ID_PANEL4 = wxNewId(); -const long pnlAoIPInfo::ID_PANEL2 = wxNewId(); const long pnlAoIPInfo::ID_TEXTCTRL1 = wxNewId(); const long pnlAoIPInfo::ID_PANEL3 = wxNewId(); const long pnlAoIPInfo::ID_M_PSWP1 = wxNewId(); @@ -131,606 +57,140 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID m_pSession(0), m_nInitialLatencyCounter(0) { - Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY")); - SetBackgroundColour(wxColour(0,0,0)); - m_pswpInfo = new wmSwitcherPanel(this, ID_M_PSWP1, wxDefaultPosition, wxSize(600,480), wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP1")); - m_pswpInfo->SetPageNameStyle(2); - m_pswpInfo->SetBackgroundColour(wxColour(0,0,0)); - pnlSession = new wxPanel(m_pswpInfo, pnlSessionInfo, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("pnlSessionInfo")); - pnlSession->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl33 = new wmLabel(pnlSession, ID_M_PLBL59, _("Input"), wxPoint(5,10), wxSize(590,20), 0, _T("ID_M_PLBL59")); - m_pLbl33->SetBorderState(uiRect::BORDER_NONE); - m_pLbl33->GetUiRect().SetGradient(0); - m_pLbl33->SetForegroundColour(wxColour(255,255,255)); - m_pLbl33->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl20 = new wmLabel(pnlSession, ID_M_PLBL38, _("Name"), wxPoint(5,70), wxSize(394,20), 0, _T("ID_M_PLBL38")); - m_pLbl20->SetBorderState(uiRect::BORDER_NONE); - m_pLbl20->GetUiRect().SetGradient(0); - m_pLbl20->SetForegroundColour(wxColour(255,255,255)); - m_pLbl20->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl24 = new wmLabel(pnlSession, ID_M_PLBL40, _("Type"), wxPoint(400,70), wxSize(195,20), 0, _T("ID_M_PLBL40")); - m_pLbl24->SetBorderState(uiRect::BORDER_NONE); - m_pLbl24->GetUiRect().SetGradient(0); - m_pLbl24->SetForegroundColour(wxColour(255,255,255)); - m_pLbl24->SetBackgroundColour(wxColour(0,0,255)); - m_plblInput = new wmLabel(pnlSession, ID_M_PLBL60, wxEmptyString, wxPoint(5,31), wxSize(590,25), 0, _T("ID_M_PLBL60")); - m_plblInput->SetBorderState(uiRect::BORDER_NONE); - m_plblInput->GetUiRect().SetGradient(0); - m_plblInput->SetForegroundColour(wxColour(0,128,0)); - m_plblInput->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblInputFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblInput->SetFont(m_plblInputFont); - m_plblSessionName = new wmLabel(pnlSession, ID_M_PLBL41, wxEmptyString, wxPoint(5,91), wxSize(394,25), 0, _T("ID_M_PLBL41")); - m_plblSessionName->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionName->GetUiRect().SetGradient(0); - m_plblSessionName->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionName->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionNameFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionName->SetFont(m_plblSessionNameFont); - m_plblSessionType = new wmLabel(pnlSession, ID_M_PLBL43, wxEmptyString, wxPoint(400,91), wxSize(195,25), 0, _T("ID_M_PLBL43")); - m_plblSessionType->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionType->GetUiRect().SetGradient(0); - m_plblSessionType->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionType->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionType->SetFont(m_plblSessionTypeFont); - m_pLbl3 = new wmLabel(pnlSession, ID_M_PLBL3, _("Description"), wxPoint(5,130), wxSize(590,20), 0, _T("ID_M_PLBL3")); - m_pLbl3->SetBorderState(uiRect::BORDER_NONE); - m_pLbl3->GetUiRect().SetGradient(0); - m_pLbl3->SetForegroundColour(wxColour(255,255,255)); - m_pLbl3->SetBackgroundColour(wxColour(0,0,255)); - m_plblDescription = new wmLabel(pnlSession, ID_M_PLBL63, wxEmptyString, wxPoint(5,151), wxSize(590,25), 0, _T("ID_M_PLBL63")); - m_plblDescription->SetBorderState(uiRect::BORDER_NONE); - m_plblDescription->GetUiRect().SetGradient(0); - m_plblDescription->SetForegroundColour(wxColour(0,128,0)); - m_plblDescription->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblDescriptionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblDescription->SetFont(m_plblDescriptionFont); - m_pLbl19 = new wmLabel(pnlSession, ID_M_PLBL34, _("Domain"), wxPoint(540,200), wxSize(55,20), 0, _T("ID_M_PLBL34")); - m_pLbl19->SetBorderState(uiRect::BORDER_NONE); - m_pLbl19->GetUiRect().SetGradient(0); - m_pLbl19->SetForegroundColour(wxColour(255,255,255)); - m_pLbl19->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl18 = new wmLabel(pnlSession, ID_M_PLBL33, _("Version"), wxPoint(150,200), wxSize(189,20), 0, _T("ID_M_PLBL33")); - m_pLbl18->SetBorderState(uiRect::BORDER_NONE); - m_pLbl18->GetUiRect().SetGradient(0); - m_pLbl18->SetForegroundColour(wxColour(255,255,255)); - m_pLbl18->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl21 = new wmLabel(pnlSession, ID_M_PLBL36, _("Sync ID"), wxPoint(340,200), wxSize(199,20), 0, _T("ID_M_PLBL36")); - m_pLbl21->SetBorderState(uiRect::BORDER_NONE); - m_pLbl21->GetUiRect().SetGradient(0); - m_pLbl21->SetForegroundColour(wxColour(255,255,255)); - m_pLbl21->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl32 = new wmLabel(pnlSession, ID_M_PLBL58, _("Sync Type"), wxPoint(5,200), wxSize(144,20), 0, _T("ID_M_PLBL58")); - m_pLbl32->SetBorderState(uiRect::BORDER_NONE); - m_pLbl32->GetUiRect().SetGradient(0); - m_pLbl32->SetForegroundColour(wxColour(255,255,255)); - m_pLbl32->SetBackgroundColour(wxColour(0,0,255)); - m_plblSyncType = new wmLabel(pnlSession, ID_M_PLBL37, wxEmptyString, wxPoint(5,221), wxSize(144,25), 0, _T("ID_M_PLBL37")); - m_plblSyncType->SetBorderState(uiRect::BORDER_NONE); - m_plblSyncType->GetUiRect().SetGradient(0); - m_plblSyncType->SetForegroundColour(wxColour(0,128,0)); - m_plblSyncType->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSyncTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSyncType->SetFont(m_plblSyncTypeFont); - m_plblSyncVersion = new wmLabel(pnlSession, ID_M_PLBL64, wxEmptyString, wxPoint(150,221), wxSize(189,25), 0, _T("ID_M_PLBL64")); - m_plblSyncVersion->SetBorderState(uiRect::BORDER_NONE); - m_plblSyncVersion->GetUiRect().SetGradient(0); - m_plblSyncVersion->SetForegroundColour(wxColour(0,128,0)); - m_plblSyncVersion->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSyncVersionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSyncVersion->SetFont(m_plblSyncVersionFont); - m_plblSyncId = new wmLabel(pnlSession, ID_M_PLBL65, wxEmptyString, wxPoint(340,221), wxSize(199,25), 0, _T("ID_M_PLBL65")); - m_plblSyncId->SetBorderState(uiRect::BORDER_NONE); - m_plblSyncId->GetUiRect().SetGradient(0); - m_plblSyncId->SetForegroundColour(wxColour(0,128,0)); - m_plblSyncId->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSyncIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSyncId->SetFont(m_plblSyncIdFont); - m_plblSyncDomain = new wmLabel(pnlSession, ID_M_PLBL66, wxEmptyString, wxPoint(540,221), wxSize(55,25), 0, _T("ID_M_PLBL66")); - m_plblSyncDomain->SetBorderState(uiRect::BORDER_NONE); - m_plblSyncDomain->GetUiRect().SetGradient(0); - m_plblSyncDomain->SetForegroundColour(wxColour(0,128,0)); - m_plblSyncDomain->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSyncDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSyncDomain->SetFont(m_plblSyncDomainFont); - m_pLbl40 = new wmLabel(pnlSession, ID_M_PLBL75, _("Audio Subsessions"), wxPoint(5,300), wxSize(144,20), 0, _T("ID_M_PLBL75")); - m_pLbl40->SetBorderState(uiRect::BORDER_NONE); - m_pLbl40->GetUiRect().SetGradient(0); - m_pLbl40->SetForegroundColour(wxColour(255,255,255)); - m_pLbl40->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl41 = new wmLabel(pnlSession, ID_M_PLBL76, _("Video Subsessions"), wxPoint(150,300), wxSize(144,20), 0, _T("ID_M_PLBL76")); - m_pLbl41->SetBorderState(uiRect::BORDER_NONE); - m_pLbl41->GetUiRect().SetGradient(0); - m_pLbl41->SetForegroundColour(wxColour(255,255,255)); - m_pLbl41->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl42 = new wmLabel(pnlSession, ID_M_PLBL77, _("Duplicate Streams"), wxPoint(295,300), wxSize(144,20), 0, _T("ID_M_PLBL77")); - m_pLbl42->SetBorderState(uiRect::BORDER_NONE); - m_pLbl42->GetUiRect().SetGradient(0); - m_pLbl42->SetForegroundColour(wxColour(255,255,255)); - m_pLbl42->SetBackgroundColour(wxColour(0,0,255)); - m_plblSubsessionsAudio = new wmLabel(pnlSession, ID_M_PLBL78, wxEmptyString, wxPoint(5,321), wxSize(144,25), 0, _T("ID_M_PLBL78")); - m_plblSubsessionsAudio->SetBorderState(uiRect::BORDER_NONE); - m_plblSubsessionsAudio->GetUiRect().SetGradient(0); - m_plblSubsessionsAudio->SetForegroundColour(wxColour(0,128,0)); - m_plblSubsessionsAudio->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubsessionsAudioFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubsessionsAudio->SetFont(m_plblSubsessionsAudioFont); - m_plblSubsessionVideo = new wmLabel(pnlSession, ID_M_PLBL79, wxEmptyString, wxPoint(150,321), wxSize(144,25), 0, _T("ID_M_PLBL79")); - m_plblSubsessionVideo->SetBorderState(uiRect::BORDER_NONE); - m_plblSubsessionVideo->GetUiRect().SetGradient(0); - m_plblSubsessionVideo->SetForegroundColour(wxColour(0,128,0)); - m_plblSubsessionVideo->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubsessionVideoFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubsessionVideo->SetFont(m_plblSubsessionVideoFont); - m_plblGroups = new wmLabel(pnlSession, ID_M_PLBL80, wxEmptyString, wxPoint(295,321), wxSize(144,25), 0, _T("ID_M_PLBL80")); - m_plblGroups->SetBorderState(uiRect::BORDER_NONE); - m_plblGroups->GetUiRect().SetGradient(0); - m_plblGroups->SetForegroundColour(wxColour(0,128,0)); - m_plblGroups->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblGroupsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblGroups->SetFont(m_plblGroupsFont); - pnlSubsession = new wxPanel(m_pswpInfo, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); - pnlSubsession->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl23 = new wmLabel(pnlSubsession, ID_M_PLBL39, _("Source"), wxPoint(5,10), wxSize(199,20), 0, _T("ID_M_PLBL39")); - m_pLbl23->SetBorderState(uiRect::BORDER_NONE); - m_pLbl23->GetUiRect().SetGradient(0); - m_pLbl23->SetForegroundColour(wxColour(255,255,255)); - m_pLbl23->SetBackgroundColour(wxColour(0,0,255)); - m_plblSessionSource = new wmLabel(pnlSubsession, ID_M_PLBL42, wxEmptyString, wxPoint(5,31), wxSize(199,25), 0, _T("ID_M_PLBL42")); - m_plblSessionSource->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionSource->GetUiRect().SetGradient(0); - m_plblSessionSource->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionSource->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionSourceFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionSource->SetFont(m_plblSessionSourceFont); - m_pLbl25 = new wmLabel(pnlSubsession, ID_M_PLBL44, _("Codec"), wxPoint(205,10), wxSize(74,20), 0, _T("ID_M_PLBL44")); - m_pLbl25->SetBorderState(uiRect::BORDER_NONE); - m_pLbl25->GetUiRect().SetGradient(0); - m_pLbl25->SetForegroundColour(wxColour(255,255,255)); - m_pLbl25->SetBackgroundColour(wxColour(0,0,255)); - m_plblSessionBits = new wmLabel(pnlSubsession, ID_M_PLBL47, wxEmptyString, wxPoint(205,31), wxSize(74,25), 0, _T("ID_M_PLBL47")); - m_plblSessionBits->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionBits->GetUiRect().SetGradient(0); - m_plblSessionBits->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionBits->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionBitsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionBits->SetFont(m_plblSessionBitsFont); - m_pLbl26 = new wmLabel(pnlSubsession, ID_M_PLBL45, _("Freq"), wxPoint(280,10), wxSize(100,20), 0, _T("ID_M_PLBL45")); - m_pLbl26->SetBorderState(uiRect::BORDER_NONE); - m_pLbl26->GetUiRect().SetGradient(0); - m_pLbl26->SetForegroundColour(wxColour(255,255,255)); - m_pLbl26->SetBackgroundColour(wxColour(0,0,255)); - m_plblSessionFrequency = new wmLabel(pnlSubsession, ID_M_PLBL48, wxEmptyString, wxPoint(280,31), wxSize(100,25), 0, _T("ID_M_PLBL48")); - m_plblSessionFrequency->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionFrequency->GetUiRect().SetGradient(0); - m_plblSessionFrequency->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionFrequency->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionFrequencyFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionFrequency->SetFont(m_plblSessionFrequencyFont); - m_pLbl27 = new wmLabel(pnlSubsession, ID_M_PLBL46, _("Channels"), wxPoint(381,10), wxSize(59,20), 0, _T("ID_M_PLBL46")); - m_pLbl27->SetBorderState(uiRect::BORDER_NONE); - m_pLbl27->GetUiRect().SetGradient(0); - m_pLbl27->SetForegroundColour(wxColour(255,255,255)); - m_pLbl27->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl38 = new wmLabel(pnlSubsession, ID_M_PLBL62, _("Id"), wxPoint(441,10), wxSize(158,20), 0, _T("ID_M_PLBL62")); - m_pLbl38->SetBorderState(uiRect::BORDER_NONE); - m_pLbl38->GetUiRect().SetGradient(0); - m_pLbl38->SetForegroundColour(wxColour(255,255,255)); - m_pLbl38->SetBackgroundColour(wxColour(0,0,255)); - m_plblSessionChannels = new wmLabel(pnlSubsession, ID_M_PLBL49, wxEmptyString, wxPoint(381,31), wxSize(59,25), 0, _T("ID_M_PLBL49")); - m_plblSessionChannels->SetBorderState(uiRect::BORDER_NONE); - m_plblSessionChannels->GetUiRect().SetGradient(0); - m_plblSessionChannels->SetForegroundColour(wxColour(0,128,0)); - m_plblSessionChannels->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSessionChannelsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSessionChannels->SetFont(m_plblSessionChannelsFont); - m_plblSubsessionId = new wmLabel(pnlSubsession, ID_M_PLBL84, wxEmptyString, wxPoint(441,31), wxSize(158,25), 0, _T("ID_M_PLBL84")); - m_plblSubsessionId->SetBorderState(uiRect::BORDER_NONE); - m_plblSubsessionId->GetUiRect().SetGradient(0); - m_plblSubsessionId->SetForegroundColour(wxColour(0,128,0)); - m_plblSubsessionId->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubsessionIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubsessionId->SetFont(m_plblSubsessionIdFont); - m_pLbl22 = new wmLabel(pnlSubsession, ID_M_PLBL67, _("Sync Type"), wxPoint(5,70), wxSize(144,20), 0, _T("ID_M_PLBL67")); - m_pLbl22->SetBorderState(uiRect::BORDER_NONE); - m_pLbl22->GetUiRect().SetGradient(0); - m_pLbl22->SetForegroundColour(wxColour(255,255,255)); - m_pLbl22->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl35 = new wmLabel(pnlSubsession, ID_M_PLBL68, _("Version"), wxPoint(150,70), wxSize(189,20), 0, _T("ID_M_PLBL68")); - m_pLbl35->SetBorderState(uiRect::BORDER_NONE); - m_pLbl35->GetUiRect().SetGradient(0); - m_pLbl35->SetForegroundColour(wxColour(255,255,255)); - m_pLbl35->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl36 = new wmLabel(pnlSubsession, ID_M_PLBL69, _("Sync ID"), wxPoint(340,70), wxSize(199,20), 0, _T("ID_M_PLBL69")); - m_pLbl36->SetBorderState(uiRect::BORDER_NONE); - m_pLbl36->GetUiRect().SetGradient(0); - m_pLbl36->SetForegroundColour(wxColour(255,255,255)); - m_pLbl36->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl37 = new wmLabel(pnlSubsession, ID_M_PLBL70, _("Domain"), wxPoint(540,70), wxSize(55,20), 0, _T("ID_M_PLBL70")); - m_pLbl37->SetBorderState(uiRect::BORDER_NONE); - m_pLbl37->GetUiRect().SetGradient(0); - m_pLbl37->SetForegroundColour(wxColour(255,255,255)); - m_pLbl37->SetBackgroundColour(wxColour(0,0,255)); - m_plblSubSyncType = new wmLabel(pnlSubsession, ID_M_PLBL71, wxEmptyString, wxPoint(5,91), wxSize(144,25), 0, _T("ID_M_PLBL71")); - m_plblSubSyncType->SetBorderState(uiRect::BORDER_NONE); - m_plblSubSyncType->GetUiRect().SetGradient(0); - m_plblSubSyncType->SetForegroundColour(wxColour(0,128,0)); - m_plblSubSyncType->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubSyncTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubSyncType->SetFont(m_plblSubSyncTypeFont); - m_plblSubSyncVersion = new wmLabel(pnlSubsession, ID_M_PLBL72, wxEmptyString, wxPoint(150,91), wxSize(189,25), 0, _T("ID_M_PLBL72")); - m_plblSubSyncVersion->SetBorderState(uiRect::BORDER_NONE); - m_plblSubSyncVersion->GetUiRect().SetGradient(0); - m_plblSubSyncVersion->SetForegroundColour(wxColour(0,128,0)); - m_plblSubSyncVersion->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubSyncVersionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubSyncVersion->SetFont(m_plblSubSyncVersionFont); - m_plblSubSyncDomain = new wmLabel(pnlSubsession, ID_M_PLBL74, wxEmptyString, wxPoint(540,91), wxSize(55,25), 0, _T("ID_M_PLBL74")); - m_plblSubSyncDomain->SetBorderState(uiRect::BORDER_NONE); - m_plblSubSyncDomain->GetUiRect().SetGradient(0); - m_plblSubSyncDomain->SetForegroundColour(wxColour(0,128,0)); - m_plblSubSyncDomain->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubSyncDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubSyncDomain->SetFont(m_plblSubSyncDomainFont); - m_plblSubSyncId = new wmLabel(pnlSubsession, ID_M_PLBL73, wxEmptyString, wxPoint(340,91), wxSize(199,25), 0, _T("ID_M_PLBL73")); - m_plblSubSyncId->SetBorderState(uiRect::BORDER_NONE); - m_plblSubSyncId->GetUiRect().SetGradient(0); - m_plblSubSyncId->SetForegroundColour(wxColour(0,128,0)); - m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSubSyncIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSubSyncId->SetFont(m_plblSubSyncIdFont); - m_pLbl29 = new wmLabel(pnlSubsession, ID_M_PLBL52, _("Sync Timestamp"), wxPoint(5,130), wxSize(149,20), 0, _T("ID_M_PLBL52")); - m_pLbl29->SetBorderState(uiRect::BORDER_NONE); - m_pLbl29->GetUiRect().SetGradient(0); - m_pLbl29->SetForegroundColour(wxColour(255,255,255)); - m_pLbl29->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl31 = new wmLabel(pnlSubsession, ID_M_PLBL54, _("Current Timestamp"), wxPoint(155,130), wxSize(149,20), 0, _T("ID_M_PLBL54")); - m_pLbl31->SetBorderState(uiRect::BORDER_NONE); - m_pLbl31->GetUiRect().SetGradient(0); - m_pLbl31->SetForegroundColour(wxColour(255,255,255)); - m_pLbl31->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl28 = new wmLabel(pnlSubsession, ID_M_PLBL50, _("Transmission Time"), wxPoint(5,185), wxSize(165,20), 0, _T("ID_M_PLBL50")); - m_pLbl28->SetBorderState(uiRect::BORDER_NONE); - m_pLbl28->GetUiRect().SetGradient(0); - m_pLbl28->SetForegroundColour(wxColour(255,255,255)); - m_pLbl28->SetBackgroundColour(wxColour(0,0,255)); - m_plblSyncTimestamp = new wmLabel(pnlSubsession, ID_M_PLBL55, wxEmptyString, wxPoint(5,151), wxSize(149,25), 0, _T("ID_M_PLBL55")); - m_plblSyncTimestamp->SetBorderState(uiRect::BORDER_NONE); - m_plblSyncTimestamp->GetUiRect().SetGradient(0); - m_plblSyncTimestamp->SetForegroundColour(wxColour(0,128,0)); - m_plblSyncTimestamp->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblSyncTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblSyncTimestamp->SetFont(m_plblSyncTimestampFont); - m_plblCurrentTimestamp = new wmLabel(pnlSubsession, ID_M_PLBL57, wxEmptyString, wxPoint(155,151), wxSize(149,25), 0, _T("ID_M_PLBL57")); - m_plblCurrentTimestamp->SetBorderState(uiRect::BORDER_NONE); - m_plblCurrentTimestamp->GetUiRect().SetGradient(0); - m_plblCurrentTimestamp->SetForegroundColour(wxColour(0,128,0)); - m_plblCurrentTimestamp->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblCurrentTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblCurrentTimestamp->SetFont(m_plblCurrentTimestampFont); - m_plblTransmissionTime = new wmLabel(pnlSubsession, ID_M_PLBL51, wxEmptyString, wxPoint(5,206), wxSize(165,25), 0, _T("ID_M_PLBL51")); - m_plblTransmissionTime->SetBorderState(uiRect::BORDER_NONE); - m_plblTransmissionTime->GetUiRect().SetGradient(0); - m_plblTransmissionTime->SetForegroundColour(wxColour(0,128,0)); - m_plblTransmissionTime->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblTransmissionTimeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblTransmissionTime->SetFont(m_plblTransmissionTimeFont); - m_pLbl1 = new wmLabel(pnlSubsession, ID_M_PLBL1, _("Presentation Time"), wxPoint(171,185), wxSize(165,20), 0, _T("ID_M_PLBL1")); - m_pLbl1->SetBorderState(uiRect::BORDER_NONE); - m_pLbl1->GetUiRect().SetGradient(0); - m_pLbl1->SetForegroundColour(wxColour(255,255,255)); - m_pLbl1->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl30 = new wmLabel(pnlSubsession, ID_M_PLBL53, _("Network Latency"), wxPoint(337,185), wxSize(100,20), 0, _T("ID_M_PLBL53")); - m_pLbl30->SetBorderState(uiRect::BORDER_NONE); - m_pLbl30->GetUiRect().SetGradient(0); - m_pLbl30->SetForegroundColour(wxColour(255,255,255)); - m_pLbl30->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl2 = new wmLabel(pnlSubsession, ID_M_PLBL4, _("Display/Playback Time"), wxPoint(5,240), wxSize(166,20), 0, _T("ID_M_PLBL4")); - m_pLbl2->SetBorderState(uiRect::BORDER_NONE); - m_pLbl2->GetUiRect().SetGradient(0); - m_pLbl2->SetForegroundColour(wxColour(255,255,255)); - m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl34 = new wmLabel(pnlSubsession, ID_M_PLBL61, _("Last Frame Size"), wxPoint(5,300), wxSize(144,20), 0, _T("ID_M_PLBL61")); - m_pLbl34->SetBorderState(uiRect::BORDER_NONE); - m_pLbl34->GetUiRect().SetGradient(0); - m_pLbl34->SetForegroundColour(wxColour(255,255,255)); - m_pLbl34->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl43 = new wmLabel(pnlSubsession, ID_M_PLBL81, _("Last Frame Duration"), wxPoint(150,300), wxSize(144,20), 0, _T("ID_M_PLBL81")); - m_pLbl43->SetBorderState(uiRect::BORDER_NONE); - m_pLbl43->GetUiRect().SetGradient(0); - m_pLbl43->SetForegroundColour(wxColour(255,255,255)); - m_pLbl43->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl44 = new wmLabel(pnlSubsession, ID_M_PLBL87, _("Playback Queue"), wxPoint(450,300), wxSize(144,20), 0, _T("ID_M_PLBL87")); - m_pLbl44->SetBorderState(uiRect::BORDER_NONE); - m_pLbl44->GetUiRect().SetGradient(0); - m_pLbl44->SetForegroundColour(wxColour(255,255,255)); - m_pLbl44->SetBackgroundColour(wxColour(0,0,255)); - m_plblFrameSize = new wmLabel(pnlSubsession, ID_M_PLBL82, wxEmptyString, wxPoint(5,321), wxSize(144,25), 0, _T("ID_M_PLBL82")); - m_plblFrameSize->SetBorderState(uiRect::BORDER_NONE); - m_plblFrameSize->GetUiRect().SetGradient(0); - m_plblFrameSize->SetForegroundColour(wxColour(0,128,0)); - m_plblFrameSize->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblFrameSizeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblFrameSize->SetFont(m_plblFrameSizeFont); - m_plblFrameDuration = new wmLabel(pnlSubsession, ID_M_PLBL83, wxEmptyString, wxPoint(150,321), wxSize(144,25), 0, _T("ID_M_PLBL83")); - m_plblFrameDuration->SetBorderState(uiRect::BORDER_NONE); - m_plblFrameDuration->GetUiRect().SetGradient(0); - m_plblFrameDuration->SetForegroundColour(wxColour(0,128,0)); - m_plblFrameDuration->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblFrameDurationFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblFrameDuration->SetFont(m_plblFrameDurationFont); - m_plblPlaybackQueue = new wmLabel(pnlSubsession, ID_M_PLBL88, wxEmptyString, wxPoint(450,321), wxSize(144,25), 0, _T("ID_M_PLBL88")); - m_plblPlaybackQueue->SetBorderState(uiRect::BORDER_NONE); - m_plblPlaybackQueue->GetUiRect().SetGradient(0); - m_plblPlaybackQueue->SetForegroundColour(wxColour(0,128,0)); - m_plblPlaybackQueue->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblPlaybackQueueFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblPlaybackQueue->SetFont(m_plblPlaybackQueueFont); - m_pLbl4 = new wmLabel(pnlSubsession, ID_M_PLBL6, _("Playback Latency"), wxPoint(238,240), wxSize(100,20), 0, _T("ID_M_PLBL6")); - m_pLbl4->SetBorderState(uiRect::BORDER_NONE); - m_pLbl4->GetUiRect().SetGradient(0); - m_pLbl4->SetForegroundColour(wxColour(255,255,255)); - m_pLbl4->SetBackgroundColour(wxColour(0,0,255)); - m_plblTimestampIn = new wmLabel(pnlSubsession, ID_M_PLBL2, wxEmptyString, wxPoint(171,206), wxSize(165,25), 0, _T("ID_M_PLBL2")); - m_plblTimestampIn->SetBorderState(uiRect::BORDER_NONE); - m_plblTimestampIn->GetUiRect().SetGradient(0); - m_plblTimestampIn->SetForegroundColour(wxColour(0,128,0)); - m_plblTimestampIn->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblTimestampInFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblTimestampIn->SetFont(m_plblTimestampInFont); - m_plblLatencyNetwork = new wmLabel(pnlSubsession, ID_M_PLBL56, wxEmptyString, wxPoint(337,206), wxSize(100,25), 0, _T("ID_M_PLBL56")); - m_plblLatencyNetwork->SetBorderState(uiRect::BORDER_NONE); - m_plblLatencyNetwork->GetUiRect().SetGradient(0); - m_plblLatencyNetwork->SetForegroundColour(wxColour(155,0,0)); - m_plblLatencyNetwork->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblLatencyNetworkFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblLatencyNetwork->SetFont(m_plblLatencyNetworkFont); - m_plblTimestampOut = new wmLabel(pnlSubsession, ID_M_PLBL5, wxEmptyString, wxPoint(5,261), wxSize(166,25), 0, _T("ID_M_PLBL5")); - m_plblTimestampOut->SetBorderState(uiRect::BORDER_NONE); - m_plblTimestampOut->GetUiRect().SetGradient(0); - m_plblTimestampOut->SetForegroundColour(wxColour(0,128,0)); - m_plblTimestampOut->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblTimestampOutFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblTimestampOut->SetFont(m_plblTimestampOutFont); - m_plblLatency = new wmLabel(pnlSubsession, ID_M_PLBL7, wxEmptyString, wxPoint(238,261), wxSize(100,25), 0, _T("ID_M_PLBL7")); - m_plblLatency->SetBorderState(uiRect::BORDER_NONE); - m_plblLatency->GetUiRect().SetGradient(0); - m_plblLatency->SetForegroundColour(wxColour(155,0,0)); - m_plblLatency->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblLatencyFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblLatency->SetFont(m_plblLatencyFont); - pnlQoS = new wxPanel(m_pswpInfo, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2")); - pnlQoS->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl5 = new wmLabel(pnlQoS, ID_M_PLBL8, _("QoS Time"), wxPoint(5,5), wxSize(144,20), 0, _T("ID_M_PLBL8")); - m_pLbl5->SetBorderState(uiRect::BORDER_NONE); - m_pLbl5->GetUiRect().SetGradient(0); - m_pLbl5->SetForegroundColour(wxColour(255,255,255)); - m_pLbl5->SetBackgroundColour(wxColour(0,0,255)); - - m_plblRTCP_Last_Title = new wmLabel(pnlQoS, wxNewId(), _("Last SR"), wxPoint(150,5), wxSize(144,20), 0, _T("ID_M_PLBL8")); - m_plblRTCP_Last_Title->SetBorderState(uiRect::BORDER_NONE); - m_plblRTCP_Last_Title->GetUiRect().SetGradient(0); - m_plblRTCP_Last_Title->SetForegroundColour(wxColour(255,255,255)); - m_plblRTCP_Last_Title->SetBackgroundColour(wxColour(0,0,255)); - - m_plblRTCP_NTP_Title = new wmLabel(pnlQoS, wxNewId(), _("SR NTP"), wxPoint(295,5), wxSize(144,20), 0, _T("ID_M_PLBL8")); - m_plblRTCP_NTP_Title->SetBorderState(uiRect::BORDER_NONE); - m_plblRTCP_NTP_Title->GetUiRect().SetGradient(0); - m_plblRTCP_NTP_Title->SetForegroundColour(wxColour(255,255,255)); - m_plblRTCP_NTP_Title->SetBackgroundColour(wxColour(0,0,255)); - - - m_pLbl6 = new wmLabel(pnlQoS, ID_M_PLBL9, _("Total Packets"), wxPoint(440,5), wxSize(80,20), 0, _T("ID_M_PLBL9")); - m_pLbl6->SetBorderState(uiRect::BORDER_NONE); - m_pLbl6->GetUiRect().SetGradient(0); - m_pLbl6->SetForegroundColour(wxColour(255,255,255)); - m_pLbl6->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl7 = new wmLabel(pnlQoS, ID_M_PLBL10, _("Packets Lost"), wxPoint(521,5), wxSize(80,20), 0, _T("ID_M_PLBL10")); - m_pLbl7->SetBorderState(uiRect::BORDER_NONE); - m_pLbl7->GetUiRect().SetGradient(0); - m_pLbl7->SetForegroundColour(wxColour(255,255,255)); - m_pLbl7->SetBackgroundColour(wxColour(0,0,255)); - - - m_plblQoSTime = new wmLabel(pnlQoS, ID_M_PLBL11, wxEmptyString, wxPoint(5,26), wxSize(144,25), 0, _T("ID_M_PLBL11")); - m_plblQoSTime->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSTime->GetUiRect().SetGradient(0); - m_plblQoSTime->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSTime->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSTimeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSTime->SetFont(m_plblQoSTimeFont); - - m_plblRTCP_Last = new wmLabel(pnlQoS, wxNewId(), "", wxPoint(150,26), wxSize(144,25), 0, _T("ID_M_PLBL8")); - m_plblRTCP_Last->SetBorderState(uiRect::BORDER_NONE); - m_plblRTCP_Last->GetUiRect().SetGradient(0); - m_plblRTCP_Last->SetForegroundColour(wxColour(0,128,0)); - m_plblRTCP_Last->SetBackgroundColour(wxColour(255,255,255)); - - m_plblRTCP_NTP = new wmLabel(pnlQoS, wxNewId(), _("SR NTP"), wxPoint(295,26), wxSize(144,25), 0, _T("ID_M_PLBL8")); - m_plblRTCP_NTP->SetBorderState(uiRect::BORDER_NONE); - m_plblRTCP_NTP->GetUiRect().SetGradient(0); - m_plblRTCP_NTP->SetForegroundColour(wxColour(0,128,0)); - m_plblRTCP_NTP->SetBackgroundColour(wxColour(255,255,255)); - - - m_plblQoSReceived = new wmLabel(pnlQoS, ID_M_PLBL13, wxEmptyString, wxPoint(440,26), wxSize(80,25), 0, _T("ID_M_PLBL13")); - m_plblQoSReceived->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSReceived->GetUiRect().SetGradient(0); - m_plblQoSReceived->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSReceived->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSReceivedFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSReceived->SetFont(m_plblQoSReceivedFont); - m_plblQoSLost = new wmLabel(pnlQoS, ID_M_PLBL12, wxEmptyString, wxPoint(521,26), wxSize(80,25), 0, _T("ID_M_PLBL12")); - m_plblQoSLost->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSLost->GetUiRect().SetGradient(0); - m_plblQoSLost->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSLost->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSLostFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSLost->SetFont(m_plblQoSLostFont); - - - m_pLbl8 = new wmLabel(pnlQoS, ID_M_PLBL14, _("kBits/s Min"), wxPoint(5,60), wxSize(194,20), 0, _T("ID_M_PLBL14")); - m_pLbl8->SetBorderState(uiRect::BORDER_NONE); - m_pLbl8->GetUiRect().SetGradient(0); - m_pLbl8->SetForegroundColour(wxColour(255,255,255)); - m_pLbl8->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl9 = new wmLabel(pnlQoS, ID_M_PLBL15, _("kBits/s Average"), wxPoint(200,60), wxSize(199,20), 0, _T("ID_M_PLBL15")); - m_pLbl9->SetBorderState(uiRect::BORDER_NONE); - m_pLbl9->GetUiRect().SetGradient(0); - m_pLbl9->SetForegroundColour(wxColour(255,255,255)); - m_pLbl9->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl10 = new wmLabel(pnlQoS, ID_M_PLBL16, _("kBits/s Max"), wxPoint(400,60), wxSize(195,20), 0, _T("ID_M_PLBL16")); - m_pLbl10->SetBorderState(uiRect::BORDER_NONE); - m_pLbl10->GetUiRect().SetGradient(0); - m_pLbl10->SetForegroundColour(wxColour(255,255,255)); - m_pLbl10->SetBackgroundColour(wxColour(0,0,255)); - m_plblQoSKbMin = new wmLabel(pnlQoS, ID_M_PLBL17, wxEmptyString, wxPoint(5,81), wxSize(194,25), 0, _T("ID_M_PLBL17")); - m_plblQoSKbMin->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSKbMin->GetUiRect().SetGradient(0); - m_plblQoSKbMin->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSKbMin->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSKbMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSKbMin->SetFont(m_plblQoSKbMinFont); - m_plblQoSKbAv = new wmLabel(pnlQoS, ID_M_PLBL18, wxEmptyString, wxPoint(200,81), wxSize(199,25), 0, _T("ID_M_PLBL18")); - m_plblQoSKbAv->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSKbAv->GetUiRect().SetGradient(0); - m_plblQoSKbAv->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSKbAv->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSKbAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSKbAv->SetFont(m_plblQoSKbAvFont); - m_plblQoSKbMax = new wmLabel(pnlQoS, ID_M_PLBL19, wxEmptyString, wxPoint(400,81), wxSize(195,25), 0, _T("ID_M_PLBL19")); - m_plblQoSKbMax->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSKbMax->GetUiRect().SetGradient(0); - m_plblQoSKbMax->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSKbMax->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSKbMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSKbMax->SetFont(m_plblQoSKbMaxFont); - m_pLbl11 = new wmLabel(pnlQoS, ID_M_PLBL20, _("Packets Lost/s Min"), wxPoint(5,115), wxSize(194,20), 0, _T("ID_M_PLBL20")); - m_pLbl11->SetBorderState(uiRect::BORDER_NONE); - m_pLbl11->GetUiRect().SetGradient(0); - m_pLbl11->SetForegroundColour(wxColour(255,255,255)); - m_pLbl11->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl12 = new wmLabel(pnlQoS, ID_M_PLBL21, _("Packets Lost/s Average"), wxPoint(200,115), wxSize(199,20), 0, _T("ID_M_PLBL21")); - m_pLbl12->SetBorderState(uiRect::BORDER_NONE); - m_pLbl12->GetUiRect().SetGradient(0); - m_pLbl12->SetForegroundColour(wxColour(255,255,255)); - m_pLbl12->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl13 = new wmLabel(pnlQoS, ID_M_PLBL22, _("Packets Lost/s Max"), wxPoint(400,115), wxSize(195,20), 0, _T("ID_M_PLBL22")); - m_pLbl13->SetBorderState(uiRect::BORDER_NONE); - m_pLbl13->GetUiRect().SetGradient(0); - m_pLbl13->SetForegroundColour(wxColour(255,255,255)); - m_pLbl13->SetBackgroundColour(wxColour(0,0,255)); - m_plblQoSPacketsMin = new wmLabel(pnlQoS, ID_M_PLBL23, wxEmptyString, wxPoint(5,136), wxSize(194,25), 0, _T("ID_M_PLBL23")); - m_plblQoSPacketsMin->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSPacketsMin->GetUiRect().SetGradient(0); - m_plblQoSPacketsMin->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSPacketsMin->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSPacketsMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSPacketsMin->SetFont(m_plblQoSPacketsMinFont); - m_plblQoSPacketsAv = new wmLabel(pnlQoS, ID_M_PLBL24, wxEmptyString, wxPoint(200,136), wxSize(199,25), 0, _T("ID_M_PLBL24")); - m_plblQoSPacketsAv->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSPacketsAv->GetUiRect().SetGradient(0); - m_plblQoSPacketsAv->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSPacketsAv->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSPacketsAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSPacketsAv->SetFont(m_plblQoSPacketsAvFont); - m_plblQoSPacketsMax = new wmLabel(pnlQoS, ID_M_PLBL25, wxEmptyString, wxPoint(400,136), wxSize(195,25), 0, _T("ID_M_PLBL25")); - m_plblQoSPacketsMax->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSPacketsMax->GetUiRect().SetGradient(0); - m_plblQoSPacketsMax->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSPacketsMax->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSPacketsMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSPacketsMax->SetFont(m_plblQoSPacketsMaxFont); - m_pLbl14 = new wmLabel(pnlQoS, ID_M_PLBL26, _("Inter Packet Gap Min"), wxPoint(5,170), wxSize(194,20), 0, _T("ID_M_PLBL26")); - m_pLbl14->SetBorderState(uiRect::BORDER_NONE); - m_pLbl14->GetUiRect().SetGradient(0); - m_pLbl14->SetForegroundColour(wxColour(255,255,255)); - m_pLbl14->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl15 = new wmLabel(pnlQoS, ID_M_PLBL27, _("Inter Packet Gap Average"), wxPoint(200,170), wxSize(199,20), 0, _T("ID_M_PLBL27")); - m_pLbl15->SetBorderState(uiRect::BORDER_NONE); - m_pLbl15->GetUiRect().SetGradient(0); - m_pLbl15->SetForegroundColour(wxColour(255,255,255)); - m_pLbl15->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl16 = new wmLabel(pnlQoS, ID_M_PLBL28, _("Inter Packet Gap Max"), wxPoint(400,170), wxSize(195,20), 0, _T("ID_M_PLBL28")); - m_pLbl16->SetBorderState(uiRect::BORDER_NONE); - m_pLbl16->GetUiRect().SetGradient(0); - m_pLbl16->SetForegroundColour(wxColour(255,255,255)); - m_pLbl16->SetBackgroundColour(wxColour(0,0,255)); - m_plblQoSInterMin = new wmLabel(pnlQoS, ID_M_PLBL29, wxEmptyString, wxPoint(5,191), wxSize(194,25), 0, _T("ID_M_PLBL29")); - m_plblQoSInterMin->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSInterMin->GetUiRect().SetGradient(0); - m_plblQoSInterMin->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSInterMin->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSInterMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSInterMin->SetFont(m_plblQoSInterMinFont); - m_plblQoSInterAv = new wmLabel(pnlQoS, ID_M_PLBL30, wxEmptyString, wxPoint(200,191), wxSize(199,25), 0, _T("ID_M_PLBL30")); - m_plblQoSInterAv->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSInterAv->GetUiRect().SetGradient(0); - m_plblQoSInterAv->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSInterAv->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSInterAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSInterAv->SetFont(m_plblQoSInterAvFont); - m_plblQoSInterMax = new wmLabel(pnlQoS, ID_M_PLBL31, wxEmptyString, wxPoint(400,191), wxSize(195,25), 0, _T("ID_M_PLBL31")); - m_plblQoSInterMax->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSInterMax->GetUiRect().SetGradient(0); - m_plblQoSInterMax->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSInterMax->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSInterMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSInterMax->SetFont(m_plblQoSInterMaxFont); - m_pLbl17 = new wmLabel(pnlQoS, ID_M_PLBL32, _("Jitter"), wxPoint(5,225), wxSize(194,20), 0, _T("ID_M_PLBL32")); - m_pLbl17->SetBorderState(uiRect::BORDER_NONE); - m_pLbl17->GetUiRect().SetGradient(0); - m_pLbl17->SetForegroundColour(wxColour(255,255,255)); - m_pLbl17->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl39 = new wmLabel(pnlQoS, ID_M_PLBL85, _("Current Graph"), wxPoint(400,225), wxSize(194,20), 0, _T("ID_M_PLBL85")); - m_pLbl39->SetBorderState(uiRect::BORDER_NONE); - m_pLbl39->GetUiRect().SetGradient(0); - m_pLbl39->SetForegroundColour(wxColour(255,255,255)); - m_pLbl39->SetBackgroundColour(wxColour(0,128,64)); - m_plblQoSJitter = new wmLabel(pnlQoS, ID_M_PLBL35, wxEmptyString, wxPoint(5,246), wxSize(194,25), 0, _T("ID_M_PLBL35")); - m_plblQoSJitter->SetBorderState(uiRect::BORDER_NONE); - m_plblQoSJitter->GetUiRect().SetGradient(0); - m_plblQoSJitter->SetForegroundColour(wxColour(0,128,0)); - m_plblQoSJitter->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblQoSJitterFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblQoSJitter->SetFont(m_plblQoSJitterFont); - m_pLbl45 = new wmLabel(pnlQoS, ID_M_PLBL89, _("TS-DF"), wxPoint(200,225), wxSize(194,20), 0, _T("ID_M_PLBL89")); - m_pLbl45->SetBorderState(uiRect::BORDER_NONE); - m_pLbl45->GetUiRect().SetGradient(0); - m_pLbl45->SetForegroundColour(wxColour(255,255,255)); - m_pLbl45->SetBackgroundColour(wxColour(0,0,255)); - m_plblTSDF = new wmLabel(pnlQoS, ID_M_PLBL90, wxEmptyString, wxPoint(200,246), wxSize(194,25), 0, _T("ID_M_PLBL90")); - m_plblTSDF->SetBorderState(uiRect::BORDER_NONE); - m_plblTSDF->GetUiRect().SetGradient(0); - m_plblTSDF->SetForegroundColour(wxColour(0,128,0)); - m_plblTSDF->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblTSDFFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblTSDF->SetFont(m_plblTSDFFont); - m_plblGraph = new wmLabel(pnlQoS, ID_M_PLBL86, wxEmptyString, wxPoint(400,246), wxSize(194,25), 0, _T("ID_M_PLBL86")); - m_plblGraph->SetBorderState(uiRect::BORDER_NONE); - m_plblGraph->GetUiRect().SetGradient(0); - m_plblGraph->SetForegroundColour(wxColour(0,128,0)); - m_plblGraph->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblGraphFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblGraph->SetFont(m_plblGraphFont); - Panel1 = new wxPanel(pnlQoS, ID_PANEL4, wxPoint(0,280), wxSize(600,160), wxTAB_TRAVERSAL, _T("ID_PANEL4")); - Panel1->SetBackgroundColour(wxColour(0,0,0)); - m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160)); - m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160)); - m_pHistogram->Show(false); - - pnlSDP = new wxPanel(m_pswpInfo, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); - pnlSDP->SetBackgroundColour(wxColour(0,0,0)); - m_pSdp = new wmListAdv(pnlSDP, wxNewId(), wxPoint(5,5), wxSize(590,435), 0, wmListAdv::SCROLL_VERTICAL, wxSize(-1,30), 1, wxSize(0,1)); - m_pSdp->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT)); - m_pSdp->SetBackgroundColour(*wxBLACK); - - m_pswpInfo->AddPage(pnlSession, _("Session"), false); - m_pswpInfo->AddPage(pnlSubsession, _("Active Subsession"), false); - m_pswpInfo->AddPage(pnlQoS, _("QoS"), false); - m_pswpInfo->AddPage(pnlSDP, _("Raw SDP"), false); - //*) + //(*Initialize(pnlAoIPInfo) + Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY")); + SetBackgroundColour(wxColour(0,0,0)); + m_pswpInfo = new wmSwitcherPanel(this, ID_M_PSWP1, wxDefaultPosition, wxSize(600,480), wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP1")); + m_pswpInfo->SetPageNameStyle(2); + m_pswpInfo->SetBackgroundColour(wxColour(0,0,0)); + pnlSession = new wxPanel(m_pswpInfo, pnlSessionInfo, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("pnlSessionInfo")); + pnlSession->SetBackgroundColour(wxColour(0,0,0)); + m_pLbl33 = new wmLabel(pnlSession, ID_M_PLBL59, _("Input"), wxPoint(5,10), wxSize(590,20), 0, _T("ID_M_PLBL59")); + m_pLbl33->SetBorderState(uiRect::BORDER_NONE); + m_pLbl33->GetUiRect().SetGradient(0); + m_pLbl33->SetForegroundColour(wxColour(255,255,255)); + m_pLbl33->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl20 = new wmLabel(pnlSession, ID_M_PLBL38, _("Name"), wxPoint(5,70), wxSize(394,20), 0, _T("ID_M_PLBL38")); + m_pLbl20->SetBorderState(uiRect::BORDER_NONE); + m_pLbl20->GetUiRect().SetGradient(0); + m_pLbl20->SetForegroundColour(wxColour(255,255,255)); + m_pLbl20->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl24 = new wmLabel(pnlSession, ID_M_PLBL40, _("Type"), wxPoint(400,70), wxSize(195,20), 0, _T("ID_M_PLBL40")); + m_pLbl24->SetBorderState(uiRect::BORDER_NONE); + m_pLbl24->GetUiRect().SetGradient(0); + m_pLbl24->SetForegroundColour(wxColour(255,255,255)); + m_pLbl24->SetBackgroundColour(wxColour(0,0,255)); + m_plblInput = new wmLabel(pnlSession, ID_M_PLBL60, wxEmptyString, wxPoint(5,31), wxSize(590,25), 0, _T("ID_M_PLBL60")); + m_plblInput->SetBorderState(uiRect::BORDER_NONE); + m_plblInput->GetUiRect().SetGradient(0); + m_plblInput->SetForegroundColour(wxColour(0,128,0)); + m_plblInput->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblInputFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblInput->SetFont(m_plblInputFont); + m_plblSessionName = new wmLabel(pnlSession, ID_M_PLBL41, wxEmptyString, wxPoint(5,91), wxSize(394,25), 0, _T("ID_M_PLBL41")); + m_plblSessionName->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionName->GetUiRect().SetGradient(0); + m_plblSessionName->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionName->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionNameFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionName->SetFont(m_plblSessionNameFont); + m_plblSessionType = new wmLabel(pnlSession, ID_M_PLBL43, wxEmptyString, wxPoint(400,91), wxSize(195,25), 0, _T("ID_M_PLBL43")); + m_plblSessionType->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionType->GetUiRect().SetGradient(0); + m_plblSessionType->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionType->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionType->SetFont(m_plblSessionTypeFont); + m_pLbl3 = new wmLabel(pnlSession, ID_M_PLBL3, _("Description"), wxPoint(5,130), wxSize(590,20), 0, _T("ID_M_PLBL3")); + m_pLbl3->SetBorderState(uiRect::BORDER_NONE); + m_pLbl3->GetUiRect().SetGradient(0); + m_pLbl3->SetForegroundColour(wxColour(255,255,255)); + m_pLbl3->SetBackgroundColour(wxColour(0,0,255)); + m_plblDescription = new wmLabel(pnlSession, ID_M_PLBL63, wxEmptyString, wxPoint(5,151), wxSize(590,25), 0, _T("ID_M_PLBL63")); + m_plblDescription->SetBorderState(uiRect::BORDER_NONE); + m_plblDescription->GetUiRect().SetGradient(0); + m_plblDescription->SetForegroundColour(wxColour(0,128,0)); + m_plblDescription->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblDescriptionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblDescription->SetFont(m_plblDescriptionFont); + m_pLbl19 = new wmLabel(pnlSession, ID_M_PLBL34, _("Domain"), wxPoint(540,200), wxSize(55,20), 0, _T("ID_M_PLBL34")); + m_pLbl19->SetBorderState(uiRect::BORDER_NONE); + m_pLbl19->GetUiRect().SetGradient(0); + m_pLbl19->SetForegroundColour(wxColour(255,255,255)); + m_pLbl19->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl18 = new wmLabel(pnlSession, ID_M_PLBL33, _("Version"), wxPoint(150,200), wxSize(189,20), 0, _T("ID_M_PLBL33")); + m_pLbl18->SetBorderState(uiRect::BORDER_NONE); + m_pLbl18->GetUiRect().SetGradient(0); + m_pLbl18->SetForegroundColour(wxColour(255,255,255)); + m_pLbl18->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl21 = new wmLabel(pnlSession, ID_M_PLBL36, _("Sync ID"), wxPoint(340,200), wxSize(199,20), 0, _T("ID_M_PLBL36")); + m_pLbl21->SetBorderState(uiRect::BORDER_NONE); + m_pLbl21->GetUiRect().SetGradient(0); + m_pLbl21->SetForegroundColour(wxColour(255,255,255)); + m_pLbl21->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl32 = new wmLabel(pnlSession, ID_M_PLBL58, _("Sync Type"), wxPoint(5,200), wxSize(144,20), 0, _T("ID_M_PLBL58")); + m_pLbl32->SetBorderState(uiRect::BORDER_NONE); + m_pLbl32->GetUiRect().SetGradient(0); + m_pLbl32->SetForegroundColour(wxColour(255,255,255)); + m_pLbl32->SetBackgroundColour(wxColour(0,0,255)); + m_plblSyncType = new wmLabel(pnlSession, ID_M_PLBL37, wxEmptyString, wxPoint(5,221), wxSize(144,25), 0, _T("ID_M_PLBL37")); + m_plblSyncType->SetBorderState(uiRect::BORDER_NONE); + m_plblSyncType->GetUiRect().SetGradient(0); + m_plblSyncType->SetForegroundColour(wxColour(0,128,0)); + m_plblSyncType->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSyncTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSyncType->SetFont(m_plblSyncTypeFont); + m_plblSyncVersion = new wmLabel(pnlSession, ID_M_PLBL64, wxEmptyString, wxPoint(150,221), wxSize(189,25), 0, _T("ID_M_PLBL64")); + m_plblSyncVersion->SetBorderState(uiRect::BORDER_NONE); + m_plblSyncVersion->GetUiRect().SetGradient(0); + m_plblSyncVersion->SetForegroundColour(wxColour(0,128,0)); + m_plblSyncVersion->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSyncVersionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSyncVersion->SetFont(m_plblSyncVersionFont); + m_plblSyncId = new wmLabel(pnlSession, ID_M_PLBL65, wxEmptyString, wxPoint(340,221), wxSize(199,25), 0, _T("ID_M_PLBL65")); + m_plblSyncId->SetBorderState(uiRect::BORDER_NONE); + m_plblSyncId->GetUiRect().SetGradient(0); + m_plblSyncId->SetForegroundColour(wxColour(0,128,0)); + m_plblSyncId->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSyncIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSyncId->SetFont(m_plblSyncIdFont); + m_plblSyncDomain = new wmLabel(pnlSession, ID_M_PLBL66, wxEmptyString, wxPoint(540,221), wxSize(55,25), 0, _T("ID_M_PLBL66")); + m_plblSyncDomain->SetBorderState(uiRect::BORDER_NONE); + m_plblSyncDomain->GetUiRect().SetGradient(0); + m_plblSyncDomain->SetForegroundColour(wxColour(0,128,0)); + m_plblSyncDomain->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSyncDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSyncDomain->SetFont(m_plblSyncDomainFont); + m_pLbl40 = new wmLabel(pnlSession, ID_M_PLBL75, _("Audio Subsessions"), wxPoint(5,300), wxSize(144,20), 0, _T("ID_M_PLBL75")); + m_pLbl40->SetBorderState(uiRect::BORDER_NONE); + m_pLbl40->GetUiRect().SetGradient(0); + m_pLbl40->SetForegroundColour(wxColour(255,255,255)); + m_pLbl40->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl42 = new wmLabel(pnlSession, ID_M_PLBL77, _("Duplicate Streams"), wxPoint(295,300), wxSize(144,20), 0, _T("ID_M_PLBL77")); + m_pLbl42->SetBorderState(uiRect::BORDER_NONE); + m_pLbl42->GetUiRect().SetGradient(0); + m_pLbl42->SetForegroundColour(wxColour(255,255,255)); + m_pLbl42->SetBackgroundColour(wxColour(0,0,255)); + m_plblSubsessionsAudio = new wmLabel(pnlSession, ID_M_PLBL78, wxEmptyString, wxPoint(5,321), wxSize(144,25), 0, _T("ID_M_PLBL78")); + m_plblSubsessionsAudio->SetBorderState(uiRect::BORDER_NONE); + m_plblSubsessionsAudio->GetUiRect().SetGradient(0); + m_plblSubsessionsAudio->SetForegroundColour(wxColour(0,128,0)); + m_plblSubsessionsAudio->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubsessionsAudioFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubsessionsAudio->SetFont(m_plblSubsessionsAudioFont); + m_plblGroups = new wmLabel(pnlSession, ID_M_PLBL80, wxEmptyString, wxPoint(295,321), wxSize(144,25), 0, _T("ID_M_PLBL80")); + m_plblGroups->SetBorderState(uiRect::BORDER_NONE); + m_plblGroups->GetUiRect().SetGradient(0); + m_plblGroups->SetForegroundColour(wxColour(0,128,0)); + m_plblGroups->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblGroupsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblGroups->SetFont(m_plblGroupsFont); + pnlSDP = new wxPanel(m_pswpInfo, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); + pnlSDP->SetBackgroundColour(wxColour(0,0,0)); + m_ptxtSDP = new wxTextCtrl(pnlSDP, ID_TEXTCTRL1, wxEmptyString, wxPoint(5,5), wxSize(590,435), wxTE_MULTILINE|wxTE_READONLY, wxDefaultValidator, _T("ID_TEXTCTRL1")); + m_pswpInfo->AddPage(pnlSession, _("Session"), false);x + m_pswpInfo->AddPage(pnlSDP, _("Raw SDP"), false); + //*) #ifdef PTPMONKEY @@ -741,49 +201,6 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID Connect(wxID_ANY, wxEVT_CLOCK_UPDATED, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); #endif // PTPMONKEY - m_plblEpoch = new wmLabel(pnlSubsession, wxNewId(), wxEmptyString, wxPoint(305,151), wxSize(249,25), 0, _T("ID_M_PLBL57")); - m_plblEpoch->SetBorderState(uiRect::BORDER_NONE); - m_plblEpoch->GetUiRect().SetGradient(0); - m_plblEpoch->SetForegroundColour(wxColour(0,128,0)); - m_plblEpoch->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblEpochFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblEpoch->SetFont(m_plblEpochFont); - - m_pswpInfo->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); - m_pGraph->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); - m_pHistogram->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); - - - ClearGraphs(); - - int nInterval = Settings::Get().Read(wxT("QoS"), wxT("Interval"), 1000)*1000; - m_pGraph->AddGraph(wxT("kBit/s"), wxColour(0,255,0), nInterval, false); - m_pHistogram->AddGraph(wxT("kBit/s"), wxColour(0,255,0), 0.1); - - - m_pGraph->AddGraph(wxT("TS-DF"), wxColour(255,255,255), nInterval, false); - m_pHistogram->AddGraph("TS-DF", wxColour(255,255,255), 1.0); - - m_pGraph->AddGraph(wxT("Packet Gap"), wxColour(0,0,255), nInterval, false); - m_pHistogram->AddGraph("Packet Gap", wxColour(0,0,255), 0.1); - - - m_pGraph->AddGraph(wxT("Packet Loss"), wxColour(255,0,0), nInterval, false); - m_pHistogram->AddGraph("Packet Loss", wxColour(255,0,0), 10.0); - - - m_pGraph->AddGraph(wxT("Jitter"), wxColour(255,255,0), nInterval, false); - m_pHistogram->AddGraph("Jitter", wxColour(255,255,0), 0.01); - - m_pGraph->AddGraph(wxT("Timestamp"), wxColour(0,0,255), nInterval, false); - m_pHistogram->AddGraph("Timestamp", wxColour(0,0,255), 1000); - - m_pGraph->AddGraph(wxT("Timestamp Errors"), wxColour(255,128,0), nInterval, false); - m_pHistogram->AddGraph("Timestamp Errors", wxColour(255,128,0), 10); - - m_pGraph->AddGraph(wxT("Slip"), wxColour(180,200,255), nInterval, false); - m_pHistogram->AddGraph("Slip", wxColour(180,200,255), 10); - //ConnectLeftUp(); @@ -828,68 +245,11 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) { if(pData) { - m_plblQoSTime->SetLabel(pData->tsTime.Format(wxT("%H:%M:%S:%l"))); - m_plblQoSKbAv->SetLabel(wxString::Format(wxT("%.2f [%.2f]"), pData->dkbits_per_second_Now, pData->dkbits_per_second_Av)); - m_plblQoSKbMax->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_max)); - m_plblQoSKbMin->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_min)); - m_plblQoSLost->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsLost)); - m_plblQoSPacketsAv->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_av)); - m_plblQoSPacketsMax->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_max)); - m_plblQoSPacketsMin->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_min)); - m_plblQoSReceived->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsReceived)); - - m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_min)); - m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_Now, pData->dInter_packet_gap_ms_av)); - m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); - - m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); - m_plblTSDF->SetLabel(wxString::Format(wxT("%.0f us"), pData->dTSDF)); - - wxDateTime dtSR(time_t(pData->tvLastSR_Time.tv_sec)); - dtSR.SetMillisecond(pData->tvLastSR_Time.tv_usec/1000); - - if(dtSR.IsValid()) - { - m_plblRTCP_Last->SetLabel(dtSR.Format("%H:%M:%S:%l")); - } - else - { - m_plblRTCP_Last->SetLabel(""); - } - - wxDateTime dtNTP(time_t(pData->tvSync.tv_sec)); - dtNTP.SetMillisecond(pData->tvSync.tv_usec/1000); - if(dtNTP.IsValid()) - { - m_plblRTCP_NTP->SetLabel(dtNTP.Format("%H:%M:%S:%l")); - } - else - { - m_plblRTCP_NTP->SetLabel(""); - } - - - m_pGraph->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); - m_pHistogram->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); - - m_pGraph->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); - m_pHistogram->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); - - m_pGraph->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); - m_pHistogram->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); - - m_pGraph->AddPeak(wxT("Jitter"), pData->dJitter); - m_pHistogram->AddPeak(wxT("Jitter"), pData->dJitter); - - if(pData->dTSDF >= 0.0) + auto itPanel = m_mQos.find(pData->nStream); + if(itPanel != m_mQos.end()) { - m_pGraph->AddPeak(wxT("TS-DF"), pData->dTSDF); - m_pHistogram->AddPeak(wxT("TS-DF"), pData->dTSDF); + itPanel->second->QoSUpdated(pData); } - m_pGraph->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); - m_pHistogram->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); - m_pGraph->AddPeak("Slip", m_dSlip); - m_pHistogram->AddPeak("Slip", m_dSlip); } } @@ -899,16 +259,16 @@ void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) SetTimestamp(pTimedBuffer->GetTransmissionTime(), m_plblTransmissionTime, false); SetTimestamp(pTimedBuffer->GetTimeVal(), m_plblTimestampIn); SetTimestamp(pTimedBuffer->GetPlaybackTime(), m_plblTimestampOut); - m_plblCurrentTimestamp->SetLabel(wxString::Format(wxT("%u"), pTimedBuffer->GetTimestamp())); + m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pTimedBuffer->GetTimestamp())); ShowLatency(pTimedBuffer); - m_plblFrameSize->SetLabel(wxString::Format(wxT("%u bytes"), pTimedBuffer->GetDuration())); + m_plblFrameSize->SetLabel(wxString::Format("%u bytes", pTimedBuffer->GetDuration())); m_dFrameDuration = static_cast(pTimedBuffer->GetDuration())/static_cast(m_nSampleRate*m_nFrameSize)*1e6; - m_plblFrameDuration->SetLabel(wxString::Format(wxT("%.2f us"), m_dFrameDuration)); + m_plblFrameDuration->SetLabel(wxString::Format("%.2f us", m_dFrameDuration)); - m_plblPlaybackQueue->SetLabel(wxString::Format(wxT("%u"), pTimedBuffer->GetBufferDepth())); + m_plblPlaybackQueue->SetLabel(wxString::Format("%u", pTimedBuffer->GetBufferDepth())); double dTimestamp(static_cast(pTimedBuffer->GetTimestamp())/4294967296.0); m_pGraph->AddPeak("Timestamp",dTimestamp);//static_cast(pTimedBuffer->GetTimestamp())/2e32); @@ -928,11 +288,11 @@ void pnlAoIPInfo::SetTimestamp(const timeval& tv, wmLabel* pLabel, bool bDate) wxDateTime dt(time_t(tv.tv_sec)); if(!bDate) { - pLabel->SetLabel(wxString::Format(wxT("%s:%03ld"), dt.Format(wxT("%H:%M:%S")).c_str(), tv.tv_usec/1000)); + pLabel->SetLabel(wxString::Format("%s:%03ld", dt.Format("%H:%M:%S").c_str(), tv.tv_usec/1000)); } else { - pLabel->SetLabel(wxString::Format(wxT("%s:%03ld"), dt.Format(wxT("%Y-%m-%d %H:%M:%S")).c_str(), tv.tv_usec/1000)); + pLabel->SetLabel(wxString::Format("%s:%03ld", dt.Format("%Y-%m-%d %H:%M:%S").c_str(), tv.tv_usec/1000)); } } @@ -947,8 +307,8 @@ void pnlAoIPInfo::ShowLatency(const timedbuffer* pTimedBuffer) m_dLatency = static_cast(tvLatency.tv_sec)*1000000.0 + static_cast(tvLatency.tv_usec); m_dLatency -= m_dFrameDuration; //we add the duration on because the transmission time is first sample not last sample of frane - m_plblLatency->SetLabel(wxString::Format(wxT("%.0f us"), dPlayback)); - m_plblLatencyNetwork->SetLabel(wxString::Format(wxT("%.0f us"), m_dLatency)); //@todo confirm that our latency calculation is back to front - hence the minus sign + m_plblLatency->SetLabel(wxString::Format("%.0f us", dPlayback)); + m_plblLatencyNetwork->SetLabel(wxString::Format("%.0f us", m_dLatency)); //@todo confirm that our latency calculation is back to front - hence the minus sign if(m_nInitialLatencyCounter < 3) { @@ -972,9 +332,9 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) { m_pSession = &aSession; m_plblSessionName->SetLabel(aSession.sName); - if(Settings::Get().Read(wxT("Input"), wxT("Type"), wxEmptyString) == wxT("AoIP")) + if(Settings::Get().Read("Input", "Type", wxEmptyString) == "AoIP") { - m_plblInput->SetLabel(Settings::Get().Read(wxT("Input"), wxT("AoIP"), wxEmptyString)); + m_plblInput->SetLabel(Settings::Get().Read("Input", "AoIP", wxEmptyString)); } else { @@ -984,8 +344,7 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) m_plblSyncVersion->SetLabel(aSession.refClock.sVersion); m_plblSyncId->SetLabel(aSession.refClock.sId); - - m_plblSyncDomain->SetLabel(wxString::Format(wxT("%lu"), aSession.refClock.nDomain)); + m_plblSyncDomain->SetLabel(wxString::Format("%lu", aSession.refClock.nDomain)); m_plblSessionType->SetLabel(aSession.sType); wxClientDC dc(this); @@ -998,117 +357,61 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) m_pSdp->AddElement(std::make_shared(dc, m_pSdp->GetClientRect().GetWidth(), asLines[i])); } - if(aSession.GetCurrentSubsession() != aSession.lstSubsession.end()) + //delete the old subsession pages + m_mQos.clear(); + m_mSubsessions.clear(); + for(size_t i = 0 ; i < m_pswpInfo->GetPageCount();) { - m_plblSubsessionId->SetLabel(aSession.GetCurrentSubsession()->sId); - m_plblSessionSource->SetLabel(aSession.GetCurrentSubsession()->sSourceAddress); - m_plblSessionBits->SetLabel(aSession.GetCurrentSubsession()->sCodec); - m_plblSessionFrequency->SetLabel(wxString::Format(wxT("%.1fkHz"), aSession.GetCurrentSubsession()->nSampleRate/1000.0)); - m_plblSessionChannels->SetLabel(wxString::Format(wxT("%u"), aSession.GetCurrentSubsession()->nChannels)); - - m_plblSyncTimestamp->SetLabel(wxString::Format(wxT("%u"), aSession.GetCurrentSubsession()->nSyncTimestamp)); - - m_nSampleRate = aSession.GetCurrentSubsession()->nSampleRate; - m_nFrameSize = min((unsigned int)256 ,aSession.GetCurrentSubsession()->nChannels); - if(aSession.GetCurrentSubsession()->sCodec == wxT("L24")) + if(m_pswpInfo->GetPageText(i).Before(':') == "Subsession" || m_pswpInfo->GetPageText(i).Before(':') == "QoS") { - m_nFrameSize*=3; - } - else if(aSession.GetCurrentSubsession()->sCodec == wxT("L16")) - { - m_nFrameSize*=2; - } - else if(aSession.GetCurrentSubsession()->sCodec == wxT("F32")) - { - m_nFrameSize*=4; - } - - m_plblSubSyncType->SetLabel(aSession.GetCurrentSubsession()->refClock.sType); - m_plblSubSyncVersion->SetLabel(aSession.GetCurrentSubsession()->refClock.sVersion); - m_plblSubSyncId->SetLabel(aSession.GetCurrentSubsession()->refClock.sId); - #ifdef PTPMONKEY - if(m_plblSubSyncId->GetLabel().MakeLower() == wxPtp::Get().GetMasterClockId(0)) - { - m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); + m_pswpInfo->DeletePage(i); } else { - m_plblSubSyncId->SetBackgroundColour(wxColour(255,100,100)); + ++i; } - #else - m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,100)); - #endif - m_plblSubSyncDomain->SetLabel(wxString::Format(wxT("%lu"), aSession.GetCurrentSubsession()->refClock.nDomain)); - - - - } - else - { - m_plblSessionSource->SetLabel(wxEmptyString); - m_plblSessionBits->SetLabel(wxEmptyString); - m_plblSessionFrequency->SetLabel(wxEmptyString); - m_plblSessionChannels->SetLabel(wxEmptyString); - m_plblSessionType->SetLabel(wxEmptyString); - m_plblSyncTimestamp->SetLabel(wxEmptyString); } unsigned int nAudio(0), nVideo(0); for(list::const_iterator itSub = aSession.lstSubsession.begin(); itSub != aSession.lstSubsession.end(); ++itSub) { - if(itSub->sMedium.CmpNoCase(wxT("audio")) == 0) + if(itSub->sMedium.CmpNoCase("audio") == 0) { nAudio++; } - else if(itSub->sMedium.CmpNoCase(wxT("video")) == 0) - { - nVideo++; - } } - m_plblSubsessionsAudio->SetLabel(wxString::Format(wxT("%u"), nAudio)); - m_plblSubsessionVideo->SetLabel(wxString::Format(wxT("%u"), nVideo)); + m_plblSubsessionsAudio->SetLabel(wxString::Format("%u", nAudio)); m_plblGroups->SetLabel(aSession.sGroups); -} + for(const auto& sub : aSession.lstSubsession) + { + auto pnlSub = new pnlSubsession(m_pswpInfo, wxNewId(), wxDefaultPosition, wxDefaultSize); + m_pswpInfo->AddPage(pnlSub, "Subsession: "+sub.sGroup, false); -void pnlAoIPInfo::ShowGraph(const wxString& sGraph) -{ - m_pGraph->HideAllGraphs(); - m_pGraph->ShowGraph(sGraph, true); - m_pHistogram->ShowGraph(sGraph); - m_plblGraph->SetLabel(sGraph); - m_sGraph = sGraph; -} + auto pnlQos = new pnlQoS(m_pswpInfo, wxNewId(), wxDefaultPosition, wxDefaultSize); + m_pswpInfo->AddPage(pnlQos, "QoS: "+sub.sGroup, false); + } -void pnlAoIPInfo::ClearGraphs() -{ - m_pGraph->ClearGraphs(); - m_pHistogram->ClearGraphs(); } + void pnlAoIPInfo::OnPtpEvent(wxCommandEvent& event) { #ifdef PTPMONKEY - if(m_plblSubSyncId->GetLabel().MakeLower() == wxPtp::Get().GetMasterClockId(0)) + if(m_plblSyncId->GetLabel().MakeLower() == wxPtp::Get().GetMasterClockId(0)) { - m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); + m_plblSyncId->SetBackgroundColour(wxColour(255,255,255)); } else { - m_plblSubSyncId->SetBackgroundColour(wxColour(255,100,100)); + m_plblSyncId->SetBackgroundColour(wxColour(255,100,100)); } #endif } -void pnlAoIPInfo::SetGraphType(const wxString& sType) -{ - m_pHistogram->Show(sType == "Histogram"); - m_pGraph->Show(sType != "Histogram"); - m_pGraph->ShowBarGraph(sType == "Bar Chart"); -} void pnlAoIPInfo::ChangeGranularity(int nWhich) { diff --git a/plugins/aoip info/pnlAoIPInfo.h b/plugins/aoip info/pnlAoIPInfo.h index af91157f..71b7b084 100644 --- a/plugins/aoip info/pnlAoIPInfo.h +++ b/plugins/aoip info/pnlAoIPInfo.h @@ -2,7 +2,6 @@ #define PNLAOIPINFO_H //(*Headers(pnlAoIPInfo) -#include "historygraph.h" #include "wmlabel.h" #include "wmswitcherpanel.h" #include @@ -13,6 +12,9 @@ #include "timedbuffer.h" #include "histogram.h" #include "wmlistadv.h" +#include "pnlSubsession.h" +#include "pnlQos.h"; +#include struct qosData; struct session; @@ -30,107 +32,34 @@ class pnlAoIPInfo: public wxPanel void ChangeResolution(int nWhich); //(*Declarations(pnlAoIPInfo) - HistoryGraph* m_pGraph; - wmLabel* m_pLbl10; - wmLabel* m_pLbl11; - wmLabel* m_pLbl12; - wmLabel* m_pLbl13; - wmLabel* m_pLbl14; - wmLabel* m_pLbl15; - wmLabel* m_pLbl16; - wmLabel* m_pLbl17; wmLabel* m_pLbl18; wmLabel* m_pLbl19; - wmLabel* m_pLbl1; wmLabel* m_pLbl20; wmLabel* m_pLbl21; - wmLabel* m_pLbl22; - wmLabel* m_pLbl23; wmLabel* m_pLbl24; - wmLabel* m_pLbl25; - wmLabel* m_pLbl26; - wmLabel* m_pLbl27; - wmLabel* m_pLbl28; - wmLabel* m_pLbl29; - wmLabel* m_pLbl2; - wmLabel* m_pLbl30; - wmLabel* m_pLbl31; wmLabel* m_pLbl32; wmLabel* m_pLbl33; - wmLabel* m_pLbl34; - wmLabel* m_pLbl35; - wmLabel* m_pLbl36; - wmLabel* m_pLbl37; - wmLabel* m_pLbl38; - wmLabel* m_pLbl39; wmLabel* m_pLbl3; wmLabel* m_pLbl40; - wmLabel* m_pLbl41; wmLabel* m_pLbl42; - wmLabel* m_pLbl43; - wmLabel* m_pLbl44; - wmLabel* m_pLbl45; - wmLabel* m_pLbl4; - wmLabel* m_pLbl5; - wmLabel* m_pLbl6; - wmLabel* m_pLbl7; - wmLabel* m_pLbl8; - wmLabel* m_pLbl9; - wmLabel* m_plblCurrentTimestamp; wmLabel* m_plblDescription; - wmLabel* m_plblFrameDuration; - wmLabel* m_plblFrameSize; - wmLabel* m_plblGraph; wmLabel* m_plblGroups; wmLabel* m_plblInput; - wmLabel* m_plblLatency; - wmLabel* m_plblLatencyNetwork; - wmLabel* m_plblPlaybackQueue; - wmLabel* m_plblQoSInterAv; - wmLabel* m_plblQoSInterMax; - wmLabel* m_plblQoSInterMin; - wmLabel* m_plblQoSJitter; - wmLabel* m_plblQoSKbAv; - wmLabel* m_plblQoSKbMax; - wmLabel* m_plblQoSKbMin; - wmLabel* m_plblQoSLost; - wmLabel* m_plblQoSPacketsAv; - wmLabel* m_plblQoSPacketsMax; - wmLabel* m_plblQoSPacketsMin; - wmLabel* m_plblQoSReceived; - wmLabel* m_plblQoSTime; - wmLabel* m_plblSessionBits; - wmLabel* m_plblSessionChannels; - wmLabel* m_plblSessionFrequency; wmLabel* m_plblSessionName; - wmLabel* m_plblSessionSource; wmLabel* m_plblSessionType; - wmLabel* m_plblSubSyncDomain; - wmLabel* m_plblSubSyncId; - wmLabel* m_plblSubSyncType; - wmLabel* m_plblSubSyncVersion; - wmLabel* m_plblSubsessionId; - wmLabel* m_plblSubsessionVideo; wmLabel* m_plblSubsessionsAudio; wmLabel* m_plblSyncDomain; wmLabel* m_plblSyncId; - wmLabel* m_plblSyncTimestamp; wmLabel* m_plblSyncType; wmLabel* m_plblSyncVersion; - wmLabel* m_plblTSDF; - wmLabel* m_plblTimestampIn; - wmLabel* m_plblTimestampOut; - wmLabel* m_plblTransmissionTime; wmSwitcherPanel* m_pswpInfo; - wxPanel* Panel1; - wxPanel* pnlQoS; wxPanel* pnlSDP; wxPanel* pnlSession; - wxPanel* pnlSubsession; + wxTextCtrl* m_ptxtSDP; //*) wmListAdv* m_pSdp; - Histogram* m_pHistogram; + wmLabel* m_plblEpoch; wmLabel* m_plblRTCP_Last; @@ -173,84 +102,10 @@ class pnlAoIPInfo: public wxPanel static const long ID_M_PLBL65; static const long ID_M_PLBL66; static const long ID_M_PLBL75; - static const long ID_M_PLBL76; static const long ID_M_PLBL77; static const long ID_M_PLBL78; - static const long ID_M_PLBL79; static const long ID_M_PLBL80; static const long pnlSessionInfo; - static const long ID_M_PLBL39; - static const long ID_M_PLBL42; - static const long ID_M_PLBL44; - static const long ID_M_PLBL47; - static const long ID_M_PLBL45; - static const long ID_M_PLBL48; - static const long ID_M_PLBL46; - static const long ID_M_PLBL62; - static const long ID_M_PLBL49; - static const long ID_M_PLBL84; - static const long ID_M_PLBL67; - static const long ID_M_PLBL68; - static const long ID_M_PLBL69; - static const long ID_M_PLBL70; - static const long ID_M_PLBL71; - static const long ID_M_PLBL72; - static const long ID_M_PLBL74; - static const long ID_M_PLBL73; - static const long ID_M_PLBL52; - static const long ID_M_PLBL54; - static const long ID_M_PLBL50; - static const long ID_M_PLBL55; - static const long ID_M_PLBL57; - static const long ID_M_PLBL51; - static const long ID_M_PLBL1; - static const long ID_M_PLBL53; - static const long ID_M_PLBL4; - static const long ID_M_PLBL61; - static const long ID_M_PLBL81; - static const long ID_M_PLBL87; - static const long ID_M_PLBL82; - static const long ID_M_PLBL83; - static const long ID_M_PLBL88; - static const long ID_M_PLBL6; - static const long ID_M_PLBL2; - static const long ID_M_PLBL56; - static const long ID_M_PLBL5; - static const long ID_M_PLBL7; - static const long ID_PANEL1; - static const long ID_M_PLBL8; - static const long ID_M_PLBL9; - static const long ID_M_PLBL10; - static const long ID_M_PLBL11; - static const long ID_M_PLBL13; - static const long ID_M_PLBL12; - static const long ID_M_PLBL14; - static const long ID_M_PLBL15; - static const long ID_M_PLBL16; - static const long ID_M_PLBL17; - static const long ID_M_PLBL18; - static const long ID_M_PLBL19; - static const long ID_M_PLBL20; - static const long ID_M_PLBL21; - static const long ID_M_PLBL22; - static const long ID_M_PLBL23; - static const long ID_M_PLBL24; - static const long ID_M_PLBL25; - static const long ID_M_PLBL26; - static const long ID_M_PLBL27; - static const long ID_M_PLBL28; - static const long ID_M_PLBL29; - static const long ID_M_PLBL30; - static const long ID_M_PLBL31; - static const long ID_M_PLBL32; - static const long ID_M_PLBL85; - static const long ID_M_PLBL35; - static const long ID_M_PLBL89; - static const long ID_M_PLBL90; - static const long ID_M_PLBL86; - static const long ID_CUSTOM12; - static const long ID_PANEL4; - static const long ID_PANEL2; static const long ID_TEXTCTRL1; static const long ID_PANEL3; static const long ID_M_PSWP1; @@ -288,6 +143,10 @@ class pnlAoIPInfo: public wxPanel double m_dLatency; enum {GRAPH_MIN=0, GRAPH_MAX}; + + std::map m_mSubsessions; + std::map m_mQos; + DECLARE_EVENT_TABLE() }; diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp new file mode 100644 index 00000000..b9a598d4 --- /dev/null +++ b/plugins/aoip info/pnlQos.cpp @@ -0,0 +1,447 @@ +#include "pnlQos.h" + +//(*InternalHeaders(pnlQos) +#include +#include +#include +//*) + +//(*IdInit(pnlQos) +const long pnlQos::ID_CUSTOM12 = wxNewId(); +const long pnlQos::ID_CUSTOM1 = wxNewId(); +const long pnlQos::ID_PANEL4 = wxNewId(); +const long pnlQos::ID_M_PLBL90 = wxNewId(); +const long pnlQos::ID_M_PBTN29 = wxNewId(); +const long pnlQos::ID_M_PBTN1 = wxNewId(); +const long pnlQos::ID_M_PBTN2 = wxNewId(); +const long pnlQos::ID_M_PBTN3 = wxNewId(); +const long pnlQos::ID_M_PLBL89 = wxNewId(); +const long pnlQos::ID_M_PLBL35 = wxNewId(); +const long pnlQos::ID_M_PLBL85 = wxNewId(); +const long pnlQos::ID_M_PLBL32 = wxNewId(); +const long pnlQos::ID_M_PLBL31 = wxNewId(); +const long pnlQos::ID_M_PLBL30 = wxNewId(); +const long pnlQos::ID_M_PLBL29 = wxNewId(); +const long pnlQos::ID_M_PLBL28 = wxNewId(); +const long pnlQos::ID_M_PLBL27 = wxNewId(); +const long pnlQos::ID_M_PLBL26 = wxNewId(); +const long pnlQos::ID_M_PLBL25 = wxNewId(); +const long pnlQos::ID_M_PLBL24 = wxNewId(); +const long pnlQos::ID_M_PLBL23 = wxNewId(); +const long pnlQos::ID_M_PLBL22 = wxNewId(); +const long pnlQos::ID_M_PLBL21 = wxNewId(); +const long pnlQos::ID_M_PLBL20 = wxNewId(); +const long pnlQos::ID_M_PLBL19 = wxNewId(); +const long pnlQos::ID_M_PLBL18 = wxNewId(); +const long pnlQos::ID_M_PLBL17 = wxNewId(); +const long pnlQos::ID_M_PLBL15 = wxNewId(); +const long pnlQos::ID_M_PLBL16 = wxNewId(); +const long pnlQos::ID_M_PLBL14 = wxNewId(); +const long pnlQos::ID_M_PLBL12 = wxNewId(); +const long pnlQos::ID_M_PLBL13 = wxNewId(); +const long pnlQos::ID_M_PLBL11 = wxNewId(); +const long pnlQos::ID_M_PLBL3 = wxNewId(); +const long pnlQos::ID_M_PLBL4 = wxNewId(); +const long pnlQos::ID_M_PLBL10 = wxNewId(); +const long pnlQos::ID_M_PLBL9 = wxNewId(); +const long pnlQos::ID_M_PLBL8 = wxNewId(); +const long pnlQos::ID_M_PLBL1 = wxNewId(); +const long pnlQos::ID_M_PLBL2 = wxNewId(); +//*) + +BEGIN_EVENT_TABLE(pnlQos,wxPanel) + //(*EventTable(pnlQos) + //*) +END_EVENT_TABLE() + +pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilder, wxWindowID id,const wxPoint& pos,const wxSize& size) : + m_sGroup(sGroup) +{ + //(*Initialize(pnlQos) + Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id")); + SetBackgroundColour(wxColour(0,0,0)); + Panel1 = new wxPanel(this, ID_PANEL4, wxPoint(0,280), wxSize(600,160), wxTAB_TRAVERSAL, _T("ID_PANEL4")); + Panel1->SetBackgroundColour(wxColour(0,0,0)); + m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160),1,10,0); + m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160),1,10,0); + m_plblTSDF = new wmLabel(this, ID_M_PLBL90, wxEmptyString, wxPoint(146,246), wxSize(109,25), 0, _T("ID_M_PLBL90")); + m_plblTSDF->SetBorderState(uiRect::BORDER_NONE); + m_plblTSDF->GetUiRect().SetGradient(0); + m_plblTSDF->SetForegroundColour(wxColour(0,128,0)); + m_plblTSDF->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblTSDFFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblTSDF->SetFont(m_plblTSDFFont); + m_pbtnCurrentGraph = new wmButton(this, ID_M_PBTN29, wxEmptyString, wxPoint(262,246), wxSize(150,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN29")); + m_pbtnCurrentGraph->SetForegroundColour(wxColour(0,128,0)); + m_pbtnCurrentGraph->SetBackgroundColour(wxColour(255,255,255)); + m_pbtnCurrentGraph->SetColourSelected(wxColour(wxT("#800000"))); + m_pbtnGraphType = new wmButton(this, ID_M_PBTN1, _("Line Graph"), wxPoint(413,246), wxSize(60,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN1")); + m_pbtnGraphType->SetForegroundColour(wxColour(0,128,0)); + m_pbtnGraphType->SetBackgroundColour(wxColour(255,255,255)); + m_pbtnGraphType->SetColourSelected(wxColour(wxT("#800000"))); + m_pbtnRange = new wmButton(this, ID_M_PBTN2, _("Range"), wxPoint(474,246), wxSize(60,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnRange->SetForegroundColour(wxColour(0,128,0)); + m_pbtnRange->SetBackgroundColour(wxColour(255,255,255)); + m_pbtnRange->SetColourSelected(wxColour(wxT("#800000"))); + m_pbtnClear = new wmButton(this, ID_M_PBTN3, _("Clear"), wxPoint(535,246), wxSize(60,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN3")); + m_pbtnClear->SetForegroundColour(wxColour(0,128,0)); + m_pbtnClear->SetBackgroundColour(wxColour(255,255,255)); + m_pbtnClear->SetColourSelected(wxColour(wxT("#800000"))); + m_pLbl45 = new wmLabel(this, ID_M_PLBL89, _("TS-DF"), wxPoint(146,225), wxSize(109,20), 0, _T("ID_M_PLBL89")); + m_pLbl45->SetBorderState(uiRect::BORDER_NONE); + m_pLbl45->GetUiRect().SetGradient(0); + m_pLbl45->SetForegroundColour(wxColour(255,255,255)); + m_pLbl45->SetBackgroundColour(wxColour(0,0,255)); + m_plblQoSJitter = new wmLabel(this, ID_M_PLBL35, wxEmptyString, wxPoint(5,246), wxSize(140,25), 0, _T("ID_M_PLBL35")); + m_plblQoSJitter->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSJitter->GetUiRect().SetGradient(0); + m_plblQoSJitter->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSJitter->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSJitterFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSJitter->SetFont(m_plblQoSJitterFont); + m_pLbl39 = new wmLabel(this, ID_M_PLBL85, _("Current Graph"), wxPoint(262,225), wxSize(333,20), 0, _T("ID_M_PLBL85")); + m_pLbl39->SetBorderState(uiRect::BORDER_NONE); + m_pLbl39->GetUiRect().SetGradient(0); + m_pLbl39->SetForegroundColour(wxColour(255,255,255)); + m_pLbl39->SetBackgroundColour(wxColour(0,128,64)); + m_pLbl17 = new wmLabel(this, ID_M_PLBL32, _("Jitter"), wxPoint(5,225), wxSize(140,20), 0, _T("ID_M_PLBL32")); + m_pLbl17->SetBorderState(uiRect::BORDER_NONE); + m_pLbl17->GetUiRect().SetGradient(0); + m_pLbl17->SetForegroundColour(wxColour(255,255,255)); + m_pLbl17->SetBackgroundColour(wxColour(0,0,255)); + m_plblQoSInterMax = new wmLabel(this, ID_M_PLBL31, wxEmptyString, wxPoint(400,191), wxSize(195,25), 0, _T("ID_M_PLBL31")); + m_plblQoSInterMax->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSInterMax->GetUiRect().SetGradient(0); + m_plblQoSInterMax->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSInterMax->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSInterMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSInterMax->SetFont(m_plblQoSInterMaxFont); + m_plblQoSInterAv = new wmLabel(this, ID_M_PLBL30, wxEmptyString, wxPoint(200,191), wxSize(199,25), 0, _T("ID_M_PLBL30")); + m_plblQoSInterAv->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSInterAv->GetUiRect().SetGradient(0); + m_plblQoSInterAv->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSInterAv->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSInterAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSInterAv->SetFont(m_plblQoSInterAvFont); + m_plblQoSInterMin = new wmLabel(this, ID_M_PLBL29, wxEmptyString, wxPoint(5,191), wxSize(194,25), 0, _T("ID_M_PLBL29")); + m_plblQoSInterMin->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSInterMin->GetUiRect().SetGradient(0); + m_plblQoSInterMin->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSInterMin->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSInterMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSInterMin->SetFont(m_plblQoSInterMinFont); + m_pLbl16 = new wmLabel(this, ID_M_PLBL28, _("Inter Packet Gap Max"), wxPoint(400,170), wxSize(195,20), 0, _T("ID_M_PLBL28")); + m_pLbl16->SetBorderState(uiRect::BORDER_NONE); + m_pLbl16->GetUiRect().SetGradient(0); + m_pLbl16->SetForegroundColour(wxColour(255,255,255)); + m_pLbl16->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl15 = new wmLabel(this, ID_M_PLBL27, _("Inter Packet Gap Average"), wxPoint(200,170), wxSize(199,20), 0, _T("ID_M_PLBL27")); + m_pLbl15->SetBorderState(uiRect::BORDER_NONE); + m_pLbl15->GetUiRect().SetGradient(0); + m_pLbl15->SetForegroundColour(wxColour(255,255,255)); + m_pLbl15->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl14 = new wmLabel(this, ID_M_PLBL26, _("Inter Packet Gap Min"), wxPoint(5,170), wxSize(194,20), 0, _T("ID_M_PLBL26")); + m_pLbl14->SetBorderState(uiRect::BORDER_NONE); + m_pLbl14->GetUiRect().SetGradient(0); + m_pLbl14->SetForegroundColour(wxColour(255,255,255)); + m_pLbl14->SetBackgroundColour(wxColour(0,0,255)); + m_plblQoSPacketsMax = new wmLabel(this, ID_M_PLBL25, wxEmptyString, wxPoint(400,136), wxSize(195,25), 0, _T("ID_M_PLBL25")); + m_plblQoSPacketsMax->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSPacketsMax->GetUiRect().SetGradient(0); + m_plblQoSPacketsMax->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSPacketsMax->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSPacketsMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSPacketsMax->SetFont(m_plblQoSPacketsMaxFont); + m_plblQoSPacketsAv = new wmLabel(this, ID_M_PLBL24, wxEmptyString, wxPoint(200,136), wxSize(199,25), 0, _T("ID_M_PLBL24")); + m_plblQoSPacketsAv->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSPacketsAv->GetUiRect().SetGradient(0); + m_plblQoSPacketsAv->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSPacketsAv->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSPacketsAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSPacketsAv->SetFont(m_plblQoSPacketsAvFont); + m_plblQoSPacketsMin = new wmLabel(this, ID_M_PLBL23, wxEmptyString, wxPoint(5,136), wxSize(194,25), 0, _T("ID_M_PLBL23")); + m_plblQoSPacketsMin->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSPacketsMin->GetUiRect().SetGradient(0); + m_plblQoSPacketsMin->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSPacketsMin->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSPacketsMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSPacketsMin->SetFont(m_plblQoSPacketsMinFont); + m_pLbl13 = new wmLabel(this, ID_M_PLBL22, _("Packets Lost/s Max"), wxPoint(400,115), wxSize(195,20), 0, _T("ID_M_PLBL22")); + m_pLbl13->SetBorderState(uiRect::BORDER_NONE); + m_pLbl13->GetUiRect().SetGradient(0); + m_pLbl13->SetForegroundColour(wxColour(255,255,255)); + m_pLbl13->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl12 = new wmLabel(this, ID_M_PLBL21, _("Packets Lost/s Average"), wxPoint(200,115), wxSize(199,20), 0, _T("ID_M_PLBL21")); + m_pLbl12->SetBorderState(uiRect::BORDER_NONE); + m_pLbl12->GetUiRect().SetGradient(0); + m_pLbl12->SetForegroundColour(wxColour(255,255,255)); + m_pLbl12->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl11 = new wmLabel(this, ID_M_PLBL20, _("Packets Lost/s Min"), wxPoint(5,115), wxSize(194,20), 0, _T("ID_M_PLBL20")); + m_pLbl11->SetBorderState(uiRect::BORDER_NONE); + m_pLbl11->GetUiRect().SetGradient(0); + m_pLbl11->SetForegroundColour(wxColour(255,255,255)); + m_pLbl11->SetBackgroundColour(wxColour(0,0,255)); + m_plblQoSKbMax = new wmLabel(this, ID_M_PLBL19, wxEmptyString, wxPoint(400,81), wxSize(195,25), 0, _T("ID_M_PLBL19")); + m_plblQoSKbMax->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSKbMax->GetUiRect().SetGradient(0); + m_plblQoSKbMax->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSKbMax->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSKbMaxFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSKbMax->SetFont(m_plblQoSKbMaxFont); + m_plblQoSKbAv = new wmLabel(this, ID_M_PLBL18, wxEmptyString, wxPoint(200,81), wxSize(199,25), 0, _T("ID_M_PLBL18")); + m_plblQoSKbAv->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSKbAv->GetUiRect().SetGradient(0); + m_plblQoSKbAv->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSKbAv->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSKbAvFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSKbAv->SetFont(m_plblQoSKbAvFont); + m_plblQoSKbMin = new wmLabel(this, ID_M_PLBL17, wxEmptyString, wxPoint(5,81), wxSize(194,25), 0, _T("ID_M_PLBL17")); + m_plblQoSKbMin->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSKbMin->GetUiRect().SetGradient(0); + m_plblQoSKbMin->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSKbMin->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSKbMinFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSKbMin->SetFont(m_plblQoSKbMinFont); + m_pLbl9 = new wmLabel(this, ID_M_PLBL15, _("kBits/s Average"), wxPoint(200,60), wxSize(199,20), 0, _T("ID_M_PLBL15")); + m_pLbl9->SetBorderState(uiRect::BORDER_NONE); + m_pLbl9->GetUiRect().SetGradient(0); + m_pLbl9->SetForegroundColour(wxColour(255,255,255)); + m_pLbl9->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl10 = new wmLabel(this, ID_M_PLBL16, _("kBits/s Max"), wxPoint(400,60), wxSize(195,20), 0, _T("ID_M_PLBL16")); + m_pLbl10->SetBorderState(uiRect::BORDER_NONE); + m_pLbl10->GetUiRect().SetGradient(0); + m_pLbl10->SetForegroundColour(wxColour(255,255,255)); + m_pLbl10->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl8 = new wmLabel(this, ID_M_PLBL14, _("kBits/s Min"), wxPoint(5,60), wxSize(194,20), 0, _T("ID_M_PLBL14")); + m_pLbl8->SetBorderState(uiRect::BORDER_NONE); + m_pLbl8->GetUiRect().SetGradient(0); + m_pLbl8->SetForegroundColour(wxColour(255,255,255)); + m_pLbl8->SetBackgroundColour(wxColour(0,0,255)); + m_plblQoSLost = new wmLabel(this, ID_M_PLBL12, wxEmptyString, wxPoint(500,26), wxSize(100,25), 0, _T("ID_M_PLBL12")); + m_plblQoSLost->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSLost->GetUiRect().SetGradient(0); + m_plblQoSLost->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSLost->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSLostFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSLost->SetFont(m_plblQoSLostFont); + m_plblQoSReceived = new wmLabel(this, ID_M_PLBL13, wxEmptyString, wxPoint(400,26), wxSize(99,25), 0, _T("ID_M_PLBL13")); + m_plblQoSReceived->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSReceived->GetUiRect().SetGradient(0); + m_plblQoSReceived->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSReceived->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSReceivedFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSReceived->SetFont(m_plblQoSReceivedFont); + m_plblQoSTime = new wmLabel(this, ID_M_PLBL11, wxEmptyString, wxPoint(5,26), wxSize(132,25), 0, _T("ID_M_PLBL11")); + m_plblQoSTime->SetBorderState(uiRect::BORDER_NONE); + m_plblQoSTime->GetUiRect().SetGradient(0); + m_plblQoSTime->SetForegroundColour(wxColour(0,128,0)); + m_plblQoSTime->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblQoSTimeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblQoSTime->SetFont(m_plblQoSTimeFont); + m_plblRTCP_Last = new wmLabel(this, ID_M_PLBL3, wxEmptyString, wxPoint(138,26), wxSize(130,25), 0, _T("ID_M_PLBL3")); + m_plblRTCP_Last->SetBorderState(uiRect::BORDER_NONE); + m_plblRTCP_Last->GetUiRect().SetGradient(0); + m_plblRTCP_Last->SetForegroundColour(wxColour(0,128,0)); + m_plblRTCP_Last->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblRTCP_LastFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblRTCP_Last->SetFont(m_plblRTCP_LastFont); + m_plblRTCP_NTP = new wmLabel(this, ID_M_PLBL4, wxEmptyString, wxPoint(269,26), wxSize(132,25), 0, _T("ID_M_PLBL4")); + m_plblRTCP_NTP->SetBorderState(uiRect::BORDER_NONE); + m_plblRTCP_NTP->GetUiRect().SetGradient(0); + m_plblRTCP_NTP->SetForegroundColour(wxColour(0,128,0)); + m_plblRTCP_NTP->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblRTCP_NTPFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblRTCP_NTP->SetFont(m_plblRTCP_NTPFont); + m_pLbl7 = new wmLabel(this, ID_M_PLBL10, _("Packets Lost"), wxPoint(500,5), wxSize(100,20), 0, _T("ID_M_PLBL10")); + m_pLbl7->SetBorderState(uiRect::BORDER_NONE); + m_pLbl7->GetUiRect().SetGradient(0); + m_pLbl7->SetForegroundColour(wxColour(255,255,255)); + m_pLbl7->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl6 = new wmLabel(this, ID_M_PLBL9, _("Total Packets"), wxPoint(400,5), wxSize(99,20), 0, _T("ID_M_PLBL9")); + m_pLbl6->SetBorderState(uiRect::BORDER_NONE); + m_pLbl6->GetUiRect().SetGradient(0); + m_pLbl6->SetForegroundColour(wxColour(255,255,255)); + m_pLbl6->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl5 = new wmLabel(this, ID_M_PLBL8, _("QoS Time"), wxPoint(5,5), wxSize(132,20), 0, _T("ID_M_PLBL8")); + m_pLbl5->SetBorderState(uiRect::BORDER_NONE); + m_pLbl5->GetUiRect().SetGradient(0); + m_pLbl5->SetForegroundColour(wxColour(255,255,255)); + m_pLbl5->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl1 = new wmLabel(this, ID_M_PLBL1, _("Last SR"), wxPoint(138,5), wxSize(130,20), 0, _T("ID_M_PLBL1")); + m_pLbl1->SetBorderState(uiRect::BORDER_NONE); + m_pLbl1->GetUiRect().SetGradient(0); + m_pLbl1->SetForegroundColour(wxColour(255,255,255)); + m_pLbl1->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl2 = new wmLabel(this, ID_M_PLBL2, _("SR NTP"), wxPoint(269,5), wxSize(130,20), 0, _T("ID_M_PLBL2")); + m_pLbl2->SetBorderState(uiRect::BORDER_NONE); + m_pLbl2->GetUiRect().SetGradient(0); + m_pLbl2->SetForegroundColour(wxColour(255,255,255)); + m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); + + Connect(ID_M_PBTN2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlQos::OnbtnRangeClick); + Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlQos::OnbtnClearClick); + //*) + + + + m_pswpInfo->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); + m_pGraph->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); + m_pHistogram->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); + + + ClearGraphs(); + + int nInterval = Settings::Get().Read(wxT("QoS"), wxT("Interval"), 1000)*1000; + m_pGraph->AddGraph(wxT("kBit/s"), wxColour(0,255,0), nInterval, false); + m_pHistogram->AddGraph(wxT("kBit/s"), wxColour(0,255,0), 0.1); + + + m_pGraph->AddGraph(wxT("TS-DF"), wxColour(255,255,255), nInterval, false); + m_pHistogram->AddGraph("TS-DF", wxColour(255,255,255), 1.0); + + m_pGraph->AddGraph(wxT("Packet Gap"), wxColour(0,0,255), nInterval, false); + m_pHistogram->AddGraph("Packet Gap", wxColour(0,0,255), 0.1); + + + m_pGraph->AddGraph(wxT("Packet Loss"), wxColour(255,0,0), nInterval, false); + m_pHistogram->AddGraph("Packet Loss", wxColour(255,0,0), 10.0); + + + m_pGraph->AddGraph(wxT("Jitter"), wxColour(255,255,0), nInterval, false); + m_pHistogram->AddGraph("Jitter", wxColour(255,255,0), 0.01); + + m_pGraph->AddGraph(wxT("Timestamp"), wxColour(0,0,255), nInterval, false); + m_pHistogram->AddGraph("Timestamp", wxColour(0,0,255), 1000); + + m_pGraph->AddGraph(wxT("Timestamp Errors"), wxColour(255,128,0), nInterval, false); + m_pHistogram->AddGraph("Timestamp Errors", wxColour(255,128,0), 10); + + m_pGraph->AddGraph(wxT("Slip"), wxColour(180,200,255), nInterval, false); + m_pHistogram->AddGraph("Slip", wxColour(180,200,255), 10); + + + m_pbtnCurrentGraph->SetPopup({"kBit/s", "Packet Gap", "Packet Loss", "Jitter", "Timestamp", "Timestamp Errors", "TS-DF", "Slip"}); + m_pbtnCurrentGraph->ConnectToSetting(m_pBuilder->GetSection(), "Graph_"+sGroup, "kBit/s"); + + m_pbtnGraphType->SetPopup({"Line Graph", "Bar Chart", "Histogram"}); + m_pbtnGraphType->ConnectToSetting(m_pBuilder->GetSection(), "GraphType_"+sGroup, "kBit/s"); + + pBuilder->RegisterForSettingsUpdates(this, "Graph_"+sGroup); + pBuilder->RegisterForSettingsUpdates(this, "GraphType_"+sGroup); + + Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&pnlQos::OnSettingChanged); +} + +pnlQos::~pnlQos() +{ + //(*Destroy(pnlQos) + //*) +} + +void pnlQos::QoSUpdated(qosData* pData) +{ + m_plblQoSTime->SetLabel(pData->tsTime.Format(wxT("%H:%M:%S:%l"))); + m_plblQoSKbAv->SetLabel(wxString::Format(wxT("%.2f [%.2f]"), pData->dkbits_per_second_Now, pData->dkbits_per_second_Av)); + m_plblQoSKbMax->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_max)); + m_plblQoSKbMin->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_min)); + m_plblQoSLost->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsLost)); + m_plblQoSPacketsAv->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_av)); + m_plblQoSPacketsMax->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_max)); + m_plblQoSPacketsMin->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_min)); + m_plblQoSReceived->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsReceived)); + + m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_min)); + m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_Now, pData->dInter_packet_gap_ms_av)); + m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); + + m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); + m_plblTSDF->SetLabel(wxString::Format(wxT("%.0f us"), pData->dTSDF)); + + wxDateTime dtSR(time_t(pData->tvLastSR_Time.tv_sec)); + dtSR.SetMillisecond(pData->tvLastSR_Time.tv_usec/1000); + + if(dtSR.IsValid()) + { + m_plblRTCP_Last->SetLabel(dtSR.Format("%H:%M:%S:%l")); + } + else + { + m_plblRTCP_Last->SetLabel(""); + } + + wxDateTime dtNTP(time_t(pData->tvSync.tv_sec)); + dtNTP.SetMillisecond(pData->tvSync.tv_usec/1000); + if(dtNTP.IsValid()) + { + m_plblRTCP_NTP->SetLabel(dtNTP.Format("%H:%M:%S:%l")); + } + else + { + m_plblRTCP_NTP->SetLabel(""); + } + + + m_pGraph->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); + m_pHistogram->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); + + m_pGraph->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); + m_pHistogram->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); + + m_pGraph->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); + m_pHistogram->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); + + m_pGraph->AddPeak(wxT("Jitter"), pData->dJitter); + m_pHistogram->AddPeak(wxT("Jitter"), pData->dJitter); + + if(pData->dTSDF >= 0.0) + { + m_pGraph->AddPeak(wxT("TS-DF"), pData->dTSDF); + m_pHistogram->AddPeak(wxT("TS-DF"), pData->dTSDF); + } + m_pGraph->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); + m_pHistogram->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); + m_pGraph->AddPeak("Slip", m_dSlip); + m_pHistogram->AddPeak("Slip", m_dSlip); +} + +void pnlQos::OnbtnRangeClick(wxCommandEvent& event) +{ + m_pGraph->RecalculateRange(m_sGraph); +} + +void pnlQos::OnbtnClearClick(wxCommandEvent& event) +{ + m_pGraph->ClearGraphs(); + m_pHistogram->ClearGraphs(); +} + +void pnlQos::ShowGraph(const wxString& sGraph) +{ + m_pGraph->HideAllGraphs(); + m_pGraph->ShowGraph(sGraph, true); + m_pHistogram->ShowGraph(sGraph); + + m_pbtnCurrentGraph->SetLabel(sGraph); + m_sGraph = sGraph; +} + +void pnlQos::SetGraphType(const wxString& sType) +{ + m_pHistogram->Show(sType == "Histogram"); + m_pGraph->Show(sType != "Histogram"); + m_pGraph->ShowBarGraph(sType == "Bar Chart"); + + m_pbtnGraphType->SetLabel(sType); +} + +void pnlQos::OnSettingChanged(SettingEvent& event) +{ + if(event.GetKey() == "Graph_"+sGroup) + { + ShowGraph(event.GetValue()); + } + else if(event.GetKey() == "GraphType_"+sGroup) + { + ShowGraphType(event.GetValue()); + } +} diff --git a/plugins/aoip info/pnlQos.h b/plugins/aoip info/pnlQos.h new file mode 100644 index 00000000..809af6f9 --- /dev/null +++ b/plugins/aoip info/pnlQos.h @@ -0,0 +1,129 @@ +#ifndef PNLQOS_H +#define PNLQOS_H + +//(*Headers(pnlQos) +#include "histogram.h" +#include "historygraph.h" +#include "wmbutton.h" +#include "wmlabel.h" +#include +//*) + +class SettingEvent; + +class pnlQos: public wxPanel +{ + public: + + pnlQos(wxWindow* parent, const wxString& sGroup, AoIPInfoBuilder* pBuilder, wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize); + virtual ~pnlQos(); + + //(*Declarations(pnlQos) + Histogram* m_pHistogram; + HistoryGraph* m_pGraph; + wmButton* m_pbtnClear; + wmButton* m_pbtnCurrentGraph; + wmButton* m_pbtnGraphType; + wmButton* m_pbtnRange; + wmLabel* m_pLbl10; + wmLabel* m_pLbl11; + wmLabel* m_pLbl12; + wmLabel* m_pLbl13; + wmLabel* m_pLbl14; + wmLabel* m_pLbl15; + wmLabel* m_pLbl16; + wmLabel* m_pLbl17; + wmLabel* m_pLbl1; + wmLabel* m_pLbl2; + wmLabel* m_pLbl39; + wmLabel* m_pLbl45; + wmLabel* m_pLbl5; + wmLabel* m_pLbl6; + wmLabel* m_pLbl7; + wmLabel* m_pLbl8; + wmLabel* m_pLbl9; + wmLabel* m_plblQoSInterAv; + wmLabel* m_plblQoSInterMax; + wmLabel* m_plblQoSInterMin; + wmLabel* m_plblQoSJitter; + wmLabel* m_plblQoSKbAv; + wmLabel* m_plblQoSKbMax; + wmLabel* m_plblQoSKbMin; + wmLabel* m_plblQoSLost; + wmLabel* m_plblQoSPacketsAv; + wmLabel* m_plblQoSPacketsMax; + wmLabel* m_plblQoSPacketsMin; + wmLabel* m_plblQoSReceived; + wmLabel* m_plblQoSTime; + wmLabel* m_plblRTCP_Last; + wmLabel* m_plblRTCP_NTP; + wmLabel* m_plblTSDF; + wxPanel* Panel1; + //*) + + protected: + + //(*Identifiers(pnlQos) + static const long ID_CUSTOM12; + static const long ID_CUSTOM1; + static const long ID_PANEL4; + static const long ID_M_PLBL90; + static const long ID_M_PBTN29; + static const long ID_M_PBTN1; + static const long ID_M_PBTN2; + static const long ID_M_PBTN3; + static const long ID_M_PLBL89; + static const long ID_M_PLBL35; + static const long ID_M_PLBL85; + static const long ID_M_PLBL32; + static const long ID_M_PLBL31; + static const long ID_M_PLBL30; + static const long ID_M_PLBL29; + static const long ID_M_PLBL28; + static const long ID_M_PLBL27; + static const long ID_M_PLBL26; + static const long ID_M_PLBL25; + static const long ID_M_PLBL24; + static const long ID_M_PLBL23; + static const long ID_M_PLBL22; + static const long ID_M_PLBL21; + static const long ID_M_PLBL20; + static const long ID_M_PLBL19; + static const long ID_M_PLBL18; + static const long ID_M_PLBL17; + static const long ID_M_PLBL15; + static const long ID_M_PLBL16; + static const long ID_M_PLBL14; + static const long ID_M_PLBL12; + static const long ID_M_PLBL13; + static const long ID_M_PLBL11; + static const long ID_M_PLBL3; + static const long ID_M_PLBL4; + static const long ID_M_PLBL10; + static const long ID_M_PLBL9; + static const long ID_M_PLBL8; + static const long ID_M_PLBL1; + static const long ID_M_PLBL2; + //*) + + void QoSUpdated(qosData* pData); + void ShowGraph(const wxString& sGraph); + void SetGraphType(const wxString& sType); + + private: + + //(*Handlers(pnlQos) + void OnbtnRangeClick(wxCommandEvent& event); + void OnbtnClearClick(wxCommandEvent& event); + //*) + + void OnSettingChanged(SettingEvent& event); + + wxString m_sGroup; + wxString m_sGraph; + + + DECLARE_EVENT_TABLE() +}; + +#endif diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp new file mode 100644 index 00000000..23b16a3d --- /dev/null +++ b/plugins/aoip info/pnlSubsession.cpp @@ -0,0 +1,352 @@ +#include "pnlSubsession.h" + +//(*InternalHeaders(pnlSubsession) +#include +#include +#include +//*) + +//(*IdInit(pnlSubsession) +const long pnlSubsession::ID_M_PLBL39 = wxNewId(); +const long pnlSubsession::ID_M_PLBL42 = wxNewId(); +const long pnlSubsession::ID_M_PLBL44 = wxNewId(); +const long pnlSubsession::ID_M_PLBL47 = wxNewId(); +const long pnlSubsession::ID_M_PLBL45 = wxNewId(); +const long pnlSubsession::ID_M_PLBL48 = wxNewId(); +const long pnlSubsession::ID_M_PLBL46 = wxNewId(); +const long pnlSubsession::ID_M_PLBL62 = wxNewId(); +const long pnlSubsession::ID_M_PLBL49 = wxNewId(); +const long pnlSubsession::ID_M_PLBL84 = wxNewId(); +const long pnlSubsession::ID_M_PLBL67 = wxNewId(); +const long pnlSubsession::ID_M_PLBL68 = wxNewId(); +const long pnlSubsession::ID_M_PLBL69 = wxNewId(); +const long pnlSubsession::ID_M_PLBL70 = wxNewId(); +const long pnlSubsession::ID_M_PLBL71 = wxNewId(); +const long pnlSubsession::ID_M_PLBL72 = wxNewId(); +const long pnlSubsession::ID_M_PLBL74 = wxNewId(); +const long pnlSubsession::ID_M_PLBL73 = wxNewId(); +const long pnlSubsession::ID_M_PLBL52 = wxNewId(); +const long pnlSubsession::ID_M_PLBL54 = wxNewId(); +const long pnlSubsession::ID_M_PLBL3 = wxNewId(); +const long pnlSubsession::ID_M_PLBL50 = wxNewId(); +const long pnlSubsession::ID_M_PLBL55 = wxNewId(); +const long pnlSubsession::ID_M_PLBL57 = wxNewId(); +const long pnlSubsession::ID_M_PLBL6 = wxNewId(); +const long pnlSubsession::ID_M_PLBL51 = wxNewId(); +const long pnlSubsession::ID_M_PLBL1 = wxNewId(); +const long pnlSubsession::ID_M_PLBL53 = wxNewId(); +const long pnlSubsession::ID_M_PLBL4 = wxNewId(); +const long pnlSubsession::ID_M_PLBL61 = wxNewId(); +const long pnlSubsession::ID_M_PLBL81 = wxNewId(); +const long pnlSubsession::ID_M_PLBL82 = wxNewId(); +const long pnlSubsession::ID_M_PLBL83 = wxNewId(); +const long pnlSubsession::ID_M_PLBL2 = wxNewId(); +const long pnlSubsession::ID_M_PLBL56 = wxNewId(); +const long pnlSubsession::ID_M_PLBL5 = wxNewId(); +//*) + +BEGIN_EVENT_TABLE(pnlSubsession,wxPanel) + //(*EventTable(pnlSubsession) + //*) +END_EVENT_TABLE() + +pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID id,const wxPoint& pos,const wxSize& size) +{ + //(*Initialize(pnlSubsession) + Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id")); + SetBackgroundColour(wxColour(0,0,0)); + m_pLbl23 = new wmLabel(this, ID_M_PLBL39, _("Source"), wxPoint(5,10), wxSize(199,20), 0, _T("ID_M_PLBL39")); + m_pLbl23->SetBorderState(uiRect::BORDER_NONE); + m_pLbl23->GetUiRect().SetGradient(0); + m_pLbl23->SetForegroundColour(wxColour(255,255,255)); + m_pLbl23->SetBackgroundColour(wxColour(0,0,255)); + m_plblSessionSource = new wmLabel(this, ID_M_PLBL42, wxEmptyString, wxPoint(5,31), wxSize(199,25), 0, _T("ID_M_PLBL42")); + m_plblSessionSource->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionSource->GetUiRect().SetGradient(0); + m_plblSessionSource->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionSource->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionSourceFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionSource->SetFont(m_plblSessionSourceFont); + m_pLbl25 = new wmLabel(this, ID_M_PLBL44, _("Codec"), wxPoint(205,10), wxSize(74,20), 0, _T("ID_M_PLBL44")); + m_pLbl25->SetBorderState(uiRect::BORDER_NONE); + m_pLbl25->GetUiRect().SetGradient(0); + m_pLbl25->SetForegroundColour(wxColour(255,255,255)); + m_pLbl25->SetBackgroundColour(wxColour(0,0,255)); + m_plblSessionBits = new wmLabel(this, ID_M_PLBL47, wxEmptyString, wxPoint(205,31), wxSize(74,25), 0, _T("ID_M_PLBL47")); + m_plblSessionBits->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionBits->GetUiRect().SetGradient(0); + m_plblSessionBits->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionBits->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionBitsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionBits->SetFont(m_plblSessionBitsFont); + m_pLbl26 = new wmLabel(this, ID_M_PLBL45, _("Freq"), wxPoint(280,10), wxSize(100,20), 0, _T("ID_M_PLBL45")); + m_pLbl26->SetBorderState(uiRect::BORDER_NONE); + m_pLbl26->GetUiRect().SetGradient(0); + m_pLbl26->SetForegroundColour(wxColour(255,255,255)); + m_pLbl26->SetBackgroundColour(wxColour(0,0,255)); + m_plblSessionFrequency = new wmLabel(this, ID_M_PLBL48, wxEmptyString, wxPoint(280,31), wxSize(100,25), 0, _T("ID_M_PLBL48")); + m_plblSessionFrequency->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionFrequency->GetUiRect().SetGradient(0); + m_plblSessionFrequency->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionFrequency->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionFrequencyFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionFrequency->SetFont(m_plblSessionFrequencyFont); + m_pLbl27 = new wmLabel(this, ID_M_PLBL46, _("Channels"), wxPoint(381,10), wxSize(59,20), 0, _T("ID_M_PLBL46")); + m_pLbl27->SetBorderState(uiRect::BORDER_NONE); + m_pLbl27->GetUiRect().SetGradient(0); + m_pLbl27->SetForegroundColour(wxColour(255,255,255)); + m_pLbl27->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl38 = new wmLabel(this, ID_M_PLBL62, _("Id"), wxPoint(441,10), wxSize(158,20), 0, _T("ID_M_PLBL62")); + m_pLbl38->SetBorderState(uiRect::BORDER_NONE); + m_pLbl38->GetUiRect().SetGradient(0); + m_pLbl38->SetForegroundColour(wxColour(255,255,255)); + m_pLbl38->SetBackgroundColour(wxColour(0,0,255)); + m_plblSessionChannels = new wmLabel(this, ID_M_PLBL49, wxEmptyString, wxPoint(381,31), wxSize(59,25), 0, _T("ID_M_PLBL49")); + m_plblSessionChannels->SetBorderState(uiRect::BORDER_NONE); + m_plblSessionChannels->GetUiRect().SetGradient(0); + m_plblSessionChannels->SetForegroundColour(wxColour(0,128,0)); + m_plblSessionChannels->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSessionChannelsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSessionChannels->SetFont(m_plblSessionChannelsFont); + m_plblSubsessionId = new wmLabel(this, ID_M_PLBL84, wxEmptyString, wxPoint(441,31), wxSize(158,25), 0, _T("ID_M_PLBL84")); + m_plblSubsessionId->SetBorderState(uiRect::BORDER_NONE); + m_plblSubsessionId->GetUiRect().SetGradient(0); + m_plblSubsessionId->SetForegroundColour(wxColour(0,128,0)); + m_plblSubsessionId->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubsessionIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubsessionId->SetFont(m_plblSubsessionIdFont); + m_pLbl22 = new wmLabel(this, ID_M_PLBL67, _("Sync Type"), wxPoint(5,70), wxSize(144,20), 0, _T("ID_M_PLBL67")); + m_pLbl22->SetBorderState(uiRect::BORDER_NONE); + m_pLbl22->GetUiRect().SetGradient(0); + m_pLbl22->SetForegroundColour(wxColour(255,255,255)); + m_pLbl22->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl35 = new wmLabel(this, ID_M_PLBL68, _("Version"), wxPoint(150,70), wxSize(189,20), 0, _T("ID_M_PLBL68")); + m_pLbl35->SetBorderState(uiRect::BORDER_NONE); + m_pLbl35->GetUiRect().SetGradient(0); + m_pLbl35->SetForegroundColour(wxColour(255,255,255)); + m_pLbl35->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl36 = new wmLabel(this, ID_M_PLBL69, _("Sync ID"), wxPoint(340,70), wxSize(199,20), 0, _T("ID_M_PLBL69")); + m_pLbl36->SetBorderState(uiRect::BORDER_NONE); + m_pLbl36->GetUiRect().SetGradient(0); + m_pLbl36->SetForegroundColour(wxColour(255,255,255)); + m_pLbl36->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl37 = new wmLabel(this, ID_M_PLBL70, _("Domain"), wxPoint(540,70), wxSize(55,20), 0, _T("ID_M_PLBL70")); + m_pLbl37->SetBorderState(uiRect::BORDER_NONE); + m_pLbl37->GetUiRect().SetGradient(0); + m_pLbl37->SetForegroundColour(wxColour(255,255,255)); + m_pLbl37->SetBackgroundColour(wxColour(0,0,255)); + m_plblSubSyncType = new wmLabel(this, ID_M_PLBL71, wxEmptyString, wxPoint(5,91), wxSize(144,25), 0, _T("ID_M_PLBL71")); + m_plblSubSyncType->SetBorderState(uiRect::BORDER_NONE); + m_plblSubSyncType->GetUiRect().SetGradient(0); + m_plblSubSyncType->SetForegroundColour(wxColour(0,128,0)); + m_plblSubSyncType->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubSyncTypeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubSyncType->SetFont(m_plblSubSyncTypeFont); + m_plblSubSyncVersion = new wmLabel(this, ID_M_PLBL72, wxEmptyString, wxPoint(150,91), wxSize(189,25), 0, _T("ID_M_PLBL72")); + m_plblSubSyncVersion->SetBorderState(uiRect::BORDER_NONE); + m_plblSubSyncVersion->GetUiRect().SetGradient(0); + m_plblSubSyncVersion->SetForegroundColour(wxColour(0,128,0)); + m_plblSubSyncVersion->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubSyncVersionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubSyncVersion->SetFont(m_plblSubSyncVersionFont); + m_plblSubSyncDomain = new wmLabel(this, ID_M_PLBL74, wxEmptyString, wxPoint(540,91), wxSize(55,25), 0, _T("ID_M_PLBL74")); + m_plblSubSyncDomain->SetBorderState(uiRect::BORDER_NONE); + m_plblSubSyncDomain->GetUiRect().SetGradient(0); + m_plblSubSyncDomain->SetForegroundColour(wxColour(0,128,0)); + m_plblSubSyncDomain->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubSyncDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubSyncDomain->SetFont(m_plblSubSyncDomainFont); + m_plblSubSyncId = new wmLabel(this, ID_M_PLBL73, wxEmptyString, wxPoint(340,91), wxSize(199,25), 0, _T("ID_M_PLBL73")); + m_plblSubSyncId->SetBorderState(uiRect::BORDER_NONE); + m_plblSubSyncId->GetUiRect().SetGradient(0); + m_plblSubSyncId->SetForegroundColour(wxColour(0,128,0)); + m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSubSyncIdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSubSyncId->SetFont(m_plblSubSyncIdFont); + m_pLbl29 = new wmLabel(this, ID_M_PLBL52, _("Sync Timestamp"), wxPoint(5,130), wxSize(160,20), 0, _T("ID_M_PLBL52")); + m_pLbl29->SetBorderState(uiRect::BORDER_NONE); + m_pLbl29->GetUiRect().SetGradient(0); + m_pLbl29->SetForegroundColour(wxColour(255,255,255)); + m_pLbl29->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl31 = new wmLabel(this, ID_M_PLBL54, _("Current Timestamp"), wxPoint(166,130), wxSize(160,20), 0, _T("ID_M_PLBL54")); + m_pLbl31->SetBorderState(uiRect::BORDER_NONE); + m_pLbl31->GetUiRect().SetGradient(0); + m_pLbl31->SetForegroundColour(wxColour(255,255,255)); + m_pLbl31->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl3 = new wmLabel(this, ID_M_PLBL3, _("Playing Timestamp"), wxPoint(428,130), wxSize(167,20), 0, _T("ID_M_PLBL3")); + m_pLbl3->SetBorderState(uiRect::BORDER_NONE); + m_pLbl3->GetUiRect().SetGradient(0); + m_pLbl3->SetForegroundColour(wxColour(255,255,255)); + m_pLbl3->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl28 = new wmLabel(this, ID_M_PLBL50, _("Transmission Time"), wxPoint(5,185), wxSize(160,20), 0, _T("ID_M_PLBL50")); + m_pLbl28->SetBorderState(uiRect::BORDER_NONE); + m_pLbl28->GetUiRect().SetGradient(0); + m_pLbl28->SetForegroundColour(wxColour(255,255,255)); + m_pLbl28->SetBackgroundColour(wxColour(0,0,255)); + m_plblSyncTimestamp = new wmLabel(this, ID_M_PLBL55, wxEmptyString, wxPoint(5,151), wxSize(160,25), 0, _T("ID_M_PLBL55")); + m_plblSyncTimestamp->SetBorderState(uiRect::BORDER_NONE); + m_plblSyncTimestamp->GetUiRect().SetGradient(0); + m_plblSyncTimestamp->SetForegroundColour(wxColour(0,128,0)); + m_plblSyncTimestamp->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblSyncTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblSyncTimestamp->SetFont(m_plblSyncTimestampFont); + m_plblCurrentTimestamp = new wmLabel(this, ID_M_PLBL57, wxEmptyString, wxPoint(166,151), wxSize(160,25), 0, _T("ID_M_PLBL57")); + m_plblCurrentTimestamp->SetBorderState(uiRect::BORDER_NONE); + m_plblCurrentTimestamp->GetUiRect().SetGradient(0); + m_plblCurrentTimestamp->SetForegroundColour(wxColour(0,128,0)); + m_plblCurrentTimestamp->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblCurrentTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblCurrentTimestamp->SetFont(m_plblCurrentTimestampFont); + m_pLbl4 = new wmLabel(this, ID_M_PLBL6, wxEmptyString, wxPoint(428,151), wxSize(167,25), 0, _T("ID_M_PLBL6")); + m_pLbl4->SetBorderState(uiRect::BORDER_NONE); + m_pLbl4->GetUiRect().SetGradient(0); + m_pLbl4->SetForegroundColour(wxColour(0,128,0)); + m_pLbl4->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pLbl4Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_pLbl4->SetFont(m_pLbl4Font); + m_plblTransmissionTime = new wmLabel(this, ID_M_PLBL51, wxEmptyString, wxPoint(5,206), wxSize(160,25), 0, _T("ID_M_PLBL51")); + m_plblTransmissionTime->SetBorderState(uiRect::BORDER_NONE); + m_plblTransmissionTime->GetUiRect().SetGradient(0); + m_plblTransmissionTime->SetForegroundColour(wxColour(0,128,0)); + m_plblTransmissionTime->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblTransmissionTimeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblTransmissionTime->SetFont(m_plblTransmissionTimeFont); + m_pLbl1 = new wmLabel(this, ID_M_PLBL1, _("Presentation Time"), wxPoint(166,185), wxSize(160,20), 0, _T("ID_M_PLBL1")); + m_pLbl1->SetBorderState(uiRect::BORDER_NONE); + m_pLbl1->GetUiRect().SetGradient(0); + m_pLbl1->SetForegroundColour(wxColour(255,255,255)); + m_pLbl1->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl30 = new wmLabel(this, ID_M_PLBL53, _("Network Latency"), wxPoint(327,185), wxSize(100,20), 0, _T("ID_M_PLBL53")); + m_pLbl30->SetBorderState(uiRect::BORDER_NONE); + m_pLbl30->GetUiRect().SetGradient(0); + m_pLbl30->SetForegroundColour(wxColour(255,255,255)); + m_pLbl30->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl2 = new wmLabel(this, ID_M_PLBL4, _("Display/Playback Time"), wxPoint(428,185), wxSize(167,20), 0, _T("ID_M_PLBL4")); + m_pLbl2->SetBorderState(uiRect::BORDER_NONE); + m_pLbl2->GetUiRect().SetGradient(0); + m_pLbl2->SetForegroundColour(wxColour(255,255,255)); + m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl34 = new wmLabel(this, ID_M_PLBL61, _("Last Frame Size"), wxPoint(5,240), wxSize(144,20), 0, _T("ID_M_PLBL61")); + m_pLbl34->SetBorderState(uiRect::BORDER_NONE); + m_pLbl34->GetUiRect().SetGradient(0); + m_pLbl34->SetForegroundColour(wxColour(255,255,255)); + m_pLbl34->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl43 = new wmLabel(this, ID_M_PLBL81, _("Last Frame Duration"), wxPoint(150,240), wxSize(144,20), 0, _T("ID_M_PLBL81")); + m_pLbl43->SetBorderState(uiRect::BORDER_NONE); + m_pLbl43->GetUiRect().SetGradient(0); + m_pLbl43->SetForegroundColour(wxColour(255,255,255)); + m_pLbl43->SetBackgroundColour(wxColour(0,0,255)); + m_plblFrameSize = new wmLabel(this, ID_M_PLBL82, wxEmptyString, wxPoint(5,261), wxSize(144,25), 0, _T("ID_M_PLBL82")); + m_plblFrameSize->SetBorderState(uiRect::BORDER_NONE); + m_plblFrameSize->GetUiRect().SetGradient(0); + m_plblFrameSize->SetForegroundColour(wxColour(0,128,0)); + m_plblFrameSize->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblFrameSizeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblFrameSize->SetFont(m_plblFrameSizeFont); + m_plblFrameDuration = new wmLabel(this, ID_M_PLBL83, wxEmptyString, wxPoint(150,261), wxSize(144,25), 0, _T("ID_M_PLBL83")); + m_plblFrameDuration->SetBorderState(uiRect::BORDER_NONE); + m_plblFrameDuration->GetUiRect().SetGradient(0); + m_plblFrameDuration->SetForegroundColour(wxColour(0,128,0)); + m_plblFrameDuration->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblFrameDurationFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblFrameDuration->SetFont(m_plblFrameDurationFont); + m_plblTimestampIn = new wmLabel(this, ID_M_PLBL2, wxEmptyString, wxPoint(166,206), wxSize(160,25), 0, _T("ID_M_PLBL2")); + m_plblTimestampIn->SetBorderState(uiRect::BORDER_NONE); + m_plblTimestampIn->GetUiRect().SetGradient(0); + m_plblTimestampIn->SetForegroundColour(wxColour(0,128,0)); + m_plblTimestampIn->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblTimestampInFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblTimestampIn->SetFont(m_plblTimestampInFont); + m_plblLatencyNetwork = new wmLabel(this, ID_M_PLBL56, wxEmptyString, wxPoint(327,206), wxSize(100,25), 0, _T("ID_M_PLBL56")); + m_plblLatencyNetwork->SetBorderState(uiRect::BORDER_NONE); + m_plblLatencyNetwork->GetUiRect().SetGradient(0); + m_plblLatencyNetwork->SetForegroundColour(wxColour(155,0,0)); + m_plblLatencyNetwork->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblLatencyNetworkFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblLatencyNetwork->SetFont(m_plblLatencyNetworkFont); + m_plblTimestampOut = new wmLabel(this, ID_M_PLBL5, wxEmptyString, wxPoint(428,206), wxSize(167,25), 0, _T("ID_M_PLBL5")); + m_plblTimestampOut->SetBorderState(uiRect::BORDER_NONE); + m_plblTimestampOut->GetUiRect().SetGradient(0); + m_plblTimestampOut->SetForegroundColour(wxColour(0,128,0)); + m_plblTimestampOut->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblTimestampOutFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblTimestampOut->SetFont(m_plblTimestampOutFont); + //*) + + m_plblEpoch = new wmLabel(this, wxNewId(), wxEmptyString, wxPoint(305,151), wxSize(249,25), 0, _T("ID_M_PLBL57")); + m_plblEpoch->SetBorderState(uiRect::BORDER_NONE); + m_plblEpoch->GetUiRect().SetGradient(0); + m_plblEpoch->SetForegroundColour(wxColour(0,128,0)); + m_plblEpoch->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblEpochFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblEpoch->SetFont(m_plblEpochFont); + + + + + m_plblSubsessionId->SetLabel(sub.sId); + m_plblSessionSource->SetLabel(sub.sSourceAddress); + m_plblSessionBits->SetLabel(sub.sCodec); + m_plblSessionFrequency->SetLabel(wxString::Format("%.1fkHz", sub.nSampleRate/1000.0)); + m_plblSessionChannels->SetLabel(wxString::Format("%u", sub.nChannels)); + + m_plblSyncTimestamp->SetLabel(wxString::Format("%u", sub.nSyncTimestamp)); + + m_nSampleRate = sub.nSampleRate; + m_nFrameSize = min((unsigned int)256 ,sub.nChannels); + if(sub.sCodec == "L24") + { + m_nFrameSize*=3; + } + else if(sub.sCodec == "L16") + { + m_nFrameSize*=2; + } + else if(sub.sCodec == "F32") + { + m_nFrameSize*=4; + } + + m_plblSubSyncType->SetLabel(sub.refClock.sType); + m_plblSubSyncVersion->SetLabel(sub.refClock.sVersion); + m_plblSubSyncId->SetLabel(sub.refClock.sId); +#ifdef PTPMONKEY + if(m_plblSubSyncId->GetLabel().MakeLower() == wxPtp::Get().GetMasterClockId(0)) + { + m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); + } + else + { + m_plblSubSyncId->SetBackgroundColour(wxColour(255,100,100)); + } + wxPtp::Get().AddHandler(this); + + Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); + Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); + Connect(wxID_ANY, wxEVT_CLOCK_UPDATED, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); + +#else + m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,100)); +#endif + m_plblSubSyncDomain->SetLabel(wxString::Format("%lu", sub.refClock.nDomain)); +} + +pnlSubsession::~pnlSubsession() +{ + //(*Destroy(pnlSubsession) + //*) +} + +void pnlSubsession::OnPtpEvent(wxCommandEvent& event) +{ +#ifdef PTPMONKEY + if(m_plblSubSyncId->GetLabel().MakeLower() == wxPtp::Get().GetMasterClockId(0)) + { + m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,255)); + } + else + { + m_plblSubSyncId->SetBackgroundColour(wxColour(255,100,100)); + } +#endif +} diff --git a/plugins/aoip info/pnlSubsession.h b/plugins/aoip info/pnlSubsession.h new file mode 100644 index 00000000..12931959 --- /dev/null +++ b/plugins/aoip info/pnlSubsession.h @@ -0,0 +1,105 @@ +#ifndef PNLSUBSESSION_H +#define PNLSUBSESSION_H + +//(*Headers(pnlSubsession) +#include "wmlabel.h" +#include +//*) + +class pnlSubsession: public wxPanel +{ + public: + + pnlSubsession(wxWindow* parent,const subsession& sub, wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize); + virtual ~pnlSubsession(); + + //(*Declarations(pnlSubsession) + wmLabel* m_pLbl1; + wmLabel* m_pLbl22; + wmLabel* m_pLbl23; + wmLabel* m_pLbl25; + wmLabel* m_pLbl26; + wmLabel* m_pLbl27; + wmLabel* m_pLbl28; + wmLabel* m_pLbl29; + wmLabel* m_pLbl2; + wmLabel* m_pLbl30; + wmLabel* m_pLbl31; + wmLabel* m_pLbl34; + wmLabel* m_pLbl35; + wmLabel* m_pLbl36; + wmLabel* m_pLbl37; + wmLabel* m_pLbl38; + wmLabel* m_pLbl3; + wmLabel* m_pLbl43; + wmLabel* m_pLbl4; + wmLabel* m_plblCurrentTimestamp; + wmLabel* m_plblFrameDuration; + wmLabel* m_plblFrameSize; + wmLabel* m_plblLatencyNetwork; + wmLabel* m_plblSessionBits; + wmLabel* m_plblSessionChannels; + wmLabel* m_plblSessionFrequency; + wmLabel* m_plblSessionSource; + wmLabel* m_plblSubSyncDomain; + wmLabel* m_plblSubSyncId; + wmLabel* m_plblSubSyncType; + wmLabel* m_plblSubSyncVersion; + wmLabel* m_plblSubsessionId; + wmLabel* m_plblSyncTimestamp; + wmLabel* m_plblTimestampIn; + wmLabel* m_plblTimestampOut; + wmLabel* m_plblTransmissionTime; + //*) + + protected: + + //(*Identifiers(pnlSubsession) + static const long ID_M_PLBL39; + static const long ID_M_PLBL42; + static const long ID_M_PLBL44; + static const long ID_M_PLBL47; + static const long ID_M_PLBL45; + static const long ID_M_PLBL48; + static const long ID_M_PLBL46; + static const long ID_M_PLBL62; + static const long ID_M_PLBL49; + static const long ID_M_PLBL84; + static const long ID_M_PLBL67; + static const long ID_M_PLBL68; + static const long ID_M_PLBL69; + static const long ID_M_PLBL70; + static const long ID_M_PLBL71; + static const long ID_M_PLBL72; + static const long ID_M_PLBL74; + static const long ID_M_PLBL73; + static const long ID_M_PLBL52; + static const long ID_M_PLBL54; + static const long ID_M_PLBL3; + static const long ID_M_PLBL50; + static const long ID_M_PLBL55; + static const long ID_M_PLBL57; + static const long ID_M_PLBL6; + static const long ID_M_PLBL51; + static const long ID_M_PLBL1; + static const long ID_M_PLBL53; + static const long ID_M_PLBL4; + static const long ID_M_PLBL61; + static const long ID_M_PLBL81; + static const long ID_M_PLBL82; + static const long ID_M_PLBL83; + static const long ID_M_PLBL2; + static const long ID_M_PLBL56; + static const long ID_M_PLBL5; + //*) + + private: + + //(*Handlers(pnlSubsession) + //*) + void OnPtpEvent(wxCommandEvent& event); + + DECLARE_EVENT_TABLE() +}; + +#endif diff --git a/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs b/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs index 47044b7c..af3da889 100644 --- a/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs +++ b/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs @@ -194,13 +194,6 @@ #FFFFFF #0000FF - - - 150,300 - 144,20 - #FFFFFF - #0000FF - 295,300 @@ -223,21 +216,6 @@ Consolas - - - 150,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - 295,321 @@ -256,782 +234,6 @@ - - - #000000 - - - 5,10 - 199,20 - #FFFFFF - #0000FF - - - - 5,31 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 205,10 - 74,20 - #FFFFFF - #0000FF - - - - 205,31 - 74,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 280,10 - 100,20 - #FFFFFF - #0000FF - - - - 280,31 - 100,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 381,10 - 59,20 - #FFFFFF - #0000FF - - - - 441,10 - 158,20 - #FFFFFF - #0000FF - - - - 381,31 - 59,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 441,31 - 158,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,70 - 144,20 - #FFFFFF - #0000FF - - - - 150,70 - 189,20 - #FFFFFF - #0000FF - - - - 340,70 - 199,20 - #FFFFFF - #0000FF - - - - 540,70 - 55,20 - #FFFFFF - #0000FF - - - - 5,91 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 150,91 - 189,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 540,91 - 55,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 340,91 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,130 - 149,20 - #FFFFFF - #0000FF - - - - 155,130 - 149,20 - #FFFFFF - #0000FF - - - - 5,185 - 165,20 - #FFFFFF - #0000FF - - - - 5,151 - 149,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 155,151 - 149,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,206 - 165,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 171,185 - 165,20 - #FFFFFF - #0000FF - - - - 337,185 - 100,20 - #FFFFFF - #0000FF - - - - 5,240 - 166,20 - #FFFFFF - #0000FF - - - - 5,300 - 144,20 - #FFFFFF - #0000FF - - - - 150,300 - 144,20 - #FFFFFF - #0000FF - - - - 450,300 - 144,20 - #FFFFFF - #0000FF - - - - 5,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 150,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 450,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 238,240 - 100,20 - #FFFFFF - #0000FF - - - - 171,206 - 165,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 337,206 - 100,25 - #9B0000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,261 - 166,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 238,261 - 100,25 - #9B0000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - - - - #000000 - - - 5,5 - 194,20 - #FFFFFF - #0000FF - - - - 200,5 - 199,20 - #FFFFFF - #0000FF - - - - 400,5 - 195,20 - #FFFFFF - #0000FF - - - - 5,26 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,26 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,26 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,60 - 194,20 - #FFFFFF - #0000FF - - - - 200,60 - 199,20 - #FFFFFF - #0000FF - - - - 400,60 - 195,20 - #FFFFFF - #0000FF - - - - 5,81 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,81 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,81 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,115 - 194,20 - #FFFFFF - #0000FF - - - - 200,115 - 199,20 - #FFFFFF - #0000FF - - - - 400,115 - 195,20 - #FFFFFF - #0000FF - - - - 5,136 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,136 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,136 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,170 - 194,20 - #FFFFFF - #0000FF - - - - 200,170 - 199,20 - #FFFFFF - #0000FF - - - - 400,170 - 195,20 - #FFFFFF - #0000FF - - - - 5,191 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,191 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,191 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,225 - 194,20 - #FFFFFF - #0000FF - - - - 400,225 - 194,20 - #FFFFFF - #008040 - - - - 5,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,225 - 194,20 - #FFFFFF - #0000FF - - - - 200,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - 0,280 - 600,160 - #000000 - - $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); - levelgraph.h - 1 - - 0,0 - 600,160 - #0000FF - #000000 - 50,-1 - - - - - #000000 diff --git a/plugins/aoip info/wxsmith/pnlQos.wxs b/plugins/aoip info/wxsmith/pnlQos.wxs new file mode 100644 index 00000000..cb99ed89 --- /dev/null +++ b/plugins/aoip info/wxsmith/pnlQos.wxs @@ -0,0 +1,432 @@ + + + + #000000 + 1 + 1 + + 0,280 + 600,160 + #000000 + + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); + histogram.h + 1 + + 0,0 + 600,160 + 1 + #0000FF + #000000 + 50,-1 + + + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); + historygraph.h + 1 + + 0,0 + 600,160 + #0000FF + #000000 + 50,-1 + + + + + 146,246 + 109,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + #800000 + 262,246 + 150,25 + #008000 + #FFFFFF + + + + + #800000 + 413,246 + 60,25 + #008000 + #FFFFFF + + + + + #800000 + 474,246 + 60,25 + #008000 + #FFFFFF + + + + + + #800000 + 535,246 + 60,25 + #008000 + #FFFFFF + + + + + + 146,225 + 109,20 + #FFFFFF + #0000FF + + + + 5,246 + 140,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 262,225 + 333,20 + #FFFFFF + #008040 + + + + 5,225 + 140,20 + #FFFFFF + #0000FF + + + + 400,191 + 195,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 200,191 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,191 + 194,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,170 + 195,20 + #FFFFFF + #0000FF + + + + 200,170 + 199,20 + #FFFFFF + #0000FF + + + + 5,170 + 194,20 + #FFFFFF + #0000FF + + + + 400,136 + 195,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 200,136 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,136 + 194,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,115 + 195,20 + #FFFFFF + #0000FF + + + + 200,115 + 199,20 + #FFFFFF + #0000FF + + + + 5,115 + 194,20 + #FFFFFF + #0000FF + + + + 400,81 + 195,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 200,81 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,81 + 194,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 200,60 + 199,20 + #FFFFFF + #0000FF + + + + 400,60 + 195,20 + #FFFFFF + #0000FF + + + + 5,60 + 194,20 + #FFFFFF + #0000FF + + + + 500,26 + 100,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,26 + 99,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,26 + 132,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 138,26 + 130,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 269,26 + 132,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 500,5 + 100,20 + #FFFFFF + #0000FF + + + + 400,5 + 99,20 + #FFFFFF + #0000FF + + + + 5,5 + 132,20 + #FFFFFF + #0000FF + + + + 138,5 + 130,20 + #FFFFFF + #0000FF + + + + 269,5 + 130,20 + #FFFFFF + #0000FF + + + diff --git a/plugins/aoip info/wxsmith/pnlSubsession.wxs b/plugins/aoip info/wxsmith/pnlSubsession.wxs new file mode 100644 index 00000000..1f327743 --- /dev/null +++ b/plugins/aoip info/wxsmith/pnlSubsession.wxs @@ -0,0 +1,404 @@ + + + + #000000 + 1 + 1 + + + 5,10 + 199,20 + #FFFFFF + #0000FF + + + + 5,31 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 205,10 + 74,20 + #FFFFFF + #0000FF + + + + 205,31 + 74,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 280,10 + 100,20 + #FFFFFF + #0000FF + + + + 280,31 + 100,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 381,10 + 59,20 + #FFFFFF + #0000FF + + + + 441,10 + 158,20 + #FFFFFF + #0000FF + + + + 381,31 + 59,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 441,31 + 158,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,70 + 144,20 + #FFFFFF + #0000FF + + + + 150,70 + 189,20 + #FFFFFF + #0000FF + + + + 340,70 + 199,20 + #FFFFFF + #0000FF + + + + 540,70 + 55,20 + #FFFFFF + #0000FF + + + + 5,91 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 150,91 + 189,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 540,91 + 55,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 340,91 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,130 + 160,20 + #FFFFFF + #0000FF + + + + 166,130 + 160,20 + #FFFFFF + #0000FF + + + + 428,130 + 167,20 + #FFFFFF + #0000FF + + + + 5,185 + 160,20 + #FFFFFF + #0000FF + + + + 5,151 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,151 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 428,151 + 167,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,206 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,185 + 160,20 + #FFFFFF + #0000FF + + + + 327,185 + 100,20 + #FFFFFF + #0000FF + + + + 428,185 + 167,20 + #FFFFFF + #0000FF + + + + 5,240 + 144,20 + #FFFFFF + #0000FF + + + + 150,240 + 144,20 + #FFFFFF + #0000FF + + + + 5,261 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 150,261 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,206 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 327,206 + 100,25 + #9B0000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 428,206 + 167,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + From ec228aac504f33f744298ba5f397c63bfaf990a9 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 12:30:54 +0100 Subject: [PATCH 02/30] 2022-7 work --- CMakeLists.txt | 10 +- InitialSetup/CMakeLists.txt | 6 +- dosetup/CMakeLists.txt | 7 +- pam2/CMakeLists.txt | 22 +- pam2/pnlSettingsTime.cpp | 7 + pam2/pnlSettingsTime.h | 3 + pam2_paths.h.in | 2 +- pambase/CMakeLists.txt | 10 +- pambase/aes67source.cpp | 2 +- pambase/iomanager.cpp | 48 +++- pambase/iomanager.h | 3 + pambase/qos.cpp | 57 ++++- pambase/qos.h | 68 ++---- pambase/remoteapi.cpp | 2 +- pambase/rtpserverthread.cpp | 17 +- pambase/rtpserverthread.h | 1 + pambase/rtpthread.cpp | 262 +++++++++++++++------ pambase/rtpthread.h | 22 +- pambase/rtsputil.cpp | 92 +++----- pambase/rtsputil.h | 4 +- pambase/session.h | 109 ++++----- pambase/smpte2110mediasession.cpp | 312 +++++--------------------- pambase/smpte2110mediasession.h | 85 +++---- pambase/timemanager.cpp | 3 - pambase/wxptp.cpp | 21 +- pambase/wxptp.h | 11 +- pambase/wxsink.cpp | 27 ++- pambase/wxsink.h | 23 +- pamfft/CMakeLists.txt | 8 +- pamlevel/CMakeLists.txt | 8 +- plugins/InputAlign/CMakeLists.txt | 6 +- plugins/LTC/CMakeLists.txt | 5 +- plugins/LTCGenerator/CMakeLists.txt | 5 +- plugins/anglemeters/CMakeLists.txt | 7 +- plugins/aoip info/CMakeLists.txt | 8 +- plugins/aoip info/aoipinfobuilder.cpp | 10 - plugins/aoip info/aoipinfobuilder.h | 1 + plugins/aoip info/pnlAoIPInfo.cpp | 58 ++++- plugins/aoip info/pnlAoIPInfo.h | 13 +- plugins/aoip info/pnlQos.cpp | 29 ++- plugins/aoip info/pnlQos.h | 9 +- plugins/aoip info/pnlSubsession.cpp | 29 ++- plugins/aoip info/pnlSubsession.h | 3 + plugins/channel delay/CMakeLists.txt | 7 +- plugins/correlation/CMakeLists.txt | 8 +- plugins/distortion/CMakeLists.txt | 7 +- plugins/fft/CMakeLists.txt | 7 +- plugins/fftdiff/CMakeLists.txt | 7 +- plugins/fftphase/CMakeLists.txt | 6 +- plugins/identify/CMakeLists.txt | 5 +- plugins/levels/CMakeLists.txt | 5 +- plugins/lineup/CMakeLists.txt | 5 +- plugins/lissajou/CMakeLists.txt | 6 +- plugins/meters/CMakeLists.txt | 6 +- plugins/noiseGenerator/CMakeLists.txt | 6 +- plugins/peak count/CMakeLists.txt | 6 +- plugins/peak log/CMakeLists.txt | 5 +- plugins/polarscope/CMakeLists.txt | 6 +- plugins/ptp/CMakeLists.txt | 6 +- plugins/ptp/ptppanel.cpp | 2 +- plugins/r128/CMakeLists.txt | 6 +- plugins/radar/CMakeLists.txt | 5 +- plugins/record/CMakeLists.txt | 6 +- plugins/scope/CMakeLists.txt | 5 +- plugins/spectogram/CMakeLists.txt | 5 +- plugins/waveform/CMakeLists.txt | 5 +- 66 files changed, 787 insertions(+), 780 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60473248..3a43ba65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(pamworkspace VERSION 1.5.4) -SET(CMAKE_CXX_STANDARD 14) +set(CMAKE_INSTALL_PREFIX "/usr/local") SET(NMOS OFF CACHE BOOL "set to ON to include NMOS") @@ -15,7 +15,7 @@ SET(DIR_PTPMONKEY ${DIR_BASE}/ptpmonkey CACHE STRING "location of ptpmonkey") SET(DIR_SAPSERVER ${DIR_BASE}/sapserver CACHE STRING "location of sapserver") SET(DIR_LOG ${DIR_BASE}/log CACHE STRING "location of pml log") SET(DIR_DNSSD ${DIR_BASE}/dnssd CACHE STRING "location of pml dnssd") -SET(DIR_RESTGOOSE ${DIR_BASE}/restgoose CACHE STRING "location of pml restgoose") +SET(DIR_RESTGOOSE ${DIR_BASE}/Restgoose CACHE STRING "location of pml restgoose") #set the following to off so we build them rather than one of the sub projects SET(BUILD_DNSSD OFF) @@ -124,6 +124,8 @@ else() unset(NMOS_TEMP_DIR2) else() message(STATUS "restgoose found - update to latest version") + execute_process(COMMAND git -C ${DIR_RESTGOOSE} checkout v3_7.10) + #execute_process(COMMAND git -C ${DIR_RESTGOOSE} pull) execute_process(COMMAND git -C ${DIR_RESTGOOSE} pull --no-rebase) endif() unset(NMOS_TEMP_DIR) @@ -209,8 +211,6 @@ message(STATUS "Configure plugin fftdiff") add_subdirectory(plugins/fftdiff) message(STATUS "Configure plugin correlation") add_subdirectory(plugins/correlation) -message(STATUS "Configure bob") -add_subdirectory(plugins/bob) #Add new plugin projects above this line message(STATUS "Configure pam2") diff --git a/InitialSetup/CMakeLists.txt b/InitialSetup/CMakeLists.txt index 13bf39a7..5623f392 100644 --- a/InitialSetup/CMakeLists.txt +++ b/InitialSetup/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(InitialSetup LANGUAGES CXX VERSION 1.0.0.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -26,11 +26,11 @@ target_link_libraries(InitialSetup ${wxWidgets_LIBRARIES} pambase restgoose ssl) -set_property(TARGET InitialSetup PROPERTY CXX_STANDARD 14) +set_property(TARGET InitialSetup PROPERTY CXX_STANDARD 17) set_target_properties(InitialSetup PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS InitialSetup RUNTIME DESTINATION /usr/local/bin) +install(TARGETS InitialSetup RUNTIME DESTINATION bin) endif() diff --git a/dosetup/CMakeLists.txt b/dosetup/CMakeLists.txt index 71786a73..aad9a23c 100644 --- a/dosetup/CMakeLists.txt +++ b/dosetup/CMakeLists.txt @@ -1,6 +1,7 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(dosetup LANGUAGES CXX VERSION 1.0.0.0) + execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -21,12 +22,12 @@ target_link_libraries(dosetup pml_log) -set_property(TARGET dosetup PROPERTY CXX_STANDARD 14) +set_property(TARGET dosetup PROPERTY CXX_STANDARD 17) set_target_properties(dosetup PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS dosetup RUNTIME DESTINATION /usr/local/bin) +install(TARGETS dosetup RUNTIME DESTINATION bin) endif() diff --git a/pam2/CMakeLists.txt b/pam2/CMakeLists.txt index 3e4d4041..73b8f265 100644 --- a/pam2/CMakeLists.txt +++ b/pam2/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(pam2 LANGUAGES CXX VERSION 1.6.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -73,21 +73,19 @@ target_link_libraries(pam2 optimized pamfft debug pamfftd) target_link_libraries(pam2 optimized pamlevel debug pamleveld) +set_target_properties(pam2 PROPERTIES CXX_STANDARD 17) set_target_properties(pam2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS pam2 RUNTIME DESTINATION /usr/local/bin) +install(TARGETS pam2 RUNTIME DESTINATION bin) install(CODE "execute_process(COMMAND setcap cap_sys_time,cap_sys_admin,cap_net_bind_service+ep /usr/local/bin/pam2 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})") -install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/documents/pam2.conf /etc/ld.so.conf.d/)") +install(FILES ${CMAKE_SOURCE_DIR}/documents/pam2.conf DESTINATION "../../etc/ld.so.conf.d/") install(CODE "execute_process(COMMAND ldconfig)") -install(CODE "execute_process(COMMAND mkdir -p ${DIR_PAM})") -install(CODE "execute_process(COMMAND chown ${DIR_PAM} -Rv --reference=${DIR_PAM}/..)") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/audio_hats.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/macaddress.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/ppmtypes.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/r128types.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/pam2.ini ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -rp ${CMAKE_SOURCE_DIR}/documents/help ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -rp ${CMAKE_SOURCE_DIR}/documents/generator ${DIR_PAM})") +install(FILES ${CMAKE_SOURCE_DIR}/documents/audio_hats.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/macaddress.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/ppmtypes.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/pam2.ini DESTINATION etc/pam2/) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/documents/help DESTINATION etc/pam2/) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/documents/generator DESTINATION /etc/pam2/) endif() diff --git a/pam2/pnlSettingsTime.cpp b/pam2/pnlSettingsTime.cpp index 51b779b8..c9913011 100644 --- a/pam2/pnlSettingsTime.cpp +++ b/pam2/pnlSettingsTime.cpp @@ -120,6 +120,12 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p Connect(ID_TIMER1,wxEVT_TIMER,(wxObjectEventFunction)&pnlSettingsTime::OntimerTimeTrigger); //*) + //extra buttons etc + m_pbtnPtpMode = new wmButton(m_ppnlPTP, wxNewId(), "Mode", wxPoint(350,110), wxSize(200,40), 0, wxDefaultValidator, _T("ID_M_PBTN1")); + m_pbtnPtpMode->SetBackgroundColour(wxColour(0,128,64)); + m_pbtnPtpMode->SetColourDisabled(wxColour(wxT("#808080"))); + m_pbtnPtpMode->SetToggleLook(true, wxT("Multicast"), wxT("Hybrid"), 60); + for(auto pairServer : TimeManager::Get().GetNtpServers()) { if(pairServer.second) @@ -162,6 +168,7 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p m_plstDate->ConnectToSetting("Time", "LTC_Format", (int)2); m_pbtnSync->ConnectToSetting("Time", "Tai", false); + m_pbtnPtpMode->ConnectToSetting("Time", "Ptp_Mode", false); } pnlSettingsTime::~pnlSettingsTime() diff --git a/pam2/pnlSettingsTime.h b/pam2/pnlSettingsTime.h index 50a3fef2..85881bf3 100644 --- a/pam2/pnlSettingsTime.h +++ b/pam2/pnlSettingsTime.h @@ -41,6 +41,9 @@ class pnlSettingsTime: public wxPanel wxTimer m_timerTime; //*) + wmButton* m_pbtnPtpMode; + + protected: //(*Identifiers(pnlSettingsTime) diff --git a/pam2_paths.h.in b/pam2_paths.h.in index 846d6fb6..2f95f231 100644 --- a/pam2_paths.h.in +++ b/pam2_paths.h.in @@ -6,7 +6,7 @@ namespace pml { namespace pam2 { - const char* CONFIG_PATH = "@DIR_PAM@"; + const char* CONFIG_PATH = "/usr/local/etc"; } } #endif diff --git a/pambase/CMakeLists.txt b/pambase/CMakeLists.txt index 56fbaf13..474ce3f4 100644 --- a/pambase/CMakeLists.txt +++ b/pambase/CMakeLists.txt @@ -1,6 +1,7 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(pambase LANGUAGES CXX VERSION 1.7.1) + execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -37,7 +38,7 @@ message(${CMAKE_CURRENT_SOURCE_DIR}) #pambase settubgs -set(SOURCES "advelement.cpp" "aes67mediasession.cpp" "AES67ServerMediaSubsession.cpp" "aes67source.cpp" "anglemeter.cpp" "aoipsourcemanager.cpp" "audio.cpp" "audioevent.cpp" "dlgmask.cpp" +set(SOURCES "advelement.cpp" "AES67ServerMediaSubsession.cpp" "aes67source.cpp" "anglemeter.cpp" "aoipsourcemanager.cpp" "audio.cpp" "audioevent.cpp" "dlgmask.cpp" "generator.cpp" "generatorpluginbuilder.cpp" "generatorpluginfactory.cpp" "histogram.cpp" "historygraph.cpp" "inimanager.cpp" "inisection.cpp" "iomanager.cpp" "levelcalculator.cpp" "levelgraph.cpp" "levelmeter.cpp" "liveaudiosource.cpp" "monitorevent.cpp" "monitorpluginbuilder.cpp" "monitorpluginfactory.cpp" "networkcontrol.cpp" "pamRTSPServer.cpp" "niir.cpp" "ondemandaes67mediasubsession.cpp" "ondemandpamsubsession.cpp" "ondemandstreamer.cpp" "ourRTSPClient.cpp" "ourSIPClient.cpp" "PamTaskScheduler.cpp" "PamUsageEnvironment.cpp" "pcstats.cpp" "pmcontrol.cpp" "pmpanel.cpp" "ppmtypes.cpp" "qos.cpp" "r128calculator.cpp" @@ -58,7 +59,8 @@ target_include_directories(pambase PUBLIC ${DIR_JSON}/dist) target_include_directories(pambase PUBLIC ${CMAKE_BINARY_DIR}/include) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +set_target_properties(pambase PROPERTIES CXX_STANDARD 17) +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -112,5 +114,5 @@ set_target_properties(pambase PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS pambase LIBRARY DESTINATION /usr/local/lib) + install(TARGETS pambase LIBRARY DESTINATION lib) endif() diff --git a/pambase/aes67source.cpp b/pambase/aes67source.cpp index 6543e133..7ab3de44 100644 --- a/pambase/aes67source.cpp +++ b/pambase/aes67source.cpp @@ -1,4 +1,4 @@ -#include "aes67mediasession.h" +//#include "aes67mediasession.h" #include "UsageEnvironment.hh" #include "aes67source.h" #include diff --git a/pambase/iomanager.cpp b/pambase/iomanager.cpp index 6ac7eb53..31764652 100644 --- a/pambase/iomanager.cpp +++ b/pambase/iomanager.cpp @@ -113,15 +113,17 @@ IOManager::IOManager() : Connect(wxID_ANY,wxEVT_RTP_SESSION_CLOSED,(wxObjectEventFunction)&IOManager::OnRTPSessionClosed); Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&IOManager::OnSettingEvent); + Connect(wxID_ANY,wxEVT_RTP_FRAME,(wxObjectEventFunction)&IOManager::OnRtpFrame); Connect(wxID_ANY,wxEVT_QOS_UPDATED,(wxObjectEventFunction)&IOManager::OnQoS); + Connect(wxID_ANY, wxEVT_STREAMING, (wxObjectEventFunction)&IOManager::OnStreaming); #ifdef PTPMONKEY wxPtp::Get().AddHandler(this); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&IOManager::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&IOManager::OnPtpEvent); - wxPtp::Get().RunDomain(std::string(Settings::Get().Read(wxT("AoIP_Settings"), wxT("Interface"), wxT("eth0")).mb_str()), - Settings::Get().Read(wxT("AoIP_Settings"), wxT("Domain"), 0)); + wxPtp::Get().RunDomain(std::string(Settings::Get().Read("AoIP_Settings", "Interface", "eth0").mb_str()), + Settings::Get().Read("Time", "PTP_Domain", 0), Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); #endif // PTPMONKEY m_pGenerator = std::make_unique(); m_pGenerator->SetSampleRate(48000); @@ -189,7 +191,7 @@ void IOManager::StopStream() void IOManager::OnSettingEvent(SettingEvent& event) { - if(event.GetSection() == wxT("Monitor")) + if(event.GetSection() == "Monitor") { OnSettingEventMonitor(event); } @@ -780,7 +782,7 @@ void IOManager::InitAudioInputDevice(bool bStart) m_SessionIn = session(wxEmptyString, wxT("Soundcard"), SoundcardManager::Get().GetInputDeviceName()); //@todo its possible soundcard might not be two channels - m_SessionIn.lstSubsession.push_back(subsession(wxEmptyString, SoundcardManager::Get().GetInputDeviceName(), wxEmptyString, + m_SessionIn.lstSubsession.push_back(subsession(wxEmptyString, SoundcardManager::Get().GetInputDeviceName(), "0", wxEmptyString, wxT("L24"), wxEmptyString, SoundcardManager::Get().GetInputDevice(), SoundcardManager::Get().GetInputSampleRate(), CreateChannels(2), 0, {0,0}, refclk())); m_SessionIn.SetCurrentSubsession(); @@ -897,7 +899,7 @@ void IOManager::CreateSessionFromOutput(const wxString& sSource) m_pGenerator->SetSampleRate(nSampleRate); } m_SessionOut.lstSubsession.push_back(subsession(Settings::Get().Read(wxT("Output"), wxT("Source"),wxEmptyString), - sSource, wxEmptyString, wxT("F32"), wxEmptyString, 0, nSampleRate, CreateChannels(nChannels), + sSource, "0", wxEmptyString, wxT("F32"), wxEmptyString, 0, nSampleRate, CreateChannels(nChannels), 0, {0,0}, refclk())); m_SessionOut.SetCurrentSubsession(); @@ -1146,19 +1148,19 @@ void IOManager::OnRTPSessionClosed(wxCommandEvent& event) { m_nCurrentRtp = 0; } - //m_setRtpOrphan.erase(event.GetInt()); + m_mRtp.erase(event.GetInt()); pmlLog(pml::LOG_INFO) << "IOManager\tOnRTPSessionClosed: " << event.GetInt(); } void IOManager::OnRTPSession(wxCommandEvent& event) { - session* pSession = reinterpret_cast(event.GetClientData()); + auto pSession = reinterpret_cast(event.GetClientData()); - m_SessionIn = session(pSession->sRawSDP, pSession->sName, pSession->sType, pSession->sDescription, pSession->sGroups); - for(list::iterator itSub = pSession->lstSubsession.begin(); itSub != pSession->lstSubsession.end(); ++itSub) + m_SessionIn = session(pSession->sRawSDP, pSession->sName, pSession->sType, pSession->sDescription, pSession->setGroups); + for(const auto& sub : pSession->lstSubsession) { - m_SessionIn.lstSubsession.push_back((*itSub)); + m_SessionIn.lstSubsession.push_back(sub); } m_SessionIn.SetCurrentSubsession(); @@ -1291,6 +1293,18 @@ void IOManager::OnQoS(wxCommandEvent& event) } } +void IOManager::OnRtpFrame(wxCommandEvent& event) +{ + for(auto pHandler : m_setHandlers) + { + wxCommandEvent eventUp(wxEVT_RTP_FRAME); + eventUp.SetId(event.GetId()); + eventUp.SetInt(event.GetInt()); + eventUp.SetExtraLong(event.GetExtraLong()); + pHandler->ProcessEvent(eventUp); + } +} + void IOManager::OnTimerSilence(wxTimerEvent& event) { @@ -1401,7 +1415,6 @@ void IOManager::Stream() if(m_bStreamAlwaysOn || bNmos) //@todo bodge for NMOS { StreamAlwaysOn(); - DoSAP(Settings::Get().Read("Server", "SAP",0)); } else { @@ -1438,6 +1451,19 @@ void IOManager::StreamAlwaysOn() } } +void IOManager::OnStreaming(wxCommandEvent& event) +{ + pmlLog() << "IOManager::OnStreaming " << event.GetInt(); + if(event.GetInt() == 1) + { + DoSAP(Settings::Get().Read("Server", "SAP",0)); + } + else + { + DoSAP(false); + } +} + void IOManager::StreamOnDemand() { pmlLog(pml::LOG_INFO) << "IOManager\tCreate OnDemand AES67 Server"; diff --git a/pambase/iomanager.h b/pambase/iomanager.h index 89809d8e..87795d69 100644 --- a/pambase/iomanager.h +++ b/pambase/iomanager.h @@ -77,6 +77,7 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void OnRTPSession(wxCommandEvent& event); void OnRTPSessionClosed(wxCommandEvent& event); void OnQoS(wxCommandEvent& event); + void OnRtpFrame(wxCommandEvent& event); void InputTypeChanged(); void InputChanged(const wxString& sKey); @@ -124,6 +125,8 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void CheckIfGain(); void InitAoIPInput(); + void OnStreaming(wxCommandEvent& event); + std::vector CreateRouting(); std::set m_setHandlers; diff --git a/pambase/qos.cpp b/pambase/qos.cpp index 38d86753..d1f77c18 100644 --- a/pambase/qos.cpp +++ b/pambase/qos.cpp @@ -4,17 +4,44 @@ #include "rtpthread.h" #include #include +#include "smpte2110mediasession.h" +#include "log.h" - +qosMeasurementRecord::qosMeasurementRecord(Smpte2110MediaSubsession* pSubsession) : + m_pSubsession(pSubsession) +{ + + gettimeofday(&m_tvMeasurementStart, nullptr); + gettimeofday(&m_tvMeasurementEnd, nullptr); + + if(m_pSubsession->rtpSource()) + { + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); + // Assume that there's only one SSRC source (usually the case): + RTPReceptionStats* stats = statsIter.next(True); + if (stats != NULL) + { + m_dkBytesTotal = stats->totNumKBytesReceived(); + m_nTotNumPacketsReceived = stats->totNumPacketsReceived(); + m_nTotNumPacketsExpected = stats->totNumPacketsExpected(); + } + } +} void qosMeasurementRecord::periodicQOSMeasurement(struct timeval const& timeNow) { + pmlLog(pml::LOG_DEBUG) << "qosMeasurementRecord::periodicQOSMeasurement"; + if(!m_pSubsession || !m_pSubsession->rtpSource() || !m_pThread) + { + return; + } + unsigned secsDiff = timeNow.tv_sec - m_tvMeasurementEnd.tv_sec; int usecsDiff = timeNow.tv_usec - m_tvMeasurementEnd.tv_usec; double timeDiff = secsDiff + usecsDiff/1000000.0; m_tvMeasurementEnd = timeNow; - RTPReceptionStatsDB::Iterator statsIter(m_pSource->receptionStatsDB()); + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); // Assume that there's only one SSRC source (usually the case): RTPReceptionStats* stats = statsIter.next(True); if (stats != NULL) @@ -42,7 +69,6 @@ void qosMeasurementRecord::periodicQOSMeasurement(struct timeval const& timeNow) m_nTotNumPacketsExpected = totExpectedNow; double lossFractionNow = deltaExpectedNow == 0 ? 0.0 : 1.0 - deltaReceivedNow/(double)deltaExpectedNow; - //if (lossFractionNow < 0.0) lossFractionNow = 0.0; //reordering can cause if (lossFractionNow < m_dPacket_loss_fraction_min) { m_dPacket_loss_fraction_min = lossFractionNow; @@ -99,19 +125,18 @@ void qosMeasurementRecord::printQOSData() pData->dPacket_loss_fraction_av = 100*packetLossFraction; pData->dPacket_loss_fraction_max = (packetLossFraction == 1.0 ? 100.0 : 100*m_dPacket_loss_fraction_max); - if(m_pSource) + if(m_pSubsession->rtpSource()) { - - RTPReceptionStatsDB::Iterator statsIter(m_pSource->receptionStatsDB()); + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); // Assume that there's only one SSRC source (usually the case): RTPReceptionStats* stats = statsIter.next(True); if (stats != NULL) { pData->dInter_packet_gap_ms_Now = stats->currentInterPacketGapUS()/1000.0; pData->dInter_packet_gap_ms_min = stats->minInterPacketGapUS()/1000.0; - struct timeval totalGaps = stats->totalInterPacketGaps(); - double totalGapsMS = totalGaps.tv_sec*1000.0 + totalGaps.tv_usec/1000.0; - unsigned totNumPacketsReceived = stats->totNumPacketsReceived(); + auto totalGaps = stats->totalInterPacketGaps(); + auto totalGapsMS = totalGaps.tv_sec*1000.0 + totalGaps.tv_usec/1000.0; + auto totNumPacketsReceived = stats->totNumPacketsReceived(); pData->dInter_packet_gap_ms_av = (totNumPacketsReceived == 0 ? 0.0 : totalGapsMS/totNumPacketsReceived); pData->dInter_packet_gap_ms_max = stats->maxInterPacketGapUS()/1000.0; @@ -119,7 +144,7 @@ void qosMeasurementRecord::printQOSData() pData->nBaseExtSeqNum = stats->baseExtSeqNumReceived(); pData->nLastResetExtSeqNum = stats->lastResetExtSeqNumReceived(); pData->nHighestExtSeqNum = stats->highestExtSeqNumReceived(); - pData->dJitter = static_cast(stats->jitter())/static_cast(m_pSource->timestampFrequency()); + pData->dJitter = static_cast(stats->jitter())/static_cast(m_pSubsession->rtpSource()->timestampFrequency()); pData->dJitter *= 1000.0; //into ms not seconds pData->nLastSR_NTPmsw = stats->lastReceivedSR_NTPmsw(); pData->nLastSR_NTPlsw = stats->lastReceivedSR_NTPlsw(); @@ -131,7 +156,17 @@ void qosMeasurementRecord::printQOSData() pData->tvSync.tv_usec = (unsigned)(microseconds+0.5); } - } + pData->sStream = m_pSubsession->GetGroup(); m_pThread->QosUpdated(pData); } + + +unsigned long qosMeasurementRecord::GetQosMeasurementIntervalMS() const +{ + if(m_pThread) + { + return m_pThread->GetQosMeasurementIntervalMS(); + } + return 5000; +} \ No newline at end of file diff --git a/pambase/qos.h b/pambase/qos.h index 43e0dfb7..8a45ba72 100644 --- a/pambase/qos.h +++ b/pambase/qos.h @@ -4,65 +4,41 @@ #include "session.h" class RtpThread; - - +class Smpte2110MediaSubsession; class qosMeasurementRecord { public: - qosMeasurementRecord(struct timeval const& startTime, RTPSource* src,UsageEnvironment& env, RtpThread* pThread) - : m_pSource(src), m_pNext(NULL), - m_pEnv(&env), - m_pThread(pThread), - m_tvMeasurementEnd(startTime), - m_tvMeasurementStart(startTime), - m_dkbits_per_second_min(1e20), m_dkbits_per_second_max(0), - m_dkBytesTotal(0.0), - m_kBytesDeltaNow(0.0), - m_dkbpsNow(0.0), - m_dPacket_loss_fraction_min(1.0), m_dPacket_loss_fraction_max(0.0), - m_nTotNumPacketsReceived(0), m_nTotNumPacketsExpected(0) - { - - - RTPReceptionStatsDB::Iterator statsIter(src->receptionStatsDB()); - // Assume that there's only one SSRC source (usually the case): - RTPReceptionStats* stats = statsIter.next(True); - if (stats != NULL) - { - m_dkBytesTotal = stats->totNumKBytesReceived(); - m_nTotNumPacketsReceived = stats->totNumPacketsReceived(); - m_nTotNumPacketsExpected = stats->totNumPacketsExpected(); - } - } - virtual ~qosMeasurementRecord() - { - delete m_pNext; - } - + explicit qosMeasurementRecord(Smpte2110MediaSubsession* pSubsession); + virtual ~qosMeasurementRecord(){} + void periodicQOSMeasurement(struct timeval const& timeNow); void printQOSData(); + void SetHandler(RtpThread* pThread) { m_pThread = pThread;} + + unsigned long GetQosMeasurementIntervalMS() const; public: - RTPSource* m_pSource; - qosMeasurementRecord* m_pNext; - UsageEnvironment* m_pEnv; + - RtpThread* m_pThread; timeval m_tvMeasurementStart; timeval m_tvMeasurementEnd; - double m_dkbits_per_second_min; - double m_dkbits_per_second_max; - double m_dkBytesTotal; - double m_kBytesDeltaNow; - double m_dkbpsNow; - double m_dPacket_loss_fraction_min; - double m_dPacket_loss_fraction_max; - unsigned int m_nTotNumPacketsReceived; - unsigned int m_nTotNumPacketsExpected; - + double m_dkbits_per_second_min = 1e20; + double m_dkbits_per_second_max = 0.0; + double m_dkBytesTotal = 0.0; + double m_kBytesDeltaNow = 0.0; + double m_dkbpsNow = 0.0; + double m_dPacket_loss_fraction_min = 1.0; + double m_dPacket_loss_fraction_max = 0.0; + unsigned int m_nTotNumPacketsReceived = 0; + unsigned int m_nTotNumPacketsExpected = 0; + +private: + Smpte2110MediaSubsession* m_pSubsession; + //qosMeasurementRecord* m_pNext = nullptr; + RtpThread* m_pThread = nullptr; }; diff --git a/pambase/remoteapi.cpp b/pambase/remoteapi.cpp index b511e2e5..183b3586 100644 --- a/pambase/remoteapi.cpp +++ b/pambase/remoteapi.cpp @@ -732,7 +732,7 @@ pml::restgoose::response RemoteApi::PostWavFile(const query& theQuery, const std } else if(data.name.Get() == "file") { - sLocation = wxString(data.filepath.Get()); + sLocation = wxString(data.filepath.string()); } } pmlLog() << "Name: " << sFilename.ToStdString() << "\tLocation: " << sLocation.ToStdString(); diff --git a/pambase/rtpserverthread.cpp b/pambase/rtpserverthread.cpp index 1d9cddc2..84b29763 100644 --- a/pambase/rtpserverthread.cpp +++ b/pambase/rtpserverthread.cpp @@ -7,6 +7,7 @@ #include "log.h" #include "iomanager.h" +wxDEFINE_EVENT(wxEVT_STREAMING, wxCommandEvent); RtpServerThread::RtpServerThread(wxEvtHandler* pHandler, const std::set& setRTCPHandlers, const wxString& sRTSP, unsigned int nRTSPPort, const wxString& sSourceIp, unsigned int nRTPPort, bool bSSM, LiveAudioSource::enumPacketTime ePacketTime, const std::vector& vRouting) : @@ -48,17 +49,29 @@ void* RtpServerThread::Entry() if(!CreateStream()) { m_mutex.Unlock(); + wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(0); + wxQueueEvent(m_pHandler, pEvent); return NULL; } m_mutex.Unlock(); + wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(1); + wxQueueEvent(m_pHandler, pEvent); + while(m_eventLoopWatchVariable == 0) { m_penv->taskScheduler().doEventLoop(&m_eventLoopWatchVariable); } CloseStream(); + + pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(0); + wxQueueEvent(m_pHandler, pEvent); + return NULL; } @@ -189,11 +202,11 @@ bool RtpServerThread::CreateStream() pmlLog(pml::LOG_INFO) << m_sSDP; - + m_bStreaming = true; m_pSink->startPlaying(*m_pSource, afterPlaying, reinterpret_cast(this)); - m_bStreaming = true; + // Settings::Get().Write(wxT("AoIP"), wxT("Epoch"), pSmss->GetEpochTimestamp()); return true; diff --git a/pambase/rtpserverthread.h b/pambase/rtpserverthread.h index 5d7d5d7f..c47e37cf 100644 --- a/pambase/rtpserverthread.h +++ b/pambase/rtpserverthread.h @@ -65,3 +65,4 @@ class PAMBASE_IMPEXPORT RtpServerThread : public wxThread std::vector m_vRouting; }; +wxDECLARE_EXPORTED_EVENT(WXEXPORT, wxEVT_STREAMING, wxCommandEvent); \ No newline at end of file diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index 148803ca..24385800 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -14,6 +14,8 @@ #include "wxptp.h" #include "aes67source.h" #include "log.h" +#include "settings.h" + using namespace std; //// A function that outputs a string that identifies each subsession (for debugging output). Modify this if you wish: @@ -22,11 +24,18 @@ UsageEnvironment& operator<<(UsageEnvironment& env, const Smpte2110MediaSubsessi return env << subsession.mediumName() << "/" << subsession.codecName(); } +bool Tv1LessThanTv2(const timeval& tv1, const timeval& tv2) +{ + return (tv1.tv_sec < tv2.tv_sec || (tv1.tv_sec == tv2.tv_sec && tv1.tv_usec < tv2.tv_usec)); +} + + DEFINE_EVENT_TYPE(wxEVT_QOS_UPDATED) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION_CLOSED) DEFINE_EVENT_TYPE(wxEVT_SDP) +DEFINE_EVENT_TYPE(wxEVT_RTP_FRAME) RtpThread::RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly) : wxThread(wxTHREAD_JOINABLE), @@ -120,7 +129,7 @@ void* RtpThread::Entry() // @todo do we need to delete clients etc? if(m_pRtspClient) { - pmlLog(pml::LOG_TRACE) << "RTPThread::Entry\t" << "Shutdown stream"; + pmlLog(pml::LOG_DEBUG) << "RTPThread::Entry\t" << "Shutdown stream"; shutdownStream(m_pRtspClient, 0); m_pRtspClient = nullptr; } @@ -137,7 +146,7 @@ void RtpThread::StreamFromSDP() m_pSession = Smpte2110MediaSession::createNew(*m_penv, m_sDescriptor.c_str()); - if (m_pSession == NULL) + if (m_pSession == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a MediaSession object from the SDP description: " << m_penv->getResultMsg(); return; @@ -151,67 +160,51 @@ void RtpThread::StreamFromSDP() unsigned int nCountAudio(0); unsigned int nCountVideo(0); MediaSubsessionIterator iterCount(*m_pSession); - MediaSubsession* pSubsessionCount = NULL; - while ((pSubsessionCount = iterCount.next()) != NULL) + MediaSubsession* pSubsessionCount = nullptr; + while ((pSubsessionCount = iterCount.next()) != nullptr) { if (strcmp(pSubsessionCount->codecName(), "L16") == 0 || strcmp(pSubsessionCount->codecName(), "L24") == 0) // 16 or 24-bit linear audio (RFC 3190) { if(pSubsessionCount->numChannels() > 0) + { nCountAudio++; + } else { pmlLog(pml::LOG_WARN) << "RTP Client\tAudio subsession, but 0 channels defined"; } } - else if (strcmp(pSubsessionCount->codecName(), "RAW") == 0) - { - nCountVideo++; - } } pmlLog(pml::LOG_DEBUG) << "RTP Client\tNumber of AES67 Subsessions: " << nCountAudio; - pmlLog(pml::LOG_DEBUG) << "RTP Client\tNumber of Video Subsessions: " << nCountVideo; + pmlLog(pml::LOG_DEBUG) << "RTP Client\tStreams = " << m_pSession->GetGroups().size(); if(nCountAudio == 0) { pmlLog(pml::LOG_WARN) << "RTP Client\tNo AES67 subsessions. Exit"; return; } + + MediaSubsessionIterator iter(*m_pSession); - Smpte2110MediaSubsession* subsession = NULL; - while ((subsession = dynamic_cast(iter.next())) != NULL) + Smpte2110MediaSubsession* pSubsession = nullptr; + while ((pSubsession = dynamic_cast(iter.next())) != nullptr) { - if (!subsession->initiate (0)) - { - pmlLog(pml::LOG_WARN) << "RTP Client\tFailed to initiate the subsession: " << m_penv->getResultMsg(); - } - else + if((m_pSession->GetGroups().find(pSubsession->GetGroup()) != m_pSession->GetGroups().end())) // duplicate streams { - subsession->sink = wxSink::createNew(*m_penv, *subsession, this); - pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the subsession: "; - if (subsession->rtcpIsMuxed()) + if (!pSubsession->initiate (0)) { - pmlLog(pml::LOG_DEBUG) << "client port " << subsession->clientPortNum(); + pmlLog(pml::LOG_WARN) << "RTP Client\tFailed to initiate the subsession: " << m_penv->getResultMsg(); } else { - pmlLog(pml::LOG_DEBUG) << "client ports " << subsession->clientPortNum() << "-" << subsession->clientPortNum()+1; - } - - pmlLog(pml::LOG_DEBUG) << "RTP Client\tSessionId: " << subsession->GetEndpoint(); - if (subsession->sink == NULL) - { - pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a data sink for the subsession: " << m_penv->getResultMsg(); - } - else - { - pmlLog(pml::LOG_DEBUG) << "RTP Client\tCreated a data sink for the subsession"; - - subsession->sink->startPlaying(*subsession->readSource(), NULL, NULL); - beginQOSMeasurement(*m_penv, m_pSession, this); + CreateSink(pSubsession); } } } PassSessionDetails(m_pSession); + beginQOSMeasurement(*m_penv, m_pSession, this); + + while(m_eventLoopWatchVariable == 0) { @@ -219,6 +212,31 @@ void RtpThread::StreamFromSDP() } } +void RtpThread::CreateSink(Smpte2110MediaSubsession* pSubsession) +{ + pSubsession->sink = wxSink::createNew(*m_penv, *pSubsession, this); + pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the subsession: "; + if (pSubsession->rtcpIsMuxed()) + { + pmlLog(pml::LOG_DEBUG) << "client port " << pSubsession->clientPortNum(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "client ports " << pSubsession->clientPortNum() << "-" << pSubsession->clientPortNum()+1; + } + pmlLog(pml::LOG_DEBUG) << "RTP Client\tSessionId: " << pSubsession->GetEndpoint(); + + if (pSubsession->sink == nullptr) + { + pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a data sink for the subsession: " << m_penv->getResultMsg(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "RTP Client\tCreated a data sink for the subsession"; + pSubsession->sink->startPlaying(*pSubsession->readSource(), nullptr, nullptr); + } +} + bool RtpThread::DoRTSP() { // Begin by creating a "RTSPClient" object. Note that there is a separate "RTSPClient" object for each stream that we wish @@ -226,14 +244,13 @@ bool RtpThread::DoRTSP() wxString sUrl(m_source.sDetails); sUrl.Replace(wxT(" "), wxT("%20")); m_pRtspClient = ourRTSPClient::createNew((*m_penv), sUrl.mb_str(), this, 1, m_sProgName.mb_str()); - if (m_pRtspClient == NULL) + if (m_pRtspClient == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a RTSP client for URL \"" << sUrl.ToStdString() << "\": " << (*m_penv).getResultMsg(); return false; } pmlLog() << "RTSP Send Options"; m_pRtspClient->sendOptionsCommand(continueAfterOPTIONS); - //m_pRtspClient->sendDescribeCommand(continueAfterDESCRIBE); return true; } @@ -243,7 +260,7 @@ bool RtpThread::DoSIP() wxString sUrl(m_source.sDetails); sUrl.Replace(wxT(" "), wxT("%20")); m_pSipClient = ourSIPClient::createNew((*m_penv), sUrl.mb_str(), this, 1, m_sProgName.mb_str()); - if (m_pRtspClient == NULL) + if (m_pRtspClient == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a RTSP client for URL \"" << sUrl.ToStdString() << "\": " << (*m_penv).getResultMsg(); return false; @@ -273,14 +290,109 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy return static_cast(nSample)/ 2147483648.0; } -void RtpThread::AddFrame(const wxString& sEndpoint, unsigned long nSSRC, const timeval& timePresentation, unsigned long nFrameSize, u_int8_t* pFrameBuffer, -u_int8_t nBytesPerSample, const timeval& timeTransmission, -unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExtension_t* pExt) +void RtpThread::AddFrame(std::shared_ptr pFrame) { - if(m_bClosing || m_Session.GetCurrentSubsession() == m_Session.lstSubsession.end() || m_Session.GetCurrentSubsession()->sSourceAddress != sEndpoint) + if(m_bClosing || m_Session.GetCurrentSubsession() == m_Session.lstSubsession.end() || m_nInputChannels==0) + { return; + } + + auto itGroup = m_mRedundantBuffers.find(pFrame->sGroup); + if(itGroup == m_mRedundantBuffers.end()) + { + itGroup = m_mRedundantBuffers.insert({pFrame->sGroup, std::list>()}).first; + m_mStreamUsage.insert({pFrame->sGroup, 0}); + } + itGroup->second.push_back(pFrame); + + if(m_pHandler) + { + wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_RTP_FRAME); + pEvent->SetString(pFrame->sGroup); + pEvent->SetInt(pFrame->nTimestamp); + wxQueueEvent(m_pHandler, pEvent); + } + + HandleFrameAdded(); +} + +void RtpThread::WorkoutFirstFrame() +{ + //if we've not yet extracted from the buffer then get the one with the earliest transmission time + gettimeofday(&m_tvLastExtracted, nullptr); + size_t nMaxReceived = 0; - if(m_pCurrentBuffer == 0) + for(const auto& pairBuffer : m_mRedundantBuffers) + { + nMaxReceived = std::max(nMaxReceived, pairBuffer.second.size()); + if(pairBuffer.second.empty() == false && Tv1LessThanTv2(pairBuffer.second.front()->timeTransmission, m_tvLastExtracted)) + { + m_nTimestamp = pairBuffer.second.front()->nTimestamp-1; + m_tvLastExtracted = pairBuffer.second.front()->timeTransmission; + } + } + if(nMaxReceived > m_nRedundantBufferQueue) //we don't move on from this until at least one stream has sent (10) frames + { + m_bFrameExtracted = true; + } +} + +void RtpThread::HandleFrameAdded() +{ + if(m_mRedundantBuffers.size() == 1) //no redundant frames so no point buffering + { + if(m_mRedundantBuffers.begin()->second.empty() == false) + { + ConvertFrameToTimedBuffer(m_mRedundantBuffers.begin()->second.front()); + m_mRedundantBuffers.begin()->second.pop_front(); + } + } + else if(m_bFrameExtracted == false) + { + WorkoutFirstFrame(); + } + else + { + WorkoutNextFrame(); + } +} + +void RtpThread::WorkoutNextFrame() +{ + auto bExtracted = false; + for(const auto& pairBuffer : m_mRedundantBuffers) + { + for(auto itFrame = pairBuffer.second.begin(); itFrame != pairBuffer.second.end();) + { + if(Tv1LessThanTv2((*itFrame)->timeTransmission, m_tvLastExtracted)) + { //delete frame if transmitted earlier than the last one we extracted + auto itDelete = itFrame; + ++itFrame; + pairBuffer.second.erase(itFrame); + } + else if((*itFrame)->nTimestamp == m_nTimestamp+1) //this is the timestamp we want + { + if(!bExtracted) + { + m_tvLastExtracted = (*itFrame)->timeTransmission; + ConvertFrameToTimedBuffer(*itFrame); + bExtracted = true; + } + pairBuffer.second.erase(itFrame); + break; + } + else + { + ++itFrame; + } + } + } +} + +void RtpThread::ConvertFrameToTimedBuffer(std::shared_ptr pFrame) +{ + + if(m_pCurrentBuffer == nullptr) { m_pCurrentBuffer = new float[m_nBufferSize*m_nInputChannels]; m_nSampleBufferSize = 0; @@ -288,16 +400,16 @@ unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExten double dOffset = 0.0; - for(int i = 0; i < nFrameSize; i+=nBytesPerSample) + for(int i = 0; i < pFrame->nFrameSize; i+=pFrame->nBytesPerSample) { - float dSample(ConvertFrameBufferToSample(&pFrameBuffer[i], nBytesPerSample)); + auto dSample = ConvertFrameBufferToSample(&(pFrame->pBuffer[i]), pFrame->nBytesPerSample); if(m_nSampleBufferSize == 0) { - m_dTransmission = timeTransmission.tv_sec + (static_cast(timeTransmission.tv_usec))/1000000.0; - m_dPresentation = (timePresentation.tv_sec + (static_cast(timePresentation.tv_usec))/1000000.0) - dOffset; + m_dTransmission = pFrame->timeTransmission.tv_sec + (static_cast(pFrame->timeTransmission.tv_usec))/1000000.0; + m_dPresentation = (pFrame->timePresentation.tv_sec + (static_cast(pFrame->timePresentation.tv_usec))/1000000.0) - dOffset; //is the timestamp what we'd expect?? - m_nTimestamp = nTimestamp; + m_nTimestamp = pFrame->nTimestamp; } else if(i%m_nInputChannels ==0) @@ -316,36 +428,30 @@ unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExten if(m_nSampleBufferSize == m_nBufferSize*m_nInputChannels) //filled up buffer { - timedbuffer* pTimedBuffer = new timedbuffer(m_nBufferSize*m_nInputChannels, ConvertDoubleToPairTime(m_dPresentation), m_nTimestamp, m_nInputChannels); + auto pTimedBuffer = new timedbuffer(m_nBufferSize*m_nInputChannels, ConvertDoubleToPairTime(m_dPresentation), m_nTimestamp, m_nInputChannels); pTimedBuffer->SetBuffer(m_pCurrentBuffer); pTimedBuffer->SetTransmissionTime(ConvertDoubleToPairTime(m_dTransmission)); - pTimedBuffer->SetDuration(nDuration); - AudioEvent* pEvent = new AudioEvent(pTimedBuffer, AudioEvent::RTP, m_nBufferSize, m_nSampleRate, false, false); + pTimedBuffer->SetDuration(pFrame->nFrameSize); + auto pEvent = new AudioEvent(pTimedBuffer, AudioEvent::RTP, m_nBufferSize, m_nSampleRate, false, false); wxQueueEvent(m_pHandler, pEvent); m_nSampleBufferSize = 0; } } - - - //QOS - if(m_nInputChannels*nBytesPerSample != 0) + if(m_nInputChannels*pFrame->nBytesPerSample != 0) { - unsigned int nExpectedDifference = nFrameSize/(m_nInputChannels*nBytesPerSample); - if(nExpectedDifference != nTimestampDifference) + auto nExpectedDifference = pFrame->nFrameSize/(m_nInputChannels*pFrame->nBytesPerSample); + if(nExpectedDifference != pFrame->nTimestampDifference) { m_nTimestampErrors++; - m_nTimestampErrorsTotal++; } } - - int nFramesPerSec = (m_nSampleRate*m_nInputChannels*nBytesPerSample)/nFrameSize; - + int nFramesPerSec = (m_nSampleRate*m_nInputChannels*pFrame->nBytesPerSample)/pFrame->nFrameSize; timeval tvSub; - timersub(&timePresentation, &timeTransmission, &tvSub); + timersub(&pFrame->timePresentation, &pFrame->timeTransmission, &tvSub); double dTSDF = (static_cast(tvSub.tv_sec)*1000000.0)+tvSub.tv_usec; if(m_dDelay0 == std::numeric_limits::lowest() || m_nTSDFCount == nFramesPerSec) @@ -362,11 +468,13 @@ unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExten else { dTSDF -= m_dDelay0; - // dTSDF *= 1000000.0; m_dTSDFMax = max(m_dTSDFMax, dTSDF); m_dTSDFMin = min(m_dTSDFMin, dTSDF); m_nTSDFCount++; } + + //keep track of which streams frames come from + ++m_mStreamUsage[pFrame->sGroup]; } @@ -376,7 +484,7 @@ void RtpThread::StopStream() if(m_pRtspClient) { pmlLog(pml::LOG_INFO) << "RTP Client\tStop Stream "; - pmlLog(pml::LOG_TRACE) << "RTPThread::StopStream\t" << "Shutdown stream"; + pmlLog(pml::LOG_DEBUG) << "RTPThread::StopStream\t" << "Shutdown stream"; shutdownStream(m_pRtspClient, 0); m_pRtspClient = nullptr; } @@ -389,7 +497,12 @@ void RtpThread::StopStream() void RtpThread::QosUpdated(qosData* pData) { - + auto itStream = m_mStreamUsage.find(pData->sStream); + if(itStream != m_mStreamUsage.end()) + { + pData->nFramesUsed = itStream->second; + } + pData->nTimestampErrors = m_nTimestampErrors; pData->nTimestampErrorsTotal = m_nTimestampErrorsTotal; pData->dTSDF = m_dTSDF; @@ -407,6 +520,10 @@ void RtpThread::QosUpdated(qosData* pData) void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) { + pmlLog(pml::LOG_DEBUG) << "RtpThread::PassSessionDetails"; + + //make the buffer queue the same size as the number of streams + m_Session = session(); m_Session.sName = wxString::FromUTF8(pSession->sessionName()); @@ -414,18 +531,19 @@ void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) m_Session.sType = wxString::FromUTF8(pSession->mediaSessionType()); m_Session.refClock = pSession->GetRefClock(); m_Session.sDescription = wxString::FromUTF8(pSession->sessionDescription()); - m_Session.sGroups = pSession->GetGroupDup(); + m_Session.setGroups = pSession->GetGroups(); MediaSubsessionIterator iterSub(*pSession); - Smpte2110MediaSubsession* pSubsession = NULL; - while ((pSubsession = dynamic_cast(iterSub.next())) != NULL) + Smpte2110MediaSubsession* pSubsession = nullptr; + while ((pSubsession = dynamic_cast(iterSub.next())) != nullptr) { refclk clock = pSubsession->GetRefClock(); timeval tvEpoch = pSubsession->GetLastEpoch(); m_Session.lstSubsession.push_back(subsession(wxString::FromUTF8(pSubsession->sessionId()), wxString::FromUTF8(pSubsession->GetEndpoint()), + pSubsession->GetGroup(), wxString::FromUTF8(pSubsession->mediumName()), wxString::FromUTF8(pSubsession->codecName()), wxString::FromUTF8(pSubsession->protocolName()), @@ -436,9 +554,9 @@ void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) tvEpoch, pSubsession->GetRefClock())); #ifdef PTPMONKEY - if(pSubsession->GetRefClock().sType.CmpNoCase(wxT("PTP")) == 0) + if(pSubsession->GetRefClock().sType.CmpNoCase("PTP") == 0) { - wxPtp::Get().RunDomain(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain); + wxPtp::Get().RunDomain(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); } #endif // PTPMONKEY @@ -494,7 +612,7 @@ void RtpThread::SetQosMeasurementIntervalMS(unsigned long nMilliseconds) unsigned long RtpThread::GetQosMeasurementIntervalMS() { - wxMutexLocker ml(m_mutex); + //wxMutexLocker ml(m_mutex); return m_nQosMeasurementIntervalMS; } @@ -504,8 +622,8 @@ void RtpThread::MasterClockChanged() if(m_pSession) { MediaSubsessionIterator iter(*m_pSession); - Smpte2110MediaSubsession* subsession = NULL; - while ((subsession = dynamic_cast(iter.next())) != NULL) + Smpte2110MediaSubsession* subsession = nullptr; + while ((subsession = dynamic_cast(iter.next())) != nullptr) { Aes67Source* pSource = dynamic_cast(subsession->readSource()); if(pSource) diff --git a/pambase/rtpthread.h b/pambase/rtpthread.h index 91f5df49..cee1e01c 100644 --- a/pambase/rtpthread.h +++ b/pambase/rtpthread.h @@ -12,7 +12,9 @@ #include "dlldefine.h" #include "aoipsourcemanager.h" #include - +#include +#include +#include struct qosData; class Smpte2110MediaSession; @@ -22,7 +24,7 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread public: RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly = false); void* Entry(); - void AddFrame(const wxString& sEndpoint, unsigned long nSSRC, const timeval& timePresentation, unsigned long nFrameSize, u_int8_t* pBuffer, u_int8_t nBits, const timeval& timeTransmission, unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExtension_t* pExt); + void AddFrame(std::shared_ptr pFrame); void MasterClockChanged(); @@ -70,7 +72,13 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread timeval ConvertDoubleToPairTime(double dTime); + void CreateSink(Smpte2110MediaSubsession* pSubsession); + + void HandleFrameAdded(); + void ConvertFrameToTimedBuffer(std::shared_ptr pFrame); + void WorkoutFirstFrame(); + void WorkoutNextFrame(); wxEvtHandler* m_pHandler; wxString m_sProgName; @@ -82,7 +90,6 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread wxCondition* m_pCondition; wxString m_sReceivingInterface; - std::queue m_qBufferFrames; float* m_pCurrentBuffer; double m_dTransmission; @@ -118,7 +125,11 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread unsigned long m_nQosMeasurementIntervalMS; - + std::map>> m_mRedundantBuffers; + std::map m_mStreamUsage; + bool m_bFrameExtracted = false; + timeval m_tvLastExtracted; + size_t m_nRedundantBufferQueue = 10; }; @@ -126,5 +137,6 @@ DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_QOS_UPDATED,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_CLOSED,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_SDP,-1) -DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RPT_SESSION_EPOCH,-1) +DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_EPOCH,-1) +DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_FRAME,-1) diff --git a/pambase/rtsputil.cpp b/pambase/rtsputil.cpp index 2708cf1e..24571fe6 100644 --- a/pambase/rtsputil.cpp +++ b/pambase/rtsputil.cpp @@ -26,12 +26,6 @@ std::stringstream& operator<<(std::stringstream& ss, const MediaSubsession& subs } - -TaskToken qosMeasurementTimerTask = NULL; - -qosMeasurementRecord* g_pRecord = NULL; - - void continueAfterOPTIONS(RTSPClient* rtspClient, int resultCode, char* resultString) { if(resultCode == 0 && rtspClient != nullptr) @@ -130,40 +124,52 @@ void setupNextSubsession(RTSPClient* rtspClient) UsageEnvironment& env = rtspClient->envir(); // alias StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias + auto pSession = dynamic_cast(scs.session); + scs.subsession = scs.iter->next(); if (scs.subsession != NULL) { - if (!scs.subsession->initiate()) - { - pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to initiate the \"" << *scs.subsession << "\" subsession: " << env.getResultMsg();; - setupNextSubsession(rtspClient); // give up on this subsession; go to the next one - } - else + + auto pSubsession = dynamic_cast(scs.subsession); + + if((pSession->GetGroups().find(pSubsession->GetGroup()) != pSession->GetGroups().end())) // duplicate streams { - pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the \"" <sessionId()<< "\" subsession ("; - if (scs.subsession->rtcpIsMuxed()) + if (!pSubsession->initiate()) { - pmlLog(pml::LOG_DEBUG) << "client port " << scs.subsession->clientPortNum(); + pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to initiate the \"" << *pSubsession << "\" subsession: " << env.getResultMsg();; + setupNextSubsession(rtspClient); // give up on this subsession; go to the next one } else { - pmlLog(pml::LOG_DEBUG) << "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1; - } - pmlLog(pml::LOG_DEBUG) << " SubsessionId: " << scs.subsession->sessionId(); + pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the \"" <sessionId()<< "\" subsession ("; + if (pSubsession->rtcpIsMuxed()) + { + pmlLog(pml::LOG_DEBUG) << "client port " << pSubsession->clientPortNum(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "client ports " << pSubsession->clientPortNum() << "-" << pSubsession->clientPortNum()+1; + } + pmlLog(pml::LOG_DEBUG) << " SubsessionId: " << pSubsession->sessionId(); - // Continue setting up this subsession, by sending a RTSP "SETUP" command: - rtspClient->sendSetupCommand(*scs.subsession, continueAfterSETUP, False, False); + // Continue setting up this subsession, by sending a RTSP "SETUP" command: + rtspClient->sendSetupCommand(*pSubsession, continueAfterSETUP, False, False); + } + return; + } + else + { + setupNextSubsession(rtspClient); // give up on this subsession; go to the next one } - return; } if(scs.sFirstSubSessionId.empty() == false) { //managed to setup at least 1 subsession - ourRTSPClient* pClient = dynamic_cast(rtspClient); + auto pClient = dynamic_cast(rtspClient); if(pClient) { - pClient->GetHandler()->PassSessionDetails(dynamic_cast(scs.session)); + pClient->GetHandler()->PassSessionDetails(pSession); // We've finished setting up all of the subsessions. Now, send a RTSP "PLAY" command to start the streaming: scs.duration = scs.session->playEndTime() - scs.session->playStartTime(); @@ -414,50 +420,20 @@ void beginQOSMeasurement(UsageEnvironment& env, MediaSession* session, RtpThread struct timeval startTime; gettimeofday(&startTime, NULL); nextQOSMeasurementUSecs = startTime.tv_sec*1000000 + startTime.tv_usec; - // qosMeasurementRecord* qosRecordTail = NULL; + MediaSubsessionIterator iter(*session); MediaSubsession* subsession; while ((subsession = iter.next()) != NULL) { - RTPSource* src = subsession->rtpSource(); - if (src != NULL) + auto pSubsession = dynamic_cast(subsession); + if(pSubsession) { - if(g_pRecord != NULL) - { - delete g_pRecord; - } - g_pRecord = new qosMeasurementRecord(startTime, src, env, pThread); - scheduleNextQOSMeasurement(); - break; + pSubsession->SetHandler(pThread); + pSubsession->ScheduleNextQOSMeasurement(); } } } -void scheduleNextQOSMeasurement() -{ - nextQOSMeasurementUSecs += g_pRecord->m_pThread->GetQosMeasurementIntervalMS()*1000; - struct timeval timeNow; - gettimeofday(&timeNow, NULL); - unsigned timeNowUSecs = timeNow.tv_sec*1000000 + timeNow.tv_usec; - int usecsToDelay = nextQOSMeasurementUSecs - timeNowUSecs; - - - qosMeasurementTimerTask = g_pRecord->m_pEnv->taskScheduler().scheduleDelayedTask(usecsToDelay, (TaskFunc*)periodicQOSMeasurement, (void*)NULL); - - - -} - -void periodicQOSMeasurement(UsageEnvironment& env, void* clientData) -{ - struct timeval timeNow; - gettimeofday(&timeNow, NULL); - - g_pRecord->periodicQOSMeasurement(timeNow); - - // Do this again later: - scheduleNextQOSMeasurement(); -} diff --git a/pambase/rtsputil.h b/pambase/rtsputil.h index f4254133..fd8bcf88 100644 --- a/pambase/rtsputil.h +++ b/pambase/rtsputil.h @@ -9,6 +9,7 @@ class RtpThread; class qosMeasurementRecord; +class Smpte2110MediaSubsessionl; static unsigned nextQOSMeasurementUSecs; @@ -38,6 +39,5 @@ void setupNextSubsession(RTSPClient* rtspClient); void shutdownStream(RTSPClient* rtspClient, int exitCode = 1); void beginQOSMeasurement(UsageEnvironment& env, MediaSession* session, RtpThread* pThread); -static void periodicQOSMeasurement(UsageEnvironment& env, void* clientData); // forward -static void scheduleNextQOSMeasurement(); + diff --git a/pambase/session.h b/pambase/session.h index 1135617a..76910a2c 100644 --- a/pambase/session.h +++ b/pambase/session.h @@ -6,6 +6,8 @@ #include #include #include +#include + extern const wxString CH_GROUP_ORDER[8]; extern const wxString CH_GROUP_TYPE[15]; @@ -55,25 +57,25 @@ struct PAMBASE_IMPEXPORT subsession enumChannel type; }; - subsession() : nPort(0), nSampleRate(0), nChannels(0), nSyncTimestamp(0){} - subsession(const wxString& sI, const wxString& sourceaddress, const wxString& medium, const wxString& codec, const wxString& protocol, - unsigned int port, unsigned int samplerate, const std::vector& channels, - unsigned int synctimestamp, const timeval& epoch, const refclk& clk) : - sId(sI), sSourceAddress(sourceaddress), sMedium(medium), sCodec(codec), sProtocol(protocol), nPort(port), nSampleRate(samplerate), nChannels(channels.size()), + subsession()=default; + subsession(const wxString& sI, const wxString& sourceaddress, const wxString& group, const wxString& medium, const wxString& codec, const wxString& protocol, unsigned int port, unsigned int samplerate, const std::vector& channels,unsigned int synctimestamp, const timeval& epoch, const refclk& clk) : + sId(sI), sSourceAddress(sourceaddress), sGroup(group), sMedium(medium), sCodec(codec), sProtocol(protocol), nPort(port), nSampleRate(samplerate), nChannels(channels.size()), vChannels(channels), nSyncTimestamp(synctimestamp), tvEpoch(epoch),refClock(clk){} wxString sId; wxString sSourceAddress; + wxString sGroup; wxString sMedium; wxString sCodec; wxString sProtocol; - unsigned int nPort; - unsigned int nSampleRate; - unsigned int nChannels; - + + unsigned int nPort = 0; + unsigned int nSampleRate = 0; + unsigned int nChannels = 0; + std::vector vChannels; - unsigned int nSyncTimestamp; + unsigned int nSyncTimestamp = 0; timeval tvEpoch; refclk refClock; @@ -81,9 +83,8 @@ struct PAMBASE_IMPEXPORT subsession struct PAMBASE_IMPEXPORT session { - session(const wxString& sRaw=wxEmptyString, const wxString& sn=wxEmptyString, const wxString& st=wxEmptyString, const wxString& sD=wxEmptyString, const wxString& sGr=wxEmptyString) : sRawSDP(sRaw), sName(sn), sType(st), sDescription(sD), sGroups(sGr), lstSubsession(std::list()) + session(const wxString& sRaw=wxEmptyString, const wxString& sn=wxEmptyString, const wxString& st=wxEmptyString, const wxString& sD=wxEmptyString, const std::set& groups={}) : sRawSDP(sRaw), sName(sn), sType(st), sDescription(sD), setGroups(groups), lstSubsession(std::list()) { - itCurrentSubsession = lstSubsession.end(); } @@ -105,7 +106,7 @@ struct PAMBASE_IMPEXPORT session wxString sName; wxString sType; wxString sDescription; - wxString sGroups; + std::set setGroups; refclk refClock; std::list lstSubsession; @@ -119,64 +120,44 @@ struct PAMBASE_IMPEXPORT session struct PAMBASE_IMPEXPORT qosData { qosData() : tsTime(0,0,0,0), - dkbits_per_second_min(-1.0), - dkbits_per_second_max(-1.0), - dkbits_per_second_Av(-1.0), - dkbits_per_second_Now(-1.0), - dkBytesTotal(-1.0), - dPacket_loss_fraction_min(-1.0), - dPacket_loss_fraction_max(-1.0), - dPacket_loss_fraction_av(-1.0), - nTotNumPacketsReceived(0), - dInter_packet_gap_ms_Now(-1.0), - dInter_packet_gap_ms_min(-1.0), - dInter_packet_gap_ms_av(-1.0), - dInter_packet_gap_ms_max(-1.0), - nTotNumPacketsLost(-1), - nBaseExtSeqNum(0), - nLastResetExtSeqNum(0), - nHighestExtSeqNum(0), - dJitter(-1.0), - nLastSR_NTPmsw(0), - nLastSR_NTPlsw(0), tvLastSR_Time{0,0}, - tvSync{0,0}, - nSSRC(0), - dTSDF(-1.0), - nTimestampErrors(0), - nTimestampErrorsTotal(0){} + tvSync{0,0} + {} wxTimeSpan tsTime; - double dkbits_per_second_min; - double dkbits_per_second_max; - double dkbits_per_second_Av; - double dkbits_per_second_Now; - double dkBytesTotal; - double dPacket_loss_fraction_min; - double dPacket_loss_fraction_max; - double dPacket_loss_fraction_av; - unsigned int nTotNumPacketsReceived; - - double dInter_packet_gap_ms_Now; - double dInter_packet_gap_ms_min; - double dInter_packet_gap_ms_av; - double dInter_packet_gap_ms_max; - int nTotNumPacketsLost; - - unsigned int nBaseExtSeqNum; - unsigned int nLastResetExtSeqNum; - unsigned int nHighestExtSeqNum; - double dJitter; - unsigned int nLastSR_NTPmsw; - unsigned int nLastSR_NTPlsw; + double dkbits_per_second_min = -1.0; + double dkbits_per_second_max = -1.0; + double dkbits_per_second_Av = -1.0; + double dkbits_per_second_Now = -1.0; + double dkBytesTotal = -1.0; + double dPacket_loss_fraction_min = -1.0; + double dPacket_loss_fraction_max = -1.0; + double dPacket_loss_fraction_av = -1.0; + unsigned int nTotNumPacketsReceived = 0; + + double dInter_packet_gap_ms_Now = -1.0; + double dInter_packet_gap_ms_min = -1.0; + double dInter_packet_gap_ms_av = -1.0; + double dInter_packet_gap_ms_max = -1.0; + int nTotNumPacketsLost = -1; + + unsigned int nBaseExtSeqNum = 0; + unsigned int nLastResetExtSeqNum = 0; + unsigned int nHighestExtSeqNum = 0; + double dJitter = -1.0; + unsigned int nLastSR_NTPmsw = 0; + unsigned int nLastSR_NTPlsw = 0; timeval tvLastSR_Time; timeval tvSync; - unsigned int nSSRC; + unsigned int nSSRC = 0; + + double dTSDF = -1.0; + unsigned int nTimestampErrors = 0; + unsigned int nTimestampErrorsTotal = 0; - double dTSDF; - unsigned int nTimestampErrors; - unsigned int nTimestampErrorsTotal; + wxString sStream; + unsigned long nFramesUsed = 0; }; extern const std::map CH_GROUP_SIZE; diff --git a/pambase/smpte2110mediasession.cpp b/pambase/smpte2110mediasession.cpp index 6f3a3de2..8e888dee 100644 --- a/pambase/smpte2110mediasession.cpp +++ b/pambase/smpte2110mediasession.cpp @@ -10,29 +10,20 @@ #include #include "wxptp.h" #include "log.h" - - -using namespace std; - -const wxString Smpte2110MediaSubsession::STR_SAMPLING[13] = { wxT("YCbCr-4:4:4"), wxT("YCbCr-4:2:2"), wxT("YCbCr-4:2:0"), wxT("CLYCbCr-4:4:4"), wxT("CLYCbCr-4:2:2"), wxT("CLYCbCr-4:2:0"), wxT("ICtCp-4:4:4"), wxT("ICtCp-4:2:2"), wxT("ICtCp-4:2:0"), wxT("RGB"), wxT("XYZ"), wxT("KEY"), wxT("Unknown")}; -const wxString Smpte2110MediaSubsession::STR_COLORIMETRY[8] = {wxT("BT601"), wxT("BT709"), wxT("BT2020"), wxT("BT2100"), wxT("ST2065-1"), wxT("ST2065-3"), wxT("XYZ"), wxT("Unspecified")}; -const wxString Smpte2110MediaSubsession::STR_TCS[10] = {wxT("SDR"), wxT("PQ"), wxT("HLG"), wxT("LINEAR"), wxT("BT2100LINPQ"), wxT("BT2100LINHLG"), wxT("ST2065-1"), wxT("ST2428-1"), wxT("DENSITY"), wxT("Unspecified")}; -const wxString Smpte2110MediaSubsession::STR_RANGE[3] = {wxT("Narrow"), wxT("FullProtect"), wxT("Full")}; -const wxString Smpte2110MediaSubsession::STR_PACKING[2] = {wxT("General"), wxT("Block")}; - +#include "rtsputil.h" +#include "threadpool.h" Smpte2110MediaSession* Smpte2110MediaSession::createNew(UsageEnvironment& env, char const* sdpDescription) { - Smpte2110MediaSession* newSession = new Smpte2110MediaSession(env); - if (newSession != NULL) + auto newSession = new Smpte2110MediaSession(env); + if (newSession != nullptr) { - newSession->initializeSMPTE_SDP(sdpDescription); if (!newSession->initializeWithSDP(sdpDescription)) { delete newSession; - return NULL; + return nullptr; } } @@ -41,7 +32,7 @@ Smpte2110MediaSession* Smpte2110MediaSession::createNew(UsageEnvironment& env, void Smpte2110MediaSession::initializeSMPTE_SDP(char const* sdpDescription) { - if (sdpDescription == NULL) + if (sdpDescription == nullptr) { return; } @@ -51,7 +42,7 @@ void Smpte2110MediaSession::initializeSMPTE_SDP(char const* sdpDescription) // Begin by processing all SDP lines until we see the first "m=" char const* sdpLine = sdpDescription; char const* nextSDPLine; - while (1) + while (true) { if (!parseSDPLine(sdpLine, nextSDPLine)) { @@ -170,11 +161,20 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_Group(char const* sdpLine) size_t nFront = sSdp.find(sFind); if(nFront != wxNOT_FOUND) { + m_setGroups.clear(); + size_t nEnd = sSdp.find(wxT("\n"), nFront); nEnd -= nFront; - m_sGroups = sSdp.substr(nFront+sFind.length(), (nEnd-sFind.length())); + auto asGroups = wxStringTokenize(sSdp.substr(nFront+sFind.length(), (nEnd-sFind.length())), " "); + for(const auto& sGroup : asGroups) + { + m_setGroups.insert(sGroup); + } return True; } + + m_setGroups = {"1"}; + return False; } @@ -210,9 +210,7 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_MaxPTime(char const* sdpLine) } -Smpte2110MediaSession::Smpte2110MediaSession(UsageEnvironment& env) : MediaSession(env), - m_dPackageMs(0), - m_dMaxPackageMs(0) +Smpte2110MediaSession::Smpte2110MediaSession(UsageEnvironment& env) : MediaSession(env) { } @@ -226,25 +224,7 @@ MediaSubsession* Smpte2110MediaSession::createNewMediaSubsession() } -Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), - m_nSyncTime(0), - m_nFirstTimestamp(0), - m_dClockDeviation(0), - m_dPackageMs(0), - m_dMaxPackageMs(0), - m_nSampling(0), - m_nDepth(0), - m_bFloating(false), - m_nWidth(0), - m_nHeight(0), - m_nColorimetry(0), - m_nPackingMode(0), - m_bInterlaced(false), - m_bSegmented(false), - m_nTCS(0), - m_nRange(0), - m_bMaxUdp(false), - m_channels(0) +Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), m_qos(this) { } @@ -270,29 +250,17 @@ Boolean Smpte2110MediaSubsession::createSourceObjects(int useSpecialRTPoffset) { m_sEndpoint = wxString::FromUTF8(fConnectionEndpointName); - char* mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; + auto mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; sprintf(mimeType, "%s/%s", mediumName(), codecName()); fReadSource = fRTPSource = Aes67Source::createNew(env(), fRTPSocket, fRTPPayloadFormat, fRTPTimestampFrequency, mimeType, 0,FALSE, m_nSyncTime); delete[] mimeType; - + + pmlLog() << "-------------- " << fNumChannels << "----------------------"; m_channels.resize(fNumChannels); parseSDPAttribute_Channels(); //Channel mapping if any return TRUE; } - else if(strcmp(fCodecName,"RAW") == 0) - { - AnalyzeAttributes(); - - m_sEndpoint = wxString::FromUTF8(fConnectionEndpointName); - - char* mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; - sprintf(mimeType, "%s/%s", mediumName(), codecName()); - fReadSource = fRTPSource = RawVideoSource::createNew(env(), fRTPSocket, fRTPPayloadFormat, fRTPTimestampFrequency, mimeType, 0,FALSE, m_nSyncTime); - delete[] mimeType; - - return TRUE; - } else { env().setResultMsg("RTP payload format unknown or not supported"); @@ -523,7 +491,7 @@ void Smpte2110MediaSubsession::parseSDPAttribute_ExtMap() unsigned long nId; sExt.BeforeFirst(wxT(' ')).ToULong(&nId); - m_mExtHeader.insert(make_pair(nId, sExt.AfterFirst(wxT(' ')))); + m_mExtHeader.insert({nId, sExt.AfterFirst(' ')}); } } @@ -542,220 +510,22 @@ void Smpte2110MediaSubsession::parseSDPAttribute_Mid() } } -map::const_iterator Smpte2110MediaSubsession::GetExtHeaderBegin() const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeaderBegin() const { return m_mExtHeader.begin(); } -map::const_iterator Smpte2110MediaSubsession::GetExtHeaderEnd() const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeaderEnd() const { return m_mExtHeader.end(); } -map::const_iterator Smpte2110MediaSubsession::GetExtHeader(unsigned long nId) const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeader(unsigned long nId) const { return m_mExtHeader.find(nId); } - - - -int Smpte2110MediaSubsession::GetSampling() -{ - return m_nSampling; -} - -unsigned char Smpte2110MediaSubsession::GetDepth() -{ - return m_nDepth; -} - -bool Smpte2110MediaSubsession::AreSamplesInteger() -{ - return !m_bFloating; -} - -unsigned int Smpte2110MediaSubsession::GetWidth() -{ - return m_nWidth; -} - -unsigned int Smpte2110MediaSubsession::GetHeight() -{ - return m_nHeight; -} - -pair Smpte2110MediaSubsession::GetExactFrameRate() -{ - return m_pairFrameRate; -} - -int Smpte2110MediaSubsession::GetColorimetry() -{ - return m_nColorimetry; -} - -int Smpte2110MediaSubsession::GetPackingMode() -{ - return m_nPackingMode; -} - -wxString Smpte2110MediaSubsession::GetSSN() -{ - return m_sSSN; -} - -bool Smpte2110MediaSubsession::IsInterlaced() -{ - return m_bInterlaced; -} - -bool Smpte2110MediaSubsession::IsSegmented() -{ - return m_bSegmented; -} - -int Smpte2110MediaSubsession::GetTCS() -{ - return m_nTCS; -} - -int Smpte2110MediaSubsession::GetRange() -{ - return m_nRange; -} - -bool Smpte2110MediaSubsession::UseMaxUDP() -{ - return m_bMaxUdp; -} - -pair Smpte2110MediaSubsession::GetAspectRatio() -{ - return m_pairAspectRatio; -} - - -void Smpte2110MediaSubsession::AnalyzeAttributes() -{ - wxString str(wxString::FromUTF8(attrVal_str("sampling"))); - for(m_nSampling = 0; m_nSampling < 12; m_nSampling++) - { - if(str.CmpNoCase(STR_SAMPLING[m_nSampling]) == 0) - break; - } - env() << "Sampling: " << STR_SAMPLING[m_nSampling] << "\n"; - - str = wxString::FromUTF8(attrVal_str("depth")); - if(str.CmpNoCase(wxT("16f")) == 0) - { - m_nDepth = 16; - m_bFloating = true; - } - else - { - m_bFloating = false; - unsigned long nChar; - str.ToULong(&nChar); - m_nDepth = nChar; - } - env() << "Depth: " << m_nDepth; - if(m_bFloating) - { - env() << "f"; - } - env() << "\n"; - - m_nWidth = attrVal_int("width"); - m_nHeight = attrVal_int("height"); - - env() << "Resolution: " << (int)m_nWidth << "x" << (int)m_nHeight << "\n"; - - str = wxString::FromUTF8(attrVal_str("exactframerate")); - str.BeforeFirst(wxT('/')).ToULong(&m_pairFrameRate.first); - if(str.AfterFirst(wxT('/')) == wxEmptyString) - { - m_pairFrameRate.second = 1; - } - else - { - str.AfterFirst(wxT('/')).ToULong(&m_pairFrameRate.second); - } - env() << "Frame Rate: " << (int)m_pairFrameRate.first << "/" << (int)m_pairFrameRate.second << "\n"; - - str = wxString::FromUTF8(attrVal_str("colorimetry")); - for(m_nColorimetry = 0; m_nColorimetry < 7; m_nColorimetry++) - { - if(str.CmpNoCase(STR_COLORIMETRY[m_nColorimetry]) == 0) - break; - } - - env() << "Colorimetry:" << STR_COLORIMETRY[m_nColorimetry] << "\n"; - - str = wxString::FromUTF8(attrVal_str("pm")); - if(str.CmpNoCase(wxT("2110GPM")) == 0) - { - m_nPackingMode = GPM; - } - else - { - m_nPackingMode = BPM; - } - env() << "Packing:" << STR_PACKING[m_nPackingMode] << "\n"; - - m_sSSN = wxString::FromUTF8(attrVal_str("ssn")); - env() << "SSN:" << m_sSSN << "\n"; - - m_bInterlaced = (fAttributeTable->Lookup("interlace") != NULL); - m_bSegmented = (fAttributeTable->Lookup("segmented") != NULL); - m_bMaxUdp = (fAttributeTable->Lookup("maxudp") != NULL); - - - str = wxString::FromUTF8(attrVal_str("tcs")); - for(m_nTCS = 0; m_nTCS < 9; m_nTCS++) - { - if(str.CmpNoCase(STR_TCS[m_nTCS]) == 0) - break; - } - env() << "TCS:" << STR_TCS[m_nTCS] << "(" << str << ")\n"; - - str = wxString::FromUTF8(attrVal_str("range")); - for(m_nRange = 0; m_nRange < 3; m_nRange++) - { - if(str.CmpNoCase(STR_RANGE[m_nRange]) == 0) - break; - } - if(m_nRange == 3) - { - m_nRange = NARROW; - } - - env() << "RANGE:" << STR_RANGE[m_nRange] << "\n"; - - - str = wxString::FromUTF8(attrVal_str("par")); - if(str != wxEmptyString) - { - str.BeforeFirst(wxT(':')).ToULong(&m_pairAspectRatio.first); - if(str.AfterFirst(wxT(':')) == wxEmptyString) - { - m_pairAspectRatio.second = 1; - } - else - { - str.AfterFirst(wxT(':')).ToULong(&m_pairAspectRatio.second); - } - } - else - { - m_pairAspectRatio.first = 1; - m_pairAspectRatio.second = 1; - } - env() << "Pixel Aspect Radio: " << (int)m_pairAspectRatio.first << ":" << (int)m_pairAspectRatio.second << "\n"; - - } - bool Smpte2110MediaSubsession::SetChannelGrouping(size_t& nChannel, const subsession::channelGrouping& grouping) { if(nChannel < m_channels.size()) @@ -845,3 +615,33 @@ void Smpte2110MediaSubsession::parseSDPAttribute_Channels() } +static void periodicQOSMeasurement(void* clientData) +{ + auto pSubsession = reinterpret_cast(clientData); + pSubsession->PeriodicQOSMeasurement(); +} + + +void Smpte2110MediaSubsession::PeriodicQOSMeasurement() +{ + struct timeval timeNow; + gettimeofday(&timeNow, NULL); + + m_qos.periodicQOSMeasurement(timeNow); + + // Do this again later: + ScheduleNextQOSMeasurement(); +} + +void Smpte2110MediaSubsession::ScheduleNextQOSMeasurement() +{ + nextQOSMeasurementUSecs += m_qos.GetQosMeasurementIntervalMS()*1000; + + int usecsToDelay = m_qos.GetQosMeasurementIntervalMS()*1000; + m_qosMeasurementTimerTask = env().taskScheduler().scheduleDelayedTask(usecsToDelay, (TaskFunc*)periodicQOSMeasurement, (void*)this); + if(m_qosMeasurementTimerTask == nullptr) + { + pmlLog(pml::LOG_ERROR) << "Smpte2110MediaSubsession::ScheduleNextQOSMeasurement - FAILED"; + } + +} diff --git a/pambase/smpte2110mediasession.h b/pambase/smpte2110mediasession.h index 7049c95e..331aa454 100644 --- a/pambase/smpte2110mediasession.h +++ b/pambase/smpte2110mediasession.h @@ -5,6 +5,8 @@ #include "session.h" #include #include +#include "qos.h" + class Smpte2110MediaSubsession; @@ -35,11 +37,13 @@ class Smpte2110MediaSession : public MediaSession return m_dMaxPackageMs; } - const wxString& GetGroupDup() const + const std::set& GetGroups() const { - return m_sGroups; + return m_setGroups; } + + protected: @@ -57,7 +61,7 @@ class Smpte2110MediaSession : public MediaSession wxString m_sRawSDP; - wxString m_sGroups; + std::set m_setGroups; refclk m_refclk; double m_dPackageMs; double m_dMaxPackageMs; @@ -91,47 +95,26 @@ class Smpte2110MediaSubsession : public MediaSubsession return m_dMaxPackageMs; } + const wxString& GetGroup() const { return m_sGroup; } + std::map::const_iterator GetExtHeaderBegin() const; std::map::const_iterator GetExtHeaderEnd() const; std::map::const_iterator GetExtHeader(unsigned long nId) const; - int GetSampling(); - unsigned char GetDepth(); - bool AreSamplesInteger(); - unsigned int GetWidth(); - unsigned int GetHeight(); - std::pair GetExactFrameRate(); - int GetColorimetry(); - int GetPackingMode(); - wxString GetSSN(); - bool IsInterlaced(); - bool IsSegmented(); - int GetTCS(); - int GetRange(); - bool UseMaxUDP(); - std::pair GetAspectRatio(); - - - enum Sampling{YCbCr_444, YCbCr_422, YCbCr_420, CLYCbCr_444, CLYCbCr_422, CLYCbCr_420, ICtCp_444, ICtCp_422, ICtCp_420, RGB_, XYZ, KEY, UNKNOWN}; - enum Colorimetry{C_BT601, C_BT709, BC_T2020, C_BT2100, C_ST2065_1, C_ST2065_3, C_XYZ, C_UNSPECIFIED}; - enum TCS{SDR, PQ, HLG, LINEAR, BT2100LINPQ, BT2100LINHLG, ST2065_1, ST2428_1, DENSITY, UNSPECIFIED}; - enum Range{NARROW, FULLPROTECT, FULL}; - enum Packing{GPM, BPM}; + void SetHandler(RtpThread* pThread) { m_qos.SetHandler(pThread);} + + const std::vector& GetChannelGrouping() const { return m_channels;} + const qosMeasurementRecord& GetQoS() const { return m_qos;} - const std::vector& GetChannelGrouping() const { return m_channels;} + void ScheduleNextQOSMeasurement(); + void PeriodicQOSMeasurement(); - static const wxString STR_SAMPLING[13]; - static const wxString STR_COLORIMETRY[8]; - static const wxString STR_TCS[10]; - static const wxString STR_RANGE[3]; - static const wxString STR_PACKING[2]; + UsageEnvironment& GetEnv() { return env(); } protected: - void AnalyzeAttributes(); - friend class Smpte2110MediaSession; - Smpte2110MediaSubsession(MediaSession& parent); + explicit Smpte2110MediaSubsession(MediaSession& parent); virtual Boolean createSourceObjects(int useSpecialRTPoffset); bool SetChannelGrouping(size_t& nChannel, const subsession::channelGrouping& grouping); @@ -146,38 +129,26 @@ class Smpte2110MediaSubsession : public MediaSubsession void parseSDPAttribute_Mid(); void parseSDPAttribute_Channels(); - unsigned long m_nSyncTime; - unsigned int m_nFirstTimestamp; + + + unsigned long m_nSyncTime = 0; + unsigned int m_nFirstTimestamp = 0; wxString m_sEndpoint; - double m_dClockDeviation; + double m_dClockDeviation = 0.0; refclk m_refclk; - double m_dPackageMs; - double m_dMaxPackageMs; + double m_dPackageMs = 0.0; + double m_dMaxPackageMs = 0.0; std::map m_mExtHeader; wxString m_sGroup; - - - int m_nSampling; - unsigned char m_nDepth; - bool m_bFloating; - unsigned long m_nWidth; - unsigned long m_nHeight; - std::pair m_pairFrameRate; - int m_nColorimetry; - int m_nPackingMode; - wxString m_sSSN; - bool m_bInterlaced; - bool m_bSegmented; - int m_nTCS; - int m_nRange; - bool m_bMaxUdp; - std::pair m_pairAspectRatio; - + std::vector m_channels; + + qosMeasurementRecord m_qos; + TaskToken m_qosMeasurementTimerTask = nullptr; }; diff --git a/pambase/timemanager.cpp b/pambase/timemanager.cpp index e94d9e97..5051d709 100644 --- a/pambase/timemanager.cpp +++ b/pambase/timemanager.cpp @@ -246,8 +246,6 @@ bool TimeManager::TrySyncToPtp() offset += utc; } - pmlLog(pml::LOG_TRACE) << "TimeManager::SyncToPTP\t" << (m_bUseTai ? "TAI" : "UTC") << "\tOffset=" << offset.count(); - if(abs(std::chrono::duration_cast(offset).count()) > 500) { if(m_nPtpSamples > 1) //first stat is often 37s out @@ -279,7 +277,6 @@ bool TimeManager::TrySyncToPtp() if(!m_bPtpLock && m_nPtpSamples < m_nMinSamplSize) // { //waiting for more info - pmlLog(pml::LOG_TRACE) << "TimeManager::SyncToPTP\t" << "waiting for more info"; return true; } diff --git a/pambase/wxptp.cpp b/pambase/wxptp.cpp index 9267c456..e6eac961 100644 --- a/pambase/wxptp.cpp +++ b/pambase/wxptp.cpp @@ -112,21 +112,32 @@ wxPtp::wxPtp() : m_pNotifier(std::make_shared()) { } -void wxPtp::RunDomain(const wxString& sInterface, unsigned char nDomain) +void wxPtp::RunDomain(const wxString& sInterface, unsigned char nDomain, ptpmonkey::Mode mode) { + pmlLog(pml::LOG_TRACE) << "wxPtp::RunDomain"; auto itMonkey = m_mDomain.find(nDomain); if(itMonkey == m_mDomain.end()) { - itMonkey = m_mDomain.insert(std::make_pair(nDomain, std::make_shared(IpInterface(std::string(sInterface.mb_str())), nDomain, 2))).first; + mode = ptpmonkey::Mode::HYBRID; + itMonkey = m_mDomain.insert(std::make_pair(nDomain, std::make_shared(IpInterface(std::string(sInterface.mb_str())), nDomain, 2, mode, ptpmonkey::Rate::EVERY_1_SEC))).first; itMonkey->second->AddEventHandler(m_pNotifier); - //itMonkey->second->AddEventHandler(std::make_shared()); itMonkey->second->Run(); } - else if(itMonkey->second->IsStopped()) + else { - itMonkey->second->Restart(); + if(itMonkey->second->GetMode() != mode) + { + m_mDomain.erase(itMonkey); + itMonkey = m_mDomain.insert(std::make_pair(nDomain, std::make_shared(IpInterface(std::string(sInterface.mb_str())), nDomain, 2, mode, ptpmonkey::Rate::EVERY_1_SEC))).first; + itMonkey->second->AddEventHandler(m_pNotifier); + } + else if(itMonkey->second->IsStopped()) + { + itMonkey->second->Restart(); + } } + pmlLog(pml::LOG_TRACE) << "wxPtp::RunDomain = done"; } void wxPtp::AddHandler(wxEvtHandler* pHandler) diff --git a/pambase/wxptp.h b/pambase/wxptp.h index 19c64396..6f5653c9 100644 --- a/pambase/wxptp.h +++ b/pambase/wxptp.h @@ -5,13 +5,7 @@ #include #include #include "dlldefine.h" - - -namespace ptpmonkey -{ - class PtpMonkey; - class PtpV2Clock; -}; +#include "ptpmonkey.h" class wxPtpEventHandler; @@ -20,7 +14,7 @@ class PAMBASE_IMPEXPORT wxPtp : public wxEvtHandler public: static wxPtp& Get(); - void RunDomain(const wxString& sInterface, unsigned char nDomain); + void RunDomain(const wxString& sInterface, unsigned char nDomain, ptpmonkey::Mode mode); void StopDomain(unsigned char nDomain); wxString GetMasterClockId(unsigned char nDomain); @@ -43,6 +37,7 @@ class PAMBASE_IMPEXPORT wxPtp : public wxEvtHandler std::shared_ptr m_pNotifier; std::map> m_mDomain; std::map > m_mEmpty; + }; diff --git a/pambase/wxsink.cpp b/pambase/wxsink.cpp index 6682d420..ced0bb7f 100644 --- a/pambase/wxsink.cpp +++ b/pambase/wxsink.cpp @@ -31,7 +31,6 @@ wxSink::wxSink(UsageEnvironment& env, MediaSubsession& subsession,RtpThread* pHa { fStreamId = strDup(streamId); fReceiveBuffer = new u_int8_t[DUMMY_SINK_RECEIVE_BUFFER_SIZE]; - m_nLastTimestamp = 0; } wxSink::~wxSink() @@ -42,7 +41,7 @@ wxSink::~wxSink() void wxSink::afterGettingFrame(void* clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds) { - wxSink* sink = (wxSink*)clientData; + auto sink = (wxSink*)clientData; sink->afterGettingFrame(frameSize, numTruncatedBytes, presentationTime, durationInMicroseconds); } @@ -65,7 +64,7 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c m_nLastTimestamp = pSource->GetRTPTimestamp(); //do we have an associated header ext?? - mExtension_t* mExt = NULL; + mExtension_t* mExt = nullptr; map::iterator itExt = m_mExtension.find(tvPresentation); if(itExt != m_mExtension.end()) { @@ -80,7 +79,6 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c if(strcmp(m_pSubsession->codecName(),"L16") == 0) { nBytesPerSample = 2; - } else if(strcmp(m_pSubsession->codecName(),"L24") == 0) { @@ -88,15 +86,22 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c } if(nBytesPerSample != 0) { - m_pHandler->AddFrame(m_pSubsession->GetEndpoint(), pSource->lastReceivedSSRC(), tvPresentation, frameSize, fReceiveBuffer, - nBytesPerSample, pSource->GetTransmissionTime(), pSource->GetRTPTimestamp(),frameSize, nDifference, mExt); + auto pFrame = std::make_shared(); + pFrame->sEndpoint = m_pSubsession->GetEndpoint(); + pFrame->sGroup = m_pSubsession->GetGroup(); + pFrame->nSSRC = pSource->lastReceivedSSRC(); + pFrame->timePresentation = tvPresentation; + pFrame->timeTransmission = pSource->GetTransmissionTime(); + pFrame->nFrameSize = frameSize; + pFrame->pBuffer = fReceiveBuffer; + pFrame->nBytesPerSample = nBytesPerSample; + pFrame->nTimestamp = pSource->GetRTPTimestamp(); + pFrame->nTimestampDifference = nDifference; + pFrame->mExt = mExt; + + m_pHandler->AddFrame(pFrame); } } - else if(strcmp(m_pSubsession->mediumName(), "video") == 0) - { - - } - continuePlaying(); } diff --git a/pambase/wxsink.h b/pambase/wxsink.h index 919c1356..ee629d9b 100644 --- a/pambase/wxsink.h +++ b/pambase/wxsink.h @@ -4,6 +4,7 @@ #include "liveMedia.hh" #include "BasicUsageEnvironment.hh" #include "timedbuffer.h" +#include class RtpThread; class Smpte2110MediaSubsession; @@ -13,6 +14,26 @@ bool operator<(const timeval& t1, const timeval& t2); typedef std::map mExtension_t; + + +struct rtpFrame +{ + wxString sEndpoint; + wxString sGroup; + unsigned long nSSRC = 0; + + timeval timePresentation; + timeval timeTransmission; + unsigned int nTimestamp = 0; + int nTimestampDifference = 0; + + unsigned long nFrameSize = 0; + u_int8_t* pBuffer = nullptr; + u_int8_t nBytesPerSample = 0; + + mExtension_t* mExt = nullptr; +}; + class wxSink: public MediaSink { public: @@ -50,7 +71,7 @@ class wxSink: public MediaSink RtpThread* m_pHandler; char* fStreamId; - unsigned int m_nLastTimestamp; + unsigned int m_nLastTimestamp = 0; std::map m_mExtension; diff --git a/pamfft/CMakeLists.txt b/pamfft/CMakeLists.txt index 7c1d725f..322e9d09 100644 --- a/pamfft/CMakeLists.txt +++ b/pamfft/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(pamfft LANGUAGES CXX C VERSION 1.2.0.0) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -20,7 +20,7 @@ find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -36,7 +36,7 @@ target_link_libraries(pamfft optimized pambase debug pambased) target_link_libraries(pamfft optimized restgoose debug restgoosed) set_target_properties(pamfft PROPERTIES DEBUG_POSTFIX "d") - +set_target_properties(pamfft PROPERTIES CXX_STANDARD 17) @@ -44,6 +44,6 @@ set_target_properties(pamfft PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../../lib/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS pamfft LIBRARY DESTINATION /usr/local/lib) + install(TARGETS pamfft LIBRARY DESTINATION lib) endif() diff --git a/pamlevel/CMakeLists.txt b/pamlevel/CMakeLists.txt index 8943cd54..84fab2f0 100644 --- a/pamlevel/CMakeLists.txt +++ b/pamlevel/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(pamlevel LANGUAGES CXX VERSION 1.3.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -31,7 +31,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() endif() -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -46,11 +46,11 @@ target_link_libraries(pamlevel ${wxWidgets_LIBRARIES}) target_link_libraries(pamlevel optimized pambase debug pambased) set_target_properties(pamlevel PROPERTIES DEBUG_POSTFIX "d") - +set_target_properties(pamlevel PROPERTIES CXX_STANDARD 17) set_target_properties(pamlevel PROPERTIES LIBRARY_OUTPUT_DIRECTORY "../../lib/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS pamlevel LIBRARY DESTINATION /usr/local/lib) + install(TARGETS pamlevel LIBRARY DESTINATION lib) endif() diff --git a/plugins/InputAlign/CMakeLists.txt b/plugins/InputAlign/CMakeLists.txt index 5ae17f24..2cf3c46c 100644 --- a/plugins/InputAlign/CMakeLists.txt +++ b/plugins/InputAlign/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(InputAlign MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME} find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,8 +33,10 @@ target_compile_options(InputAlign PRIVATE ${flags}) target_link_libraries(InputAlign ${wxWidgets_LIBRARIES}) target_link_libraries(InputAlign optimized pambase debug pambased) +set_target_properties(InputAlign PROPERTIES CXX_STANDARD 17) + #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS InputAlign LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS InputAlign LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/LTC/CMakeLists.txt b/plugins/LTC/CMakeLists.txt index a2047526..9a196042 100644 --- a/plugins/LTC/CMakeLists.txt +++ b/plugins/LTC/CMakeLists.txt @@ -23,7 +23,7 @@ add_library(LTC MODULE ${SOURCES} ${LTC_SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJE find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -39,8 +39,9 @@ target_compile_options(LTC PRIVATE ${flags}) target_link_libraries(LTC ${wxWidgets_LIBRARIES}) target_link_libraries(LTC optimized pambase debug pambased) +set_target_properties(LTC PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS LTC LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS LTC LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/LTCGenerator/CMakeLists.txt b/plugins/LTCGenerator/CMakeLists.txt index 1acc4625..b742652a 100644 --- a/plugins/LTCGenerator/CMakeLists.txt +++ b/plugins/LTCGenerator/CMakeLists.txt @@ -23,7 +23,7 @@ add_library(LTCGenerator MODULE ${SOURCES} ${LTC_SOURCES} ${CMAKE_BINARY_DIR}/sr find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -39,8 +39,9 @@ target_compile_options(LTCGenerator PRIVATE ${flags}) target_link_libraries(LTCGenerator ${wxWidgets_LIBRARIES}) target_link_libraries(LTCGenerator optimized pambase debug pambased) +set_target_properties(LTCGenerator PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS LTCGenerator LIBRARY DESTINATION /usr/local/lib/pam2/generator) + install(TARGETS LTCGenerator LIBRARY DESTINATION lib/pam2/generator) endif() diff --git a/plugins/anglemeters/CMakeLists.txt b/plugins/anglemeters/CMakeLists.txt index 162df2e8..d942dcad 100644 --- a/plugins/anglemeters/CMakeLists.txt +++ b/plugins/anglemeters/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(anglemeters LANGUAGES CXX VERSION 1.2.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -17,7 +17,7 @@ add_library(anglemeters MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,10 @@ target_compile_options(anglemeters PRIVATE ${flags}) target_link_libraries(anglemeters ${wxWidgets_LIBRARIES}) target_link_libraries(anglemeters optimized pambase debug pambased) +set_target_properties(anglemeters PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS anglemeters LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS anglemeters LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/aoip info/CMakeLists.txt b/plugins/aoip info/CMakeLists.txt index 937f9dde..b72afbc3 100644 --- a/plugins/aoip info/CMakeLists.txt +++ b/plugins/aoip info/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(aoipinfo LANGUAGES CXX VERSION 1.1.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -18,7 +18,7 @@ add_library(aoipinfo MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,10 +34,10 @@ target_compile_options(aoipinfo PRIVATE ${flags}) target_link_libraries(aoipinfo ${wxWidgets_LIBRARIES}) target_link_libraries(aoipinfo optimized pambase debug pambased) - +set_target_properties(aoipinfo PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS aoipinfo LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS aoipinfo LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/aoip info/aoipinfobuilder.cpp b/plugins/aoip info/aoipinfobuilder.cpp index 3035a728..b531d7ba 100644 --- a/plugins/aoip info/aoipinfobuilder.cpp +++ b/plugins/aoip info/aoipinfobuilder.cpp @@ -71,14 +71,6 @@ void AoIPInfoBuilder::OutputChannels(const std::vector& vChannels) void AoIPInfoBuilder::OnSettingChanged(SettingEvent& event) { - if(event.GetKey() == wxT("Graph")) - { - m_pInfo->ShowGraph(event.GetValue()); - } - else if(event.GetKey() == "Type") - { - m_pInfo->SetGraphType(event.GetValue()); - } } void AoIPInfoBuilder::SetQoSData(qosData* pData) @@ -99,12 +91,10 @@ bool AoIPInfoBuilder::CanBeMaximized() const void AoIPInfoBuilder::ClearGraphs() { - m_pInfo->ClearGraphs(); } void AoIPInfoBuilder::RecalculateRange() { - m_pInfo->RecalculateRange(); } void AoIPInfoBuilder::ChangeGranularity(int nWhich) diff --git a/plugins/aoip info/aoipinfobuilder.h b/plugins/aoip info/aoipinfobuilder.h index 86d5a08d..bda523ac 100644 --- a/plugins/aoip info/aoipinfobuilder.h +++ b/plugins/aoip info/aoipinfobuilder.h @@ -33,6 +33,7 @@ class WXEXPORT AoIPInfoBuilder : public MonitorPluginBuilder friend class pnlGraph; friend class pnlSettings; friend class pnlAoIPInfo; + friend class pnlQos; void OnSettingChanged(SettingEvent& event); diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index 3e82d21b..f7e5d9db 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -17,7 +17,7 @@ #include #include //*) - +#include "log.h" using namespace std; //(*IdInit(pnlAoIPInfo) @@ -188,10 +188,15 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID pnlSDP = new wxPanel(m_pswpInfo, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); pnlSDP->SetBackgroundColour(wxColour(0,0,0)); m_ptxtSDP = new wxTextCtrl(pnlSDP, ID_TEXTCTRL1, wxEmptyString, wxPoint(5,5), wxSize(590,435), wxTE_MULTILINE|wxTE_READONLY, wxDefaultValidator, _T("ID_TEXTCTRL1")); - m_pswpInfo->AddPage(pnlSession, _("Session"), false);x + m_pswpInfo->AddPage(pnlSession, _("Session"), false); m_pswpInfo->AddPage(pnlSDP, _("Raw SDP"), false); //*) + m_pSdp = new wmListAdv(pnlSDP, wxNewId(), wxPoint(5,5), wxSize(590,435), 0, wmListAdv::SCROLL_VERTICAL, wxSize(-1,30), 1, wxSize(0,1)); + m_pSdp->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); + m_pSdp->SetBackgroundColour(*wxBLACK); + + m_pswpInfo->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); #ifdef PTPMONKEY wxPtp::Get().AddHandler(this); @@ -245,7 +250,7 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) { if(pData) { - auto itPanel = m_mQos.find(pData->nStream); + auto itPanel = m_mQos.find(pData->sStream); if(itPanel != m_mQos.end()) { itPanel->second->QoSUpdated(pData); @@ -256,6 +261,15 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) { + for(const auto& [sName, pPanel] : m_mSubsessions) + { + pPanel->SetAudioData(pTimedBuffer); + } + for(const auto& [sName, pPanel] : m_mQos) + { + pPanel->SetAudioData(pTimedBuffer); + } + /* SetTimestamp(pTimedBuffer->GetTransmissionTime(), m_plblTransmissionTime, false); SetTimestamp(pTimedBuffer->GetTimeVal(), m_plblTimestampIn); SetTimestamp(pTimedBuffer->GetPlaybackTime(), m_plblTimestampOut); @@ -279,6 +293,7 @@ void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) m_plblTimestampIn->SetBackgroundColour(wxPtp::Get().IsSyncedToMaster(0) ? *wxWHITE : wxColour(255,180,180)); m_plblLatencyNetwork->SetBackgroundColour(wxPtp::Get().IsSyncedToMaster(0) ? *wxWHITE : wxColour(255,180,180)); #endif // PTPMONKEY + */ } @@ -299,6 +314,7 @@ void pnlAoIPInfo::SetTimestamp(const timeval& tv, wmLabel* pLabel, bool bDate) void pnlAoIPInfo::ShowLatency(const timedbuffer* pTimedBuffer) { + /* double dPlayback = pTimedBuffer->GetPlaybackLatency(); timeval tvLatency; @@ -325,12 +341,16 @@ void pnlAoIPInfo::ShowLatency(const timedbuffer* pTimedBuffer) long long int nSet = static_cast(tvSet.tv_sec)*1e6 + static_cast(tvSet.tv_usec); m_plblEpoch->SetLabel(wxString::Format("%lld us", nLast-nSet)); #endif + */ } void pnlAoIPInfo::SessionStarted(const session& aSession) { + pmlLog() << "pnlAoIPInfo::SessionStarted"; + m_pSession = &aSession; + m_plblSessionName->SetLabel(aSession.sName); if(Settings::Get().Read("Input", "Type", wxEmptyString) == "AoIP") { @@ -340,15 +360,19 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) { m_plblInput->SetLabel(wxEmptyString); } + pmlLog() << "pnlAoIPInfo::SessionStarted 2"; m_plblSyncType->SetLabel(aSession.refClock.sType); m_plblSyncVersion->SetLabel(aSession.refClock.sVersion); m_plblSyncId->SetLabel(aSession.refClock.sId); + pmlLog() << "pnlAoIPInfo::SessionStarted 3"; m_plblSyncDomain->SetLabel(wxString::Format("%lu", aSession.refClock.nDomain)); m_plblSessionType->SetLabel(aSession.sType); + pmlLog() << "pnlAoIPInfo::SessionStarted 4"; wxClientDC dc(this); dc.SetFont(m_pSdp->GetFont()); + pmlLog() << "pnlAoIPInfo::SessionStarted 5"; m_pSdp->Clear(); wxArrayString asLines(wxStringTokenize(aSession.sRawSDP, "\n")); @@ -372,7 +396,7 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) } } - unsigned int nAudio(0), nVideo(0); + unsigned int nAudio = 0; for(list::const_iterator itSub = aSession.lstSubsession.begin(); itSub != aSession.lstSubsession.end(); ++itSub) { if(itSub->sMedium.CmpNoCase("audio") == 0) @@ -381,19 +405,31 @@ void pnlAoIPInfo::SessionStarted(const session& aSession) } } m_plblSubsessionsAudio->SetLabel(wxString::Format("%u", nAudio)); - m_plblGroups->SetLabel(aSession.sGroups); + wxString sGroups; + for(const auto& sGroup : aSession.setGroups) + { + sGroups += sGroup+" "; + } + m_plblGroups->SetLabel(sGroups); for(const auto& sub : aSession.lstSubsession) { - auto pnlSub = new pnlSubsession(m_pswpInfo, wxNewId(), wxDefaultPosition, wxDefaultSize); + pmlLog() << "Create subsession page"; + auto pnlSub = new pnlSubsession(m_pswpInfo, sub, wxNewId(), wxDefaultPosition, wxDefaultSize); m_pswpInfo->AddPage(pnlSub, "Subsession: "+sub.sGroup, false); - auto pnlQos = new pnlQoS(m_pswpInfo, wxNewId(), wxDefaultPosition, wxDefaultSize); - m_pswpInfo->AddPage(pnlQos, "QoS: "+sub.sGroup, false); + m_mSubsessions.try_emplace(sub.sGroup, pnlSub); + + pmlLog() << "Create Qos page"; + auto pnlQ = new pnlQos(m_pswpInfo, sub.sGroup, m_pBuilder, wxNewId(), wxDefaultPosition, wxDefaultSize); + m_pswpInfo->AddPage(pnlQ, "QoS: "+sub.sGroup, false); + + m_mQos.try_emplace(sub.sGroup, pnlQ); } + pmlLog() << "DONE"; } @@ -415,15 +451,15 @@ void pnlAoIPInfo::OnPtpEvent(wxCommandEvent& event) void pnlAoIPInfo::ChangeGranularity(int nWhich) { - m_pHistogram->ChangeGranularity(m_sGraph,nWhich); +// m_pHistogram->ChangeGranularity(m_sGraph,nWhich); } void pnlAoIPInfo::ChangeResolution(int nWhich) { - m_pHistogram->ChangeResolution(m_sGraph,nWhich); + // m_pHistogram->ChangeResolution(m_sGraph,nWhich); } void pnlAoIPInfo::RecalculateRange() { - m_pGraph->RecalculateRange(m_sGraph); + // m_pGraph->RecalculateRange(m_sGraph); } diff --git a/plugins/aoip info/pnlAoIPInfo.h b/plugins/aoip info/pnlAoIPInfo.h index 71b7b084..2f8b282a 100644 --- a/plugins/aoip info/pnlAoIPInfo.h +++ b/plugins/aoip info/pnlAoIPInfo.h @@ -10,10 +10,9 @@ //*) #include "timedbuffer.h" -#include "histogram.h" #include "wmlistadv.h" #include "pnlSubsession.h" -#include "pnlQos.h"; +#include "pnlQos.h" #include struct qosData; @@ -72,9 +71,6 @@ class pnlAoIPInfo: public wxPanel void SetAudioData(const timedbuffer* pTimedBudder); - void ShowGraph(const wxString& sGraph); - void SetGraphType(const wxString& sType); - void ClearGraphs(); void RecalculateRange(); double GetLatency() const { return m_dLatency; } @@ -132,8 +128,7 @@ class pnlAoIPInfo: public wxPanel unsigned int m_nSampleRate; unsigned int m_nFrameSize; const session* m_pSession; - wxString m_sGraph; - + double m_dFrameDuration; double m_dSlip; @@ -144,8 +139,8 @@ class pnlAoIPInfo: public wxPanel enum {GRAPH_MIN=0, GRAPH_MAX}; - std::map m_mSubsessions; - std::map m_mQos; + std::map m_mSubsessions; + std::map m_mQos; DECLARE_EVENT_TABLE() }; diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index b9a598d4..0c04377c 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -5,6 +5,8 @@ #include #include //*) +#include "settingevent.h" +#include "settings.h" //(*IdInit(pnlQos) const long pnlQos::ID_CUSTOM12 = wxNewId(); @@ -62,8 +64,8 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde SetBackgroundColour(wxColour(0,0,0)); Panel1 = new wxPanel(this, ID_PANEL4, wxPoint(0,280), wxSize(600,160), wxTAB_TRAVERSAL, _T("ID_PANEL4")); Panel1->SetBackgroundColour(wxColour(0,0,0)); - m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160),1,10,0); - m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160),1,10,0); + m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160)); + m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160)); m_plblTSDF = new wmLabel(this, ID_M_PLBL90, wxEmptyString, wxPoint(146,246), wxSize(109,25), 0, _T("ID_M_PLBL90")); m_plblTSDF->SetBorderState(uiRect::BORDER_NONE); m_plblTSDF->GetUiRect().SetGradient(0); @@ -283,14 +285,10 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde //*) - - m_pswpInfo->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); m_pGraph->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); m_pHistogram->SetFont(wxFont(7,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT)); - ClearGraphs(); - int nInterval = Settings::Get().Read(wxT("QoS"), wxT("Interval"), 1000)*1000; m_pGraph->AddGraph(wxT("kBit/s"), wxColour(0,255,0), nInterval, false); m_pHistogram->AddGraph(wxT("kBit/s"), wxColour(0,255,0), 0.1); @@ -321,10 +319,10 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde m_pbtnCurrentGraph->SetPopup({"kBit/s", "Packet Gap", "Packet Loss", "Jitter", "Timestamp", "Timestamp Errors", "TS-DF", "Slip"}); - m_pbtnCurrentGraph->ConnectToSetting(m_pBuilder->GetSection(), "Graph_"+sGroup, "kBit/s"); + m_pbtnCurrentGraph->ConnectToSetting(pBuilder->GetSection(), "Graph_"+sGroup, "kBit/s"); m_pbtnGraphType->SetPopup({"Line Graph", "Bar Chart", "Histogram"}); - m_pbtnGraphType->ConnectToSetting(m_pBuilder->GetSection(), "GraphType_"+sGroup, "kBit/s"); + m_pbtnGraphType->ConnectToSetting(pBuilder->GetSection(), "GraphType_"+sGroup, "kBit/s"); pBuilder->RegisterForSettingsUpdates(this, "Graph_"+sGroup); pBuilder->RegisterForSettingsUpdates(this, "GraphType_"+sGroup); @@ -436,12 +434,21 @@ void pnlQos::SetGraphType(const wxString& sType) void pnlQos::OnSettingChanged(SettingEvent& event) { - if(event.GetKey() == "Graph_"+sGroup) + if(event.GetKey() == "Graph_"+m_sGroup) { ShowGraph(event.GetValue()); } - else if(event.GetKey() == "GraphType_"+sGroup) + else if(event.GetKey() == "GraphType_"+m_sGroup) { - ShowGraphType(event.GetValue()); + SetGraphType(event.GetValue()); } } + +void pnlQos::SetAudioData(const timedbuffer* pTimedBuffer) +{ + + double dTimestamp(static_cast(pTimedBuffer->GetTimestamp())/4294967296.0); + m_pGraph->AddPeak("Timestamp",dTimestamp); + m_pHistogram->AddPeak("Timestamp",dTimestamp); + +} \ No newline at end of file diff --git a/plugins/aoip info/pnlQos.h b/plugins/aoip info/pnlQos.h index 809af6f9..96db6f43 100644 --- a/plugins/aoip info/pnlQos.h +++ b/plugins/aoip info/pnlQos.h @@ -8,6 +8,9 @@ #include "wmlabel.h" #include //*) +#include "aoipinfobuilder.h" +#include "histogram.h" +#include "historygraph.h" class SettingEvent; @@ -60,6 +63,8 @@ class pnlQos: public wxPanel wmLabel* m_plblTSDF; wxPanel* Panel1; //*) + void QoSUpdated(qosData* pData); + void SetAudioData(const timedbuffer* pTimedBuffer); protected: @@ -106,7 +111,7 @@ class pnlQos: public wxPanel static const long ID_M_PLBL2; //*) - void QoSUpdated(qosData* pData); + void ShowGraph(const wxString& sGraph); void SetGraphType(const wxString& sType); @@ -122,7 +127,7 @@ class pnlQos: public wxPanel wxString m_sGroup; wxString m_sGraph; - + double m_dSlip; DECLARE_EVENT_TABLE() }; diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 23b16a3d..39331ca2 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -6,6 +6,10 @@ #include //*) +#ifdef PTPMONKEY +#include "wxptp.h" +#endif + //(*IdInit(pnlSubsession) const long pnlSubsession::ID_M_PLBL39 = wxNewId(); const long pnlSubsession::ID_M_PLBL42 = wxNewId(); @@ -50,7 +54,8 @@ BEGIN_EVENT_TABLE(pnlSubsession,wxPanel) //*) END_EVENT_TABLE() -pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID id,const wxPoint& pos,const wxSize& size) +pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID id,const wxPoint& pos,const wxSize& size) : +m_sub(sub) { //(*Initialize(pnlSubsession) Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id")); @@ -273,15 +278,6 @@ pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID m_plblTimestampOut->SetFont(m_plblTimestampOutFont); //*) - m_plblEpoch = new wmLabel(this, wxNewId(), wxEmptyString, wxPoint(305,151), wxSize(249,25), 0, _T("ID_M_PLBL57")); - m_plblEpoch->SetBorderState(uiRect::BORDER_NONE); - m_plblEpoch->GetUiRect().SetGradient(0); - m_plblEpoch->SetForegroundColour(wxColour(0,128,0)); - m_plblEpoch->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblEpochFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblEpoch->SetFont(m_plblEpochFont); - - m_plblSubsessionId->SetLabel(sub.sId); @@ -292,8 +288,9 @@ pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID m_plblSyncTimestamp->SetLabel(wxString::Format("%u", sub.nSyncTimestamp)); - m_nSampleRate = sub.nSampleRate; - m_nFrameSize = min((unsigned int)256 ,sub.nChannels); + /*m_nSampleRate = sub.nSampleRate; + + m_nFrameSize = min((unsigned int)256 ,sub.nChannels); if(sub.sCodec == "L24") { m_nFrameSize*=3; @@ -305,7 +302,7 @@ pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID else if(sub.sCodec == "F32") { m_nFrameSize*=4; - } + }*/ m_plblSubSyncType->SetLabel(sub.refClock.sType); m_plblSubSyncVersion->SetLabel(sub.refClock.sVersion); @@ -321,9 +318,9 @@ pnlSubsession::pnlSubsession(wxWindow* parent, const subsession& sub, wxWindowID } wxPtp::Get().AddHandler(this); - Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); - Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); - Connect(wxID_ANY, wxEVT_CLOCK_UPDATED, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); + Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&pnlSubsession::OnPtpEvent); + Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&pnlSubsession::OnPtpEvent); + Connect(wxID_ANY, wxEVT_CLOCK_UPDATED, (wxObjectEventFunction)&pnlSubsession::OnPtpEvent); #else m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,100)); diff --git a/plugins/aoip info/pnlSubsession.h b/plugins/aoip info/pnlSubsession.h index 12931959..619c89bd 100644 --- a/plugins/aoip info/pnlSubsession.h +++ b/plugins/aoip info/pnlSubsession.h @@ -6,6 +6,8 @@ #include //*) +#include "session.h" + class pnlSubsession: public wxPanel { public: @@ -99,6 +101,7 @@ class pnlSubsession: public wxPanel //*) void OnPtpEvent(wxCommandEvent& event); + subsession m_sub; DECLARE_EVENT_TABLE() }; diff --git a/plugins/channel delay/CMakeLists.txt b/plugins/channel delay/CMakeLists.txt index 2a87906a..15d0c716 100644 --- a/plugins/channel delay/CMakeLists.txt +++ b/plugins/channel delay/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(channeldelay LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -20,7 +20,7 @@ add_library(channeldelay MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAM find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_link_libraries(channeldelay ${wxWidgets_LIBRARIES}) target_link_libraries(channeldelay optimized pambase debug pambased) target_link_libraries(channeldelay optimized pamfft debug pamfftd) +set_target_properties(channeldelay PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS channeldelay LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS channeldelay LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/correlation/CMakeLists.txt b/plugins/correlation/CMakeLists.txt index 19665b56..25d8c514 100644 --- a/plugins/correlation/CMakeLists.txt +++ b/plugins/correlation/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(correlation LANGUAGES CXX VERSION 0.1.0) @@ -22,7 +22,7 @@ add_library(correlation MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -41,7 +41,9 @@ target_link_libraries(correlation optimized pambase debug pambased) target_link_libraries(correlation optimized pamlevel debug pamleveld) +set_target_properties(correlation PROPERTIES CXX_STANDARD 17) + #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS correlation LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS correlation LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/distortion/CMakeLists.txt b/plugins/distortion/CMakeLists.txt index e8d00a33..224c9b96 100644 --- a/plugins/distortion/CMakeLists.txt +++ b/plugins/distortion/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(distortion LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -22,7 +22,7 @@ add_library(distortion MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME} find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -39,9 +39,10 @@ target_link_libraries(distortion ${wxWidgets_LIBRARIES}) target_link_libraries(distortion optimized pambase debug pambased) target_link_libraries(distortion optimized pamfft debug pamfftd) +set_target_properties(distortion PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS distortion LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS distortion LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/fft/CMakeLists.txt b/plugins/fft/CMakeLists.txt index 63db9701..b493b082 100644 --- a/plugins/fft/CMakeLists.txt +++ b/plugins/fft/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(fft LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -23,7 +23,7 @@ add_library(fft MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -40,10 +40,11 @@ target_link_libraries(fft ${wxWidgets_LIBRARIES}) target_link_libraries(fft optimized pambase debug pambased) target_link_libraries(fft optimized pamfft debug pamfftd) +set_target_properties(fft PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS fft LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS fft LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/fftdiff/CMakeLists.txt b/plugins/fftdiff/CMakeLists.txt index 23eba7d4..9ae7fc5f 100644 --- a/plugins/fftdiff/CMakeLists.txt +++ b/plugins/fftdiff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22 FATAL_ERROR) project(car LANGUAGES CXX VERSION 1.1.0) @@ -20,7 +20,7 @@ add_library(car MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -38,8 +38,9 @@ target_link_libraries(car optimized pambase debug pambased) target_link_libraries(car optimized pamfft debug pamfftd) +set_target_properties(car PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS car LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS car LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/fftphase/CMakeLists.txt b/plugins/fftphase/CMakeLists.txt index 3f276313..c9ce4413 100644 --- a/plugins/fftphase/CMakeLists.txt +++ b/plugins/fftphase/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(fftphase MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -42,11 +42,11 @@ target_link_libraries(fftphase optimized pambase debug pambased) target_link_libraries(fftphase optimized pamfft debug pamfftd) target_link_libraries(fftphase optimized restgoose debug restgoosed) - +set_target_properties(fftphase PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS fftphase LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS fftphase LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/identify/CMakeLists.txt b/plugins/identify/CMakeLists.txt index cf8eda74..81f11bca 100644 --- a/plugins/identify/CMakeLists.txt +++ b/plugins/identify/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(identify MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,8 +33,9 @@ target_compile_options(identify PRIVATE ${flags}) target_link_libraries(identify ${wxWidgets_LIBRARIES}) target_link_libraries(identify optimized pambase debug pambased) +set_target_properties(identify PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS identify LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS identify LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/levels/CMakeLists.txt b/plugins/levels/CMakeLists.txt index 12e76032..136856c9 100644 --- a/plugins/levels/CMakeLists.txt +++ b/plugins/levels/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(levels MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,8 +34,9 @@ target_compile_options(levels PRIVATE ${flags}) target_link_libraries(levels ${wxWidgets_LIBRARIES}) target_link_libraries(levels optimized pambase debug pambased) +set_target_properties(levels PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS levels LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS levels LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/lineup/CMakeLists.txt b/plugins/lineup/CMakeLists.txt index 44468af7..bce73ecf 100644 --- a/plugins/lineup/CMakeLists.txt +++ b/plugins/lineup/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(lineup MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_link_libraries(lineup ${wxWidgets_LIBRARIES}) target_link_libraries(lineup optimized pambase debug pambased) target_link_libraries(lineup optimized pamfft debug pamfftd) target_link_libraries(lineup optimized pamlevel debug pamleveld) +set_target_properties(lineup PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS lineup LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS lineup LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/lissajou/CMakeLists.txt b/plugins/lissajou/CMakeLists.txt index f1714d40..570f8ed6 100644 --- a/plugins/lissajou/CMakeLists.txt +++ b/plugins/lissajou/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(lissajou MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,12 +32,14 @@ else() endif() target_compile_options(lissajou PRIVATE ${flags}) +set_target_properties(lissajou PROPERTIES CXX_STANDARD 17) + #target_link_libraries(lissajou ${wxWidgets_LIBRARIES}) #target_link_libraries(lissajou optimized pambase debug pambased) #target_link_libraries(lissajou optimized pamfft debug pamfftd) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS lissajou LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS lissajou LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/meters/CMakeLists.txt b/plugins/meters/CMakeLists.txt index bbb6b8cd..3c054eec 100644 --- a/plugins/meters/CMakeLists.txt +++ b/plugins/meters/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(meters MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(meters PRIVATE ${flags}) target_link_libraries(meters ${wxWidgets_LIBRARIES}) target_link_libraries(meters optimized pambase debug pambased) - +set_target_properties(meters PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS meters LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS meters LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/noiseGenerator/CMakeLists.txt b/plugins/noiseGenerator/CMakeLists.txt index 3910f3cc..1f30630e 100644 --- a/plugins/noiseGenerator/CMakeLists.txt +++ b/plugins/noiseGenerator/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(noiseGenerator MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_N find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(noiseGenerator PRIVATE ${flags}) target_link_libraries(noiseGenerator ${wxWidgets_LIBRARIES}) target_link_libraries(noiseGenerator optimized pambase debug pambased) - +set_target_properties(noiseGenerator PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS noiseGenerator LIBRARY DESTINATION /usr/local/lib/pam2/generator) + install(TARGETS noiseGenerator LIBRARY DESTINATION lib/pam2/generator) endif() diff --git a/plugins/peak count/CMakeLists.txt b/plugins/peak count/CMakeLists.txt index e3c77d09..df9f5c41 100644 --- a/plugins/peak count/CMakeLists.txt +++ b/plugins/peak count/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(peakcount MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(peakcount PRIVATE ${flags}) target_link_libraries(peakcount ${wxWidgets_LIBRARIES}) target_link_libraries(peakcount optimized pambase debug pambased) - +set_target_properties(peakcount PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS peakcount LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS peakcount LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/peak log/CMakeLists.txt b/plugins/peak log/CMakeLists.txt index 0cff24e1..2522e49e 100644 --- a/plugins/peak log/CMakeLists.txt +++ b/plugins/peak log/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(peaklog MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ve find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,9 +34,10 @@ target_link_libraries(peaklog ${wxWidgets_LIBRARIES}) target_link_libraries(peaklog optimized pambase debug pambased) target_link_libraries(peaklog optimized restgoose debug restgoosed) target_link_libraries(peaklog optimized pml_log debug pml_logd) +set_target_properties(peaklog PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS peaklog LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS peaklog LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/polarscope/CMakeLists.txt b/plugins/polarscope/CMakeLists.txt index 25879b54..1b9e6faf 100644 --- a/plugins/polarscope/CMakeLists.txt +++ b/plugins/polarscope/CMakeLists.txt @@ -18,7 +18,7 @@ target_link_libraries(polarscope optimized pamfft debug pamfftd) find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,10 +33,10 @@ target_compile_options(polarscope PRIVATE ${flags}) target_link_libraries(polarscope ${wxWidgets_LIBRARIES}) target_link_libraries(polarscope optimized pambase debug pambased) - +set_target_properties(polarscope PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS polarscope LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS polarscope LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/ptp/CMakeLists.txt b/plugins/ptp/CMakeLists.txt index f79106d5..112916a3 100644 --- a/plugins/ptp/CMakeLists.txt +++ b/plugins/ptp/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(ptp MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,9 +34,9 @@ target_compile_options(ptp PRIVATE ${flags}) target_link_libraries(ptp ${wxWidgets_LIBRARIES}) target_link_libraries(ptp optimized pambase debug pambased) - +set_target_properties(ptp PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS ptp LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS ptp LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/ptp/ptppanel.cpp b/plugins/ptp/ptppanel.cpp index 79d86bc0..447b81bc 100644 --- a/plugins/ptp/ptppanel.cpp +++ b/plugins/ptp/ptppanel.cpp @@ -1203,7 +1203,7 @@ void ptpPanel::OnTimer(wxTimerEvent& event) Connect(wxID_ANY, wxEVT_CLOCK_MSG_DELAY_REQUEST,(wxObjectEventFunction)&ptpPanel::OnClockMessage); Connect(wxID_ANY, wxEVT_CLOCK_MSG_DELAY_RESPONSE,(wxObjectEventFunction)&ptpPanel::OnClockMessage); - wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain); + wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); for(auto itClock = wxPtp::Get().GetClocksBegin(m_nDomain); itClock != wxPtp::Get().GetClocksEnd(m_nDomain); ++itClock) diff --git a/plugins/r128/CMakeLists.txt b/plugins/r128/CMakeLists.txt index 1270316e..639e8c0c 100644 --- a/plugins/r128/CMakeLists.txt +++ b/plugins/r128/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(r128 MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versi find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -35,9 +35,9 @@ target_link_libraries(r128 ${wxWidgets_LIBRARIES}) target_link_libraries(r128 optimized pambase debug pambased) target_link_libraries(r128 optimized pamlevel debug pamleveld) target_link_libraries(r128 optimized pamfft debug pamfftd) - +set_target_properties(r128 PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS r128 LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS r128 LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/radar/CMakeLists.txt b/plugins/radar/CMakeLists.txt index 48d24190..dfba7f47 100644 --- a/plugins/radar/CMakeLists.txt +++ b/plugins/radar/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(radar MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_vers find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(radar PRIVATE ${flags}) target_link_libraries(radar ${wxWidgets_LIBRARIES}) target_link_libraries(radar optimized pambase debug pambased) +set_target_properties(radar PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS radar LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS radar LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/record/CMakeLists.txt b/plugins/record/CMakeLists.txt index 844a475f..03935488 100644 --- a/plugins/record/CMakeLists.txt +++ b/plugins/record/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(record MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,9 @@ target_compile_options(record PRIVATE ${flags}) target_link_libraries(record ${wxWidgets_LIBRARIES}) target_link_libraries(record optimized pambase debug pambased) - +set_target_properties(record PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS record LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS record LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/scope/CMakeLists.txt b/plugins/scope/CMakeLists.txt index 4d824cdd..d8f1cf3a 100644 --- a/plugins/scope/CMakeLists.txt +++ b/plugins/scope/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(scope MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_vers find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(scope PRIVATE ${flags}) target_link_libraries(scope ${wxWidgets_LIBRARIES}) target_link_libraries(scope optimized pambase debug pambased) +set_target_properties(scope PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS scope LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS scope LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/spectogram/CMakeLists.txt b/plugins/spectogram/CMakeLists.txt index 44592d5c..8dfeab49 100644 --- a/plugins/spectogram/CMakeLists.txt +++ b/plugins/spectogram/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(spectogram MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME} find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_compile_options(spectogram PRIVATE ${flags}) target_link_libraries(spectogram ${wxWidgets_LIBRARIES}) target_link_libraries(spectogram optimized pambase debug pambased) target_link_libraries(spectogram optimized pamfft debug pamfftd) +set_target_properties(spectogram PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS spectogram LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS spectogram LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/waveform/CMakeLists.txt b/plugins/waveform/CMakeLists.txt index 0762551e..e4e4c949 100644 --- a/plugins/waveform/CMakeLists.txt +++ b/plugins/waveform/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(waveform MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(waveform PRIVATE ${flags}) target_link_libraries(waveform ${wxWidgets_LIBRARIES}) target_link_libraries(waveform optimized pambase debug pambased) +set_target_properties(waveform PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS waveform LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS waveform LIBRARY DESTINATION lib/pam2/monitor) endif() From 99c9151aa23a6a29d98fdbbfa830a0780cf322b6 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 12:47:17 +0100 Subject: [PATCH 03/30] Aoip work --- plugins/aoip info/pnlAoIPInfo.cpp | 64 ++++++++++++--------- plugins/aoip info/pnlAoIPInfo.h | 8 +++ plugins/aoip info/pnlQos.cpp | 14 ++--- plugins/aoip info/pnlSubsession.cpp | 44 +++++++------- plugins/aoip info/pnlSubsession.h | 8 +-- plugins/aoip info/wxsmith/pnlAoIPInfo.wxs | 52 +++++++++++++++-- plugins/aoip info/wxsmith/pnlQos.wxs | 6 +- plugins/aoip info/wxsmith/pnlSubsession.wxs | 58 +++++++++---------- 8 files changed, 158 insertions(+), 96 deletions(-) diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index f7e5d9db..dd23a257 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -41,6 +41,10 @@ const long pnlAoIPInfo::ID_M_PLBL75 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL77 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL78 = wxNewId(); const long pnlAoIPInfo::ID_M_PLBL80 = wxNewId(); +const long pnlAoIPInfo::ID_M_PLBL54 = wxNewId(); +const long pnlAoIPInfo::ID_M_PLBL57 = wxNewId(); +const long pnlAoIPInfo::ID_M_PLBL4 = wxNewId(); +const long pnlAoIPInfo::ID_M_PLBL5 = wxNewId(); const long pnlAoIPInfo::pnlSessionInfo = wxNewId(); const long pnlAoIPInfo::ID_TEXTCTRL1 = wxNewId(); const long pnlAoIPInfo::ID_PANEL3 = wxNewId(); @@ -161,30 +165,54 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID m_plblSyncDomain->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblSyncDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblSyncDomain->SetFont(m_plblSyncDomainFont); - m_pLbl40 = new wmLabel(pnlSession, ID_M_PLBL75, _("Audio Subsessions"), wxPoint(5,300), wxSize(144,20), 0, _T("ID_M_PLBL75")); + m_pLbl40 = new wmLabel(pnlSession, ID_M_PLBL75, _("Audio Subsessions"), wxPoint(5,260), wxSize(144,20), 0, _T("ID_M_PLBL75")); m_pLbl40->SetBorderState(uiRect::BORDER_NONE); m_pLbl40->GetUiRect().SetGradient(0); m_pLbl40->SetForegroundColour(wxColour(255,255,255)); m_pLbl40->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl42 = new wmLabel(pnlSession, ID_M_PLBL77, _("Duplicate Streams"), wxPoint(295,300), wxSize(144,20), 0, _T("ID_M_PLBL77")); + m_pLbl42 = new wmLabel(pnlSession, ID_M_PLBL77, _("Duplicate Streams"), wxPoint(150,260), wxSize(144,20), 0, _T("ID_M_PLBL77")); m_pLbl42->SetBorderState(uiRect::BORDER_NONE); m_pLbl42->GetUiRect().SetGradient(0); m_pLbl42->SetForegroundColour(wxColour(255,255,255)); m_pLbl42->SetBackgroundColour(wxColour(0,0,255)); - m_plblSubsessionsAudio = new wmLabel(pnlSession, ID_M_PLBL78, wxEmptyString, wxPoint(5,321), wxSize(144,25), 0, _T("ID_M_PLBL78")); + m_plblSubsessionsAudio = new wmLabel(pnlSession, ID_M_PLBL78, wxEmptyString, wxPoint(5,281), wxSize(144,25), 0, _T("ID_M_PLBL78")); m_plblSubsessionsAudio->SetBorderState(uiRect::BORDER_NONE); m_plblSubsessionsAudio->GetUiRect().SetGradient(0); m_plblSubsessionsAudio->SetForegroundColour(wxColour(0,128,0)); m_plblSubsessionsAudio->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblSubsessionsAudioFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblSubsessionsAudio->SetFont(m_plblSubsessionsAudioFont); - m_plblGroups = new wmLabel(pnlSession, ID_M_PLBL80, wxEmptyString, wxPoint(295,321), wxSize(144,25), 0, _T("ID_M_PLBL80")); + m_plblGroups = new wmLabel(pnlSession, ID_M_PLBL80, wxEmptyString, wxPoint(150,281), wxSize(144,25), 0, _T("ID_M_PLBL80")); m_plblGroups->SetBorderState(uiRect::BORDER_NONE); m_plblGroups->GetUiRect().SetGradient(0); m_plblGroups->SetForegroundColour(wxColour(0,128,0)); m_plblGroups->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblGroupsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblGroups->SetFont(m_plblGroupsFont); + m_pLbl31 = new wmLabel(pnlSession, ID_M_PLBL54, _("Current Timestamp"), wxPoint(5,320), wxSize(160,20), 0, _T("ID_M_PLBL54")); + m_pLbl31->SetBorderState(uiRect::BORDER_NONE); + m_pLbl31->GetUiRect().SetGradient(0); + m_pLbl31->SetForegroundColour(wxColour(255,255,255)); + m_pLbl31->SetBackgroundColour(wxColour(0,0,255)); + m_plblCurrentTimestamp = new wmLabel(pnlSession, ID_M_PLBL57, wxEmptyString, wxPoint(5,341), wxSize(160,25), 0, _T("ID_M_PLBL57")); + m_plblCurrentTimestamp->SetBorderState(uiRect::BORDER_NONE); + m_plblCurrentTimestamp->GetUiRect().SetGradient(0); + m_plblCurrentTimestamp->SetForegroundColour(wxColour(0,128,0)); + m_plblCurrentTimestamp->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblCurrentTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblCurrentTimestamp->SetFont(m_plblCurrentTimestampFont); + m_pLbl2 = new wmLabel(pnlSession, ID_M_PLBL4, _("Display/Playback Time"), wxPoint(166,320), wxSize(167,20), 0, _T("ID_M_PLBL4")); + m_pLbl2->SetBorderState(uiRect::BORDER_NONE); + m_pLbl2->GetUiRect().SetGradient(0); + m_pLbl2->SetForegroundColour(wxColour(255,255,255)); + m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); + m_plblTimestampOut = new wmLabel(pnlSession, ID_M_PLBL5, wxEmptyString, wxPoint(166,341), wxSize(167,25), 0, _T("ID_M_PLBL5")); + m_plblTimestampOut->SetBorderState(uiRect::BORDER_NONE); + m_plblTimestampOut->GetUiRect().SetGradient(0); + m_plblTimestampOut->SetForegroundColour(wxColour(0,128,0)); + m_plblTimestampOut->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblTimestampOutFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblTimestampOut->SetFont(m_plblTimestampOutFont); pnlSDP = new wxPanel(m_pswpInfo, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); pnlSDP->SetBackgroundColour(wxColour(0,0,0)); m_ptxtSDP = new wxTextCtrl(pnlSDP, ID_TEXTCTRL1, wxEmptyString, wxPoint(5,5), wxSize(590,435), wxTE_MULTILINE|wxTE_READONLY, wxDefaultValidator, _T("ID_TEXTCTRL1")); @@ -255,6 +283,10 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) { itPanel->second->QoSUpdated(pData); } + else + { + pmlLog() << "Could not find QoS " << pData->sStream; + } } } @@ -269,31 +301,9 @@ void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) { pPanel->SetAudioData(pTimedBuffer); } - /* - SetTimestamp(pTimedBuffer->GetTransmissionTime(), m_plblTransmissionTime, false); - SetTimestamp(pTimedBuffer->GetTimeVal(), m_plblTimestampIn); + SetTimestamp(pTimedBuffer->GetPlaybackTime(), m_plblTimestampOut); m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pTimedBuffer->GetTimestamp())); - ShowLatency(pTimedBuffer); - - m_plblFrameSize->SetLabel(wxString::Format("%u bytes", pTimedBuffer->GetDuration())); - - m_dFrameDuration = static_cast(pTimedBuffer->GetDuration())/static_cast(m_nSampleRate*m_nFrameSize)*1e6; - - m_plblFrameDuration->SetLabel(wxString::Format("%.2f us", m_dFrameDuration)); - - m_plblPlaybackQueue->SetLabel(wxString::Format("%u", pTimedBuffer->GetBufferDepth())); - - double dTimestamp(static_cast(pTimedBuffer->GetTimestamp())/4294967296.0); - m_pGraph->AddPeak("Timestamp",dTimestamp);//static_cast(pTimedBuffer->GetTimestamp())/2e32); - m_pHistogram->AddPeak("Timestamp",dTimestamp);//static_cast(pTimedBuffer->GetTimestamp())/2e32); - - #ifdef PTPMONKEY - m_plblTransmissionTime->SetBackgroundColour(wxPtp::Get().IsSyncedToMaster(0) ? *wxWHITE : wxColour(255,180,180)); - m_plblTimestampIn->SetBackgroundColour(wxPtp::Get().IsSyncedToMaster(0) ? *wxWHITE : wxColour(255,180,180)); - m_plblLatencyNetwork->SetBackgroundColour(wxPtp::Get().IsSyncedToMaster(0) ? *wxWHITE : wxColour(255,180,180)); - #endif // PTPMONKEY - */ } diff --git a/plugins/aoip info/pnlAoIPInfo.h b/plugins/aoip info/pnlAoIPInfo.h index 2f8b282a..d8c3f3c1 100644 --- a/plugins/aoip info/pnlAoIPInfo.h +++ b/plugins/aoip info/pnlAoIPInfo.h @@ -36,11 +36,14 @@ class pnlAoIPInfo: public wxPanel wmLabel* m_pLbl20; wmLabel* m_pLbl21; wmLabel* m_pLbl24; + wmLabel* m_pLbl2; + wmLabel* m_pLbl31; wmLabel* m_pLbl32; wmLabel* m_pLbl33; wmLabel* m_pLbl3; wmLabel* m_pLbl40; wmLabel* m_pLbl42; + wmLabel* m_plblCurrentTimestamp; wmLabel* m_plblDescription; wmLabel* m_plblGroups; wmLabel* m_plblInput; @@ -51,6 +54,7 @@ class pnlAoIPInfo: public wxPanel wmLabel* m_plblSyncId; wmLabel* m_plblSyncType; wmLabel* m_plblSyncVersion; + wmLabel* m_plblTimestampOut; wmSwitcherPanel* m_pswpInfo; wxPanel* pnlSDP; wxPanel* pnlSession; @@ -101,6 +105,10 @@ class pnlAoIPInfo: public wxPanel static const long ID_M_PLBL77; static const long ID_M_PLBL78; static const long ID_M_PLBL80; + static const long ID_M_PLBL54; + static const long ID_M_PLBL57; + static const long ID_M_PLBL4; + static const long ID_M_PLBL5; static const long pnlSessionInfo; static const long ID_TEXTCTRL1; static const long ID_PANEL3; diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index 0c04377c..a3a50d8d 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -64,8 +64,8 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde SetBackgroundColour(wxColour(0,0,0)); Panel1 = new wxPanel(this, ID_PANEL4, wxPoint(0,280), wxSize(600,160), wxTAB_TRAVERSAL, _T("ID_PANEL4")); Panel1->SetBackgroundColour(wxColour(0,0,0)); - m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160)); - m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160)); + m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160),1,10,0); + m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160),1,10,0); m_plblTSDF = new wmLabel(this, ID_M_PLBL90, wxEmptyString, wxPoint(146,246), wxSize(109,25), 0, _T("ID_M_PLBL90")); m_plblTSDF->SetBorderState(uiRect::BORDER_NONE); m_plblTSDF->GetUiRect().SetGradient(0); @@ -73,11 +73,11 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde m_plblTSDF->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblTSDFFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblTSDF->SetFont(m_plblTSDFFont); - m_pbtnCurrentGraph = new wmButton(this, ID_M_PBTN29, wxEmptyString, wxPoint(262,246), wxSize(150,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN29")); + m_pbtnCurrentGraph = new wmButton(this, ID_M_PBTN29, wxEmptyString, wxPoint(262,246), wxSize(140,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN29")); m_pbtnCurrentGraph->SetForegroundColour(wxColour(0,128,0)); m_pbtnCurrentGraph->SetBackgroundColour(wxColour(255,255,255)); m_pbtnCurrentGraph->SetColourSelected(wxColour(wxT("#800000"))); - m_pbtnGraphType = new wmButton(this, ID_M_PBTN1, _("Line Graph"), wxPoint(413,246), wxSize(60,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN1")); + m_pbtnGraphType = new wmButton(this, ID_M_PBTN1, _("Line Graph"), wxPoint(403,246), wxSize(70,25), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN1")); m_pbtnGraphType->SetForegroundColour(wxColour(0,128,0)); m_pbtnGraphType->SetBackgroundColour(wxColour(255,255,255)); m_pbtnGraphType->SetColourSelected(wxColour(wxT("#800000"))); @@ -322,7 +322,7 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde m_pbtnCurrentGraph->ConnectToSetting(pBuilder->GetSection(), "Graph_"+sGroup, "kBit/s"); m_pbtnGraphType->SetPopup({"Line Graph", "Bar Chart", "Histogram"}); - m_pbtnGraphType->ConnectToSetting(pBuilder->GetSection(), "GraphType_"+sGroup, "kBit/s"); + m_pbtnGraphType->ConnectToSetting(pBuilder->GetSection(), "GraphType_"+sGroup, "Line Graph"); pBuilder->RegisterForSettingsUpdates(this, "Graph_"+sGroup); pBuilder->RegisterForSettingsUpdates(this, "GraphType_"+sGroup); @@ -446,9 +446,9 @@ void pnlQos::OnSettingChanged(SettingEvent& event) void pnlQos::SetAudioData(const timedbuffer* pTimedBuffer) { - + double dTimestamp(static_cast(pTimedBuffer->GetTimestamp())/4294967296.0); m_pGraph->AddPeak("Timestamp",dTimestamp); m_pHistogram->AddPeak("Timestamp",dTimestamp); -} \ No newline at end of file +} diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 39331ca2..5f9aec1d 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -32,21 +32,21 @@ const long pnlSubsession::ID_M_PLBL73 = wxNewId(); const long pnlSubsession::ID_M_PLBL52 = wxNewId(); const long pnlSubsession::ID_M_PLBL54 = wxNewId(); const long pnlSubsession::ID_M_PLBL3 = wxNewId(); +const long pnlSubsession::ID_M_PLBL4 = wxNewId(); const long pnlSubsession::ID_M_PLBL50 = wxNewId(); const long pnlSubsession::ID_M_PLBL55 = wxNewId(); const long pnlSubsession::ID_M_PLBL57 = wxNewId(); +const long pnlSubsession::ID_M_PLBL5 = wxNewId(); const long pnlSubsession::ID_M_PLBL6 = wxNewId(); const long pnlSubsession::ID_M_PLBL51 = wxNewId(); const long pnlSubsession::ID_M_PLBL1 = wxNewId(); const long pnlSubsession::ID_M_PLBL53 = wxNewId(); -const long pnlSubsession::ID_M_PLBL4 = wxNewId(); const long pnlSubsession::ID_M_PLBL61 = wxNewId(); const long pnlSubsession::ID_M_PLBL81 = wxNewId(); const long pnlSubsession::ID_M_PLBL82 = wxNewId(); const long pnlSubsession::ID_M_PLBL83 = wxNewId(); const long pnlSubsession::ID_M_PLBL2 = wxNewId(); const long pnlSubsession::ID_M_PLBL56 = wxNewId(); -const long pnlSubsession::ID_M_PLBL5 = wxNewId(); //*) BEGIN_EVENT_TABLE(pnlSubsession,wxPanel) @@ -178,7 +178,12 @@ m_sub(sub) m_pLbl31->GetUiRect().SetGradient(0); m_pLbl31->SetForegroundColour(wxColour(255,255,255)); m_pLbl31->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl3 = new wmLabel(this, ID_M_PLBL3, _("Playing Timestamp"), wxPoint(428,130), wxSize(167,20), 0, _T("ID_M_PLBL3")); + m_pLbl2 = new wmLabel(this, ID_M_PLBL3, _("Buffer Size"), wxPoint(400,130), wxSize(80,20), 0, _T("ID_M_PLBL3")); + m_pLbl2->SetBorderState(uiRect::BORDER_NONE); + m_pLbl2->GetUiRect().SetGradient(0); + m_pLbl2->SetForegroundColour(wxColour(255,255,255)); + m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); + m_pLbl3 = new wmLabel(this, ID_M_PLBL4, _("Frames Used"), wxPoint(485,130), wxSize(110,20), 0, _T("ID_M_PLBL4")); m_pLbl3->SetBorderState(uiRect::BORDER_NONE); m_pLbl3->GetUiRect().SetGradient(0); m_pLbl3->SetForegroundColour(wxColour(255,255,255)); @@ -202,13 +207,20 @@ m_sub(sub) m_plblCurrentTimestamp->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblCurrentTimestampFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblCurrentTimestamp->SetFont(m_plblCurrentTimestampFont); - m_pLbl4 = new wmLabel(this, ID_M_PLBL6, wxEmptyString, wxPoint(428,151), wxSize(167,25), 0, _T("ID_M_PLBL6")); - m_pLbl4->SetBorderState(uiRect::BORDER_NONE); - m_pLbl4->GetUiRect().SetGradient(0); - m_pLbl4->SetForegroundColour(wxColour(0,128,0)); - m_pLbl4->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_pLbl4Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_pLbl4->SetFont(m_pLbl4Font); + m_plblBuffer = new wmLabel(this, ID_M_PLBL5, wxEmptyString, wxPoint(400,151), wxSize(80,25), 0, _T("ID_M_PLBL5")); + m_plblBuffer->SetBorderState(uiRect::BORDER_NONE); + m_plblBuffer->GetUiRect().SetGradient(0); + m_plblBuffer->SetForegroundColour(wxColour(0,128,0)); + m_plblBuffer->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblBufferFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblBuffer->SetFont(m_plblBufferFont); + m_plblContribution = new wmLabel(this, ID_M_PLBL6, wxEmptyString, wxPoint(485,151), wxSize(110,25), 0, _T("ID_M_PLBL6")); + m_plblContribution->SetBorderState(uiRect::BORDER_NONE); + m_plblContribution->GetUiRect().SetGradient(0); + m_plblContribution->SetForegroundColour(wxColour(0,128,0)); + m_plblContribution->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_plblContributionFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); + m_plblContribution->SetFont(m_plblContributionFont); m_plblTransmissionTime = new wmLabel(this, ID_M_PLBL51, wxEmptyString, wxPoint(5,206), wxSize(160,25), 0, _T("ID_M_PLBL51")); m_plblTransmissionTime->SetBorderState(uiRect::BORDER_NONE); m_plblTransmissionTime->GetUiRect().SetGradient(0); @@ -226,11 +238,6 @@ m_sub(sub) m_pLbl30->GetUiRect().SetGradient(0); m_pLbl30->SetForegroundColour(wxColour(255,255,255)); m_pLbl30->SetBackgroundColour(wxColour(0,0,255)); - m_pLbl2 = new wmLabel(this, ID_M_PLBL4, _("Display/Playback Time"), wxPoint(428,185), wxSize(167,20), 0, _T("ID_M_PLBL4")); - m_pLbl2->SetBorderState(uiRect::BORDER_NONE); - m_pLbl2->GetUiRect().SetGradient(0); - m_pLbl2->SetForegroundColour(wxColour(255,255,255)); - m_pLbl2->SetBackgroundColour(wxColour(0,0,255)); m_pLbl34 = new wmLabel(this, ID_M_PLBL61, _("Last Frame Size"), wxPoint(5,240), wxSize(144,20), 0, _T("ID_M_PLBL61")); m_pLbl34->SetBorderState(uiRect::BORDER_NONE); m_pLbl34->GetUiRect().SetGradient(0); @@ -269,13 +276,6 @@ m_sub(sub) m_plblLatencyNetwork->SetBackgroundColour(wxColour(255,255,255)); wxFont m_plblLatencyNetworkFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); m_plblLatencyNetwork->SetFont(m_plblLatencyNetworkFont); - m_plblTimestampOut = new wmLabel(this, ID_M_PLBL5, wxEmptyString, wxPoint(428,206), wxSize(167,25), 0, _T("ID_M_PLBL5")); - m_plblTimestampOut->SetBorderState(uiRect::BORDER_NONE); - m_plblTimestampOut->GetUiRect().SetGradient(0); - m_plblTimestampOut->SetForegroundColour(wxColour(0,128,0)); - m_plblTimestampOut->SetBackgroundColour(wxColour(255,255,255)); - wxFont m_plblTimestampOutFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Consolas"),wxFONTENCODING_DEFAULT); - m_plblTimestampOut->SetFont(m_plblTimestampOutFont); //*) diff --git a/plugins/aoip info/pnlSubsession.h b/plugins/aoip info/pnlSubsession.h index 619c89bd..7e391002 100644 --- a/plugins/aoip info/pnlSubsession.h +++ b/plugins/aoip info/pnlSubsession.h @@ -34,7 +34,8 @@ class pnlSubsession: public wxPanel wmLabel* m_pLbl38; wmLabel* m_pLbl3; wmLabel* m_pLbl43; - wmLabel* m_pLbl4; + wmLabel* m_plblBuffer; + wmLabel* m_plblContribution; wmLabel* m_plblCurrentTimestamp; wmLabel* m_plblFrameDuration; wmLabel* m_plblFrameSize; @@ -50,7 +51,6 @@ class pnlSubsession: public wxPanel wmLabel* m_plblSubsessionId; wmLabel* m_plblSyncTimestamp; wmLabel* m_plblTimestampIn; - wmLabel* m_plblTimestampOut; wmLabel* m_plblTransmissionTime; //*) @@ -78,21 +78,21 @@ class pnlSubsession: public wxPanel static const long ID_M_PLBL52; static const long ID_M_PLBL54; static const long ID_M_PLBL3; + static const long ID_M_PLBL4; static const long ID_M_PLBL50; static const long ID_M_PLBL55; static const long ID_M_PLBL57; + static const long ID_M_PLBL5; static const long ID_M_PLBL6; static const long ID_M_PLBL51; static const long ID_M_PLBL1; static const long ID_M_PLBL53; - static const long ID_M_PLBL4; static const long ID_M_PLBL61; static const long ID_M_PLBL81; static const long ID_M_PLBL82; static const long ID_M_PLBL83; static const long ID_M_PLBL2; static const long ID_M_PLBL56; - static const long ID_M_PLBL5; //*) private: diff --git a/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs b/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs index af3da889..5916e46e 100644 --- a/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs +++ b/plugins/aoip info/wxsmith/pnlAoIPInfo.wxs @@ -189,21 +189,21 @@ - 5,300 + 5,260 144,20 #FFFFFF #0000FF - 295,300 + 150,260 144,20 #FFFFFF #0000FF - 5,321 + 5,281 144,25 #008000 #FFFFFF @@ -218,7 +218,7 @@ - 295,321 + 150,281 144,25 #008000 #FFFFFF @@ -231,6 +231,50 @@ Consolas + + + 5,320 + 160,20 + #FFFFFF + #0000FF + + + + 5,341 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,320 + 167,20 + #FFFFFF + #0000FF + + + + 166,341 + 167,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + diff --git a/plugins/aoip info/wxsmith/pnlQos.wxs b/plugins/aoip info/wxsmith/pnlQos.wxs index cb99ed89..abb61ddd 100644 --- a/plugins/aoip info/wxsmith/pnlQos.wxs +++ b/plugins/aoip info/wxsmith/pnlQos.wxs @@ -50,7 +50,7 @@ #800000 262,246 - 150,25 + 140,25 #008000 #FFFFFF @@ -58,8 +58,8 @@ #800000 - 413,246 - 60,25 + 403,246 + 70,25 #008000 #FFFFFF diff --git a/plugins/aoip info/wxsmith/pnlSubsession.wxs b/plugins/aoip info/wxsmith/pnlSubsession.wxs index 1f327743..dd5c84bc 100644 --- a/plugins/aoip info/wxsmith/pnlSubsession.wxs +++ b/plugins/aoip info/wxsmith/pnlSubsession.wxs @@ -216,10 +216,17 @@ #FFFFFF #0000FF - - - 428,130 - 167,20 + + + 400,130 + 80,20 + #FFFFFF + #0000FF + + + + 485,130 + 110,20 #FFFFFF #0000FF @@ -260,10 +267,25 @@ Consolas - + + + 400,151 + 80,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + - 428,151 - 167,25 + 485,151 + 110,25 #008000 #FFFFFF @@ -304,13 +326,6 @@ #FFFFFF #0000FF - - - 428,185 - 167,20 - #FFFFFF - #0000FF - 5,240 @@ -385,20 +400,5 @@ Consolas - - - 428,206 - 167,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - From 8298234685d411c0d031031aec9b08853a3b329e Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 12:48:37 +0100 Subject: [PATCH 04/30] aoip --- plugins/aoip info/pnlSubsession.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/aoip info/pnlSubsession.h b/plugins/aoip info/pnlSubsession.h index 7e391002..fe1dd3c7 100644 --- a/plugins/aoip info/pnlSubsession.h +++ b/plugins/aoip info/pnlSubsession.h @@ -54,6 +54,8 @@ class pnlSubsession: public wxPanel wmLabel* m_plblTransmissionTime; //*) + void SetAudioData(const timedbuffer* pTimedBuffer); + protected: //(*Identifiers(pnlSubsession) From 87e27ab3b084b2f8ef923f2b9da9a99aa02c9e6f Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 12:49:52 +0100 Subject: [PATCH 05/30] fix to wxs --- plugins/aoip info/pnlQos.cpp | 4 ++-- plugins/aoip info/pnlQos.h | 4 +--- plugins/aoip info/wxsmith/pnlQos.wxs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index a3a50d8d..db486878 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -64,8 +64,8 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde SetBackgroundColour(wxColour(0,0,0)); Panel1 = new wxPanel(this, ID_PANEL4, wxPoint(0,280), wxSize(600,160), wxTAB_TRAVERSAL, _T("ID_PANEL4")); Panel1->SetBackgroundColour(wxColour(0,0,0)); - m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160),1,10,0); - m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160),1,10,0); + m_pHistogram = new Histogram(Panel1,ID_CUSTOM12, wxPoint(0,0),wxSize(600,160)); + m_pGraph = new HistoryGraph(Panel1,ID_CUSTOM1, wxPoint(0,0),wxSize(600,160)); m_plblTSDF = new wmLabel(this, ID_M_PLBL90, wxEmptyString, wxPoint(146,246), wxSize(109,25), 0, _T("ID_M_PLBL90")); m_plblTSDF->SetBorderState(uiRect::BORDER_NONE); m_plblTSDF->GetUiRect().SetGradient(0); diff --git a/plugins/aoip info/pnlQos.h b/plugins/aoip info/pnlQos.h index 96db6f43..7ccd5b9e 100644 --- a/plugins/aoip info/pnlQos.h +++ b/plugins/aoip info/pnlQos.h @@ -9,8 +9,6 @@ #include //*) #include "aoipinfobuilder.h" -#include "histogram.h" -#include "historygraph.h" class SettingEvent; @@ -111,7 +109,7 @@ class pnlQos: public wxPanel static const long ID_M_PLBL2; //*) - + void ShowGraph(const wxString& sGraph); void SetGraphType(const wxString& sType); diff --git a/plugins/aoip info/wxsmith/pnlQos.wxs b/plugins/aoip info/wxsmith/pnlQos.wxs index abb61ddd..bf2de264 100644 --- a/plugins/aoip info/wxsmith/pnlQos.wxs +++ b/plugins/aoip info/wxsmith/pnlQos.wxs @@ -9,7 +9,7 @@ 600,160 #000000 - $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE)); histogram.h 1 @@ -21,7 +21,7 @@ 50,-1 - $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE)); historygraph.h 1 From 3c27bf96168f502e8f68ed4e777b6ae4626179dc Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 16:24:00 +0100 Subject: [PATCH 06/30] more -7 stuff --- pambase/CMakeLists.txt | 2 +- pambase/iomanager.cpp | 19 +++++--- pambase/iomanager.h | 9 +++- pambase/qos.cpp | 1 - pambase/rtpframeevent.cpp | 31 ++++++++++++ pambase/rtpframeevent.h | 73 +++++++++++++++++++++++++++++ pambase/rtpthread.cpp | 67 +++++++++++--------------- pambase/rtpthread.h | 18 +++---- pambase/session.h | 6 ++- pambase/smpte2110mediasession.cpp | 6 ++- pambase/wxsink.cpp | 25 ++++++++++ pambase/wxsink.h | 29 ++++-------- plugins/aoip info/pnlAoIPInfo.cpp | 35 ++++++++++---- plugins/aoip info/pnlAoIPInfo.h | 3 +- plugins/aoip info/pnlQos.cpp | 36 ++++++++++---- plugins/aoip info/pnlQos.h | 6 ++- plugins/aoip info/pnlSubsession.cpp | 56 +++++++++++++++++++++- plugins/aoip info/pnlSubsession.h | 8 ++++ 18 files changed, 326 insertions(+), 104 deletions(-) create mode 100644 pambase/rtpframeevent.cpp create mode 100644 pambase/rtpframeevent.h diff --git a/pambase/CMakeLists.txt b/pambase/CMakeLists.txt index 474ce3f4..fcda50bf 100644 --- a/pambase/CMakeLists.txt +++ b/pambase/CMakeLists.txt @@ -42,7 +42,7 @@ set(SOURCES "advelement.cpp" "AES67ServerMediaSubsession.cpp" "aes67source.cpp "generator.cpp" "generatorpluginbuilder.cpp" "generatorpluginfactory.cpp" "histogram.cpp" "historygraph.cpp" "inimanager.cpp" "inisection.cpp" "iomanager.cpp" "levelcalculator.cpp" "levelgraph.cpp" "levelmeter.cpp" "liveaudiosource.cpp" "monitorevent.cpp" "monitorpluginbuilder.cpp" "monitorpluginfactory.cpp" "networkcontrol.cpp" "pamRTSPServer.cpp" "niir.cpp" "ondemandaes67mediasubsession.cpp" "ondemandpamsubsession.cpp" "ondemandstreamer.cpp" "ourRTSPClient.cpp" "ourSIPClient.cpp" "PamTaskScheduler.cpp" "PamUsageEnvironment.cpp" "pcstats.cpp" "pmcontrol.cpp" "pmpanel.cpp" "ppmtypes.cpp" "qos.cpp" "r128calculator.cpp" - "r128thread.cpp" "rawvideosource.cpp" "remoteapi.cpp" "RTCPTransmissionEvent.cpp" "rtpserverthread.cpp" "rtpthread.cpp" "rtsputil.cpp" "servicebrowser.cpp" "session.cpp" "settingevent.cpp" "settings.cpp" "smpte2110mediasession.cpp" + "r128thread.cpp" "rawvideosource.cpp" "remoteapi.cpp" "RTCPTransmissionEvent.cpp" "rtpframeevent.cpp" "rtpserverthread.cpp" "rtpthread.cpp" "rtsputil.cpp" "servicebrowser.cpp" "session.cpp" "settingevent.cpp" "settings.cpp" "smpte2110mediasession.cpp" "soundcardmanager.cpp" "soundfile.cpp" "streamclientstate.cpp" "testpluginbuilder.cpp" "testpluginfactory.cpp" "timemanager.cpp" "uirect.cpp" "wmbutton.cpp" "wmedit.cpp" "wmfocusmanager.cpp" "wmipeditpnl.cpp" "wmkeyboard.cpp" "wmlabel.cpp" "wmline.cpp" "wmlist.cpp" "wmlistadv.cpp" "wmslider.cpp" "wmslidewnd.cpp" "wmswipebutton.cpp" "wmswitcherpanel.cpp" "wmtimeedit.cpp" "wxptp.cpp" "wxsaphandler.cpp" "wxsink.cpp" "wxtouchscreenhtml.cpp" "wxzxposter.cpp" ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_version.cpp) diff --git a/pambase/iomanager.cpp b/pambase/iomanager.cpp index 31764652..1425601a 100644 --- a/pambase/iomanager.cpp +++ b/pambase/iomanager.cpp @@ -54,6 +54,16 @@ void IOManager::DeregisterForRTSPTransmission(wxEvtHandler* pHandler) m_setRTSPHandlers.erase(pHandler); } +void IOManager::RegisterForRTPFrame(wxEvtHandler* pHandler) +{ + m_setRtpFrameHandlers.insert(pHandler); +} + +void IOManager::DeregisterForRTPFrame(wxEvtHandler* pHandler) +{ + m_setRtpFrameHandlers.erase(pHandler); +} + void IOManager::RegisterHandler(wxEvtHandler* pHandler) { if(m_bSingleHandler) @@ -1293,14 +1303,11 @@ void IOManager::OnQoS(wxCommandEvent& event) } } -void IOManager::OnRtpFrame(wxCommandEvent& event) +void IOManager::OnRtpFrame(RtpFrameEvent& event) { - for(auto pHandler : m_setHandlers) + for(auto pHandler : m_setRtpFrameHandlers) { - wxCommandEvent eventUp(wxEVT_RTP_FRAME); - eventUp.SetId(event.GetId()); - eventUp.SetInt(event.GetInt()); - eventUp.SetExtraLong(event.GetExtraLong()); + RtpFrameEvent eventUp(event.GetFrame()); pHandler->ProcessEvent(eventUp); } } diff --git a/pambase/iomanager.h b/pambase/iomanager.h index 87795d69..4db06903 100644 --- a/pambase/iomanager.h +++ b/pambase/iomanager.h @@ -9,6 +9,7 @@ #include #include #include "session.h" +#include "rtpframeevent.h" class SettingEvent; class AudioEvent; @@ -43,6 +44,9 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void RegisterForRTSPTransmission(wxEvtHandler* pHandler); void DeregisterForRTSPTransmission(wxEvtHandler* pHandler); + void RegisterForRTPFrame(wxEvtHandler* pHandler); + void DeregisterForRTPFrame(wxEvtHandler* pHandler); + void Stop(); const session& GetSession(); const session& GetInputSession(); @@ -77,7 +81,7 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void OnRTPSession(wxCommandEvent& event); void OnRTPSessionClosed(wxCommandEvent& event); void OnQoS(wxCommandEvent& event); - void OnRtpFrame(wxCommandEvent& event); + void OnRtpFrame(RtpFrameEvent& event); void InputTypeChanged(); void InputChanged(const wxString& sKey); @@ -129,9 +133,10 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler std::vector CreateRouting(); - std::set m_setHandlers; + std::set m_setHandlers; std::set m_setRTCPHandlers; std::set m_setRTSPHandlers; + std::set m_setRtpFrameHandlers; bool m_bSingleHandler; session m_SessionIn; diff --git a/pambase/qos.cpp b/pambase/qos.cpp index d1f77c18..ec4aff91 100644 --- a/pambase/qos.cpp +++ b/pambase/qos.cpp @@ -30,7 +30,6 @@ qosMeasurementRecord::qosMeasurementRecord(Smpte2110MediaSubsession* pSubsession void qosMeasurementRecord::periodicQOSMeasurement(struct timeval const& timeNow) { - pmlLog(pml::LOG_DEBUG) << "qosMeasurementRecord::periodicQOSMeasurement"; if(!m_pSubsession || !m_pSubsession->rtpSource() || !m_pThread) { return; diff --git a/pambase/rtpframeevent.cpp b/pambase/rtpframeevent.cpp new file mode 100644 index 00000000..1d785501 --- /dev/null +++ b/pambase/rtpframeevent.cpp @@ -0,0 +1,31 @@ +#include "rtpframeevent.h" + + +#ifdef WXSPAM +DEFINE_EVENT_TYPE(wxEVT_RTP_FRAME) +#else +wxDEFINE_EVENT(wxEVT_RTP_FRAME, RtpFrameEvent); +#endif // WXSPAM + +//wxDECLARE_DYNAMIC_CLASS(RtpFrameEvent, wxCommandEvent) + +RtpFrameEvent::RtpFrameEvent() : wxCommandEvent(wxEVT_RTP_FRAME, wxID_ANY) +{ + +} + +RtpFrameEvent::RtpFrameEvent(std::shared_ptr pFrame) : wxCommandEvent(wxEVT_RTP_FRAME,wxID_ANY), +m_pFrame(pFrame) +{ + +} + + +RtpFrameEvent::RtpFrameEvent(const RtpFrameEvent& event) : wxCommandEvent(event), + m_pFrame(event.GetFrame()) +{ +} +std::shared_ptr RtpFrameEvent::GetFrame() const +{ + return m_pFrame; +} \ No newline at end of file diff --git a/pambase/rtpframeevent.h b/pambase/rtpframeevent.h new file mode 100644 index 00000000..e060280e --- /dev/null +++ b/pambase/rtpframeevent.h @@ -0,0 +1,73 @@ +#pragma once +#include +#include "dlldefine.h" +#include +#include + +typedef std::map mExtension_t; + +struct rtpFrame +{ + wxString sEndpoint; + wxString sGroup; + unsigned long nSSRC = 0; + + timeval timePresentation; + timeval timeTransmission; + timeval timeLatency; + unsigned int nTimestamp = 0; + int nTimestampDifference = 0; + + unsigned long nFrameSize = 0; + u_int8_t* pBuffer = nullptr; + u_int8_t nBytesPerSample = 0; + double dTSDF = 0.0; + mExtension_t* mExt = nullptr; +}; + + +class PAMBASE_IMPEXPORT RtpFrameEvent : public wxCommandEvent +{ + +public: + + /** @brief Constructor + * @param commandType should be wxEVT_NI... + * @param id the ID of the button list control + **/ + explicit RtpFrameEvent(std::shared_ptr pFrame); + + RtpFrameEvent(); + /** @brief Copy Constructor + * @param event a wxNIEvent + **/ + RtpFrameEvent(const RtpFrameEvent& event); + + /** @brief Destructor + **/ + virtual ~RtpFrameEvent()=default; + + /** @brief Creates a copy of the wxNIEvent + * @return wxNIEvent + **/ + virtual wxEvent *Clone() const { return new RtpFrameEvent(*this); } + + std::shared_ptr GetFrame() const; + + //wxDECLARE_DYNAMIC_CLASS(RtpFrameEvent) + + +protected: + + std::shared_ptr m_pFrame; +}; + +typedef void (wxEvtHandler::*RtpFrameEventFunction)(RtpFrameEvent&); + + +#ifdef WXSPAM +DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_RTP_FRAME, -1) +#else +wxDECLARE_EXPORTED_EVENT(PAMBASE_IMPEXPORT, wxEVT_RTP_FRAME,RtpFrameEvent); +#endif + diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index 24385800..bb9d5e29 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -15,6 +15,7 @@ #include "aes67source.h" #include "log.h" #include "settings.h" +#include "rtpframeevent.h" using namespace std; @@ -35,7 +36,7 @@ DEFINE_EVENT_TYPE(wxEVT_QOS_UPDATED) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION_CLOSED) DEFINE_EVENT_TYPE(wxEVT_SDP) -DEFINE_EVENT_TYPE(wxEVT_RTP_FRAME) + RtpThread::RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly) : wxThread(wxTHREAD_JOINABLE), @@ -46,11 +47,7 @@ RtpThread::RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface m_pCurrentBuffer(nullptr), m_dTransmission(0), m_dPresentation(0), - m_dDelay0(std::numeric_limits::lowest()), - m_dTSDFMax(std::numeric_limits::lowest()), - m_dTSDFMin(std::numeric_limits::max()), - m_dTSDF(0), - m_nTSDFCount(0), + m_nSampleRate(48000), m_nTimestampErrors(0), m_nTimestampErrorsTotal(0), @@ -290,7 +287,7 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy return static_cast(nSample)/ 2147483648.0; } -void RtpThread::AddFrame(std::shared_ptr pFrame) +void RtpThread::AddFrame(std::shared_ptr pFrame) { if(m_bClosing || m_Session.GetCurrentSubsession() == m_Session.lstSubsession.end() || m_nInputChannels==0) { @@ -300,16 +297,21 @@ void RtpThread::AddFrame(std::shared_ptr pFrame) auto itGroup = m_mRedundantBuffers.find(pFrame->sGroup); if(itGroup == m_mRedundantBuffers.end()) { - itGroup = m_mRedundantBuffers.insert({pFrame->sGroup, std::list>()}).first; - m_mStreamUsage.insert({pFrame->sGroup, 0}); + itGroup = m_mRedundantBuffers.insert({pFrame->sGroup, std::list>()}).first; + m_mStreamUsage.try_emplace(pFrame->sGroup, 0); } itGroup->second.push_back(pFrame); + auto itReceived = m_mFramesReceived.find(pFrame->sGroup); + if(itReceived == m_mFramesReceived.end()) + { + itReceived = m_mFramesReceived.try_emplace(pFrame->sGroup,0).first; + } + ++itReceived->second; + if(m_pHandler) { - wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_RTP_FRAME); - pEvent->SetString(pFrame->sGroup); - pEvent->SetInt(pFrame->nTimestamp); + auto pEvent = new RtpFrameEvent(pFrame); wxQueueEvent(m_pHandler, pEvent); } @@ -389,9 +391,8 @@ void RtpThread::WorkoutNextFrame() } } -void RtpThread::ConvertFrameToTimedBuffer(std::shared_ptr pFrame) +void RtpThread::ConvertFrameToTimedBuffer(std::shared_ptr pFrame) { - if(m_pCurrentBuffer == nullptr) { m_pCurrentBuffer = new float[m_nBufferSize*m_nInputChannels]; @@ -447,34 +448,12 @@ void RtpThread::ConvertFrameToTimedBuffer(std::shared_ptr pFrame) m_nTimestampErrorsTotal++; } } - int nFramesPerSec = (m_nSampleRate*m_nInputChannels*pFrame->nBytesPerSample)/pFrame->nFrameSize; - - - timeval tvSub; - timersub(&pFrame->timePresentation, &pFrame->timeTransmission, &tvSub); - double dTSDF = (static_cast(tvSub.tv_sec)*1000000.0)+tvSub.tv_usec; - - if(m_dDelay0 == std::numeric_limits::lowest() || m_nTSDFCount == nFramesPerSec) - { - m_dTSDF = m_dTSDFMax-m_dTSDFMin; - m_dDelay0 = dTSDF; - - m_dTSDFMax = std::numeric_limits::lowest(); - m_dTSDFMin = std::numeric_limits::max(); - - m_nTSDFCount = 1; + - } - else - { - dTSDF -= m_dDelay0; - m_dTSDFMax = max(m_dTSDFMax, dTSDF); - m_dTSDFMin = min(m_dTSDFMin, dTSDF); - m_nTSDFCount++; - } //keep track of which streams frames come from ++m_mStreamUsage[pFrame->sGroup]; + ++m_nTotalFramesPlayed; } @@ -502,10 +481,20 @@ void RtpThread::QosUpdated(qosData* pData) { pData->nFramesUsed = itStream->second; } + auto itReceived = m_mFramesReceived.find(pData->sStream); + if(itReceived != m_mFramesReceived.end()) + { + pData->nFramesReceived = itReceived->second; + } + auto itBuffer = m_mRedundantBuffers.find(pData->sStream); + if(itBuffer != m_mRedundantBuffers.end()) + { + pData->nBufferSize = itBuffer->second.size(); + } + pData->nTotalFrames = m_nTotalFramesPlayed; pData->nTimestampErrors = m_nTimestampErrors; pData->nTimestampErrorsTotal = m_nTimestampErrorsTotal; - pData->dTSDF = m_dTSDF; if(m_pHandler) { wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_QOS_UPDATED); diff --git a/pambase/rtpthread.h b/pambase/rtpthread.h index cee1e01c..98070c5e 100644 --- a/pambase/rtpthread.h +++ b/pambase/rtpthread.h @@ -24,7 +24,7 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread public: RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly = false); void* Entry(); - void AddFrame(std::shared_ptr pFrame); + void AddFrame(std::shared_ptr pFrame); void MasterClockChanged(); @@ -76,7 +76,7 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread void HandleFrameAdded(); - void ConvertFrameToTimedBuffer(std::shared_ptr pFrame); + void ConvertFrameToTimedBuffer(std::shared_ptr pFrame); void WorkoutFirstFrame(); void WorkoutNextFrame(); @@ -95,12 +95,7 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread double m_dTransmission; double m_dPresentation; - timeval m_tvDelay0; - double m_dDelay0; - double m_dTSDFMax; - double m_dTSDFMin; - double m_dTSDF; - unsigned int m_nTSDFCount; + unsigned int m_nSampleRate; unsigned int m_nTimestampErrors; unsigned int m_nTimestampErrorsTotal; @@ -125,8 +120,10 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread unsigned long m_nQosMeasurementIntervalMS; - std::map>> m_mRedundantBuffers; - std::map m_mStreamUsage; + std::map>> m_mRedundantBuffers; + std::map m_mStreamUsage; + std::map m_mFramesReceived; + uint64_t m_nTotalFramesPlayed = 0; bool m_bFrameExtracted = false; timeval m_tvLastExtracted; size_t m_nRedundantBufferQueue = 10; @@ -138,5 +135,4 @@ DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_CLOSED,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_SDP,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_EPOCH,-1) -DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_FRAME,-1) diff --git a/pambase/session.h b/pambase/session.h index 76910a2c..c5a70749 100644 --- a/pambase/session.h +++ b/pambase/session.h @@ -157,7 +157,11 @@ struct PAMBASE_IMPEXPORT qosData unsigned int nTimestampErrorsTotal = 0; wxString sStream; - unsigned long nFramesUsed = 0; + uint64_t nFramesUsed = 0; + uint64_t nFramesReceived = 0; + uint64_t nTotalFrames = 0; + unsigned long nBufferSize = 0; + }; extern const std::map CH_GROUP_SIZE; diff --git a/pambase/smpte2110mediasession.cpp b/pambase/smpte2110mediasession.cpp index 8e888dee..195a47dd 100644 --- a/pambase/smpte2110mediasession.cpp +++ b/pambase/smpte2110mediasession.cpp @@ -173,7 +173,7 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_Group(char const* sdpLine) return True; } - m_setGroups = {"1"}; + m_setGroups = {"0"}; return False; } @@ -224,7 +224,9 @@ MediaSubsession* Smpte2110MediaSession::createNewMediaSubsession() } -Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), m_qos(this) +Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), +m_sGroup("0"), +m_qos(this) { } diff --git a/pambase/wxsink.cpp b/pambase/wxsink.cpp index ced0bb7f..82e6f9ab 100644 --- a/pambase/wxsink.cpp +++ b/pambase/wxsink.cpp @@ -99,6 +99,31 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c pFrame->nTimestampDifference = nDifference; pFrame->mExt = mExt; + timeval tvSub; + int nFramesPerSec = (m_pSubsession->rtpTimestampFrequency()*m_pSubsession->GetChannelGrouping().size()*pFrame->nBytesPerSample)/pFrame->nFrameSize; + timersub(&pFrame->timePresentation, &pFrame->timeTransmission, &tvSub); + double dTSDF = (static_cast(tvSub.tv_sec)*1000000.0)+tvSub.tv_usec; + + if(m_dDelay0 == std::numeric_limits::lowest() || m_nTSDFCount == nFramesPerSec) + { + m_dTSDF = m_dTSDFMax-m_dTSDFMin; + m_dDelay0 = dTSDF; + + m_dTSDFMax = std::numeric_limits::lowest(); + m_dTSDFMin = std::numeric_limits::max(); + + m_nTSDFCount = 1; + + } + else + { + dTSDF -= m_dDelay0; + m_dTSDFMax = max(m_dTSDFMax, dTSDF); + m_dTSDFMin = min(m_dTSDFMin, dTSDF); + m_nTSDFCount++; + } + pFrame->dTSDF = m_dTSDF; + timersub(&(pFrame->timePresentation), &(pFrame->timeTransmission), &pFrame->timeLatency); m_pHandler->AddFrame(pFrame); } } diff --git a/pambase/wxsink.h b/pambase/wxsink.h index ee629d9b..1f2683f6 100644 --- a/pambase/wxsink.h +++ b/pambase/wxsink.h @@ -5,6 +5,7 @@ #include "BasicUsageEnvironment.hh" #include "timedbuffer.h" #include +#include "rtpframeevent.h" class RtpThread; class Smpte2110MediaSubsession; @@ -12,27 +13,6 @@ class Smpte2110MediaSubsession; bool operator<(const timeval& t1, const timeval& t2); -typedef std::map mExtension_t; - - - -struct rtpFrame -{ - wxString sEndpoint; - wxString sGroup; - unsigned long nSSRC = 0; - - timeval timePresentation; - timeval timeTransmission; - unsigned int nTimestamp = 0; - int nTimestampDifference = 0; - - unsigned long nFrameSize = 0; - u_int8_t* pBuffer = nullptr; - u_int8_t nBytesPerSample = 0; - - mExtension_t* mExt = nullptr; -}; class wxSink: public MediaSink { @@ -75,6 +55,13 @@ class wxSink: public MediaSink std::map m_mExtension; + double m_dTSDFMax = std::numeric_limits::lowest(); + double m_dTSDFMin = std::numeric_limits::max(); + double m_dTSDF = 0; + double m_nTSDFCount = 0; + double m_dDelay0 = std::numeric_limits::lowest(); + timeval m_tvDelay0; + }; diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index dd23a257..e81a715d 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -18,6 +18,10 @@ #include //*) #include "log.h" +#include "iomanager.h" +#include "rtpframeevent.h" + + using namespace std; //(*IdInit(pnlAoIPInfo) @@ -234,8 +238,8 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID Connect(wxID_ANY, wxEVT_CLOCK_UPDATED, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); #endif // PTPMONKEY - - //ConnectLeftUp(); + IOManager::Get().RegisterForRTPFrame(this); + Bind(wxEVT_RTP_FRAME, &pnlAoIPInfo::OnRtpFrame, this); } @@ -283,9 +287,11 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) { itPanel->second->QoSUpdated(pData); } - else + + auto itPanelSub = m_mSubsessions.find(pData->sStream); + if(itPanelSub != m_mSubsessions.end()) { - pmlLog() << "Could not find QoS " << pData->sStream; + itPanelSub->second->QoSUpdated(pData); } } } @@ -293,10 +299,7 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) { - for(const auto& [sName, pPanel] : m_mSubsessions) - { - pPanel->SetAudioData(pTimedBuffer); - } + for(const auto& [sName, pPanel] : m_mQos) { pPanel->SetAudioData(pTimedBuffer); @@ -461,7 +464,7 @@ void pnlAoIPInfo::OnPtpEvent(wxCommandEvent& event) void pnlAoIPInfo::ChangeGranularity(int nWhich) { -// m_pHistogram->ChangeGranularity(m_sGraph,nWhich); +// m_pHistogram->ChangeGranularity(m_sGraph,nWhichU); } void pnlAoIPInfo::ChangeResolution(int nWhich) @@ -473,3 +476,17 @@ void pnlAoIPInfo::RecalculateRange() { // m_pGraph->RecalculateRange(m_sGraph); } + +void pnlAoIPInfo::OnRtpFrame(RtpFrameEvent& event) +{ + auto itSub = m_mSubsessions.find(event.GetFrame()->sGroup); + if(itSub != m_mSubsessions.end()) + { + itSub->second->RtpFrame(event.GetFrame()); + } + auto itQos = m_mQos.find(event.GetFrame()->sGroup); + if(itQos != m_mQos.end()) + { + itQos->second->RtpFrame(event.GetFrame()); + } +} \ No newline at end of file diff --git a/plugins/aoip info/pnlAoIPInfo.h b/plugins/aoip info/pnlAoIPInfo.h index d8c3f3c1..59ac49c8 100644 --- a/plugins/aoip info/pnlAoIPInfo.h +++ b/plugins/aoip info/pnlAoIPInfo.h @@ -17,7 +17,7 @@ struct qosData; struct session; - +class RtpFrameEvent; class AoIPInfoBuilder; class pnlAoIPInfo: public wxPanel @@ -121,6 +121,7 @@ class pnlAoIPInfo: public wxPanel //*) void OnPtpEvent(wxCommandEvent& event); + void OnRtpFrame(RtpFrameEvent& event); void OnInfoLeftUp(wxMouseEvent& event); void ConnectLeftUp(); diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index db486878..ea29aae3 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -7,6 +7,8 @@ //*) #include "settingevent.h" #include "settings.h" +#include "rtpframeevent.h" +#include "log.h" //(*IdInit(pnlQos) const long pnlQos::ID_CUSTOM12 = wxNewId(); @@ -327,6 +329,9 @@ pnlQos::pnlQos(wxWindow* parent,const wxString& sGroup, AoIPInfoBuilder* pBuilde pBuilder->RegisterForSettingsUpdates(this, "Graph_"+sGroup); pBuilder->RegisterForSettingsUpdates(this, "GraphType_"+sGroup); + ShowGraph(pBuilder->ReadSetting("Graph_"+sGroup, "kBit/s")); + SetGraphType(pBuilder->ReadSetting("GraphType_"+sGroup, "Line Graph")); + Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&pnlQos::OnSettingChanged); } @@ -353,7 +358,7 @@ void pnlQos::QoSUpdated(qosData* pData) m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); - m_plblTSDF->SetLabel(wxString::Format(wxT("%.0f us"), pData->dTSDF)); + wxDateTime dtSR(time_t(pData->tvLastSR_Time.tv_sec)); dtSR.SetMillisecond(pData->tvLastSR_Time.tv_usec/1000); @@ -391,15 +396,10 @@ void pnlQos::QoSUpdated(qosData* pData) m_pGraph->AddPeak(wxT("Jitter"), pData->dJitter); m_pHistogram->AddPeak(wxT("Jitter"), pData->dJitter); - if(pData->dTSDF >= 0.0) - { - m_pGraph->AddPeak(wxT("TS-DF"), pData->dTSDF); - m_pHistogram->AddPeak(wxT("TS-DF"), pData->dTSDF); - } + m_pGraph->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); m_pHistogram->AddPeak(wxT("Timestamp Errors"), pData->nTimestampErrors); - m_pGraph->AddPeak("Slip", m_dSlip); - m_pHistogram->AddPeak("Slip", m_dSlip); + } void pnlQos::OnbtnRangeClick(wxCommandEvent& event) @@ -452,3 +452,23 @@ void pnlQos::SetAudioData(const timedbuffer* pTimedBuffer) m_pHistogram->AddPeak("Timestamp",dTimestamp); } + +void pnlQos::RtpFrame(std::shared_ptr pFrame) +{ + m_plblTSDF->SetLabel(wxString::Format(wxT("%.0f us"), pFrame->dTSDF)); + if(pFrame->dTSDF >= 0.0) + { + m_pGraph->AddPeak(wxT("TS-DF"), pFrame->dTSDF); + m_pHistogram->AddPeak(wxT("TS-DF"), pFrame->dTSDF); + } + + auto dLatency = static_cast(pFrame->timeLatency.tv_sec)*1000000.0 + static_cast(pFrame->timeLatency.tv_usec); + if(m_nLatencyCounter < 3) + { + ++m_nLatencyCounter; + m_dInitialLatency = dLatency; + } + double dSlip = dLatency-m_dInitialLatency; + m_pGraph->AddPeak("Slip", dSlip); + m_pHistogram->AddPeak("Slip", dSlip); +} \ No newline at end of file diff --git a/plugins/aoip info/pnlQos.h b/plugins/aoip info/pnlQos.h index 7ccd5b9e..a9ed53eb 100644 --- a/plugins/aoip info/pnlQos.h +++ b/plugins/aoip info/pnlQos.h @@ -9,7 +9,9 @@ #include //*) #include "aoipinfobuilder.h" +#include +struct rtpFrame; class SettingEvent; class pnlQos: public wxPanel @@ -63,6 +65,7 @@ class pnlQos: public wxPanel //*) void QoSUpdated(qosData* pData); void SetAudioData(const timedbuffer* pTimedBuffer); + void RtpFrame(std::shared_ptr pFrame); protected: @@ -125,7 +128,8 @@ class pnlQos: public wxPanel wxString m_sGroup; wxString m_sGraph; - double m_dSlip; + double m_dInitialLatency=0.0; + unsigned short m_nLatencyCounter = 0; DECLARE_EVENT_TABLE() }; diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 5f9aec1d..953c985e 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -5,7 +5,7 @@ #include #include //*) - +#include "rtpframeevent.h" #ifdef PTPMONKEY #include "wxptp.h" #endif @@ -326,6 +326,8 @@ m_sub(sub) m_plblSubSyncId->SetBackgroundColour(wxColour(255,255,100)); #endif m_plblSubSyncDomain->SetLabel(wxString::Format("%lu", sub.refClock.nDomain)); + + m_plblSyncTimestamp->SetLabel(wxString::Format("%u", sub.nSyncTimestamp)); } pnlSubsession::~pnlSubsession() @@ -347,3 +349,55 @@ void pnlSubsession::OnPtpEvent(wxCommandEvent& event) } #endif } + +void pnlSubsession::SetAudioData(const timedbuffer* pTimedBuffer) +{ + +} + +void pnlSubsession::RtpFrame(std::shared_ptr pFrame) +{ + m_plblBuffer; + m_plblContribution; + m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pFrame->nTimestamp)); + + m_dDuration = (1e6*static_cast(pFrame->nFrameSize)) / (static_cast(m_sub.nSampleRate* m_sub.nChannels*pFrame->nBytesPerSample)); + m_plblFrameDuration->SetLabel(wxString::Format(L"%.0f \u03bcs", m_dDuration)); + m_plblFrameSize->SetLabel(wxString::Format("%u bytes", pFrame->nFrameSize)); + + + + SetTimestamp(pFrame->timePresentation, m_plblTimestampIn, false); + SetTimestamp(pFrame->timeTransmission, m_plblTransmissionTime, false); + ShowLatency(pFrame); +} + +void pnlSubsession::SetTimestamp(const timeval& tv, wmLabel* pLabel, bool bDate) +{ + wxDateTime dt(time_t(tv.tv_sec)); + if(!bDate) + { + pLabel->SetLabel(wxString::Format("%s:%03ld", dt.Format("%H:%M:%S").c_str(), tv.tv_usec/1000)); + } + else + { + pLabel->SetLabel(wxString::Format("%s:%03ld", dt.Format("%Y-%m-%d %H:%M:%S").c_str(), tv.tv_usec/1000)); + } +} + + +void pnlSubsession::ShowLatency(std::shared_ptr pFrame) +{ + + auto dLatency = static_cast(pFrame->timeLatency.tv_sec)*1000000.0 + static_cast(pFrame->timeLatency.tv_usec); + dLatency += m_dDuration; //we add the duration on because the transmission time is first sample not last sample of frane + + m_plblLatencyNetwork->SetLabel(wxString::Format("%.0f us", dLatency)); + +} + +void pnlSubsession::QoSUpdated(qosData* pData) +{ + m_plblBuffer->SetLabel(wxString::Format("%u", pData->nBufferSize)); + m_plblContribution->SetLabel(wxString::Format("%.1f%%", (static_cast(pData->nFramesUsed)/static_cast(pData->nTotalFrames))*100.0)); +} \ No newline at end of file diff --git a/plugins/aoip info/pnlSubsession.h b/plugins/aoip info/pnlSubsession.h index fe1dd3c7..d5a5462e 100644 --- a/plugins/aoip info/pnlSubsession.h +++ b/plugins/aoip info/pnlSubsession.h @@ -7,7 +7,9 @@ //*) #include "session.h" +#include +struct rtpFrame; class pnlSubsession: public wxPanel { public: @@ -15,6 +17,8 @@ class pnlSubsession: public wxPanel pnlSubsession(wxWindow* parent,const subsession& sub, wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize); virtual ~pnlSubsession(); + void RtpFrame(std::shared_ptr pFrame); + //(*Declarations(pnlSubsession) wmLabel* m_pLbl1; wmLabel* m_pLbl22; @@ -55,6 +59,7 @@ class pnlSubsession: public wxPanel //*) void SetAudioData(const timedbuffer* pTimedBuffer); + void QoSUpdated(qosData* pData); protected: @@ -102,8 +107,11 @@ class pnlSubsession: public wxPanel //(*Handlers(pnlSubsession) //*) void OnPtpEvent(wxCommandEvent& event); + void SetTimestamp(const timeval& tv, wmLabel* pLabel, bool bDate); + void ShowLatency(std::shared_ptr pFrame); subsession m_sub; + double m_dDuration; DECLARE_EVENT_TABLE() }; From b668fffe182371a9afef06dd8df82a0536eae6a1 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 17:18:46 +0100 Subject: [PATCH 07/30] build: change cmake version needed --- CMakeLists.txt | 2 +- InitialSetup/CMakeLists.txt | 2 +- dosetup/CMakeLists.txt | 2 +- pam2/CMakeLists.txt | 4 ++-- pambase/CMakeLists.txt | 4 ++-- pamfft/CMakeLists.txt | 2 +- pamlevel/CMakeLists.txt | 2 +- plugins/anglemeters/CMakeLists.txt | 2 +- plugins/aoip info/CMakeLists.txt | 4 ++-- plugins/channel delay/CMakeLists.txt | 2 +- plugins/correlation/CMakeLists.txt | 2 +- plugins/distortion/CMakeLists.txt | 2 +- plugins/fft/CMakeLists.txt | 2 +- plugins/fftdiff/CMakeLists.txt | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a43ba65..ebd7c81b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(pamworkspace VERSION 1.5.4) set(CMAKE_INSTALL_PREFIX "/usr/local") diff --git a/InitialSetup/CMakeLists.txt b/InitialSetup/CMakeLists.txt index 5623f392..3b0340a5 100644 --- a/InitialSetup/CMakeLists.txt +++ b/InitialSetup/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.3.16 FATAL_ERROR) project(InitialSetup LANGUAGES CXX VERSION 1.0.0.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/dosetup/CMakeLists.txt b/dosetup/CMakeLists.txt index aad9a23c..ab9c58f9 100644 --- a/dosetup/CMakeLists.txt +++ b/dosetup/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(dosetup LANGUAGES CXX VERSION 1.0.0.0) diff --git a/pam2/CMakeLists.txt b/pam2/CMakeLists.txt index 73b8f265..39ae066d 100644 --- a/pam2/CMakeLists.txt +++ b/pam2/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) -project(pam2 LANGUAGES CXX VERSION 1.6.1) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +project(pam2 LANGUAGES CXX VERSION 1.7.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/pambase/CMakeLists.txt b/pambase/CMakeLists.txt index fcda50bf..375daf05 100644 --- a/pambase/CMakeLists.txt +++ b/pambase/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) -project(pambase LANGUAGES CXX VERSION 1.7.1) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +project(pambase LANGUAGES CXX VERSION 1.8.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/pamfft/CMakeLists.txt b/pamfft/CMakeLists.txt index 322e9d09..dcbeeab8 100644 --- a/pamfft/CMakeLists.txt +++ b/pamfft/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(pamfft LANGUAGES CXX C VERSION 1.2.0.0) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) diff --git a/pamlevel/CMakeLists.txt b/pamlevel/CMakeLists.txt index 84fab2f0..e677c20a 100644 --- a/pamlevel/CMakeLists.txt +++ b/pamlevel/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(pamlevel LANGUAGES CXX VERSION 1.3.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/anglemeters/CMakeLists.txt b/plugins/anglemeters/CMakeLists.txt index d942dcad..ed3ec1c6 100644 --- a/plugins/anglemeters/CMakeLists.txt +++ b/plugins/anglemeters/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(anglemeters LANGUAGES CXX VERSION 1.2.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/aoip info/CMakeLists.txt b/plugins/aoip info/CMakeLists.txt index b72afbc3..1fd85b84 100644 --- a/plugins/aoip info/CMakeLists.txt +++ b/plugins/aoip info/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) -project(aoipinfo LANGUAGES CXX VERSION 1.1.0) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +project(aoipinfo LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/channel delay/CMakeLists.txt b/plugins/channel delay/CMakeLists.txt index 15d0c716..f72f07a2 100644 --- a/plugins/channel delay/CMakeLists.txt +++ b/plugins/channel delay/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(channeldelay LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/correlation/CMakeLists.txt b/plugins/correlation/CMakeLists.txt index 25d8c514..ffaa5a35 100644 --- a/plugins/correlation/CMakeLists.txt +++ b/plugins/correlation/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(correlation LANGUAGES CXX VERSION 0.1.0) diff --git a/plugins/distortion/CMakeLists.txt b/plugins/distortion/CMakeLists.txt index 224c9b96..be1183fb 100644 --- a/plugins/distortion/CMakeLists.txt +++ b/plugins/distortion/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(distortion LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/fft/CMakeLists.txt b/plugins/fft/CMakeLists.txt index b493b082..cce13798 100644 --- a/plugins/fft/CMakeLists.txt +++ b/plugins/fft/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(fft LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) diff --git a/plugins/fftdiff/CMakeLists.txt b/plugins/fftdiff/CMakeLists.txt index 9ae7fc5f..ddf48231 100644 --- a/plugins/fftdiff/CMakeLists.txt +++ b/plugins/fftdiff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(car LANGUAGES CXX VERSION 1.1.0) From 3d18bd0513e5ba9fdceff8f7adefbc673089ce2f Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 27 Jul 2023 20:12:40 +0100 Subject: [PATCH 08/30] 2110-31 --- pambase/aoipsourcemanager.cpp | 2 +- pambase/levelcalculator.cpp | 2 +- pambase/rtpthread.cpp | 9 ++-- pambase/smpte2110mediasession.cpp | 2 +- pambase/wxsink.cpp | 4 ++ plugins/aoip info/pnlAoIPInfo.cpp | 10 ++-- plugins/aoip info/pnlQos.cpp | 80 +++++++++++++++-------------- plugins/aoip info/pnlSubsession.cpp | 30 ++++++----- 8 files changed, 76 insertions(+), 63 deletions(-) diff --git a/pambase/aoipsourcemanager.cpp b/pambase/aoipsourcemanager.cpp index 694a5353..47cfa048 100644 --- a/pambase/aoipsourcemanager.cpp +++ b/pambase/aoipsourcemanager.cpp @@ -348,7 +348,7 @@ void AoipSourceManager::OnSap(wxCommandEvent& event) unsigned long nCodec; if(asLines[i].AfterFirst(':').BeforeFirst(' ').ToULong(&nCodec) && nCodec > 95 && nCodec < 127) { - if(asLines[i].find("L24") != wxNOT_FOUND || asLines[i].find("L16") != wxNOT_FOUND) + if(asLines[i].find("L24") != wxNOT_FOUND || asLines[i].find("L16") != wxNOT_FOUND || asLines[i].find("AM824") != wxNOT_FOUND) { bCanDecode = true; break; diff --git a/pambase/levelcalculator.cpp b/pambase/levelcalculator.cpp index 596acb3d..4a949559 100644 --- a/pambase/levelcalculator.cpp +++ b/pambase/levelcalculator.cpp @@ -51,7 +51,7 @@ void LevelCalculator::InputSession(const session& aSession) { dBits = 16; } - else if(aSession.GetCurrentSubsession()->sCodec == wxT("L24")) + else if(aSession.GetCurrentSubsession()->sCodec == wxT("L24") || aSession.GetCurrentSubsession()->sCodec == wxT("AM824")) { dBits = 24; } diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index bb9d5e29..a459560b 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -141,7 +141,6 @@ void RtpThread::StreamFromSDP() pmlLog() << m_sDescriptor; - m_pSession = Smpte2110MediaSession::createNew(*m_penv, m_sDescriptor.c_str()); if (m_pSession == nullptr) { @@ -155,12 +154,12 @@ void RtpThread::StreamFromSDP() //count number of subsessions unsigned int nCountAudio(0); - unsigned int nCountVideo(0); MediaSubsessionIterator iterCount(*m_pSession); MediaSubsession* pSubsessionCount = nullptr; while ((pSubsessionCount = iterCount.next()) != nullptr) { - if (strcmp(pSubsessionCount->codecName(), "L16") == 0 || strcmp(pSubsessionCount->codecName(), "L24") == 0) // 16 or 24-bit linear audio (RFC 3190) + if (strcmp(pSubsessionCount->codecName(), "L16") == 0 || strcmp(pSubsessionCount->codecName(), "L24") == 0 + || strcmp(pSubsessionCount->codecName(), "AM824") == 0) // 16 or 24-bit linear audio (RFC 3190) or 2110-31 { if(pSubsessionCount->numChannels() > 0) { @@ -284,6 +283,10 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy { nSample = (static_cast(pFrameBuffer[2]) << 8) | (static_cast(pFrameBuffer[1]) << 16) | (static_cast(pFrameBuffer[0]) << 24); } + else if(nBytesPerSample == 4) + { + pa + } return static_cast(nSample)/ 2147483648.0; } diff --git a/pambase/smpte2110mediasession.cpp b/pambase/smpte2110mediasession.cpp index 195a47dd..6a8b64de 100644 --- a/pambase/smpte2110mediasession.cpp +++ b/pambase/smpte2110mediasession.cpp @@ -248,7 +248,7 @@ Boolean Smpte2110MediaSubsession::createSourceObjects(int useSpecialRTPoffset) parseSDPAttribute_Mid(); //Group if any - if (strcmp(fCodecName, "L16") == 0 || strcmp(fCodecName, "L24") == 0) // 16 or 24-bit linear audio (RFC 3190) + if (strcmp(fCodecName, "L16") == 0 || strcmp(fCodecName, "L24") == 0 || strcmp(fCodecName, "AM824") == 0) // 16 or 24-bit linear audio (RFC 3190) or 2110-31 { m_sEndpoint = wxString::FromUTF8(fConnectionEndpointName); diff --git a/pambase/wxsink.cpp b/pambase/wxsink.cpp index 82e6f9ab..30d58c81 100644 --- a/pambase/wxsink.cpp +++ b/pambase/wxsink.cpp @@ -84,6 +84,10 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c { nBytesPerSample = 3; } + else if(strcmp(m_pSubsession->codecName(),"AM824") == 0) + { + nBytesPerSample = 4 + } if(nBytesPerSample != 0) { auto pFrame = std::make_shared(); diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index e81a715d..6a2d8e9d 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -294,19 +294,21 @@ void pnlAoIPInfo::QoSUpdated(qosData* pData) itPanelSub->second->QoSUpdated(pData); } } -} + } void pnlAoIPInfo::SetAudioData(const timedbuffer* pTimedBuffer) { - for(const auto& [sName, pPanel] : m_mQos) { pPanel->SetAudioData(pTimedBuffer); } - SetTimestamp(pTimedBuffer->GetPlaybackTime(), m_plblTimestampOut); - m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pTimedBuffer->GetTimestamp())); + if(IsShownOnScreen()) + { + SetTimestamp(pTimedBuffer->GetPlaybackTime(), m_plblTimestampOut); + m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pTimedBuffer->GetTimestamp())); + } } diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index ea29aae3..b810de07 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -343,46 +343,48 @@ pnlQos::~pnlQos() void pnlQos::QoSUpdated(qosData* pData) { - m_plblQoSTime->SetLabel(pData->tsTime.Format(wxT("%H:%M:%S:%l"))); - m_plblQoSKbAv->SetLabel(wxString::Format(wxT("%.2f [%.2f]"), pData->dkbits_per_second_Now, pData->dkbits_per_second_Av)); - m_plblQoSKbMax->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_max)); - m_plblQoSKbMin->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_min)); - m_plblQoSLost->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsLost)); - m_plblQoSPacketsAv->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_av)); - m_plblQoSPacketsMax->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_max)); - m_plblQoSPacketsMin->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_min)); - m_plblQoSReceived->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsReceived)); - - m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_min)); - m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_Now, pData->dInter_packet_gap_ms_av)); - m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); - - m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); - - - wxDateTime dtSR(time_t(pData->tvLastSR_Time.tv_sec)); - dtSR.SetMillisecond(pData->tvLastSR_Time.tv_usec/1000); - - if(dtSR.IsValid()) - { - m_plblRTCP_Last->SetLabel(dtSR.Format("%H:%M:%S:%l")); - } - else + if(IsShownOnScreen()) { - m_plblRTCP_Last->SetLabel(""); - } - - wxDateTime dtNTP(time_t(pData->tvSync.tv_sec)); - dtNTP.SetMillisecond(pData->tvSync.tv_usec/1000); - if(dtNTP.IsValid()) - { - m_plblRTCP_NTP->SetLabel(dtNTP.Format("%H:%M:%S:%l")); - } - else - { - m_plblRTCP_NTP->SetLabel(""); - } - + m_plblQoSTime->SetLabel(pData->tsTime.Format(wxT("%H:%M:%S:%l"))); + m_plblQoSKbAv->SetLabel(wxString::Format(wxT("%.2f [%.2f]"), pData->dkbits_per_second_Now, pData->dkbits_per_second_Av)); + m_plblQoSKbMax->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_max)); + m_plblQoSKbMin->SetLabel(wxString::Format(wxT("%f"), pData->dkbits_per_second_min)); + m_plblQoSLost->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsLost)); + m_plblQoSPacketsAv->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_av)); + m_plblQoSPacketsMax->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_max)); + m_plblQoSPacketsMin->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_min)); + m_plblQoSReceived->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsReceived)); + + m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_min)); + m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_Now, pData->dInter_packet_gap_ms_av)); + m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); + + m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); + + + wxDateTime dtSR(time_t(pData->tvLastSR_Time.tv_sec)); + dtSR.SetMillisecond(pData->tvLastSR_Time.tv_usec/1000); + + if(dtSR.IsValid()) + { + m_plblRTCP_Last->SetLabel(dtSR.Format("%H:%M:%S:%l")); + } + else + { + m_plblRTCP_Last->SetLabel(""); + } + + wxDateTime dtNTP(time_t(pData->tvSync.tv_sec)); + dtNTP.SetMillisecond(pData->tvSync.tv_usec/1000); + if(dtNTP.IsValid()) + { + m_plblRTCP_NTP->SetLabel(dtNTP.Format("%H:%M:%S:%l")); + } + else + { + m_plblRTCP_NTP->SetLabel(""); + } + } m_pGraph->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); m_pHistogram->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 953c985e..2c41ee89 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -357,19 +357,18 @@ void pnlSubsession::SetAudioData(const timedbuffer* pTimedBuffer) void pnlSubsession::RtpFrame(std::shared_ptr pFrame) { - m_plblBuffer; - m_plblContribution; - m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pFrame->nTimestamp)); + if(IsShownOnScreen()) + { + m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pFrame->nTimestamp)); - m_dDuration = (1e6*static_cast(pFrame->nFrameSize)) / (static_cast(m_sub.nSampleRate* m_sub.nChannels*pFrame->nBytesPerSample)); - m_plblFrameDuration->SetLabel(wxString::Format(L"%.0f \u03bcs", m_dDuration)); - m_plblFrameSize->SetLabel(wxString::Format("%u bytes", pFrame->nFrameSize)); - - - - SetTimestamp(pFrame->timePresentation, m_plblTimestampIn, false); - SetTimestamp(pFrame->timeTransmission, m_plblTransmissionTime, false); - ShowLatency(pFrame); + m_dDuration = (1e6*static_cast(pFrame->nFrameSize)) / (static_cast(m_sub.nSampleRate* m_sub.nChannels*pFrame->nBytesPerSample)); + m_plblFrameDuration->SetLabel(wxString::Format(L"%.0f \u03bcs", m_dDuration)); + m_plblFrameSize->SetLabel(wxString::Format("%lu bytes", pFrame->nFrameSize)); + + SetTimestamp(pFrame->timePresentation, m_plblTimestampIn, false); + SetTimestamp(pFrame->timeTransmission, m_plblTransmissionTime, false); + ShowLatency(pFrame); + } } void pnlSubsession::SetTimestamp(const timeval& tv, wmLabel* pLabel, bool bDate) @@ -398,6 +397,9 @@ void pnlSubsession::ShowLatency(std::shared_ptr pFrame) void pnlSubsession::QoSUpdated(qosData* pData) { - m_plblBuffer->SetLabel(wxString::Format("%u", pData->nBufferSize)); - m_plblContribution->SetLabel(wxString::Format("%.1f%%", (static_cast(pData->nFramesUsed)/static_cast(pData->nTotalFrames))*100.0)); + if(IsShownOnScreen()) + { + m_plblBuffer->SetLabel(wxString::Format("%lu", pData->nBufferSize)); + m_plblContribution->SetLabel(wxString::Format("%.1f%%", (static_cast(pData->nFramesUsed)/static_cast(pData->nTotalFrames))*100.0)); + } } \ No newline at end of file From 65ac89a644d0e43b2110bbc54f73a1c19cc5bc45 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 28 Jul 2023 14:04:35 +0100 Subject: [PATCH 09/30] rtpframe fixes --- documents/pam2.ini | 43 ++++++++++++++++------------- pambase/rtpthread.cpp | 8 +++--- pambase/rtsputil.cpp | 1 + pambase/smpte2110mediasession.cpp | 2 +- pambase/wxsink.cpp | 2 +- plugins/aoip info/pnlSubsession.cpp | 18 ++++++------ 6 files changed, 41 insertions(+), 33 deletions(-) diff --git a/documents/pam2.ini b/documents/pam2.ini index 153d4486..9251279e 100644 --- a/documents/pam2.ini +++ b/documents/pam2.ini @@ -34,7 +34,7 @@ generators=White,Grey AoIP=0 Device=0 Reset=0 -Type=Soundcard +Type=Disabled [Log] Level=2 ScrollLock=0 @@ -48,19 +48,20 @@ _Options=0 [Monitor] Source=0 [Monitor Plugins] -0000=meters -0001=anglemeters -0002=lissajou -0003=fft -0004=r128 -0005=spectogram -0006=scope -0007=aoipinfo -0008=ptp -0009=radar -0010=polarscope -0011=waveform -0012=fftphase +0000=r128 +0001=bob +0002=aoipinfo +0003=waveform +0004=fftphase +0005=radar +0006=fft +0007=scope +0008=meters +0009=polarscope +0010=anglemeters +0011=lissajou +0012=spectogram +0013=correlation [Monitor::Angle Meters] DisplayText_Current=1 DisplayText_Peak=1 @@ -146,7 +147,7 @@ Channel_5=0 Channel_6=1 Channel_7=0 Channel_8=1 -Destination=Disabled +Destination=AoIP Device=0 Enabled=0 Latency=200 @@ -154,8 +155,12 @@ Left=0 Right=1 Sequence=glits Source=Sequence +[PTP Monkey] +_Options=0 [QoS] Interval=1000 +[R128] +_Options=0 [Server] ChannelMapping=St Channels=2 @@ -165,14 +170,14 @@ PacketTime=1000 RTP_Port=5004 RTSP_Address=192.168.1.123 RTSP_Interface=eth0 -State=1 +State=0 Stream=AlwaysOn [Session Info] Graph=kBit/s Type=Line Graph _Options=0 [Settings] -_Options=0 +_Options=7 [Splash] Screen=Main [Startup] @@ -190,7 +195,7 @@ Lock=0 0008=bufferlog 0009=LTC 0010=lineup -0011=InputAlign +0011=car [Test::InputAlign] Channel=0 [Test::Levels] @@ -205,4 +210,4 @@ _Panel=3 LTC_Format=2 Sync=0 [Version] -pam2=1.6.0-05095fa.x +pam2=1.6.1-9f68d46 diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index a459560b..a09f4aea 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -285,7 +285,7 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy } else if(nBytesPerSample == 4) { - pa + } return static_cast(nSample)/ 2147483648.0; } @@ -312,10 +312,10 @@ void RtpThread::AddFrame(std::shared_ptr pFrame) } ++itReceived->second; - if(m_pHandler) + if(m_pHandler && itReceived->second%21 == 0) { - auto pEvent = new RtpFrameEvent(pFrame); - wxQueueEvent(m_pHandler, pEvent); + auto pEvent = new RtpFrameEvent(pFrame); + wxQueueEvent(m_pHandler, pEvent); } HandleFrameAdded(); diff --git a/pambase/rtsputil.cpp b/pambase/rtsputil.cpp index 24571fe6..351fae8e 100644 --- a/pambase/rtsputil.cpp +++ b/pambase/rtsputil.cpp @@ -160,6 +160,7 @@ void setupNextSubsession(RTSPClient* rtspClient) } else { + pmlLog(pml::LOG_DEBUG) << " subsession not in groups " << pSubsession->GetGroup(); setupNextSubsession(rtspClient); // give up on this subsession; go to the next one } } diff --git a/pambase/smpte2110mediasession.cpp b/pambase/smpte2110mediasession.cpp index 6a8b64de..fe542440 100644 --- a/pambase/smpte2110mediasession.cpp +++ b/pambase/smpte2110mediasession.cpp @@ -212,7 +212,7 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_MaxPTime(char const* sdpLine) Smpte2110MediaSession::Smpte2110MediaSession(UsageEnvironment& env) : MediaSession(env) { - + m_setGroups = {"0"}; } diff --git a/pambase/wxsink.cpp b/pambase/wxsink.cpp index 30d58c81..85f1cf71 100644 --- a/pambase/wxsink.cpp +++ b/pambase/wxsink.cpp @@ -86,7 +86,7 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c } else if(strcmp(m_pSubsession->codecName(),"AM824") == 0) { - nBytesPerSample = 4 + nBytesPerSample = 4; } if(nBytesPerSample != 0) { diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 2c41ee89..1bf24cab 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -283,7 +283,7 @@ m_sub(sub) m_plblSubsessionId->SetLabel(sub.sId); m_plblSessionSource->SetLabel(sub.sSourceAddress); m_plblSessionBits->SetLabel(sub.sCodec); - m_plblSessionFrequency->SetLabel(wxString::Format("%.1fkHz", sub.nSampleRate/1000.0)); + m_plblSessionFrequency->SetLabel(wxString::Format("%.1fkHz", static_cast(sub.nSampleRate)/1000.0)); m_plblSessionChannels->SetLabel(wxString::Format("%u", sub.nChannels)); m_plblSyncTimestamp->SetLabel(wxString::Format("%u", sub.nSyncTimestamp)); @@ -361,13 +361,15 @@ void pnlSubsession::RtpFrame(std::shared_ptr pFrame) { m_plblCurrentTimestamp->SetLabel(wxString::Format("%u", pFrame->nTimestamp)); - m_dDuration = (1e6*static_cast(pFrame->nFrameSize)) / (static_cast(m_sub.nSampleRate* m_sub.nChannels*pFrame->nBytesPerSample)); - m_plblFrameDuration->SetLabel(wxString::Format(L"%.0f \u03bcs", m_dDuration)); - m_plblFrameSize->SetLabel(wxString::Format("%lu bytes", pFrame->nFrameSize)); - - SetTimestamp(pFrame->timePresentation, m_plblTimestampIn, false); - SetTimestamp(pFrame->timeTransmission, m_plblTransmissionTime, false); - ShowLatency(pFrame); + m_dDuration = (1e6*static_cast(pFrame->nFrameSize)) / (static_cast(m_sub.nSampleRate* m_sub.nChannels*pFrame->nBytesPerSample)); + m_plblFrameDuration->SetLabel(wxString::Format(L"%.0f \u03bcs", m_dDuration)); + m_plblFrameSize->SetLabel(wxString::Format("%lu bytes", pFrame->nFrameSize)); + + + + SetTimestamp(pFrame->timePresentation, m_plblTimestampIn, false); + SetTimestamp(pFrame->timeTransmission, m_plblTransmissionTime, false); + ShowLatency(pFrame); } } From abf20ecb2ea8491b41fe5ae20da9d0b7a6813253 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 31 Jul 2023 16:21:01 +0100 Subject: [PATCH 10/30] improvement: send out rtpframeevent regular --- pam2/pam2Main.cpp | 2 +- pambase/rtpthread.cpp | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pam2/pam2Main.cpp b/pam2/pam2Main.cpp index e01c1c06..8d66e946 100644 --- a/pam2/pam2Main.cpp +++ b/pam2/pam2Main.cpp @@ -297,7 +297,7 @@ pam2Dialog::pam2Dialog(wxWindow* parent,wxWindowID id) : m_ppnlLog = new pnlLog(m_pswpMain); pml::LogStream::AddOutput(std::make_unique()); - pml::LogStream::SetOutputLevel(pml::LOG_TRACE); + pml::LogStream::SetOutputLevel(pml::LOG_DEBUG); wxImage img(16,16); img.SetRGB(wxRect(0,0,16,16),0,0,0); diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index a09f4aea..ee77781f 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -267,8 +267,8 @@ bool RtpThread::DoSIP() timeval RtpThread::ConvertDoubleToPairTime(double dTime) { - double dInt, dDec; - dDec = modf(dTime, &dInt); + double dInt; + auto dDec = modf(dTime, &dInt); return {static_cast(dInt), static_cast<__suseconds_t>(dDec*1000000.0)}; } @@ -284,8 +284,8 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy nSample = (static_cast(pFrameBuffer[2]) << 8) | (static_cast(pFrameBuffer[1]) << 16) | (static_cast(pFrameBuffer[0]) << 24); } else if(nBytesPerSample == 4) - { - + { //@todo need to check which 3 of the 4 we uses + nSample = (static_cast(pFrameBuffer[3]) << 8) | (static_cast(pFrameBuffer[2]) << 16) | (static_cast(pFrameBuffer[1]) << 24); } return static_cast(nSample)/ 2147483648.0; } @@ -312,7 +312,8 @@ void RtpThread::AddFrame(std::shared_ptr pFrame) } ++itReceived->second; - if(m_pHandler && itReceived->second%21 == 0) + //send out an rtpframe event 20 times a second... + if(m_pHandler && itReceived->second%((14400 / itReceived->second->nFrameSize) == 0) { auto pEvent = new RtpFrameEvent(pFrame); wxQueueEvent(m_pHandler, pEvent); @@ -604,7 +605,6 @@ void RtpThread::SetQosMeasurementIntervalMS(unsigned long nMilliseconds) unsigned long RtpThread::GetQosMeasurementIntervalMS() { - //wxMutexLocker ml(m_mutex); return m_nQosMeasurementIntervalMS; } @@ -617,12 +617,10 @@ void RtpThread::MasterClockChanged() Smpte2110MediaSubsession* subsession = nullptr; while ((subsession = dynamic_cast(iter.next())) != nullptr) { - Aes67Source* pSource = dynamic_cast(subsession->readSource()); + auto pSource = dynamic_cast(subsession->readSource()); if(pSource) { - pSource->WorkoutLastEpoch(); - } } } From 2e7e44c1c5375c3851d74dd64c986e9db60668bc Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 31 Jul 2023 21:09:20 +0100 Subject: [PATCH 11/30] ptp domains --- pambase/rtpthread.cpp | 2 +- plugins/ptp/ptpbuilder.cpp | 9 +++++++-- plugins/ptp/ptppanel.cpp | 5 +++++ plugins/ptp/ptppanel.h | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index ee77781f..ed4b583b 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -313,7 +313,7 @@ void RtpThread::AddFrame(std::shared_ptr pFrame) ++itReceived->second; //send out an rtpframe event 20 times a second... - if(m_pHandler && itReceived->second%((14400 / itReceived->second->nFrameSize) == 0) + if(m_pHandler && itReceived->second%((14400 / pFrame->nFrameSize) == 0)) { auto pEvent = new RtpFrameEvent(pFrame); wxQueueEvent(m_pHandler, pEvent); diff --git a/plugins/ptp/ptpbuilder.cpp b/plugins/ptp/ptpbuilder.cpp index d1224604..f396079c 100644 --- a/plugins/ptp/ptpbuilder.cpp +++ b/plugins/ptp/ptpbuilder.cpp @@ -13,6 +13,7 @@ ptpBuilder::ptpBuilder() : MonitorPluginBuilder() { RegisterForSettingsUpdates(this); + Settings::Get().AddHandler(this, "Time", "PTP_Domain"); Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&ptpBuilder::OnSettingChanged); @@ -23,13 +24,13 @@ ptpBuilder::ptpBuilder() : MonitorPluginBuilder() void ptpBuilder::SetAudioData(const timedbuffer* pBuffer) { -// m_pMeter->SetAudioData(pBuffer); + } wxWindow* ptpBuilder::CreateMonitorPanel(wxWindow* pParent) { - m_pMeter = new ptpPanel(pParent, this); + m_pMeter = new ptpPanel(pParent, this, Settings::Get().Read("Time", "PTP_Domain", 0)); return m_pMeter; } @@ -77,6 +78,10 @@ void ptpBuilder::OnSettingChanged(SettingEvent& event) { m_pMeter->ResetStats(); } + else if(event.GetKey() == "PTP_Domain") + { + m_pMeter->SetDomain(event.GetValue(0l)); + } } diff --git a/plugins/ptp/ptppanel.cpp b/plugins/ptp/ptppanel.cpp index 447b81bc..b1df8b15 100644 --- a/plugins/ptp/ptppanel.cpp +++ b/plugins/ptp/ptppanel.cpp @@ -1477,4 +1477,9 @@ void ptpPanel::TimeWebsocketMessage() } } +void ptpPanel::SetDomain(unsigned char nDomain) +{ + m_nDomain = nDomain; + wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); +} diff --git a/plugins/ptp/ptppanel.h b/plugins/ptp/ptppanel.h index e391a19d..15f05966 100644 --- a/plugins/ptp/ptppanel.h +++ b/plugins/ptp/ptppanel.h @@ -181,6 +181,7 @@ class ptpPanel: public pmPanel **/ void OutputChannels(const std::vector& vChannels); + void SetDomain(unsigned char nDomain); protected: //(*Identifiers(ptpPanel) @@ -295,6 +296,8 @@ class ptpPanel: public pmPanel void OnLeftUp(wxMouseEvent& event); + + private: //(*Handlers(ptpPanel) From d05630b297a23d2efb60584d6ca065eec4aafbeb Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Tue, 1 Aug 2023 12:47:32 +0100 Subject: [PATCH 12/30] Adding domain number --- plugins/ptp/ptppanel.cpp | 73 +++++++++++++++++++++----------- plugins/ptp/ptppanel.h | 2 + plugins/ptp/wxsmith/ptppanel.wxs | 29 ++++++++++--- 3 files changed, 73 insertions(+), 31 deletions(-) diff --git a/plugins/ptp/ptppanel.cpp b/plugins/ptp/ptppanel.cpp index b1df8b15..8dc4651f 100644 --- a/plugins/ptp/ptppanel.cpp +++ b/plugins/ptp/ptppanel.cpp @@ -20,6 +20,7 @@ //(*IdInit(ptpPanel) const long ptpPanel::ID_M_PLST1 = wxNewId(); +const long ptpPanel::ID_M_PLBL79 = wxNewId(); const long ptpPanel::ID_M_PLBL1 = wxNewId(); const long ptpPanel::ID_M_PLBL2 = wxNewId(); const long ptpPanel::ID_M_PLBL3 = wxNewId(); @@ -204,37 +205,44 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plstClocks->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND)); m_plstClocks->SetButtonColour(wxColour(wxT("#000000"))); m_plstClocks->SetSelectedButtonColour(wxColour(wxT("#FF8000"))); - m_ptitleIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL1, _("Port Identitiy"), wxPoint(5,5), wxSize(100,25), 0, _T("ID_M_PLBL1")); + m_plblDomain = new wmLabel(m_ppnlInfo, ID_M_PLBL79, _("Domain:"), wxPoint(5,5), wxSize(280,25), 0, _T("ID_M_PLBL79")); + m_plblDomain->SetBorderState(uiRect::BORDER_NONE); + m_plblDomain->GetUiRect().SetGradient(wxWEST); + m_plblDomain->SetForegroundColour(wxColour(255,255,255)); + m_plblDomain->SetBackgroundColour(wxColour(128,128,192)); + wxFont m_plblDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_plblDomain->SetFont(m_plblDomainFont); + m_ptitleIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL1, _("Port Identitiy"), wxPoint(5,35), wxSize(100,25), 0, _T("ID_M_PLBL1")); m_ptitleIdentity->SetBorderState(uiRect::BORDER_FLAT); m_ptitleIdentity->GetUiRect().SetGradient(wxWEST); m_ptitleIdentity->SetForegroundColour(wxColour(255,255,255)); m_ptitleIdentity->SetBackgroundColour(wxColour(92,122,224)); - m_ptitleAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL2, _("Address"), wxPoint(5,35), wxSize(100,25), 0, _T("ID_M_PLBL2")); + m_ptitleAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL2, _("Address"), wxPoint(5,65), wxSize(100,25), 0, _T("ID_M_PLBL2")); m_ptitleAddress->SetBorderState(uiRect::BORDER_NONE); m_ptitleAddress->GetUiRect().SetGradient(wxWEST); m_ptitleAddress->SetForegroundColour(wxColour(255,255,255)); m_ptitleAddress->SetBackgroundColour(wxColour(92,122,224)); - m_ptitleState = new wmLabel(m_ppnlInfo, ID_M_PLBL3, _("State"), wxPoint(5,65), wxSize(100,25), 0, _T("ID_M_PLBL3")); + m_ptitleState = new wmLabel(m_ppnlInfo, ID_M_PLBL3, _("State"), wxPoint(5,95), wxSize(100,25), 0, _T("ID_M_PLBL3")); m_ptitleState->SetBorderState(uiRect::BORDER_NONE); m_ptitleState->GetUiRect().SetGradient(wxWEST); m_ptitleState->SetForegroundColour(wxColour(255,255,255)); m_ptitleState->SetBackgroundColour(wxColour(92,122,224)); - m_plblIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL12, wxEmptyString, wxPoint(105,5), wxSize(180,25), 0, _T("ID_M_PLBL12")); + m_plblIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL12, wxEmptyString, wxPoint(105,35), wxSize(180,25), 0, _T("ID_M_PLBL12")); m_plblIdentity->SetBorderState(uiRect::BORDER_DOWN); m_plblIdentity->GetUiRect().SetGradient(0); m_plblIdentity->SetForegroundColour(wxColour(0,0,0)); m_plblIdentity->SetBackgroundColour(wxColour(255,255,255)); - m_pblAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL13, wxEmptyString, wxPoint(105,35), wxSize(180,25), 0, _T("ID_M_PLBL13")); + m_pblAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL13, wxEmptyString, wxPoint(105,65), wxSize(180,25), 0, _T("ID_M_PLBL13")); m_pblAddress->SetBorderState(uiRect::BORDER_DOWN); m_pblAddress->GetUiRect().SetGradient(0); m_pblAddress->SetForegroundColour(wxColour(0,0,0)); m_pblAddress->SetBackgroundColour(wxColour(255,255,255)); - m_plblState = new wmLabel(m_ppnlInfo, ID_M_PLBL14, wxEmptyString, wxPoint(105,65), wxSize(180,25), 0, _T("ID_M_PLBL14")); + m_plblState = new wmLabel(m_ppnlInfo, ID_M_PLBL14, wxEmptyString, wxPoint(105,95), wxSize(180,25), 0, _T("ID_M_PLBL14")); m_plblState->SetBorderState(uiRect::BORDER_DOWN); m_plblState->GetUiRect().SetGradient(0); m_plblState->SetForegroundColour(wxColour(0,0,0)); m_plblState->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlAnnouncements = new wxPanel(m_ppnlInfo, ID_PANEL1, wxPoint(5,95), wxSize(280,275), wxTAB_TRAVERSAL, _T("ID_PANEL1")); + m_ppnlAnnouncements = new wxPanel(m_ppnlInfo, ID_PANEL1, wxPoint(5,140), wxSize(280,275), wxTAB_TRAVERSAL, _T("ID_PANEL1")); m_ppnlAnnouncements->SetBackgroundColour(wxColour(0,0,0)); m_ptitleAnnouncements = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL30, _("Announcements"), wxPoint(0,0), wxSize(280,25), 0, _T("ID_M_PLBL30")); m_ptitleAnnouncements->SetBorderState(uiRect::BORDER_NONE); @@ -512,7 +520,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblTime->GetUiRect().SetGradient(0); m_plblTime->SetForegroundColour(wxColour(0,0,0)); m_plblTime->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL57, L"Offset: x\u0304", wxPoint(0,60), wxSize(100,25), 0, _T("ID_M_PLBL57")); + m_ptitleOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL57, _("Offset: Average"), wxPoint(0,60), wxSize(100,25), 0, _T("ID_M_PLBL57")); m_ptitleOffsetAverage->SetBorderState(uiRect::BORDER_NONE); m_ptitleOffsetAverage->GetUiRect().SetGradient(wxWEST); m_ptitleOffsetAverage->SetForegroundColour(wxColour(255,255,255)); @@ -522,7 +530,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblOffsetAverage->GetUiRect().SetGradient(0); m_plblOffsetAverage->SetForegroundColour(wxColour(0,0,0)); m_plblOffsetAverage->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL58, L"Offset: \u03c3 \u03c3\u2093\u0304", wxPoint(0,90), wxSize(100,25), 0, _T("ID_M_PLBL58")); + m_ptitleOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL58, _("Offset: Range"), wxPoint(0,90), wxSize(100,25), 0, _T("ID_M_PLBL58")); m_ptitleOffsetRange->SetBorderState(uiRect::BORDER_NONE); m_ptitleOffsetRange->GetUiRect().SetGradient(wxWEST); m_ptitleOffsetRange->SetForegroundColour(wxColour(255,255,255)); @@ -532,7 +540,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblOffsetRange->GetUiRect().SetGradient(0); m_plblOffsetRange->SetForegroundColour(wxColour(0,0,0)); m_plblOffsetRange->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL59, L"Delay: x\u0304", wxPoint(0,120), wxSize(100,25), 0, _T("ID_M_PLBL59")); + m_ptitleDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL59, _("Delay: Average"), wxPoint(0,120), wxSize(100,25), 0, _T("ID_M_PLBL59")); m_ptitleDelayAverage->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayAverage->GetUiRect().SetGradient(wxWEST); m_ptitleDelayAverage->SetForegroundColour(wxColour(255,255,255)); @@ -542,7 +550,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblDelayAverage->GetUiRect().SetGradient(0); m_plblDelayAverage->SetForegroundColour(wxColour(0,0,0)); m_plblDelayAverage->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL60, L"Delay: \u03c3 \u03c3\u2093\u0304", wxPoint(0,150), wxSize(100,25), 0, _T("ID_M_PLBL60")); + m_ptitleDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL60, _("Delay: Range"), wxPoint(0,150), wxSize(100,25), 0, _T("ID_M_PLBL60")); m_ptitleDelayRange->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayRange->GetUiRect().SetGradient(wxWEST); m_ptitleDelayRange->SetForegroundColour(wxColour(255,255,255)); @@ -561,63 +569,63 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblGraphTitle->SetBackgroundColour(wxColour(91,149,57)); wxFont m_plblGraphTitleFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT); m_plblGraphTitle->SetFont(m_plblGraphTitleFont); - m_pLbl5 = new wmLabel(m_ppnlGraphs, ID_M_PLBL69, "y=", wxPoint(0,30), wxSize(20,30), 0, _T("ID_M_PLBL69")); + m_pLbl5 = new wmLabel(m_ppnlGraphs, ID_M_PLBL69, _("Current:"), wxPoint(0,30), wxSize(50,30), 0, _T("ID_M_PLBL69")); m_pLbl5->SetBorderState(uiRect::BORDER_NONE); m_pLbl5->GetUiRect().SetGradient(0); m_pLbl5->SetForegroundColour(wxColour(255,255,255)); m_pLbl5->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl5Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl5->SetFont(m_pLbl5Font); - m_plblCurrent = new wmLabel(m_ppnlGraphs, ID_M_PLBL74, wxEmptyString, wxPoint(20,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL74")); + m_plblCurrent = new wmLabel(m_ppnlGraphs, ID_M_PLBL74, wxEmptyString, wxPoint(50,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL74")); m_plblCurrent->SetBorderState(uiRect::BORDER_NONE); m_plblCurrent->GetUiRect().SetGradient(0); m_plblCurrent->SetForegroundColour(wxColour(186,254,167)); m_plblCurrent->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblCurrentFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblCurrent->SetFont(m_plblCurrentFont); - m_pLbl6 = new wmLabel(m_ppnlGraphs, ID_M_PLBL70, L"y\u0304=", wxPoint(140,30), wxSize(20,30), 0, _T("ID_M_PLBL70")); + m_pLbl6 = new wmLabel(m_ppnlGraphs, ID_M_PLBL70, _("Mean:"), wxPoint(140,30), wxSize(50,30), 0, _T("ID_M_PLBL70")); m_pLbl6->SetBorderState(uiRect::BORDER_NONE); m_pLbl6->GetUiRect().SetGradient(0); m_pLbl6->SetForegroundColour(wxColour(255,255,255)); m_pLbl6->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl6Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl6->SetFont(m_pLbl6Font); - m_plblMean = new wmLabel(m_ppnlGraphs, ID_M_PLBL75, wxEmptyString, wxPoint(160,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL75")); + m_plblMean = new wmLabel(m_ppnlGraphs, ID_M_PLBL75, wxEmptyString, wxPoint(190,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL75")); m_plblMean->SetBorderState(uiRect::BORDER_NONE); m_plblMean->GetUiRect().SetGradient(0); m_plblMean->SetForegroundColour(wxColour(186,254,167)); m_plblMean->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblMeanFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblMean->SetFont(m_plblMeanFont); - m_pLbl7 = new wmLabel(m_ppnlGraphs, ID_M_PLBL71, L"\u03c3=", wxPoint(280,30), wxSize(20,30), 0, _T("ID_M_PLBL71")); + m_pLbl7 = new wmLabel(m_ppnlGraphs, ID_M_PLBL71, _("SD:"), wxPoint(280,30), wxSize(50,30), 0, _T("ID_M_PLBL71")); m_pLbl7->SetBorderState(uiRect::BORDER_NONE); m_pLbl7->GetUiRect().SetGradient(0); m_pLbl7->SetForegroundColour(wxColour(255,255,255)); m_pLbl7->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl7Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl7->SetFont(m_pLbl7Font); - m_plblDeviation = new wmLabel(m_ppnlGraphs, ID_M_PLBL76, wxEmptyString, wxPoint(300,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL76")); + m_plblDeviation = new wmLabel(m_ppnlGraphs, ID_M_PLBL76, wxEmptyString, wxPoint(330,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL76")); m_plblDeviation->SetBorderState(uiRect::BORDER_NONE); m_plblDeviation->GetUiRect().SetGradient(0); m_plblDeviation->SetForegroundColour(wxColour(186,254,167)); m_plblDeviation->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblDeviationFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblDeviation->SetFont(m_plblDeviationFont); - m_pLbl8 = new wmLabel(m_ppnlGraphs, ID_M_PLBL72, L"\u03b2\u0302=", wxPoint(420,30), wxSize(20,30), 0, _T("ID_M_PLBL72")); + m_pLbl8 = new wmLabel(m_ppnlGraphs, ID_M_PLBL72, _("Slope:"), wxPoint(420,30), wxSize(50,30), 0, _T("ID_M_PLBL72")); m_pLbl8->SetBorderState(uiRect::BORDER_NONE); m_pLbl8->GetUiRect().SetGradient(0); m_pLbl8->SetForegroundColour(wxColour(255,255,255)); m_pLbl8->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl8Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl8->SetFont(m_pLbl8Font); - m_plblSlope = new wmLabel(m_ppnlGraphs, ID_M_PLBL77, wxEmptyString, wxPoint(440,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL77")); + m_plblSlope = new wmLabel(m_ppnlGraphs, ID_M_PLBL77, wxEmptyString, wxPoint(470,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL77")); m_plblSlope->SetBorderState(uiRect::BORDER_NONE); m_plblSlope->GetUiRect().SetGradient(0); m_plblSlope->SetForegroundColour(wxColour(186,254,167)); m_plblSlope->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblSlopeFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblSlope->SetFont(m_plblSlopeFont); - m_pLbl9 = new wmLabel(m_ppnlGraphs, ID_M_PLBL73, L"\u03b1\u0302+\u03b2\u0302x=", wxPoint(560,30), wxSize(50,30), 0, _T("ID_M_PLBL73")); + m_pLbl9 = new wmLabel(m_ppnlGraphs, ID_M_PLBL73, _("Est:"), wxPoint(560,30), wxSize(50,30), 0, _T("ID_M_PLBL73")); m_pLbl9->SetBorderState(uiRect::BORDER_NONE); m_pLbl9->GetUiRect().SetGradient(0); m_pLbl9->SetForegroundColour(wxColour(255,255,255)); @@ -642,7 +650,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plstGraphData = new wmList(m_ppnlGraphs, ID_M_PLST5, wxPoint(70,443), wxSize(120,34), wmList::STYLE_SELECT, 0, wxSize(-1,30), 2, wxSize(-1,-1)); m_plstGraphData->SetBackgroundColour(wxColour(0,0,0)); m_pbtnGraphClear = new wmButton(m_ppnlGraphs, ID_M_PBTN3, _("Clear All"), wxPoint(600,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); - m_pbtnGraphOptions = new wmButton(m_ppnlGraphs, ID_M_PBTN4, _("Menu"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN4")); + m_pbtnGraphOptions = new wmButton(m_ppnlGraphs, ID_M_PBTN4, _("Options"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN4")); m_ppnlHistograms = new wxPanel(m_pSwpMain, ID_PANEL16, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL16")); m_ppnlHistograms->SetBackgroundColour(wxColour(0,0,0)); m_plblHistogramTitle = new wmLabel(m_ppnlHistograms, ID_M_PLBL53, wxEmptyString, wxPoint(0,0), wxSize(800,30), 0, _T("ID_M_PLBL53")); @@ -681,7 +689,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plstHistogramResolution = new wmList(m_ppnlHistograms, ID_M_PLST3, wxPoint(460,443), wxSize(120,34), 0, 0, wxSize(-1,30), 3, wxSize(-1,-1)); m_plstHistogramResolution->SetBackgroundColour(wxColour(0,0,0)); m_pbtnHistogramClear = new wmButton(m_ppnlHistograms, ID_M_PBTN1, _("Clear All"), wxPoint(600,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN1")); - m_pbtnOptions = new wmButton(m_ppnlHistograms, ID_M_PBTN2, _("Menu"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnOptions = new wmButton(m_ppnlHistograms, ID_M_PBTN2, _("Options"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN2")); m_pSwpMain->AddPage(m_ppnlInfo, _("Info"), false); m_pSwpMain->AddPage(m_ppnlGraphs, _("Graphs"), false); m_pSwpMain->AddPage(m_ppnlHistograms, _("Histograms"), false); @@ -697,6 +705,15 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w Connect(ID_M_PBTN2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnOptionsClick); //*) + m_ptitleOffsetAverage->SetLabel(L"Offset: x\u0304"); + m_ptitleOffsetRange->SetLabel(L"Offset: \u03c3 \u03c3\u2093\u0304"); + m_ptitleDelayAverage->SetLabel(L"Delay: x\u0304"); + m_ptitleDelayRange->SetLabel(L"Delay: \u03c3 \u03c3\u2093\u0304"); + m_pLbl6->SetLabel(L"y\u0304="); + m_pLbl7->SetLabel(L"\u03c3="); + m_pLbl8->SetLabel(L"\u03b2\u0302="); + m_pLbl9->SetLabel(L"\u03b1\u0302+\u03b2\u0302x="); + m_pbtnClearStats = new wmButton(m_ppnlGraphs, wxNewId(), _("Clear Stats"), wxPoint(520,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); Connect(m_pbtnClearStats->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearStatsClick); @@ -776,6 +793,8 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_pHistoryGraph->Bind(wxEVT_LEFT_UP, &ptpPanel::OnLeftUp, this);\ ConnectLeftUp(this); + m_plblDomain->SetLabel(wxString::Format("Domain: %u", m_nDomain)); + } void ptpPanel::ConnectLeftUp(wxWindow* pParent) @@ -1479,7 +1498,13 @@ void ptpPanel::TimeWebsocketMessage() void ptpPanel::SetDomain(unsigned char nDomain) { - m_nDomain = nDomain; - wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); + if(m_nDomain != nDomain) + { + wxPtp::Get().StopDomain(m_nDomain); + m_nDomain = nDomain; + m_plblDomain->SetLabel(wxString::Format("Domain: %u", m_nDomain)); + + wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); + } } diff --git a/plugins/ptp/ptppanel.h b/plugins/ptp/ptppanel.h index 15f05966..7c4e837f 100644 --- a/plugins/ptp/ptppanel.h +++ b/plugins/ptp/ptppanel.h @@ -86,6 +86,7 @@ class ptpPanel: public pmPanel wmLabel* m_plblDelayRange; wmLabel* m_plblDelayRate; wmLabel* m_plblDeviation; + wmLabel* m_plblDomain; wmLabel* m_plblFollowCount; wmLabel* m_plblFollowRate; wmLabel* m_plblGraphTitle; @@ -186,6 +187,7 @@ class ptpPanel: public pmPanel //(*Identifiers(ptpPanel) static const long ID_M_PLST1; + static const long ID_M_PLBL79; static const long ID_M_PLBL1; static const long ID_M_PLBL2; static const long ID_M_PLBL3; diff --git a/plugins/ptp/wxsmith/ptppanel.wxs b/plugins/ptp/wxsmith/ptppanel.wxs index 46d4b9ab..e54d87b4 100644 --- a/plugins/ptp/wxsmith/ptppanel.wxs +++ b/plugins/ptp/wxsmith/ptppanel.wxs @@ -20,11 +20,26 @@ + + + wxWEST + 5,5 + 280,25 + #FFFFFF + #8080C0 + + 10 + + bold + 0 + swiss + + uiRect::BORDER_FLAT wxWEST - 5,5 + 5,35 100,25 #FFFFFF #5C7AE0 @@ -32,7 +47,7 @@ wxWEST - 5,35 + 5,65 100,25 #FFFFFF #5C7AE0 @@ -40,7 +55,7 @@ wxWEST - 5,65 + 5,95 100,25 #FFFFFF #5C7AE0 @@ -48,7 +63,7 @@ uiRect::BORDER_DOWN - 105,5 + 105,35 180,25 #000000 #FFFFFF @@ -56,7 +71,7 @@ uiRect::BORDER_DOWN - 105,35 + 105,65 180,25 #000000 #FFFFFF @@ -64,13 +79,13 @@ uiRect::BORDER_DOWN - 105,65 + 105,95 180,25 #000000 #FFFFFF - 5,95 + 5,140 280,275 #000000 From 1d9c478af9061a377b0f34a5bb95c1e8e0408ca3 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Tue, 1 Aug 2023 00:25:11 +0100 Subject: [PATCH 13/30] work on ptp domains --- pambase/wxptp.cpp | 54 ++++++++++++++++++++++++------------- pambase/wxptp.h | 3 ++- pambase/wxptpeventhandler.h | 9 ++++--- plugins/ptp/ptpbuilder.cpp | 2 +- plugins/ptp/ptppanel.cpp | 8 +++--- 5 files changed, 50 insertions(+), 26 deletions(-) diff --git a/pambase/wxptp.cpp b/pambase/wxptp.cpp index e6eac961..9462d4f2 100644 --- a/pambase/wxptp.cpp +++ b/pambase/wxptp.cpp @@ -27,75 +27,88 @@ wxDEFINE_EVENT(wxEVT_CLOCK_MSG_DELAY_RESPONSE,wxCommandEvent); using namespace ptpmonkey; -void wxPtpEventHandler::AddHandler(wxEvtHandler* pHandler) +void wxPtpEventHandler::AddHandler(wxEvtHandler* pHandler, unsigned char nDomain) { - m_lstHandlers.push_back(pHandler); + m_mmHandlers.insert({nDomain, pHandler}); } -void wxPtpEventHandler::NotifyHandlers(wxEventType type, const wxString& sClockId) +void wxPtpEventHandler::RemoveHandler(wxEvtHandler* pHandler, unsigned char nDomain) { - for(auto pHandler : m_lstHandlers) + for(auto itHandler = m_mmHandlers.lower_bound(nDomain); itHandler != m_mmHandlers.upper_bound(nDomain); ++itHandler) + { + if(itHandler->second == pHandler) + { + m_mmHandlers.erase(itHandler); + break; + } + } +} + +void wxPtpEventHandler::NotifyHandlers(wxEventType type, const wxString& sClockId, unsigned char nDomain) +{ + for(auto itHandler = m_mmHandlers.lower_bound(nDomain); itHandler != m_mmHandlers.upper_bound(nDomain); ++itHandler) { wxCommandEvent* pEvent = new wxCommandEvent(type); pEvent->SetString(sClockId); - wxQueueEvent(pHandler, pEvent); + pEvent->SetInt(nDomain); + wxQueueEvent(itHandler->second, pEvent); } } void wxPtpEventHandler::ClockAdded(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_ADDED, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_ADDED, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::ClockUpdated(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_UPDATED, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_UPDATED, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::ClockBecomeMaster(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MASTER, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MASTER, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::ClockBecomeSlave(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_SLAVE, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_SLAVE, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::ClockRemoved(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_REMOVED, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_REMOVED, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::ClockTimeCalculated(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_TIME, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_TIME, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::AnnounceSent(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MSG_ANNOUNCE, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MSG_ANNOUNCE, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::SyncSent(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MSG_SYNC, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MSG_SYNC, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::FollowUpSent(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MSG_FOLLOWUP, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MSG_FOLLOWUP, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::DelayRequestSent(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MSG_DELAY_REQUEST, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MSG_DELAY_REQUEST, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } void wxPtpEventHandler::DelayResponseSent(std::shared_ptr pClock) { - NotifyHandlers(wxEVT_CLOCK_MSG_DELAY_RESPONSE, wxString::FromUTF8(pClock->GetId().c_str())); + NotifyHandlers(wxEVT_CLOCK_MSG_DELAY_RESPONSE, wxString::FromUTF8(pClock->GetId().c_str()), pClock->GetDomain()); } @@ -140,9 +153,14 @@ void wxPtp::RunDomain(const wxString& sInterface, unsigned char nDomain, ptpmonk pmlLog(pml::LOG_TRACE) << "wxPtp::RunDomain = done"; } -void wxPtp::AddHandler(wxEvtHandler* pHandler) +void wxPtp::AddHandler(wxEvtHandler* pHandler, unsigned char nDomain) +{ + m_pNotifier->AddHandler(pHandler, nDomain); +} + +void wxPtp::RemoveHandler(wxEvtHandler* pHandler, unsigned char nDomain) { - m_pNotifier->AddHandler(pHandler); + m_pNotifier->RemoveHandler(pHandler, nDomain); } void wxPtp::StopDomain(unsigned char nDomain) diff --git a/pambase/wxptp.h b/pambase/wxptp.h index 6f5653c9..b89876df 100644 --- a/pambase/wxptp.h +++ b/pambase/wxptp.h @@ -30,7 +30,8 @@ class PAMBASE_IMPEXPORT wxPtp : public wxEvtHandler std::map >::const_iterator GetClocksBegin(unsigned char nDomain) const; std::map >::const_iterator GetClocksEnd(unsigned char nDomain) const; void ResetLocalClockStats(unsigned char nDomain); - void AddHandler(wxEvtHandler* pHandler); + void AddHandler(wxEvtHandler* pHandler, unsigned char nDomain); + void RemoveHandler(wxEvtHandler* pHandler, unsigned char nDomain); private: wxPtp(); diff --git a/pambase/wxptpeventhandler.h b/pambase/wxptpeventhandler.h index df83ee81..c2a66a0c 100644 --- a/pambase/wxptpeventhandler.h +++ b/pambase/wxptpeventhandler.h @@ -1,5 +1,7 @@ #pragma once #include "ptpeventhander.h" +#include + namespace ptpmonkey { class PtpV2Clock; @@ -8,7 +10,8 @@ namespace ptpmonkey class wxPtpEventHandler : public ptpmonkey::PtpEventHandler { public: - void AddHandler(wxEvtHandler* pHandler); + void AddHandler(wxEvtHandler* pHandler, unsigned char nDomain); + void RemoveHandler(wxEvtHandler* pHandler, unsigned char nDomain); void ClockAdded(std::shared_ptr pClock) override; void ClockUpdated(std::shared_ptr pClock) override; @@ -24,8 +27,8 @@ class wxPtpEventHandler : public ptpmonkey::PtpEventHandler void DelayResponseSent(std::shared_ptr pClock) override; protected: - void NotifyHandlers(wxEventType type, const wxString& sClockId); - std::list m_lstHandlers; + void NotifyHandlers(wxEventType type, const wxString& sClockId, unsigned char nDomain); + std::multimap m_mmHandlers; }; diff --git a/plugins/ptp/ptpbuilder.cpp b/plugins/ptp/ptpbuilder.cpp index f396079c..5aef4e87 100644 --- a/plugins/ptp/ptpbuilder.cpp +++ b/plugins/ptp/ptpbuilder.cpp @@ -30,7 +30,7 @@ void ptpBuilder::SetAudioData(const timedbuffer* pBuffer) wxWindow* ptpBuilder::CreateMonitorPanel(wxWindow* pParent) { - m_pMeter = new ptpPanel(pParent, this, Settings::Get().Read("Time", "PTP_Domain", 0)); + m_pMeter = new ptpPanel(pParent, this); return m_pMeter; } diff --git a/plugins/ptp/ptppanel.cpp b/plugins/ptp/ptppanel.cpp index 8dc4651f..d420de85 100644 --- a/plugins/ptp/ptppanel.cpp +++ b/plugins/ptp/ptppanel.cpp @@ -150,7 +150,7 @@ END_EVENT_TABLE() ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const wxPoint& pos,const wxSize& size) : pmPanel(), m_pBuilder(pBuilder), - m_nDomain(0), + m_nDomain(Settings::Get().Read("Time", "PTP_Domain", 0)), m_pClock(nullptr), m_pLocalClock(nullptr), m_mAccuracy({ { ptpAnnounce::ACC_25NS, "Within 25ns"}, @@ -1208,7 +1208,7 @@ void ptpPanel::OnTimer(wxTimerEvent& event) if(m_bRunning == false) { m_bRunning = true; - wxPtp::Get().AddHandler(this); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); Connect(wxID_ANY, wxEVT_CLOCK_ADDED,(wxObjectEventFunction)&ptpPanel::OnClockAdded); Connect(wxID_ANY, wxEVT_CLOCK_UPDATED,(wxObjectEventFunction)&ptpPanel::OnClockUpdated); @@ -1500,7 +1500,9 @@ void ptpPanel::SetDomain(unsigned char nDomain) { if(m_nDomain != nDomain) { - wxPtp::Get().StopDomain(m_nDomain); + wxPtp::Get().RemoveHandler(this, m_nDomain); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); + m_nDomain = nDomain; m_plblDomain->SetLabel(wxString::Format("Domain: %u", m_nDomain)); From c696ed475f7a2ac128c37362a3de0a130f3456e0 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Tue, 1 Aug 2023 00:25:19 +0100 Subject: [PATCH 14/30] make inter packet more sensible --- external/live/liveMedia/RTPSource.cpp | 7 +++++++ external/live/liveMedia/include/RTPSource.hh | 3 ++- pambase/iomanager.cpp | 2 +- pambase/qos.cpp | 3 ++- pambase/rtpthread.cpp | 3 ++- pambase/timemanager.cpp | 2 +- pambase/wxsink.cpp | 9 ++++----- pambase/wxsink.h | 2 +- plugins/aoip info/pnlAoIPInfo.cpp | 2 +- plugins/aoip info/pnlQos.cpp | 15 ++++++++++----- plugins/aoip info/pnlQos.h | 4 ++++ plugins/aoip info/pnlSubsession.cpp | 4 +++- 12 files changed, 38 insertions(+), 18 deletions(-) diff --git a/external/live/liveMedia/RTPSource.cpp b/external/live/liveMedia/RTPSource.cpp index 3a27b2cb..fe2126d7 100644 --- a/external/live/liveMedia/RTPSource.cpp +++ b/external/live/liveMedia/RTPSource.cpp @@ -399,6 +399,13 @@ void RTPReceptionStats::reset() { fLastResetExtSeqNumReceived = fHighestExtSeqNumReceived; } + +void RTPReceptionStats::resetMinMax() +{ + fMinInterPacketGapUS = 0x7FFFFFFF; + fMaxInterPacketGapUS = 0; +} + Boolean seqNumLT(u_int16_t s1, u_int16_t s2) { // a 'less-than' on 16-bit sequence numbers int diff = s2-s1; diff --git a/external/live/liveMedia/include/RTPSource.hh b/external/live/liveMedia/include/RTPSource.hh index 69ba1844..27f8d72d 100644 --- a/external/live/liveMedia/include/RTPSource.hh +++ b/external/live/liveMedia/include/RTPSource.hh @@ -214,11 +214,12 @@ public: unsigned minInterPacketGapUS() const { return fMinInterPacketGapUS; } unsigned maxInterPacketGapUS() const { return fMaxInterPacketGapUS; } - unsigned currentInterPacketGapUS() const { return fCurrentInterPacketGapUS; } struct timeval const& totalInterPacketGaps() const { return fTotalInterPacketGaps; } + void resetMinMax(); + protected: // called only by RTPReceptionStatsDB: friend class RTPReceptionStatsDB; diff --git a/pambase/iomanager.cpp b/pambase/iomanager.cpp index 1425601a..31c299c5 100644 --- a/pambase/iomanager.cpp +++ b/pambase/iomanager.cpp @@ -129,7 +129,7 @@ IOManager::IOManager() : #ifdef PTPMONKEY - wxPtp::Get().AddHandler(this); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&IOManager::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&IOManager::OnPtpEvent); wxPtp::Get().RunDomain(std::string(Settings::Get().Read("AoIP_Settings", "Interface", "eth0").mb_str()), diff --git a/pambase/qos.cpp b/pambase/qos.cpp index ec4aff91..88221ad0 100644 --- a/pambase/qos.cpp +++ b/pambase/qos.cpp @@ -131,7 +131,6 @@ void qosMeasurementRecord::printQOSData() RTPReceptionStats* stats = statsIter.next(True); if (stats != NULL) { - pData->dInter_packet_gap_ms_Now = stats->currentInterPacketGapUS()/1000.0; pData->dInter_packet_gap_ms_min = stats->minInterPacketGapUS()/1000.0; auto totalGaps = stats->totalInterPacketGaps(); auto totalGapsMS = totalGaps.tv_sec*1000.0 + totalGaps.tv_usec/1000.0; @@ -140,6 +139,8 @@ void qosMeasurementRecord::printQOSData() pData->dInter_packet_gap_ms_av = (totNumPacketsReceived == 0 ? 0.0 : totalGapsMS/totNumPacketsReceived); pData->dInter_packet_gap_ms_max = stats->maxInterPacketGapUS()/1000.0; + stats->resetMinMax(); //reset the min and max interpacket gap as we monitor them every second + pData->nBaseExtSeqNum = stats->baseExtSeqNumReceived(); pData->nLastResetExtSeqNum = stats->lastResetExtSeqNumReceived(); pData->nHighestExtSeqNum = stats->highestExtSeqNumReceived(); diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index ed4b583b..b68048d8 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -313,7 +313,8 @@ void RtpThread::AddFrame(std::shared_ptr pFrame) ++itReceived->second; //send out an rtpframe event 20 times a second... - if(m_pHandler && itReceived->second%((14400 / pFrame->nFrameSize) == 0)) + + if(m_pHandler && itReceived->second%(14400 / pFrame->nFrameSize) == 0) { auto pEvent = new RtpFrameEvent(pFrame); wxQueueEvent(m_pHandler, pEvent); diff --git a/pambase/timemanager.cpp b/pambase/timemanager.cpp index 5051d709..afebc8cd 100644 --- a/pambase/timemanager.cpp +++ b/pambase/timemanager.cpp @@ -24,7 +24,7 @@ TimeManager::TimeManager() : m_nMinSamplSize(10), m_nPtpSamples(0) { - wxPtp::Get().AddHandler(this); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); Bind(wxEVT_CLOCK_TIME, &TimeManager::OnPtpClockSync, this); Bind(wxEVT_CLOCK_REMOVED, &TimeManager::OnPtpClockRemoved, this); diff --git a/pambase/wxsink.cpp b/pambase/wxsink.cpp index 85f1cf71..2750d7aa 100644 --- a/pambase/wxsink.cpp +++ b/pambase/wxsink.cpp @@ -4,7 +4,7 @@ #ifdef __WXMSW__ #include "Ws2tcpip.h" #endif - +#include "log.h" #include "aes67source.h" #include "smpte2110mediasession.h" @@ -103,10 +103,10 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c pFrame->nTimestampDifference = nDifference; pFrame->mExt = mExt; - timeval tvSub; int nFramesPerSec = (m_pSubsession->rtpTimestampFrequency()*m_pSubsession->GetChannelGrouping().size()*pFrame->nBytesPerSample)/pFrame->nFrameSize; - timersub(&pFrame->timePresentation, &pFrame->timeTransmission, &tvSub); - double dTSDF = (static_cast(tvSub.tv_sec)*1000000.0)+tvSub.tv_usec; + timersub(&pFrame->timePresentation, &pFrame->timeTransmission, &pFrame->timeLatency); + + double dTSDF = (static_cast(pFrame->timeLatency.tv_sec)*1000000.0)+pFrame->timeLatency.tv_usec; if(m_dDelay0 == std::numeric_limits::lowest() || m_nTSDFCount == nFramesPerSec) { @@ -127,7 +127,6 @@ void wxSink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, c m_nTSDFCount++; } pFrame->dTSDF = m_dTSDF; - timersub(&(pFrame->timePresentation), &(pFrame->timeTransmission), &pFrame->timeLatency); m_pHandler->AddFrame(pFrame); } } diff --git a/pambase/wxsink.h b/pambase/wxsink.h index 1f2683f6..a8e720e5 100644 --- a/pambase/wxsink.h +++ b/pambase/wxsink.h @@ -57,7 +57,7 @@ class wxSink: public MediaSink double m_dTSDFMax = std::numeric_limits::lowest(); double m_dTSDFMin = std::numeric_limits::max(); - double m_dTSDF = 0; + double m_dTSDF = std::numeric_limits::lowest(); double m_nTSDFCount = 0; double m_dDelay0 = std::numeric_limits::lowest(); timeval m_tvDelay0; diff --git a/plugins/aoip info/pnlAoIPInfo.cpp b/plugins/aoip info/pnlAoIPInfo.cpp index 6a2d8e9d..a898129d 100644 --- a/plugins/aoip info/pnlAoIPInfo.cpp +++ b/plugins/aoip info/pnlAoIPInfo.cpp @@ -231,7 +231,7 @@ pnlAoIPInfo::pnlAoIPInfo(wxWindow* parent,AoIPInfoBuilder* pBuilder, wxWindowID m_pswpInfo->SetFont(wxFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT)); #ifdef PTPMONKEY - wxPtp::Get().AddHandler(this); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&pnlAoIPInfo::OnPtpEvent); diff --git a/plugins/aoip info/pnlQos.cpp b/plugins/aoip info/pnlQos.cpp index b810de07..a9ecfbe2 100644 --- a/plugins/aoip info/pnlQos.cpp +++ b/plugins/aoip info/pnlQos.cpp @@ -355,9 +355,12 @@ void pnlQos::QoSUpdated(qosData* pData) m_plblQoSPacketsMin->SetLabel(wxString::Format(wxT("%.3f"), pData->dPacket_loss_fraction_min)); m_plblQoSReceived->SetLabel(wxString::Format(wxT("%d"), pData->nTotNumPacketsReceived)); - m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_min)); - m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_Now, pData->dInter_packet_gap_ms_av)); - m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), pData->dInter_packet_gap_ms_max)); + m_plblQoSInterAv->SetLabel(wxString::Format(wxT("%f ms [%f]"), pData->dInter_packet_gap_ms_max, pData->dInter_packet_gap_ms_av)); + + m_dTotalMaxInterPacket = std::max(m_dTotalMaxInterPacket, pData->dInter_packet_gap_ms_max); + m_dTotalMinInterPacket = std::min(m_dTotalMinInterPacket, pData->dInter_packet_gap_ms_min); + m_plblQoSInterMax->SetLabel(wxString::Format(wxT("%f ms"), m_dTotalMaxInterPacket)); + m_plblQoSInterMin->SetLabel(wxString::Format(wxT("%f ms"), m_dTotalMinInterPacket)); m_plblQoSJitter->SetLabel(wxString::Format(wxT("%f ms"),pData->dJitter)); @@ -389,8 +392,8 @@ void pnlQos::QoSUpdated(qosData* pData) m_pGraph->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); m_pHistogram->AddPeak(wxT("kBit/s"), pData->dkbits_per_second_Now); - m_pGraph->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); - m_pHistogram->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_Now); + m_pGraph->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_max); + m_pHistogram->AddPeak(wxT("Packet Gap"), pData->dInter_packet_gap_ms_max); m_pGraph->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); m_pHistogram->AddPeak(wxT("Packet Loss"), pData->dPacket_loss_fraction_av); @@ -413,6 +416,8 @@ void pnlQos::OnbtnClearClick(wxCommandEvent& event) { m_pGraph->ClearGraphs(); m_pHistogram->ClearGraphs(); + m_dTotalMaxInterPacket = -1.0; + m_dTotalMinInterPacket = std::numeric_limits::max(); } void pnlQos::ShowGraph(const wxString& sGraph) diff --git a/plugins/aoip info/pnlQos.h b/plugins/aoip info/pnlQos.h index a9ed53eb..565c8bf1 100644 --- a/plugins/aoip info/pnlQos.h +++ b/plugins/aoip info/pnlQos.h @@ -10,6 +10,7 @@ //*) #include "aoipinfobuilder.h" #include +#include struct rtpFrame; class SettingEvent; @@ -130,6 +131,9 @@ class pnlQos: public wxPanel double m_dInitialLatency=0.0; unsigned short m_nLatencyCounter = 0; + + double m_dTotalMaxInterPacket = -1.0; + double m_dTotalMinInterPacket = std::numeric_limits::max(); DECLARE_EVENT_TABLE() }; diff --git a/plugins/aoip info/pnlSubsession.cpp b/plugins/aoip info/pnlSubsession.cpp index 1bf24cab..64266c1a 100644 --- a/plugins/aoip info/pnlSubsession.cpp +++ b/plugins/aoip info/pnlSubsession.cpp @@ -10,6 +10,8 @@ #include "wxptp.h" #endif +#include "settings.h" + //(*IdInit(pnlSubsession) const long pnlSubsession::ID_M_PLBL39 = wxNewId(); const long pnlSubsession::ID_M_PLBL42 = wxNewId(); @@ -316,7 +318,7 @@ m_sub(sub) { m_plblSubSyncId->SetBackgroundColour(wxColour(255,100,100)); } - wxPtp::Get().AddHandler(this); + wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&pnlSubsession::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&pnlSubsession::OnPtpEvent); From efae2ebeaca49a6c8ae84fd7248c8e33e911b798 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Tue, 1 Aug 2023 19:46:48 +0100 Subject: [PATCH 15/30] ptp domain fixing --- pambase/AES67ServerMediaSubsession.cpp | 4 +- pambase/aes67source.cpp | 2 +- pambase/dlgmask.cpp | 5 +- pambase/histogram.cpp | 10 +- pambase/iomanager.cpp | 4 +- pambase/ondemandaes67mediasubsession.cpp | 4 +- pambase/rtpthread.cpp | 2 +- pambase/timemanager.cpp | 20 +- pambase/wmbutton.cpp | 5 +- pambase/wmkeyboard.cpp | 5 +- pambase/wmlist.cpp | 5 +- pambase/wmlistadv.cpp | 5 +- pambase/wmslider.cpp | 5 +- pambase/wmswipebutton.cpp | 5 +- pambase/wmswitcherpanel.cpp | 5 +- pambase/wmtimeedit.cpp | 4 + pambase/wxptp.cpp | 231 +++++++++-------------- pambase/wxptp.h | 39 ++-- pambase/wxptpeventhandler.h | 10 +- plugins/aoip info/pnlAoIPInfo.cpp | 31 +-- plugins/aoip info/pnlSubsession.cpp | 6 +- plugins/ptp/ptppanel.cpp | 41 ++-- 22 files changed, 197 insertions(+), 251 deletions(-) diff --git a/pambase/AES67ServerMediaSubsession.cpp b/pambase/AES67ServerMediaSubsession.cpp index df29b5fd..4ed2b982 100644 --- a/pambase/AES67ServerMediaSubsession.cpp +++ b/pambase/AES67ServerMediaSubsession.cpp @@ -63,7 +63,7 @@ char const* AES67ServerMediaSubsession::sdpLines(int addressFamily) ss << "a=ptime:" << m_nPacketTime << "\r\n"; ss << "a=maxptime:" << m_nPacketTime << "\r\n"; #ifdef PTPMONKEY - ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0) << ":0\r\n"; + ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId() << ":0\r\n"; #else ss << "a=ts-refclk:" << "\r\n"; #endif // PTPMONKEY @@ -251,7 +251,7 @@ unsigned int AES67ServerMediaSubsession::GetEpochTimestamp() // //get the current time // timeval tvNow; // #ifdef PTPMONKEY -// tvNow = wxPtp::Get().GetPtpTime(0); +// tvNow = wxPtp::Get().GetPtpTime(); // #else // gettimeofday(&tvNow, 0); // #endif // PTPMONKEY diff --git a/pambase/aes67source.cpp b/pambase/aes67source.cpp index 7ab3de44..ce8dac6c 100644 --- a/pambase/aes67source.cpp +++ b/pambase/aes67source.cpp @@ -34,7 +34,7 @@ ::Aes67Source(UsageEnvironment& env, Groupsock* RTPgs, m_nSyncTimestamp(nSync) { #ifdef PTPMONKEY - wxPtp::Get().ResyncToMaster(0); + wxPtp::Get().ResyncToMaster(); #endif // PTPMONKEY WorkoutLastEpoch(); } diff --git a/pambase/dlgmask.cpp b/pambase/dlgmask.cpp index c1f37067..c6085f78 100644 --- a/pambase/dlgmask.cpp +++ b/pambase/dlgmask.cpp @@ -79,7 +79,10 @@ dlgMask::~dlgMask() void dlgMask::OnActivate(wxActivateEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } } void dlgMask::MoveToCorrectPlace(size_t nButtons) diff --git a/pambase/histogram.cpp b/pambase/histogram.cpp index 83f3ce5a..29d5feda 100644 --- a/pambase/histogram.cpp +++ b/pambase/histogram.cpp @@ -342,13 +342,19 @@ void Histogram::OnLeftDown(wxMouseEvent& event) m_bMouseDown = true; itGraph->second.dFirstDisplay = m_dFirstColumn; } - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } } void Histogram::OnLeftUp(wxMouseEvent& event) { m_bMouseDown = false; - ReleaseMouse(); + if(HasCapture()) + { + ReleaseMouse(); + } } void Histogram::OnMouseMove(wxMouseEvent& event) diff --git a/pambase/iomanager.cpp b/pambase/iomanager.cpp index 31c299c5..b9c3c429 100644 --- a/pambase/iomanager.cpp +++ b/pambase/iomanager.cpp @@ -129,10 +129,10 @@ IOManager::IOManager() : #ifdef PTPMONKEY - wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); + wxPtp::Get().AddHandler(this); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&IOManager::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&IOManager::OnPtpEvent); - wxPtp::Get().RunDomain(std::string(Settings::Get().Read("AoIP_Settings", "Interface", "eth0").mb_str()), + wxPtp::Get().Run(std::string(Settings::Get().Read("AoIP_Settings", "Interface", "eth0").mb_str()), Settings::Get().Read("Time", "PTP_Domain", 0), Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); #endif // PTPMONKEY m_pGenerator = std::make_unique(); diff --git a/pambase/ondemandaes67mediasubsession.cpp b/pambase/ondemandaes67mediasubsession.cpp index 48813c6f..ea86dd57 100644 --- a/pambase/ondemandaes67mediasubsession.cpp +++ b/pambase/ondemandaes67mediasubsession.cpp @@ -38,7 +38,7 @@ char const* AES67RTPSink::auxSDPLine() std::stringstream ss; #ifdef PTPMONKEY - ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0).ToStdString() << ":0\r\n"; + ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId().ToStdString() << ":0\r\n"; #else ss << "a=ts-refclk:" << "\r\n"; #endif // PTPMONKEY @@ -207,7 +207,7 @@ void OnDemandAES67MediaSubsession::FlushQueue() // ss << "a=ptime:" << m_ePacketTime << "\r\n"; // ss << "a=maxptime:" << m_ePacketTime << "\r\n"; // #ifdef PTPMONKEY -// ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0) << ":0\r\n"; +// ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId() << ":0\r\n"; // #else // ss << "a=ts-refclk:" << "\r\n"; // #endif // PTPMONKEY diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index b68048d8..fe5c9d9b 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -550,7 +550,7 @@ void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) #ifdef PTPMONKEY if(pSubsession->GetRefClock().sType.CmpNoCase("PTP") == 0) { - wxPtp::Get().RunDomain(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); + wxPtp::Get().Run(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); } #endif // PTPMONKEY diff --git a/pambase/timemanager.cpp b/pambase/timemanager.cpp index afebc8cd..0894567e 100644 --- a/pambase/timemanager.cpp +++ b/pambase/timemanager.cpp @@ -24,7 +24,7 @@ TimeManager::TimeManager() : m_nMinSamplSize(10), m_nPtpSamples(0) { - wxPtp::Get().AddHandler(this, Settings::Get().Read("Time", "PTP_Domain", 0)); + wxPtp::Get().AddHandler(this); Bind(wxEVT_CLOCK_TIME, &TimeManager::OnPtpClockSync, this); Bind(wxEVT_CLOCK_REMOVED, &TimeManager::OnPtpClockRemoved, this); @@ -108,12 +108,12 @@ bool TimeManager::PtpSyncFrequency() { m_nPtpSamples++; - auto pLocal = wxPtp::Get().GetLocalClock(m_nPtpDomain); + auto pLocal = wxPtp::Get().GetLocalClock(); if(pLocal) { StopCurrentSync(); - auto pMaster = wxPtp::Get().GetSyncMasterClock(m_nPtpDomain); + auto pMaster = wxPtp::Get().GetSyncMasterClock(); auto offset = pLocal->GetOffset(ptpmonkey::PtpV2Clock::CURRENT);//DoubleToTime(dEstimate); //store the PTP details for use by NMOS etc @@ -150,7 +150,7 @@ bool TimeManager::PtpSyncFrequency() clock_gettime(CLOCK_REALTIME, &tv); pmlLog() << "PTP: Current time now: " << ctime(&tv.tv_sec); } - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; m_bPtpLock = false; } @@ -182,7 +182,7 @@ bool TimeManager::PtpSyncFrequency() return false; } */ - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; std::thread th([this]{ @@ -226,14 +226,14 @@ bool TimeManager::TrySyncToPtp() { m_nPtpSamples++; - auto pLocal = wxPtp::Get().GetLocalClock(m_nPtpDomain); + auto pLocal = wxPtp::Get().GetLocalClock(); if(pLocal) { StopCurrentSync(); - auto pMaster = wxPtp::Get().GetSyncMasterClock(m_nPtpDomain); + auto pMaster = wxPtp::Get().GetSyncMasterClock(); auto offset = pLocal->GetOffset(ptpmonkey::PtpV2Clock::CURRENT);//DoubleToTime(dEstimate); @@ -268,7 +268,7 @@ bool TimeManager::TrySyncToPtp() clock_gettime(CLOCK_REALTIME, &tv); pmlLog() << "PTP: Current time now: " << ctime(&tv.tv_sec); } - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; m_bPtpLock = false; } @@ -301,7 +301,7 @@ bool TimeManager::TrySyncToPtp() pmlLog(pml::LOG_ERROR) << "Failed to set frequency " < TimeManager::GetNtpTracking() void TimeManager::OnPtpClockRemoved(wxCommandEvent& event) { - if(wxPtp::Get().GetSyncMasterClock(m_nPtpDomain) == nullptr && m_eCurrentSync == SYNC_PTP) + if(wxPtp::Get().GetSyncMasterClock() == nullptr && m_eCurrentSync == SYNC_PTP) { pmlLog() << "PTP Sync Master disappeared."; DoSync(); diff --git a/pambase/wmbutton.cpp b/pambase/wmbutton.cpp index 581a6e7d..228774fd 100644 --- a/pambase/wmbutton.cpp +++ b/pambase/wmbutton.cpp @@ -245,7 +245,10 @@ void wmButton::OnLeftDClick(wxMouseEvent& event) void wmButton::OnLeftDown(wxMouseEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } // m_pScroller->MouseDown(event.GetPosition()); diff --git a/pambase/wmkeyboard.cpp b/pambase/wmkeyboard.cpp index 4be31c44..628fe72a 100644 --- a/pambase/wmkeyboard.cpp +++ b/pambase/wmkeyboard.cpp @@ -99,7 +99,10 @@ void wmKeyboard::OnSize(wxSizeEvent& event) void wmKeyboard::OnLeftDown(wxMouseEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } m_itDown = m_lstButtons.end(); for(list