From 0e2a2e49077b79bd52d6c83c5202e452e7eea091 Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Wed, 7 Jan 2009 13:07:31 +0000 Subject: Modified the orkaudio API, adding the record and pause HTTP commands. The record command commences or un-pauses recording while the pause command pauses recording - discarding RTP packets from when the pause command is issued. Both commands require the orkuid and party to be specified as HTTP parameters. Note that this represents a change in the arguments required for the StartCapture function in DLLs. Also added an event streaming feature which streams out all tape messages as they are reported in real-time to a client connected. Clients should connect via HTTP, on port 59150. The port is configurable by setting the parameter EventStreamingServerPort in config.xml git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@590 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkbasecxx/EventStreaming.h | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 orkbasecxx/EventStreaming.h (limited to 'orkbasecxx/EventStreaming.h') diff --git a/orkbasecxx/EventStreaming.h b/orkbasecxx/EventStreaming.h new file mode 100644 index 0000000..da0daa3 --- /dev/null +++ b/orkbasecxx/EventStreaming.h @@ -0,0 +1,68 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ +#include "LogManager.h" +#include "Filter.h" +#include +#include "Utils.h" +#include +#include +#include "boost/shared_ptr.hpp" +#include "ace/Singleton.h" +#include "ace/Thread_Mutex.h" +#include "ace/Thread_Semaphore.h" +#include "AudioCapture.h" +#include "ConfigManager.h" +#include "CapturePluginProxy.h" +#include "AudioTape.h" + +//========================================================== + +class EventStreamingSession +{ +public: + EventStreamingSession(); + + void AddTapeMessage(MessageRef& message); + void GetTapeMessage(MessageRef& message); + int GetNumMessages(); + void WaitForMessages(); +private: + std::list m_messages; + ACE_Thread_Mutex m_mutex; + ACE_Thread_Semaphore m_semaphore; +}; +typedef boost::shared_ptr EventStreamingSessionRef; + +//========================================================== + +class EventStreaming +{ +public: + EventStreaming(); + + void GetLiveSessions(std::list& sessions); + void AddSession(EventStreamingSessionRef& session); + void RemoveSession(EventStreamingSessionRef& session); + int GetNumSessions(); + CStdString GetNewSessionId(); + void AddTapeMessage(MessageRef& message); + +private: + AlphaCounter m_alphaCounter; + ACE_Thread_Mutex m_mutex; + std::list m_sessions; +}; +typedef ACE_Singleton EventStreamingSingleton; + +//========================================================== + -- cgit v1.2.3