summaryrefslogtreecommitdiff
path: root/orkaudio
diff options
context:
space:
mode:
Diffstat (limited to 'orkaudio')
-rw-r--r--orkaudio/BatchProcessing.cpp2
-rw-r--r--orkaudio/CapturePort.cpp10
-rw-r--r--orkaudio/Reporting.cpp21
-rw-r--r--orkaudio/Reporting.h1
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp5
5 files changed, 33 insertions, 6 deletions
diff --git a/orkaudio/BatchProcessing.cpp b/orkaudio/BatchProcessing.cpp
index 2e3ce29..31439af 100644
--- a/orkaudio/BatchProcessing.cpp
+++ b/orkaudio/BatchProcessing.cpp
@@ -12,6 +12,8 @@
*/
#pragma warning( disable: 4786 )
+#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
+
#include "ConfigManager.h"
#include "BatchProcessing.h"
#include "ace/OS_NS_unistd.h"
diff --git a/orkaudio/CapturePort.cpp b/orkaudio/CapturePort.cpp
index 71c5e9d..a1a761c 100644
--- a/orkaudio/CapturePort.cpp
+++ b/orkaudio/CapturePort.cpp
@@ -211,8 +211,8 @@ void CapturePort::AddCaptureEvent(CaptureEventRef eventRef)
audioTapeRef->SetShouldStop(); // force stop of previous tape
}
audioTapeRef.reset(new AudioTape(m_id)); // Create a new tape
- audioTapeRef->AddCaptureEvent(eventRef, false);
- //Reporting::GetInstance()->AddAudioTape(audioTapeRef);
+ audioTapeRef->AddCaptureEvent(eventRef, true);
+
m_audioTapeRef = audioTapeRef;
LOG4CXX_INFO(s_log, "#" + m_id + ": start");
}
@@ -239,8 +239,6 @@ void CapturePort::AddCaptureEvent(CaptureEventRef eventRef)
{
// Notify immediate processing that tape has stopped
ImmediateProcessing::GetInstance()->AddAudioTape(m_audioTapeRef);
- // Reporting needs to send a stop message
- // Reporting::GetInstance()->AddAudioTape(audioTapeRef);
}
else
{
@@ -248,6 +246,10 @@ void CapturePort::AddCaptureEvent(CaptureEventRef eventRef)
LOG4CXX_WARN(s_log, "#" + m_id + ": no audio reported between last start and stop");
}
break;
+ case CaptureEvent::EtEndMetadata:
+ // Now that all metadata has been acquired, we can generate the tape start message
+ Reporting::Instance()->AddAudioTape(audioTapeRef);
+ break;
case CaptureEvent::EtDirection:
case CaptureEvent::EtRemoteParty:
case CaptureEvent::EtLocalParty:
diff --git a/orkaudio/Reporting.cpp b/orkaudio/Reporting.cpp
index 72c3f49..f03a22c 100644
--- a/orkaudio/Reporting.cpp
+++ b/orkaudio/Reporting.cpp
@@ -12,6 +12,8 @@
*/
#pragma warning( disable: 4786 )
+#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
+
#include "ConfigManager.h"
#include "Reporting.h"
#include "LogManager.h"
@@ -29,6 +31,10 @@ void Reporting::Initialize()
TapeProcessorRegistry::instance()->RegisterTapeProcessor(m_singleton);
}
+Reporting* Reporting::Instance()
+{
+ return (Reporting*)m_singleton.get();
+}
Reporting::Reporting()
{
@@ -92,8 +98,16 @@ void Reporting::ThreadHandler(void *args)
MessageRef msgRef;
audioTapeRef->GetMessage(msgRef);
+ TapeMsg* ptapeMsg = (TapeMsg*)msgRef.get();
+ bool startMsg = false;
+
if(msgRef.get() /*&& CONFIG.m_enableReporting*/)
{
+ if(ptapeMsg->m_stage.Equals("START"))
+ {
+ startMsg = true;
+ }
+
CStdString msgAsSingleLineString = msgRef->SerializeSingleLine();
LOG4CXX_INFO(LOG.reportingLog, msgAsSingleLineString);
@@ -126,8 +140,11 @@ void Reporting::ThreadHandler(void *args)
}
else
{
- // Pass the tape to the next processor
- pReporting->RunNextProcessor(audioTapeRef);
+ if(!startMsg)
+ {
+ // Pass the tape to the next processor
+ pReporting->RunNextProcessor(audioTapeRef);
+ }
}
}
else
diff --git a/orkaudio/Reporting.h b/orkaudio/Reporting.h
index e16f647..5f5365e 100644
--- a/orkaudio/Reporting.h
+++ b/orkaudio/Reporting.h
@@ -22,6 +22,7 @@ class Reporting : public TapeProcessor
{
public:
static void Initialize();
+ static Reporting* Instance();
CStdString __CDECL__ GetName();
TapeProcessorRef __CDECL__ Instanciate();
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
index cfeecc8..ec2dd4e 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
@@ -274,6 +274,11 @@ void RtpSession::ReportMetadata()
event->m_type = CaptureEvent::EtRemoteIp;
event->m_value = szRemoteIp;
g_captureEventCallBack(event, m_capturePort);
+
+ // Report end of metadata
+ event.reset(new CaptureEvent());
+ event->m_type = CaptureEvent::EtEndMetadata;
+ g_captureEventCallBack(event, m_capturePort);
}
// Returns false if the packet does not belong to the session (RTP timestamp discontinuity)