├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── install ├── lib ├── libBasicUsageEnvironment.so ├── libPocoFoundation.so ├── libPocoJSON.so ├── libPocoNet.so ├── libPocoUtil.so ├── libPocoXML.so ├── libUsageEnvironment.so ├── libcdxalloc.so ├── libgroupsock.so ├── libliveMedia.so ├── librtmp.so ├── libvdecoder.so ├── libvecore.so └── libvencoder.so ├── src ├── base │ ├── Bytes.cpp │ ├── Bytes.h │ ├── Makefile │ ├── log.h │ ├── utils.c │ └── utils.h ├── camera │ ├── CameraSource.c │ ├── CameraSource.h │ ├── Makefile │ ├── V4L2.c │ ├── V4L2.h │ ├── camera.c │ ├── camera.h │ └── videodev.h ├── encoder │ ├── FLVEncoder.cpp │ ├── FLVEncoder.h │ ├── Makefile │ ├── SpsDecode.cpp │ └── SpsDecode.h ├── exe │ ├── Makefile │ ├── recorder.c │ ├── vlrtmp.cpp │ ├── vlrtsp.cpp │ ├── vlsave.cpp │ └── vlserver.cpp ├── flv │ ├── FLVFileHead.h │ ├── FLVOutPutStream.cpp │ ├── FLVOutPutStream.h │ ├── FLVReader.cpp │ ├── FLVReader.h │ ├── FLVScriptTagBody.cpp │ ├── FLVScriptTagBody.h │ ├── FLVTag.cpp │ ├── FLVTag.h │ ├── FLVTagBody.h │ ├── FLVTagHeader.cpp │ ├── FLVTagHeader.h │ ├── FLVType.h │ ├── FLVVideoTagBody.cpp │ ├── FLVVideoTagBody.h │ ├── Makefile │ ├── amf.h │ └── lang │ │ ├── ECMAArray.cpp │ │ ├── ECMAArray.h │ │ ├── FLVData.h │ │ ├── Makefile │ │ ├── Number.cpp │ │ ├── Number.h │ │ ├── String.cpp │ │ ├── String.h │ │ ├── Struct.cpp │ │ └── Struct.h ├── h264 │ ├── H264NALU.cpp │ ├── H264NALU.h │ ├── H264Reader.cpp │ ├── H264Reader.h │ ├── Makefile │ ├── NetH264Reader.cpp │ └── NetH264Reader.h ├── io │ ├── MediaInputStream.h │ └── MediaOutputStream.h ├── main.cpp ├── media │ ├── Makefile │ ├── videorecorder.c │ ├── videorecorder.h │ ├── water_mark.c │ ├── water_mark.h │ └── water_template.h ├── rtmp │ ├── Makefile │ ├── RTMPOutPutStream.cpp │ └── RTMPOutPutStream.h ├── rtsp │ ├── H264FramedLiveSource.cpp │ ├── H264FramedLiveSource.h │ ├── H264LiveVideoServerMediaSubssion.cpp │ ├── H264LiveVideoServerMediaSubssion.h │ └── Makefile ├── server │ ├── Makefile │ ├── VideoLiveObservable.cpp │ ├── VideoLiveObservable.h │ ├── VideoLiveObserver.cpp │ ├── VideoLiveObserver.h │ ├── VideoLiveServer.cpp │ ├── VideoLiveServer.h │ ├── VideoLiveTCPConnection.cpp │ ├── VideoLiveTCPConnection.h │ └── VideoLiveTCPConnectionFactory.h └── vencoder │ ├── CDX_Debug.h │ ├── CDX_Resource_Manager.h │ ├── cedarv_osal_linux.h │ ├── include_base │ ├── CDX_SystemBase.h │ ├── threads.h │ ├── tmessage.h │ └── tsemaphore.h │ ├── include_camera │ ├── FaceDetectionApi.h │ ├── type_camera.h │ └── vdr_overlay.h │ ├── include_platform │ └── CHIP_A20 │ │ ├── cedardev_api.h │ │ ├── disp │ │ ├── display.h │ │ ├── drv_display.h │ │ ├── drv_display_sun3i.h │ │ └── types.h │ │ ├── mach │ │ ├── clock.h │ │ ├── debug-macro.S │ │ ├── dma.h │ │ ├── entry-macro.S │ │ ├── gpio.h │ │ ├── hardware.h │ │ ├── io.h │ │ ├── irqs.h │ │ ├── memory.h │ │ ├── platform.h │ │ ├── sram.h │ │ ├── system.h │ │ ├── timex.h │ │ ├── uncompress.h │ │ └── vmalloc.h │ │ ├── regulator │ │ ├── consumer.h │ │ ├── driver.h │ │ └── machine.h │ │ └── sys │ │ └── eldk_types.h │ ├── include_system │ ├── cedarx_avs_counter.h │ └── cedarx_hardware.h │ ├── include_vdecoder │ ├── libcedarv.h │ └── libve_typedef.h │ └── include_vencoder │ ├── H264encLibApi.h │ ├── JpgencLibApi.h │ ├── encoder_type.h │ ├── text.h │ └── venc.h ├── third ├── Poco │ ├── ASCIIEncoding.h │ ├── AbstractCache.h │ ├── AbstractDelegate.h │ ├── AbstractEvent.h │ ├── AbstractObserver.h │ ├── AbstractPriorityDelegate.h │ ├── AbstractStrategy.h │ ├── AccessExpirationDecorator.h │ ├── AccessExpireCache.h │ ├── AccessExpireLRUCache.h │ ├── AccessExpireStrategy.h │ ├── ActiveDispatcher.h │ ├── ActiveMethod.h │ ├── ActiveResult.h │ ├── ActiveRunnable.h │ ├── ActiveStarter.h │ ├── Activity.h │ ├── Alignment.h │ ├── Any.h │ ├── ArchiveStrategy.h │ ├── Array.h │ ├── Ascii.h │ ├── AsyncChannel.h │ ├── AtomicCounter.h │ ├── AutoPtr.h │ ├── AutoReleasePool.h │ ├── Base32Decoder.h │ ├── Base32Encoder.h │ ├── Base64Decoder.h │ ├── Base64Encoder.h │ ├── BasicEvent.h │ ├── BinaryReader.h │ ├── BinaryWriter.h │ ├── Buffer.h │ ├── BufferAllocator.h │ ├── BufferedBidirectionalStreamBuf.h │ ├── BufferedStreamBuf.h │ ├── Bugcheck.h │ ├── ByteOrder.h │ ├── Channel.h │ ├── Checksum.h │ ├── ClassLibrary.h │ ├── ClassLoader.h │ ├── Clock.h │ ├── Condition.h │ ├── Config.h │ ├── Configurable.h │ ├── ConsoleChannel.h │ ├── CountingStream.h │ ├── DOM │ │ ├── AbstractContainerNode.h │ │ ├── AbstractNode.h │ │ ├── Attr.h │ │ ├── AttrMap.h │ │ ├── AutoPtr.h │ │ ├── CDATASection.h │ │ ├── CharacterData.h │ │ ├── ChildNodesList.h │ │ ├── Comment.h │ │ ├── DOMBuilder.h │ │ ├── DOMException.h │ │ ├── DOMImplementation.h │ │ ├── DOMObject.h │ │ ├── DOMParser.h │ │ ├── DOMSerializer.h │ │ ├── DOMWriter.h │ │ ├── DTDMap.h │ │ ├── Document.h │ │ ├── DocumentEvent.h │ │ ├── DocumentFragment.h │ │ ├── DocumentType.h │ │ ├── Element.h │ │ ├── ElementsByTagNameList.h │ │ ├── Entity.h │ │ ├── EntityReference.h │ │ ├── Event.h │ │ ├── EventDispatcher.h │ │ ├── EventException.h │ │ ├── EventListener.h │ │ ├── EventTarget.h │ │ ├── MutationEvent.h │ │ ├── NamedNodeMap.h │ │ ├── Node.h │ │ ├── NodeAppender.h │ │ ├── NodeFilter.h │ │ ├── NodeIterator.h │ │ ├── NodeList.h │ │ ├── Notation.h │ │ ├── ProcessingInstruction.h │ │ ├── Text.h │ │ └── TreeWalker.h │ ├── DateTime.h │ ├── DateTimeFormat.h │ ├── DateTimeFormatter.h │ ├── DateTimeParser.h │ ├── Debugger.h │ ├── DefaultStrategy.h │ ├── DeflatingStream.h │ ├── Delegate.h │ ├── DigestEngine.h │ ├── DigestStream.h │ ├── DirectoryIterator.h │ ├── DirectoryIteratorStrategy.h │ ├── DirectoryIterator_UNIX.h │ ├── DirectoryIterator_VMS.h │ ├── DirectoryIterator_WIN32.h │ ├── DirectoryIterator_WIN32U.h │ ├── DirectoryWatcher.h │ ├── Dynamic │ │ ├── Pair.h │ │ ├── Struct.h │ │ ├── Var.h │ │ ├── VarHolder.h │ │ └── VarIterator.h │ ├── DynamicAny.h │ ├── DynamicAnyHolder.h │ ├── DynamicFactory.h │ ├── DynamicStruct.h │ ├── Environment.h │ ├── Environment_UNIX.h │ ├── Environment_VMS.h │ ├── Environment_VX.h │ ├── Environment_WIN32.h │ ├── Environment_WIN32U.h │ ├── Environment_WINCE.h │ ├── Error.h │ ├── ErrorHandler.h │ ├── Event.h │ ├── EventArgs.h │ ├── EventLogChannel.h │ ├── Event_POSIX.h │ ├── Event_VX.h │ ├── Event_WIN32.h │ ├── Exception.h │ ├── ExpirationDecorator.h │ ├── Expire.h │ ├── ExpireCache.h │ ├── ExpireLRUCache.h │ ├── ExpireStrategy.h │ ├── FIFOBuffer.h │ ├── FIFOBufferStream.h │ ├── FIFOEvent.h │ ├── FIFOStrategy.h │ ├── FPEnvironment.h │ ├── FPEnvironment_C99.h │ ├── FPEnvironment_DEC.h │ ├── FPEnvironment_DUMMY.h │ ├── FPEnvironment_SUN.h │ ├── FPEnvironment_WIN32.h │ ├── File.h │ ├── FileChannel.h │ ├── FileStream.h │ ├── FileStreamFactory.h │ ├── FileStream_POSIX.h │ ├── FileStream_WIN32.h │ ├── File_UNIX.h │ ├── File_VMS.h │ ├── File_VX.h │ ├── File_WIN32.h │ ├── File_WIN32U.h │ ├── File_WINCE.h │ ├── Format.h │ ├── Formatter.h │ ├── FormattingChannel.h │ ├── Foundation.h │ ├── FunctionDelegate.h │ ├── FunctionPriorityDelegate.h │ ├── Glob.h │ ├── HMACEngine.h │ ├── Hash.h │ ├── HashFunction.h │ ├── HashMap.h │ ├── HashSet.h │ ├── HashStatistic.h │ ├── HashTable.h │ ├── HexBinaryDecoder.h │ ├── HexBinaryEncoder.h │ ├── InflatingStream.h │ ├── Instantiator.h │ ├── JSON │ │ ├── Array.h │ │ ├── Handler.h │ │ ├── JSON.h │ │ ├── JSONException.h │ │ ├── Object.h │ │ ├── ParseHandler.h │ │ ├── Parser.h │ │ ├── PrintHandler.h │ │ ├── Query.h │ │ ├── Stringifier.h │ │ ├── Template.h │ │ └── TemplateCache.h │ ├── KeyValueArgs.h │ ├── LRUCache.h │ ├── LRUStrategy.h │ ├── Latin1Encoding.h │ ├── Latin2Encoding.h │ ├── Latin9Encoding.h │ ├── LineEndingConverter.h │ ├── LinearHashTable.h │ ├── ListMap.h │ ├── LocalDateTime.h │ ├── LogFile.h │ ├── LogFile_STD.h │ ├── LogFile_VMS.h │ ├── LogFile_WIN32.h │ ├── LogFile_WIN32U.h │ ├── LogStream.h │ ├── Logger.h │ ├── LoggingFactory.h │ ├── LoggingRegistry.h │ ├── MD4Engine.h │ ├── MD5Engine.h │ ├── Manifest.h │ ├── MemoryPool.h │ ├── MemoryStream.h │ ├── Message.h │ ├── MetaObject.h │ ├── MetaProgramming.h │ ├── Mutex.h │ ├── Mutex_POSIX.h │ ├── Mutex_VX.h │ ├── Mutex_WIN32.h │ ├── Mutex_WINCE.h │ ├── NObserver.h │ ├── NamedEvent.h │ ├── NamedEvent_Android.h │ ├── NamedEvent_UNIX.h │ ├── NamedEvent_VMS.h │ ├── NamedEvent_WIN32.h │ ├── NamedEvent_WIN32U.h │ ├── NamedMutex.h │ ├── NamedMutex_Android.h │ ├── NamedMutex_UNIX.h │ ├── NamedMutex_VMS.h │ ├── NamedMutex_WIN32.h │ ├── NamedMutex_WIN32U.h │ ├── NamedTuple.h │ ├── NestedDiagnosticContext.h │ ├── Net │ │ ├── AbstractHTTPRequestHandler.h │ │ ├── DNS.h │ │ ├── DatagramSocket.h │ │ ├── DatagramSocketImpl.h │ │ ├── DialogSocket.h │ │ ├── FTPClientSession.h │ │ ├── FTPStreamFactory.h │ │ ├── FilePartSource.h │ │ ├── HTMLForm.h │ │ ├── HTTPAuthenticationParams.h │ │ ├── HTTPBasicCredentials.h │ │ ├── HTTPBasicStreamBuf.h │ │ ├── HTTPBufferAllocator.h │ │ ├── HTTPChunkedStream.h │ │ ├── HTTPClientSession.h │ │ ├── HTTPCookie.h │ │ ├── HTTPCredentials.h │ │ ├── HTTPDigestCredentials.h │ │ ├── HTTPFixedLengthStream.h │ │ ├── HTTPHeaderStream.h │ │ ├── HTTPIOStream.h │ │ ├── HTTPMessage.h │ │ ├── HTTPRequest.h │ │ ├── HTTPRequestHandler.h │ │ ├── HTTPRequestHandlerFactory.h │ │ ├── HTTPResponse.h │ │ ├── HTTPServer.h │ │ ├── HTTPServerConnection.h │ │ ├── HTTPServerConnectionFactory.h │ │ ├── HTTPServerParams.h │ │ ├── HTTPServerRequest.h │ │ ├── HTTPServerRequestImpl.h │ │ ├── HTTPServerResponse.h │ │ ├── HTTPServerResponseImpl.h │ │ ├── HTTPServerSession.h │ │ ├── HTTPSession.h │ │ ├── HTTPSessionFactory.h │ │ ├── HTTPSessionInstantiator.h │ │ ├── HTTPStream.h │ │ ├── HTTPStreamFactory.h │ │ ├── HostEntry.h │ │ ├── ICMPClient.h │ │ ├── ICMPEventArgs.h │ │ ├── ICMPPacket.h │ │ ├── ICMPPacketImpl.h │ │ ├── ICMPSocket.h │ │ ├── ICMPSocketImpl.h │ │ ├── ICMPv4PacketImpl.h │ │ ├── IPAddress.h │ │ ├── IPAddressImpl.h │ │ ├── MailMessage.h │ │ ├── MailRecipient.h │ │ ├── MailStream.h │ │ ├── MediaType.h │ │ ├── MessageHeader.h │ │ ├── MulticastSocket.h │ │ ├── MultipartReader.h │ │ ├── MultipartWriter.h │ │ ├── NTPClient.h │ │ ├── NTPEventArgs.h │ │ ├── NTPPacket.h │ │ ├── NameValueCollection.h │ │ ├── Net.h │ │ ├── NetException.h │ │ ├── NetworkInterface.h │ │ ├── NullPartHandler.h │ │ ├── OAuth10Credentials.h │ │ ├── OAuth20Credentials.h │ │ ├── POP3ClientSession.h │ │ ├── ParallelSocketAcceptor.h │ │ ├── ParallelSocketReactor.h │ │ ├── PartHandler.h │ │ ├── PartSource.h │ │ ├── PartStore.h │ │ ├── QuotedPrintableDecoder.h │ │ ├── QuotedPrintableEncoder.h │ │ ├── RawSocket.h │ │ ├── RawSocketImpl.h │ │ ├── RemoteSyslogChannel.h │ │ ├── RemoteSyslogListener.h │ │ ├── SMTPChannel.h │ │ ├── SMTPClientSession.h │ │ ├── ServerSocket.h │ │ ├── ServerSocketImpl.h │ │ ├── Socket.h │ │ ├── SocketAcceptor.h │ │ ├── SocketAddress.h │ │ ├── SocketAddressImpl.h │ │ ├── SocketConnector.h │ │ ├── SocketDefs.h │ │ ├── SocketImpl.h │ │ ├── SocketNotification.h │ │ ├── SocketNotifier.h │ │ ├── SocketReactor.h │ │ ├── SocketStream.h │ │ ├── StreamSocket.h │ │ ├── StreamSocketImpl.h │ │ ├── StringPartSource.h │ │ ├── TCPServer.h │ │ ├── TCPServerConnection.h │ │ ├── TCPServerConnectionFactory.h │ │ ├── TCPServerDispatcher.h │ │ ├── TCPServerParams.h │ │ ├── WebSocket.h │ │ └── WebSocketImpl.h │ ├── Notification.h │ ├── NotificationCenter.h │ ├── NotificationQueue.h │ ├── NotificationStrategy.h │ ├── NullChannel.h │ ├── NullStream.h │ ├── Nullable.h │ ├── NumberFormatter.h │ ├── NumberParser.h │ ├── NumericString.h │ ├── ObjectPool.h │ ├── Observer.h │ ├── OpcomChannel.h │ ├── Optional.h │ ├── PBKDF2Engine.h │ ├── Path.h │ ├── Path_UNIX.h │ ├── Path_VMS.h │ ├── Path_WIN32.h │ ├── Path_WIN32U.h │ ├── Path_WINCE.h │ ├── PatternFormatter.h │ ├── Pipe.h │ ├── PipeImpl.h │ ├── PipeImpl_DUMMY.h │ ├── PipeImpl_POSIX.h │ ├── PipeImpl_WIN32.h │ ├── PipeStream.h │ ├── Platform.h │ ├── Platform_POSIX.h │ ├── Platform_VMS.h │ ├── Platform_VX.h │ ├── Platform_WIN32.h │ ├── Poco.h │ ├── PriorityDelegate.h │ ├── PriorityEvent.h │ ├── PriorityExpire.h │ ├── PriorityNotificationQueue.h │ ├── PriorityStrategy.h │ ├── Process.h │ ├── Process_UNIX.h │ ├── Process_VMS.h │ ├── Process_VX.h │ ├── Process_WIN32.h │ ├── Process_WIN32U.h │ ├── Process_WINCE.h │ ├── PurgeStrategy.h │ ├── RWLock.h │ ├── RWLock_Android.h │ ├── RWLock_POSIX.h │ ├── RWLock_VX.h │ ├── RWLock_WIN32.h │ ├── RWLock_WINCE.h │ ├── Random.h │ ├── RandomStream.h │ ├── RecursiveDirectoryIterator.h │ ├── RecursiveDirectoryIteratorImpl.h │ ├── RefCountedObject.h │ ├── RegularExpression.h │ ├── RotateStrategy.h │ ├── Runnable.h │ ├── RunnableAdapter.h │ ├── SAX │ │ ├── Attributes.h │ │ ├── AttributesImpl.h │ │ ├── ContentHandler.h │ │ ├── DTDHandler.h │ │ ├── DeclHandler.h │ │ ├── DefaultHandler.h │ │ ├── EntityResolver.h │ │ ├── EntityResolverImpl.h │ │ ├── ErrorHandler.h │ │ ├── InputSource.h │ │ ├── LexicalHandler.h │ │ ├── Locator.h │ │ ├── LocatorImpl.h │ │ ├── NamespaceSupport.h │ │ ├── SAXException.h │ │ ├── SAXParser.h │ │ ├── WhitespaceFilter.h │ │ ├── XMLFilter.h │ │ ├── XMLFilterImpl.h │ │ └── XMLReader.h │ ├── SHA1Engine.h │ ├── ScopedLock.h │ ├── ScopedUnlock.h │ ├── Semaphore.h │ ├── Semaphore_POSIX.h │ ├── Semaphore_VX.h │ ├── Semaphore_WIN32.h │ ├── SharedLibrary.h │ ├── SharedLibrary_HPUX.h │ ├── SharedLibrary_UNIX.h │ ├── SharedLibrary_VMS.h │ ├── SharedLibrary_VX.h │ ├── SharedLibrary_WIN32.h │ ├── SharedLibrary_WIN32U.h │ ├── SharedMemory.h │ ├── SharedMemory_DUMMY.h │ ├── SharedMemory_POSIX.h │ ├── SharedMemory_WIN32.h │ ├── SharedPtr.h │ ├── SignalHandler.h │ ├── SimpleFileChannel.h │ ├── SimpleHashTable.h │ ├── SingletonHolder.h │ ├── SortedDirectoryIterator.h │ ├── SplitterChannel.h │ ├── Stopwatch.h │ ├── StrategyCollection.h │ ├── StreamChannel.h │ ├── StreamConverter.h │ ├── StreamCopier.h │ ├── StreamTokenizer.h │ ├── StreamUtil.h │ ├── String.h │ ├── StringTokenizer.h │ ├── SynchronizedObject.h │ ├── SyslogChannel.h │ ├── Task.h │ ├── TaskManager.h │ ├── TaskNotification.h │ ├── TeeStream.h │ ├── TemporaryFile.h │ ├── TextBufferIterator.h │ ├── TextConverter.h │ ├── TextEncoding.h │ ├── TextIterator.h │ ├── Thread.h │ ├── ThreadLocal.h │ ├── ThreadPool.h │ ├── ThreadTarget.h │ ├── Thread_POSIX.h │ ├── Thread_VX.h │ ├── Thread_WIN32.h │ ├── Thread_WINCE.h │ ├── TimedNotificationQueue.h │ ├── Timer.h │ ├── Timespan.h │ ├── Timestamp.h │ ├── Timezone.h │ ├── Token.h │ ├── Tuple.h │ ├── TypeList.h │ ├── Types.h │ ├── URI.h │ ├── URIStreamFactory.h │ ├── URIStreamOpener.h │ ├── UTF16Encoding.h │ ├── UTF32Encoding.h │ ├── UTF8Encoding.h │ ├── UTF8String.h │ ├── UTFString.h │ ├── UUID.h │ ├── UUIDGenerator.h │ ├── UnWindows.h │ ├── UnbufferedStreamBuf.h │ ├── Unicode.h │ ├── UnicodeConverter.h │ ├── UniqueAccessExpireCache.h │ ├── UniqueAccessExpireLRUCache.h │ ├── UniqueAccessExpireStrategy.h │ ├── UniqueExpireCache.h │ ├── UniqueExpireLRUCache.h │ ├── UniqueExpireStrategy.h │ ├── Util │ │ ├── AbstractConfiguration.h │ │ ├── Application.h │ │ ├── ConfigurationMapper.h │ │ ├── ConfigurationView.h │ │ ├── FilesystemConfiguration.h │ │ ├── HelpFormatter.h │ │ ├── IniFileConfiguration.h │ │ ├── IntValidator.h │ │ ├── JSONConfiguration.h │ │ ├── LayeredConfiguration.h │ │ ├── LoggingConfigurator.h │ │ ├── LoggingSubsystem.h │ │ ├── MapConfiguration.h │ │ ├── Option.h │ │ ├── OptionCallback.h │ │ ├── OptionException.h │ │ ├── OptionProcessor.h │ │ ├── OptionSet.h │ │ ├── PropertyFileConfiguration.h │ │ ├── RegExpValidator.h │ │ ├── ServerApplication.h │ │ ├── Subsystem.h │ │ ├── SystemConfiguration.h │ │ ├── Timer.h │ │ ├── TimerTask.h │ │ ├── TimerTaskAdapter.h │ │ ├── Units.h │ │ ├── Util.h │ │ ├── Validator.h │ │ ├── WinRegistryConfiguration.h │ │ ├── WinRegistryKey.h │ │ ├── WinService.h │ │ └── XMLConfiguration.h │ ├── ValidArgs.h │ ├── Version.h │ ├── Void.h │ ├── Windows1250Encoding.h │ ├── Windows1251Encoding.h │ ├── Windows1252Encoding.h │ ├── WindowsConsoleChannel.h │ ├── XML │ │ ├── Name.h │ │ ├── NamePool.h │ │ ├── NamespaceStrategy.h │ │ ├── ParserEngine.h │ │ ├── XML.h │ │ ├── XMLException.h │ │ ├── XMLStream.h │ │ ├── XMLString.h │ │ ├── XMLWriter.h │ │ ├── expat.h │ │ └── expat_external.h │ ├── zconf.h │ └── zlib.h ├── librtmp │ ├── COPYING │ ├── Makefile │ ├── amf.c │ ├── amf.h │ ├── bytes.h │ ├── dh.h │ ├── dhgroups.h │ ├── handshake.h │ ├── hashswf.c │ ├── http.h │ ├── librtmp.3 │ ├── librtmp.3.html │ ├── librtmp.pc.in │ ├── log.c │ ├── log.h │ ├── parseurl.c │ ├── rtmp.c │ ├── rtmp.h │ └── rtmp_sys.h └── live555 │ ├── BasicUsageEnvironment │ ├── BasicHashTable.hh │ ├── BasicUsageEnvironment.hh │ ├── BasicUsageEnvironment0.hh │ ├── BasicUsageEnvironment_version.hh │ ├── DelayQueue.hh │ └── HandlerSet.hh │ ├── UsageEnvironment │ ├── Boolean.hh │ ├── HashTable.hh │ ├── UsageEnvironment.hh │ ├── UsageEnvironment_version.hh │ └── strDup.hh │ ├── groupsock │ ├── GroupEId.hh │ ├── Groupsock.hh │ ├── GroupsockHelper.hh │ ├── IOHandlers.hh │ ├── NetAddress.hh │ ├── NetCommon.h │ ├── NetInterface.hh │ ├── TunnelEncaps.hh │ └── groupsock_version.hh │ └── liveMedia │ ├── AC3AudioFileServerMediaSubsession.hh │ ├── AC3AudioRTPSink.hh │ ├── AC3AudioRTPSource.hh │ ├── AC3AudioStreamFramer.hh │ ├── ADTSAudioFileServerMediaSubsession.hh │ ├── ADTSAudioFileSource.hh │ ├── AMRAudioFileServerMediaSubsession.hh │ ├── AMRAudioFileSink.hh │ ├── AMRAudioFileSource.hh │ ├── AMRAudioRTPSink.hh │ ├── AMRAudioRTPSource.hh │ ├── AMRAudioSource.hh │ ├── AVIFileSink.hh │ ├── AudioInputDevice.hh │ ├── AudioRTPSink.hh │ ├── Base64.hh │ ├── BasicUDPSink.hh │ ├── BasicUDPSource.hh │ ├── BitVector.hh │ ├── ByteStreamFileSource.hh │ ├── ByteStreamMemoryBufferSource.hh │ ├── ByteStreamMultiFileSource.hh │ ├── DVVideoFileServerMediaSubsession.hh │ ├── DVVideoRTPSink.hh │ ├── DVVideoRTPSource.hh │ ├── DVVideoStreamFramer.hh │ ├── DarwinInjector.hh │ ├── DeviceSource.hh │ ├── DigestAuthentication.hh │ ├── FileServerMediaSubsession.hh │ ├── FileSink.hh │ ├── FramedFileSource.hh │ ├── FramedFilter.hh │ ├── FramedSource.hh │ ├── GSMAudioRTPSink.hh │ ├── H261VideoRTPSource.hh │ ├── H263plusVideoFileServerMediaSubsession.hh │ ├── H263plusVideoRTPSink.hh │ ├── H263plusVideoRTPSource.hh │ ├── H263plusVideoStreamFramer.hh │ ├── H264VideoFileServerMediaSubsession.hh │ ├── H264VideoFileSink.hh │ ├── H264VideoRTPSink.hh │ ├── H264VideoRTPSource.hh │ ├── H264VideoStreamDiscreteFramer.hh │ ├── H264VideoStreamFramer.hh │ ├── H264or5VideoFileSink.hh │ ├── H264or5VideoRTPSink.hh │ ├── H264or5VideoStreamDiscreteFramer.hh │ ├── H264or5VideoStreamFramer.hh │ ├── H265VideoFileServerMediaSubsession.hh │ ├── H265VideoFileSink.hh │ ├── H265VideoRTPSink.hh │ ├── H265VideoRTPSource.hh │ ├── H265VideoStreamDiscreteFramer.hh │ ├── H265VideoStreamFramer.hh │ ├── InputFile.hh │ ├── JPEGVideoRTPSink.hh │ ├── JPEGVideoRTPSource.hh │ ├── JPEGVideoSource.hh │ ├── Locale.hh │ ├── MP3ADU.hh │ ├── MP3ADURTPSink.hh │ ├── MP3ADURTPSource.hh │ ├── MP3ADUTranscoder.hh │ ├── MP3ADUinterleaving.hh │ ├── MP3AudioFileServerMediaSubsession.hh │ ├── MP3FileSource.hh │ ├── MP3Transcoder.hh │ ├── MPEG1or2AudioRTPSink.hh │ ├── MPEG1or2AudioRTPSource.hh │ ├── MPEG1or2AudioStreamFramer.hh │ ├── MPEG1or2Demux.hh │ ├── MPEG1or2DemuxedElementaryStream.hh │ ├── MPEG1or2DemuxedServerMediaSubsession.hh │ ├── MPEG1or2FileServerDemux.hh │ ├── MPEG1or2VideoFileServerMediaSubsession.hh │ ├── MPEG1or2VideoRTPSink.hh │ ├── MPEG1or2VideoRTPSource.hh │ ├── MPEG1or2VideoStreamDiscreteFramer.hh │ ├── MPEG1or2VideoStreamFramer.hh │ ├── MPEG2IndexFromTransportStream.hh │ ├── MPEG2TransportFileServerMediaSubsession.hh │ ├── MPEG2TransportStreamFramer.hh │ ├── MPEG2TransportStreamFromESSource.hh │ ├── MPEG2TransportStreamFromPESSource.hh │ ├── MPEG2TransportStreamIndexFile.hh │ ├── MPEG2TransportStreamMultiplexor.hh │ ├── MPEG2TransportStreamTrickModeFilter.hh │ ├── MPEG2TransportUDPServerMediaSubsession.hh │ ├── MPEG4ESVideoRTPSink.hh │ ├── MPEG4ESVideoRTPSource.hh │ ├── MPEG4GenericRTPSink.hh │ ├── MPEG4GenericRTPSource.hh │ ├── MPEG4LATMAudioRTPSink.hh │ ├── MPEG4LATMAudioRTPSource.hh │ ├── MPEG4VideoFileServerMediaSubsession.hh │ ├── MPEG4VideoStreamDiscreteFramer.hh │ ├── MPEG4VideoStreamFramer.hh │ ├── MPEGVideoStreamFramer.hh │ ├── MatroskaFile.hh │ ├── MatroskaFileServerDemux.hh │ ├── Media.hh │ ├── MediaSession.hh │ ├── MediaSink.hh │ ├── MediaSource.hh │ ├── MultiFramedRTPSink.hh │ ├── MultiFramedRTPSource.hh │ ├── OggFile.hh │ ├── OggFileServerDemux.hh │ ├── OggFileSink.hh │ ├── OnDemandServerMediaSubsession.hh │ ├── OutputFile.hh │ ├── PassiveServerMediaSubsession.hh │ ├── ProxyServerMediaSession.hh │ ├── QCELPAudioRTPSource.hh │ ├── QuickTimeFileSink.hh │ ├── QuickTimeGenericRTPSource.hh │ ├── RTCP.hh │ ├── RTPInterface.hh │ ├── RTPSink.hh │ ├── RTPSource.hh │ ├── RTSPClient.hh │ ├── RTSPCommon.hh │ ├── RTSPRegisterSender.hh │ ├── RTSPServer.hh │ ├── RTSPServerSupportingHTTPStreaming.hh │ ├── SIPClient.hh │ ├── ServerMediaSession.hh │ ├── SimpleRTPSink.hh │ ├── SimpleRTPSource.hh │ ├── StreamReplicator.hh │ ├── T140TextRTPSink.hh │ ├── TCPStreamSink.hh │ ├── TextRTPSink.hh │ ├── TheoraVideoRTPSink.hh │ ├── TheoraVideoRTPSource.hh │ ├── VP8VideoRTPSink.hh │ ├── VP8VideoRTPSource.hh │ ├── VP9VideoRTPSink.hh │ ├── VP9VideoRTPSource.hh │ ├── VideoRTPSink.hh │ ├── VorbisAudioRTPSink.hh │ ├── VorbisAudioRTPSource.hh │ ├── WAVAudioFileServerMediaSubsession.hh │ ├── WAVAudioFileSource.hh │ ├── liveMedia.hh │ ├── liveMedia_version.hh │ ├── ourMD5.hh │ └── uLawAudioFilter.hh ├── vlrtmp.sh └── vlserver.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .cproject 4 | .project 5 | Debug/ 6 | .DS_Store 7 | .settings/ 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # live 2 | Recorder Camera to RTMP 3 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PROG="live" 4 | PROG_PATH="/data/app/$PROG" 5 | MSG_PREFIX=" *" 6 | echo "$MSG_PREFIX start install $PROG" 7 | 8 | make -j4 9 | 10 | if [ -d "$PROG_PATH" ] ; then 11 | rm -rf $PROG_PATH 12 | fi 13 | 14 | mkdir -p $PROG_PATH 15 | 16 | cp -v -n ./vlrtmp $PROG_PATH/ 17 | cp -v -n ./vlrtmp.sh $PROG_PATH/ 18 | cp -v -n ./vlsave $PROG_PATH/ 19 | cp -v -n ./vlserver $PROG_PATH/ 20 | cp -v -n ./vlserver.sh $PROG_PATH/ 21 | 22 | if [ -f "/usr/bin/vlrtmp" ] ;then 23 | echo "$MSG_PREFIX not need add to /usr/bin" 24 | else 25 | ln -f -s $PROG_PATH/vlrtmp /usr/bin/vlrtmp 26 | fi 27 | 28 | if [ -f "/usr/bin/vlsave" ] ;then 29 | echo "$MSG_PREFIX not need add to /usr/bin" 30 | else 31 | ln -f -s $PROG_PATH/vlsave /usr/bin/vlsave 32 | fi 33 | 34 | if [ -f "/etc/init.d/vlserver" ] ;then 35 | echo "$MSG_PREFIX not need add to /etc/init.d" 36 | else 37 | ln -f -s $PROG_PATH/vlserver.sh /etc/init.d/vlserver 38 | fi 39 | 40 | if [ -f "/etc/init.d/vlrtmp" ] ;then 41 | echo "$MSG_PREFIX not need add to /etc/init.d" 42 | else 43 | ln -f -s $PROG_PATH/vlrtmp.sh /etc/init.d/vlrtmp 44 | fi 45 | 46 | if [ -f "/etc/rc0.d/K30vlserver" ] ; then 47 | echo "$MSG_PREFIX not need add vlserver to boot" 48 | else 49 | update-rc.d vlserver defaults 30 50 | fi 51 | 52 | if [ -f "/etc/rc0.d/K90vlrtmp" ] ; then 53 | echo "$MSG_PREFIX not need add vlrtmp to boot" 54 | else 55 | update-rc.d vlrtmp defaults 90 56 | fi 57 | 58 | 59 | echo "$MSG_PREFIX install sucess $PROG" 60 | 61 | service vlserver start 62 | 63 | sleep 5 64 | 65 | service vlrtmp start 66 | -------------------------------------------------------------------------------- /lib/libBasicUsageEnvironment.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libBasicUsageEnvironment.so -------------------------------------------------------------------------------- /lib/libPocoFoundation.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libPocoFoundation.so -------------------------------------------------------------------------------- /lib/libPocoJSON.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libPocoJSON.so -------------------------------------------------------------------------------- /lib/libPocoNet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libPocoNet.so -------------------------------------------------------------------------------- /lib/libPocoUtil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libPocoUtil.so -------------------------------------------------------------------------------- /lib/libPocoXML.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libPocoXML.so -------------------------------------------------------------------------------- /lib/libUsageEnvironment.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libUsageEnvironment.so -------------------------------------------------------------------------------- /lib/libcdxalloc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libcdxalloc.so -------------------------------------------------------------------------------- /lib/libgroupsock.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libgroupsock.so -------------------------------------------------------------------------------- /lib/libliveMedia.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libliveMedia.so -------------------------------------------------------------------------------- /lib/librtmp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/librtmp.so -------------------------------------------------------------------------------- /lib/libvdecoder.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libvdecoder.so -------------------------------------------------------------------------------- /lib/libvecore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libvecore.so -------------------------------------------------------------------------------- /lib/libvencoder.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/lib/libvencoder.so -------------------------------------------------------------------------------- /src/base/Bytes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * byte.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef BYTE_H_ 9 | #define BYTE_H_ 10 | 11 | #include 12 | 13 | class Bytes 14 | { 15 | private: 16 | char *data; 17 | int length; 18 | int cpostion; 19 | int capacity; 20 | 21 | public: 22 | Bytes(); 23 | Bytes(char*data, int length); 24 | Bytes(int); 25 | virtual ~Bytes(); 26 | char* getData(); 27 | void setData(char* data); 28 | int getLength(); 29 | void setLength(int length); 30 | char get(); 31 | int get(char[], int len); 32 | int getChar(); 33 | int getInt(); 34 | double getDouble(); 35 | long long getLong(); 36 | int postion(); 37 | void postion(int); 38 | bool hasRemaining(); 39 | void clear(); 40 | void put(char); 41 | void put(char*,int); 42 | void put(Bytes*); 43 | void putChar(int); 44 | void putInt(int); 45 | void putDouble(double); 46 | void putLong(long long); 47 | void flip(); 48 | int getCapacity(); 49 | }; 50 | 51 | #endif /* BYTE_H_ */ 52 | -------------------------------------------------------------------------------- /src/base/Makefile: -------------------------------------------------------------------------------- 1 | base_src = src/base/Bytes.cpp src/base/utils.c 2 | 3 | SOURCES += $(base_src) 4 | 5 | base_module += $(patsubst %cpp,%o,$(filter %cpp ,$(base_src))) 6 | base_module +=$(patsubst %c,%o,$(filter %c ,$(base_src))) 7 | -------------------------------------------------------------------------------- /src/base/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * log.h 3 | * 4 | * Created on: 2015年1月27日 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef LOG_H_ 9 | #define LOG_H_ 10 | 11 | #ifndef CPP_DEBUG 12 | #define CPP_DEBUG 1 13 | #endif 14 | 15 | #ifndef C_DEBUG 16 | #define C_DEBUG 1 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | 21 | #if CPP_DEBUG 22 | #define CPPLOG(_STR_) std::cout << __FILE__ << " " << __LINE__ << " " << _STR_ << std::endl 23 | #else 24 | #define CPPLOG(_STR_) ((void)0) 25 | #endif 26 | 27 | #endif /*__cplusplus */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif /* __cplusplus */ 33 | 34 | #if C_DEBUG 35 | #define CLOG(...) \ 36 | ((void)printf("(%s %d) ",__FILE__, __LINE__)); \ 37 | ((void)printf(__VA_ARGS__)); \ 38 | ((void)printf("\n")) 39 | 40 | #else 41 | #define CLOG(...) ((void)0) 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif /* __cplusplus */ 47 | 48 | #endif /* LOG_H_ */ 49 | -------------------------------------------------------------------------------- /src/camera/CameraSource.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMERASOURCE_H 2 | #define CAMERASOURCE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "camera.h" 9 | 10 | typedef int (*CameraDataCallback)(void *cookie, void *data); 11 | 12 | typedef struct CameraDataCallbackType{ 13 | void *cookie; //SimpleRecorder 14 | CameraDataCallback callback; 15 | }CameraDataCallbackType; 16 | 17 | 18 | typedef struct AWCameraDevice 19 | { 20 | void *context; 21 | int (*startCamera)(struct AWCameraDevice *p); 22 | int (*stopCamera)(struct AWCameraDevice *p); 23 | int (*returnFrame)(struct AWCameraDevice *p, int id); 24 | int (*setCameraDatacallback)(struct AWCameraDevice *p, void *cookie, void *callback); 25 | }AWCameraDevice; 26 | 27 | AWCameraDevice *CreateCamera(int width, int height); 28 | void DestroyCamera(AWCameraDevice* camera); 29 | void* getV4L2ctx(AWCameraDevice *p); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif /* __cplusplus */ 34 | 35 | #endif /* CAMERASOURCE_H */ -------------------------------------------------------------------------------- /src/camera/Makefile: -------------------------------------------------------------------------------- 1 | carmer_src = src/camera/V4L2.c src/camera/CameraSource.c src/camera/camera.c 2 | SOURCES += $(carmer_src) 3 | 4 | carmer_module += $(patsubst %cpp,%o,$(filter %cpp ,$(carmer_src))) 5 | carmer_module += $(patsubst %c,%o,$(filter %c ,$(carmer_src))) 6 | -------------------------------------------------------------------------------- /src/camera/camera.h: -------------------------------------------------------------------------------- 1 | #ifndef AW_CAMERA_H 2 | #define AW_CAMERA_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | #include "videodev.h" 8 | 9 | 10 | void *CreateCameraContext(); 11 | void DestroyCameraContext(void* v4l2ctx); 12 | int OpenCamera(void* v4l2ctx); 13 | void CloseCamera(void* v4l2ctx); 14 | 15 | int StartCamera(void* v4l2ctx, int *width, int *height); 16 | int StopCamera(void* v4l2ctx); 17 | 18 | int CameraGetOneframe(void* v4l2ctx, struct v4l2_buffer *buffer); 19 | void CameraReturnOneframe(void* v4l2ctx, int id); 20 | 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif /* __cplusplus */ 25 | 26 | #endif //AW_CAMERA_H 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/encoder/FLVEncoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVEncoder.h 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVENCODER_H_ 9 | #define FLVENCODER_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "../flv/amf.h" 15 | #include "../io/MediaOutputStream.h" 16 | #include "../h264/H264NALU.h" 17 | #include "../h264/H264Reader.h" 18 | #include "../flv/lang/Struct.h" 19 | #include "SpsDecode.h" 20 | 21 | using namespace std; 22 | 23 | #define AVC_PACKAGE 0x0 24 | #define AVC_FRAME 0x1 25 | #define AVC_END 0x2 26 | 27 | class FLVEncoder { 28 | 29 | private: 30 | H264Reader* in; 31 | MediaOutputStream* out; 32 | H264NALU* sps; 33 | H264NALU* pps; 34 | H264NALU* sei; 35 | H264NALU* idr; 36 | bool findSPSPPS; 37 | bool findSEIIDR; 38 | bool checkInAndOut(); 39 | bool closeInAndOut(); 40 | Bytes* buffer; 41 | 42 | protected: 43 | bool encoderSPSPPS(); 44 | bool encoderOnMetaData(); 45 | bool encodeKeyFrame(); 46 | bool encodeFrame(H264NALU*); 47 | bool encodeEndFrame(); 48 | 49 | public: 50 | FLVEncoder(); 51 | FLVEncoder(MediaOutputStream* out); 52 | FLVEncoder(H264Reader* in, MediaOutputStream* out); 53 | virtual ~FLVEncoder(); 54 | void encoder(); 55 | /** 56 | * 编码指定的数据 57 | */ 58 | bool encoder(H264NALU*); 59 | 60 | }; 61 | 62 | #endif /* FLVENCODER_H_ */ 63 | -------------------------------------------------------------------------------- /src/encoder/Makefile: -------------------------------------------------------------------------------- 1 | encode_src +=src/encoder/FLVEncoder.cpp src/encoder/SpsDecode.cpp 2 | 3 | SOURCES += $(encode_src) 4 | 5 | encode_module += $(patsubst %cpp,%o,$(filter %cpp ,$(encode_src))) 6 | encode_module += $(patsubst %c,%o,$(filter %c ,$(encode_src))) 7 | -------------------------------------------------------------------------------- /src/encoder/SpsDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpsDecode.h 3 | * 4 | * Created on: 2014-12-28 5 | * Author: Administrator 6 | */ 7 | 8 | #ifndef SPSDECODE_H_ 9 | #define SPSDECODE_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | char ue(char *pBuff, char nLen, char &nStartBit); 16 | 17 | int u(char BitCount, char * buf, char &nStartBit); 18 | 19 | bool h264_decode_sps(char* buf, int nLen, int &width, int &height); 20 | 21 | #endif /* SPSDECODE_H_ */ 22 | -------------------------------------------------------------------------------- /src/exe/Makefile: -------------------------------------------------------------------------------- 1 | vlserver = src/exe/vlserver.o 2 | vlrtmp = src/exe/vlrtmp.o 3 | vlrtsp = src/exe/vlrtsp.o 4 | vlsave = src/exe/vlsave.o 5 | recorder = src/exe/recorder.o 6 | 7 | SOURCES += src/exe/vlserver.cpp src/exe/vlrtmp.cpp src/exe/vlrtsp.cpp src/exe/vlsave.cpp src/exe/recorder.c -------------------------------------------------------------------------------- /src/exe/recorder.c: -------------------------------------------------------------------------------- 1 | /* 2 | * recorder.c 3 | * 4 | * Created on: Jan 28, 2015 5 | * Author: ouyangfeng 6 | */ 7 | #include 8 | 9 | #include "base/utils.h" 10 | #include "media/videorecorder.h" 11 | 12 | long long t; 13 | int fps = 0; 14 | Video_Recorder *recorder = NULL; 15 | 16 | void cdear(int type, void* cookie, void* data) 17 | { 18 | if (current_time_m() == t) 19 | { 20 | fps++; 21 | } 22 | else 23 | { 24 | printf("fps:%d\n", fps); 25 | fps = 1; 26 | t = current_time_m(); 27 | } 28 | 29 | } 30 | 31 | /* 信号处理例程,其中dunno将会得到信号的值 */ 32 | static void sigroutine(int dunno) 33 | { 34 | stop_video_recorder(recorder); 35 | free(recorder); 36 | recorder = NULL; 37 | return; 38 | } 39 | 40 | void testCamera(void) 41 | { 42 | recorder = create_video_recorder(640, 480); 43 | recorder->setDataCallBack(recorder, (void*) cdear, (void*) cdear); 44 | start_video_recorder(recorder); 45 | } 46 | #ifndef NO_MAIN 47 | int main(int argc, char **argv) 48 | { 49 | t = current_time_m(); 50 | signal(SIGHUP, sigroutine); //* 下面设置三个信号的处理方法 51 | signal(SIGINT, sigroutine); 52 | signal(SIGQUIT, sigroutine); 53 | testCamera(); 54 | return 1; 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /src/exe/vlserver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * test.cpp 3 | * 4 | * Created on: Jan 23, 2015 5 | * Author: ouyangfeng 6 | */ 7 | #include 8 | 9 | #include "server/VideoLiveObservable.h" 10 | #include "server/VideoLiveServer.h" 11 | 12 | using namespace std; 13 | 14 | #include 15 | 16 | #include "base/utils.h" 17 | #include "server/VideoLiveServer.h" 18 | 19 | using namespace std; 20 | 21 | #ifndef NO_MAIN 22 | int main(int argc, char **argv) 23 | { 24 | if (argc < 2) 25 | { 26 | cout << "Uage:" << argv[0] << " [ threads ]" << endl; 27 | exit(0); 28 | } 29 | string pid_path(argv[0]); 30 | pid_path = pid_path + ".pid"; 31 | save_pid(pid_path.c_str()); 32 | VideoLiveObservable* oable = VideoLiveObservable::getInstance(); 33 | VideoLiveServer().run(argc, argv); 34 | VideoLiveObservable::destory(oable); 35 | return 1; 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /src/flv/FLVFileHead.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVFileHead.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVFILEHEAD_H_ 9 | #define FLVFILEHEAD_H_ 10 | 11 | class FLVFileHead 12 | { 13 | 14 | public: 15 | bool havdAudio; 16 | bool haveVideo; 17 | FLVFileHead() 18 | { 19 | havdAudio = false; 20 | haveVideo = false; 21 | } 22 | ; 23 | virtual ~FLVFileHead() 24 | { 25 | havdAudio = false; 26 | haveVideo = false; 27 | } 28 | ; 29 | 30 | }; 31 | 32 | #endif /* FLVFILEHEAD_H_ */ 33 | -------------------------------------------------------------------------------- /src/flv/FLVOutPutStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVOutPutStream.h 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVOUTPUTSTREAM_H_ 9 | #define FLVOUTPUTSTREAM_H_ 10 | 11 | #include 12 | 13 | #include "io/MediaOutputStream.h" 14 | #include "flv/FLVType.h" 15 | #include "flv/FLVTag.h" 16 | #include "flv/FLVTagHeader.h" 17 | #include "flv/FLVScriptTagBody.h" 18 | #include "flv/FLVVideoTagBody.h" 19 | 20 | using namespace std; 21 | 22 | class FLVOutPutStream: public MediaOutputStream 23 | { 24 | 25 | private: 26 | char* filename; 27 | 28 | protected: 29 | ofstream file; 30 | /** 31 | * 写入FLV9个字节的头 32 | */ 33 | bool writeFileHeader(); 34 | unsigned int previousTagSize; 35 | unsigned long timestamp; 36 | virtual bool writeData(char, Bytes*); 37 | 38 | public: 39 | FLVOutPutStream(); 40 | FLVOutPutStream(const char*); 41 | virtual ~FLVOutPutStream(); 42 | virtual bool open(); 43 | virtual bool setParam(Bytes*); 44 | virtual bool writeHeaders(Bytes*); 45 | virtual bool writeFrame(Bytes*, char, unsigned); 46 | virtual bool flush(); 47 | virtual bool close(); 48 | bool writeBytes(const char*, unsigned int); 49 | 50 | }; 51 | 52 | #endif /* FLVOUTPUTSTREAM_H_ */ 53 | -------------------------------------------------------------------------------- /src/flv/FLVReader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVReader.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVREADER_H_ 9 | #define FLVREADER_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "FLVType.h" 16 | #include "FLVFileHead.h" 17 | #include "FLVTag.h" 18 | #include "FLVVideoTagBody.h" 19 | #include "FLVScriptTagBody.h" 20 | 21 | using namespace std; 22 | class FLVReader 23 | { 24 | private: 25 | long long filesize; 26 | ifstream file; 27 | void readFLVTagHeader(FLVTag*); 28 | void readFLVTagBody(FLVTag*); 29 | public: 30 | FLVReader(char*filename); 31 | virtual ~FLVReader(); 32 | void openFile(); 33 | void close(); 34 | FLVFileHead* readFileHead(); 35 | FLVTag* readerTag(); 36 | }; 37 | 38 | #endif /* FLVREADER_H_ */ 39 | -------------------------------------------------------------------------------- /src/flv/FLVScriptTagBody.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVScriptTagBody.cpp 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | #include 8 | 9 | #include "FLVScriptTagBody.h" 10 | 11 | using namespace std; 12 | 13 | FLVScriptTagBody::FLVScriptTagBody() 14 | { 15 | 16 | } 17 | FLVScriptTagBody::~FLVScriptTagBody() 18 | { 19 | } 20 | 21 | void FLVScriptTagBody::decoderBoby(Bytes *bytes) 22 | { 23 | setData(bytes); 24 | obj.decoder(bytes); 25 | } 26 | -------------------------------------------------------------------------------- /src/flv/FLVScriptTagBody.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVScriptTagBody.h 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVSCRIPTTAGBODY_H_ 9 | #define FLVSCRIPTTAGBODY_H_ 10 | 11 | #include "FLVTagBody.h" 12 | #include "lang/Struct.h" 13 | 14 | class FLVScriptTagBody: public FLVTagBody 15 | { 16 | 17 | private: 18 | Struct obj; 19 | 20 | public: 21 | FLVScriptTagBody(); 22 | virtual ~FLVScriptTagBody(); 23 | virtual void decoderBoby(Bytes *bytes); 24 | 25 | }; 26 | 27 | #endif /* FLVSCRIPTTAGBODY_H_ */ 28 | -------------------------------------------------------------------------------- /src/flv/FLVTag.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVTag.cpp 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #include "FLVTag.h" 9 | 10 | //Bytes* FLVTag::encoder() 11 | //{ 12 | // Bytes* bytes = new Bytes(1048510); 13 | // Bytes* header = this->header.encoder(); 14 | // 15 | // bytes->put(header); 16 | // delete header; 17 | // header = NULL; 18 | // bytes->flip(); 19 | // return bytes; 20 | //} 21 | 22 | -------------------------------------------------------------------------------- /src/flv/FLVTag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVTag.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVTAG_H_ 9 | #define FLVTAG_H_ 10 | 11 | #include "FLVTagHeader.h" 12 | #include "FLVTagBody.h" 13 | 14 | class FLVTag 15 | { 16 | 17 | public: 18 | FLVTagHeader header; 19 | FLVTagBody *body; 20 | 21 | virtual ~FLVTag() 22 | { 23 | //std::cout << "~FLVTag" << std::endl; 24 | if (body) 25 | delete body; 26 | body = NULL; 27 | } 28 | //virtual Bytes* encoder(); 29 | 30 | }; 31 | 32 | #endif /* FLVTAG_H_ */ 33 | -------------------------------------------------------------------------------- /src/flv/FLVTagBody.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVTagBody.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVTAGBODY_H_ 9 | #define FLVTAGBODY_H_ 10 | 11 | #include "base/Bytes.h" 12 | #include 13 | 14 | class FLVTagBody 15 | { 16 | 17 | protected: 18 | Bytes* data; 19 | 20 | public: 21 | FLVTagBody() 22 | { 23 | data = NULL; 24 | } 25 | virtual ~FLVTagBody() 26 | { 27 | if (data) 28 | delete data; 29 | } 30 | Bytes* getData() 31 | { 32 | return data; 33 | } 34 | void setData(Bytes* bytes) 35 | { 36 | this->data = bytes; 37 | } 38 | virtual void decoderBoby(Bytes *bytes) = 0; 39 | 40 | }; 41 | 42 | #endif /* FLVTAGBODY_H_ */ 43 | -------------------------------------------------------------------------------- /src/flv/FLVTagHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVTagHeader.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVTAGHEADER_H_ 9 | #define FLVTAGHEADER_H_ 10 | 11 | #include 12 | 13 | #include "base/Bytes.h" 14 | class FLVTagHeader 15 | { 16 | private: 17 | /** 18 | * 1到4个字节为上一个tag的总长度 19 | */ 20 | int previousTagSize; 21 | 22 | /** 23 | * 音频(0x8),视频(0x9),脚本(0x12) 24 | */ 25 | char type; 26 | 27 | /** 28 | * flvbody的长度 29 | */ 30 | int dataLength; 31 | 32 | /** 33 | * 这一帧或者视频的时间戳 34 | */ 35 | int timestamp; 36 | 37 | /** 38 | * 流id(好像总是为0) 39 | */ 40 | int streamid; 41 | public: 42 | FLVTagHeader(); 43 | int getPreviousTagSize() 44 | { 45 | return previousTagSize; 46 | } 47 | 48 | void setPreviousTagSize(int previousTagSize) 49 | { 50 | this->previousTagSize = previousTagSize; 51 | } 52 | 53 | int getType() 54 | { 55 | return type; 56 | } 57 | 58 | void setType(char type) 59 | { 60 | this->type = type; 61 | } 62 | 63 | int getDataLength() 64 | { 65 | return dataLength; 66 | } 67 | 68 | void setDataLength(int dataLength) 69 | { 70 | this->dataLength = dataLength; 71 | } 72 | 73 | int getTimestamp() 74 | { 75 | return timestamp; 76 | } 77 | 78 | void setTimestamp(int timestamp) 79 | { 80 | this->timestamp = timestamp; 81 | } 82 | 83 | int getStreamid() 84 | { 85 | return streamid; 86 | } 87 | 88 | void setStreamid(int streamid) 89 | { 90 | this->streamid = streamid; 91 | } 92 | virtual ~FLVTagHeader(); 93 | void decoder(Bytes *bytes); 94 | virtual Bytes* encoder(); 95 | 96 | }; 97 | 98 | #endif /* FLVTAGHEADER_H_ */ 99 | -------------------------------------------------------------------------------- /src/flv/FLVType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVType.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVTYPE_H_ 9 | #define FLVTYPE_H_ 10 | /** 11 | * 音频(0x8) 12 | */ 13 | #define AUDIO 0x8 14 | 15 | /** 16 | * 视频(0x9) 17 | */ 18 | #define VIDEO 0x9 19 | 20 | /** 21 | * 脚本(0x12) 22 | */ 23 | #define SCRIPT 0x12 24 | 25 | #endif /* FLVTYPE_H_ */ 26 | -------------------------------------------------------------------------------- /src/flv/FLVVideoTagBody.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVVideoTagBody.cpp 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | #include 8 | 9 | #include "FLVVideoTagBody.h" 10 | 11 | using namespace std; 12 | 13 | FLVVideoTagBody::FLVVideoTagBody() 14 | { 15 | 16 | } 17 | FLVVideoTagBody::~FLVVideoTagBody() 18 | { 19 | //cout << "~FLVVideoTagBody" << endl; 20 | } 21 | 22 | void FLVVideoTagBody::decoderBoby(Bytes *bytes) 23 | { 24 | //cout << "decoderBoby" << endl; 25 | setData(bytes); 26 | char video = getData()->get(); 27 | setFrameType(((0xF0 & video) >> 4)); 28 | setCodec((0x0F & video)); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/flv/FLVVideoTagBody.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLVVideoTagBody.h 3 | * 4 | * Created on: 2014-12-19 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef FLVVIDEOTAGBODY_H_ 9 | #define FLVVIDEOTAGBODY_H_ 10 | 11 | #include "FLVTagBody.h" 12 | 13 | class FLVVideoTagBody: public FLVTagBody 14 | { 15 | private: 16 | char frameType; 17 | char codec; 18 | public: 19 | FLVVideoTagBody(); 20 | virtual ~FLVVideoTagBody(); 21 | int getFrameType() 22 | { 23 | return frameType; 24 | } 25 | void setFrameType(char frameType) 26 | { 27 | this->frameType = frameType; 28 | } 29 | 30 | char getCodec() 31 | { 32 | return codec; 33 | } 34 | 35 | void setCodec(char codec) 36 | { 37 | this->codec = codec; 38 | } 39 | void decoderBoby(Bytes *bytes); 40 | }; 41 | 42 | #endif /* FLVVIDEOTAGBODY_H_ */ 43 | -------------------------------------------------------------------------------- /src/flv/Makefile: -------------------------------------------------------------------------------- 1 | flv_src += src/flv/FLVTag.cpp src/flv/FLVScriptTagBody.cpp src/flv/FLVTagHeader.cpp src/flv/FLVVideoTagBody.cpp src/flv/FLVReader.cpp src/flv/FLVOutPutStream.cpp 2 | 3 | SOURCES += $(flv_src) 4 | 5 | flv_module += $(patsubst %cpp,%o,$(filter %cpp ,$(flv_src))) 6 | flv_module += $(patsubst %c,%o,$(filter %c ,$(flv_src))) 7 | -------------------------------------------------------------------------------- /src/flv/lang/ECMAArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ECMAArray.h 3 | * 4 | * Created on: 2014-12-24 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef ECMAARRAY_H_ 9 | #define ECMAARRAY_H_ 10 | 11 | #include 12 | 13 | #include "FLVData.h" 14 | #include "String.h" 15 | #include "Number.h" 16 | 17 | using namespace std; 18 | 19 | class ECMA_Array_Name { 20 | 21 | public: 22 | char* name; 23 | int length; 24 | ECMA_Array_Name() { 25 | name = NULL; 26 | length = 0; 27 | } 28 | ECMA_Array_Name(const char*c) { 29 | this->length = strlen(c); 30 | name = new char[length+1]; 31 | strcpy(name, c); 32 | } 33 | ECMA_Array_Name(char*c, int length) { 34 | name = c; 35 | this->length = length; 36 | } 37 | ~ECMA_Array_Name() { 38 | delete[] name; 39 | name = NULL; 40 | length = 0; 41 | } 42 | 43 | }; 44 | 45 | class ECMA_Array: public FLVData { 46 | 47 | private: 48 | list names; 49 | list values; 50 | 51 | protected: 52 | FLVData* parseString(Bytes*); 53 | FLVData* parseNubmer(Bytes*); 54 | FLVData* parseECMAArray(Bytes*); 55 | FLVData* parseFLVData(Bytes*); 56 | 57 | public: 58 | ECMA_Array(); 59 | virtual ~ECMA_Array(); 60 | virtual char getType(); 61 | virtual void decoder(Bytes*); 62 | virtual void encoder(Bytes*); 63 | void put(const char*, FLVData*); 64 | 65 | }; 66 | 67 | #endif /* ECMAARRAY_H_ */ 68 | -------------------------------------------------------------------------------- /src/flv/lang/Makefile: -------------------------------------------------------------------------------- 1 | lang_src +=src/flv/lang/Number.cpp src/flv/lang/String.cpp src/flv/lang/Struct.cpp src/flv/lang/ECMAArray.cpp 2 | 3 | SOURCES += $(lang_src) 4 | 5 | lang_module += $(patsubst %cpp,%o,$(filter %cpp ,$(lang_src))) 6 | lang_module += $(patsubst %c,%o,$(filter %c ,$(lang_src))) 7 | -------------------------------------------------------------------------------- /src/flv/lang/Number.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Number.cpp 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #include "Number.h" 9 | 10 | using namespace std; 11 | char Number::getType() 12 | { 13 | return NUMBER; 14 | } 15 | 16 | void Number::decoder(Bytes *bytes) 17 | { 18 | if (bytes->hasRemaining()) 19 | { 20 | setNumber(bytes->getDouble()); 21 | } 22 | } 23 | 24 | void Number::encoder(Bytes* bytes) 25 | { 26 | bytes->put(getType()); 27 | bytes->putDouble(number); 28 | } 29 | -------------------------------------------------------------------------------- /src/flv/lang/Number.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Number.h 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef NUMBER_H_ 9 | #define NUMBER_H_ 10 | 11 | #include 12 | 13 | #include "FLVData.h" 14 | 15 | using namespace std; 16 | class Number: public FLVData 17 | { 18 | private: 19 | double number; 20 | public: 21 | Number() 22 | { 23 | number = 0; 24 | } 25 | Number(double number) 26 | { 27 | this->number = number; 28 | } 29 | virtual ~Number() 30 | { 31 | //cout << "Number"<< endl; 32 | number = 0; 33 | } 34 | virtual char getType(); 35 | virtual void decoder(Bytes *bytes); 36 | virtual void encoder(Bytes*); 37 | 38 | double getNumber() 39 | { 40 | return number; 41 | } 42 | 43 | void setNumber(double number) 44 | { 45 | this->number = number; 46 | cout << "Number:" << number << endl; 47 | } 48 | }; 49 | 50 | #endif /* NUMBER_H_ */ 51 | -------------------------------------------------------------------------------- /src/flv/lang/String.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * String.cpp 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #include "String.h" 9 | #include 10 | 11 | using namespace std; 12 | 13 | String::String() { 14 | length = 0; 15 | } 16 | 17 | String::String(const char* string) { 18 | this->length = strlen(string); 19 | this->string = new char[length+1]; 20 | strcpy(this->string, string); 21 | } 22 | 23 | String::~String() { 24 | // cout << "String"<< endl; 25 | if (string) 26 | delete[] string; 27 | string = NULL; 28 | length = 0; 29 | } 30 | 31 | char String::getType() { 32 | return STRING; 33 | } 34 | 35 | void String::decoder(Bytes *bytes) { 36 | if (bytes->hasRemaining()) { 37 | this->length = bytes->getChar(); 38 | string = new char[length + 1]; 39 | int i = 0; 40 | for (; i < length; i++) { 41 | string[i] = bytes->get(); 42 | } 43 | string[length] = '\0'; 44 | std::cout << "cout:" << length << std::endl; 45 | this->string = string; 46 | cout << string << endl; 47 | } 48 | } 49 | 50 | void String::encoder(Bytes *bytes) { 51 | bytes->put(getType()); 52 | bytes->putChar(length); 53 | bytes->put(string, length); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/flv/lang/String.h: -------------------------------------------------------------------------------- 1 | /* 2 | * String.h 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef STRING_H_ 9 | #define STRING_H_ 10 | 11 | #include 12 | 13 | #include "FLVData.h" 14 | 15 | class String: public FLVData 16 | { 17 | private: 18 | char* string; 19 | int length; 20 | 21 | public: 22 | String(); 23 | String(const char*); 24 | virtual ~String(); 25 | /** 26 | * 数据类型 27 | * 28 | * @return 29 | */ 30 | virtual char getType(); 31 | /** 32 | * 解码 33 | * 34 | * @param #defines 35 | */ 36 | virtual void decoder(Bytes *bs); 37 | virtual void encoder(Bytes*); 38 | }; 39 | 40 | #endif /* STRING_H_ */ 41 | -------------------------------------------------------------------------------- /src/flv/lang/Struct.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struct.cpp 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #include "Struct.h" 9 | #include 10 | 11 | Struct::Struct() 12 | { 13 | 14 | } 15 | 16 | Struct::~Struct() 17 | { 18 | // std::cout << "delete Struct "<< this << std::endl; 19 | if (objects.size()) 20 | { 21 | list::iterator it; 22 | for (it = objects.begin(); it != objects.end(); ++it) 23 | { 24 | delete *it; 25 | *it = NULL; 26 | } 27 | } 28 | objects.clear(); 29 | } 30 | 31 | void Struct::put(FLVData* data) 32 | { 33 | objects.push_back(data); 34 | } 35 | 36 | void Struct::decoder(Bytes* bytes) 37 | { 38 | while (bytes->hasRemaining()) 39 | { 40 | objects.push_back(parseFLVData(bytes)); 41 | } 42 | } 43 | 44 | void Struct::encoder(Bytes* bytes) 45 | { 46 | if (objects.size()) 47 | { 48 | list::iterator it; 49 | for (it = objects.begin(); it != objects.end(); ++it) 50 | { 51 | (*it)->encoder(bytes); 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/flv/lang/Struct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struct.h 3 | * 4 | * Created on: 2014-12-20 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef STRUCT_H_ 9 | #define STRUCT_H_ 10 | 11 | #include 12 | 13 | #include "ECMAArray.h" 14 | #include "../FLVTagBody.h" 15 | 16 | using namespace std; 17 | 18 | class Struct: public ECMA_Array 19 | { 20 | 21 | private: 22 | list objects; 23 | 24 | public: 25 | Struct(); 26 | virtual ~Struct(); 27 | virtual void decoder(Bytes*); 28 | virtual void encoder(Bytes*); 29 | virtual void put(FLVData*); 30 | 31 | }; 32 | 33 | #endif /* STRUCT_H_ */ 34 | -------------------------------------------------------------------------------- /src/h264/H264NALU.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * H264NALU.cpp 3 | * 4 | * Created on: 2014-12-18 5 | * Author: maygolf 6 | */ 7 | 8 | #include "H264NALU.h" 9 | #include 10 | 11 | using namespace std; 12 | 13 | H264NALU::H264NALU() : 14 | Bytes(), type(0), time(0) 15 | { 16 | 17 | } 18 | 19 | H264NALU::H264NALU(int capacity) : 20 | Bytes(capacity), type(0), time(0) 21 | { 22 | 23 | } 24 | H264NALU::H264NALU(char*data, int length) : 25 | Bytes(data, length), type(0), time(0) 26 | { 27 | } 28 | 29 | H264NALU::~H264NALU() 30 | { 31 | } 32 | 33 | char H264NALU::getType() 34 | { 35 | return this->type; 36 | } 37 | 38 | void H264NALU::setType(char type) 39 | { 40 | this->type = type; 41 | } 42 | 43 | unsigned H264NALU::getTime() 44 | { 45 | return time; 46 | } 47 | 48 | void H264NALU::setTime(unsigned time) 49 | { 50 | this->time = time; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/h264/H264NALU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * H264NALU.h 3 | * 4 | * Created on: 2014-12-18 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef H264NALU_H_ 9 | #define H264NALU_H_ 10 | 11 | #include 12 | #include 13 | 14 | #define SLICE 0x1 15 | 16 | #define DPA 0x2 17 | 18 | #define DPB 0x3 19 | 20 | #define DPC 0x4 21 | 22 | #define IDR 0x5 23 | 24 | #define SEI 0x6 25 | 26 | #define SPS 0x7 27 | 28 | #define PPS 0x8 29 | 30 | #define AUD 0x9 31 | 32 | #define EOSEQ 0x10 33 | 34 | #define EOSTREAM 0x11 35 | 36 | #define FILL 0x12 37 | 38 | #include "../base/Bytes.h" 39 | 40 | class H264NALU: public Bytes 41 | { 42 | 43 | private: 44 | char type; 45 | unsigned time; 46 | 47 | public: 48 | H264NALU(); 49 | H264NALU(int); 50 | H264NALU(char*data, int length); 51 | virtual ~H264NALU(); 52 | char getType(); 53 | void setType(char type); 54 | unsigned getTime(); 55 | void setTime(unsigned time); 56 | 57 | }; 58 | 59 | #endif /* H264NALU_H_ */ 60 | -------------------------------------------------------------------------------- /src/h264/H264Reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * H264Reader.h 3 | * 4 | * Created on: 2014-12-18 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef H264READER_H_ 9 | #define H264READER_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "../base/utils.h" 18 | #include "H264NALU.h" 19 | #include "../io/MediaInputStream.h" 20 | 21 | #define READ_BUFFER 10240 22 | 23 | using namespace std; 24 | 25 | class H264Reader: public MediaInputStream 26 | { 27 | 28 | protected: 29 | char* filename; 30 | ifstream file; 31 | unsigned oneframetime; 32 | H264NALU* byte; 33 | Bytes* buffer; 34 | bool findNALU(); 35 | 36 | public: 37 | H264Reader(); 38 | H264Reader(char *file, unsigned framerate); 39 | virtual ~H264Reader(); 40 | virtual bool close(); 41 | virtual H264NALU* readH264(); 42 | virtual bool open(); 43 | virtual Bytes* reader(); 44 | 45 | }; 46 | 47 | #endif /* H264READER_H_ */ 48 | -------------------------------------------------------------------------------- /src/h264/Makefile: -------------------------------------------------------------------------------- 1 | h264_src +=src/h264/H264NALU.cpp src/h264/H264Reader.cpp src/h264/NetH264Reader.cpp 2 | 3 | SOURCES += $(h264_src) 4 | 5 | h264_module += $(patsubst %cpp,%o,$(filter %cpp ,$(h264_src))) 6 | h264_module += $(patsubst %c,%o,$(filter %c ,$(h264_src))) -------------------------------------------------------------------------------- /src/h264/NetH264Reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NetH264Reader.h 3 | * 4 | * Created on: 2015年1月26日 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef CLIENT_NETH264READER_H_ 9 | #define CLIENT_NETH264READER_H_ 10 | 11 | #include 12 | 13 | #include "Poco/Net/SocketAddress.h" 14 | #include "Poco/Net/StreamSocket.h" 15 | #include "Poco/Net/SocketStream.h" 16 | #include "Poco/StreamCopier.h" 17 | 18 | #include "H264Reader.h" 19 | 20 | #include 21 | 22 | class NetH264Reader: public H264Reader 23 | { 24 | 25 | private: 26 | Poco::Net::SocketAddress address; 27 | Poco::Net::StreamSocket socket; 28 | Bytes head; 29 | Bytes nalu; 30 | bool readNaluBytes(int length); 31 | bool readBytes(int length); 32 | bool readHeadBytes(int length); 33 | int getHeadBodyLength(); 34 | long long getHeadTime(); 35 | long long pretime; 36 | 37 | public: 38 | NetH264Reader(char*); 39 | virtual ~NetH264Reader(); 40 | virtual bool close(); 41 | virtual bool open(); 42 | virtual H264NALU* readH264(); 43 | }; 44 | 45 | #endif /* CLIENT_NETH264READER_H_ */ 46 | -------------------------------------------------------------------------------- /src/io/MediaInputStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MediaInputStream.h 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef MEDIAINPUTSTREAM_H_ 9 | #define MEDIAINPUTSTREAM_H_ 10 | 11 | #include "../base/Bytes.h" 12 | 13 | class MediaInputStream 14 | { 15 | 16 | public: 17 | virtual ~MediaInputStream() 18 | { 19 | } 20 | ; 21 | virtual bool open() = 0; 22 | virtual Bytes* reader() = 0; 23 | virtual bool close() = 0; 24 | 25 | }; 26 | 27 | #endif /* MEDIAINPUTSTREAM_H_ */ 28 | -------------------------------------------------------------------------------- /src/io/MediaOutputStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MediaOutputStream.h 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef MEDIAOUTPUTSTREAM_H_ 9 | #define MEDIAOUTPUTSTREAM_H_ 10 | 11 | #include "../base/Bytes.h" 12 | 13 | class MediaOutputStream 14 | { 15 | 16 | public: 17 | MediaOutputStream() 18 | { 19 | } 20 | virtual ~MediaOutputStream() 21 | { 22 | }; 23 | virtual bool open() = 0; 24 | virtual bool setParam(Bytes*) = 0; 25 | virtual bool writeHeaders(Bytes*) = 0; 26 | virtual bool writeFrame(Bytes*,char,unsigned) = 0; 27 | virtual bool flush() = 0; 28 | virtual bool close() = 0; 29 | }; 30 | 31 | #endif /* MEDIAOUTPUTSTREAM_H_ */ 32 | -------------------------------------------------------------------------------- /src/media/Makefile: -------------------------------------------------------------------------------- 1 | media_src +=src/media/videorecorder.c src/media/water_mark.c 2 | SOURCES+=$(media_src) 3 | 4 | media_module += $(patsubst %cpp,%o,$(filter %cpp ,$(media_src))) 5 | media_module +=$(patsubst %c,%o,$(filter %c ,$(media_src))) -------------------------------------------------------------------------------- /src/media/water_mark.h: -------------------------------------------------------------------------------- 1 | #ifndef WATER_MARK_H 2 | #define WATER_MARK_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | 9 | typedef struct WaterMark_Template { 10 | 11 | unsigned int width; 12 | unsigned int height; 13 | unsigned char* data; 14 | 15 | } WaterMark_Template; 16 | 17 | typedef struct WaterMark { 18 | 19 | WaterMark_Template* templates[13]; 20 | 21 | } WaterMark; 22 | 23 | int waterMark_init(WaterMark*); 24 | 25 | int waterMark_exit(WaterMark*); 26 | 27 | void waterMarkShowTime(WaterMark* waterMark, unsigned char* src,unsigned int w,unsigned int h, unsigned int x, unsigned int y); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif /* __cplusplus */ 32 | 33 | #endif 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/rtmp/Makefile: -------------------------------------------------------------------------------- 1 | rtmp_src += src/rtmp/RTMPOutPutStream.cpp 2 | 3 | SOURCES += $(rtmp_src) 4 | 5 | rtmp_module += $(patsubst %cpp,%o,$(filter %cpp ,$(rtmp_src))) 6 | rtmp_module += $(patsubst %c,%o,$(filter %c ,$(rtmp_src))) 7 | -------------------------------------------------------------------------------- /src/rtmp/RTMPOutPutStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RTMPOutPutStream.h 3 | * 4 | * Created on: 2014-12-25 5 | * Author: maygolf 6 | */ 7 | 8 | #ifndef RTMPOUTPUTSTREAM_H_ 9 | #define RTMPOUTPUTSTREAM_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "librtmp/rtmp_sys.h" 15 | #include "librtmp/log.h" 16 | 17 | #include "flv/FLVOutPutStream.h" 18 | #include "flv/lang/String.h" 19 | 20 | class RTMPOutPutStream: public FLVOutPutStream 21 | { 22 | 23 | private: 24 | char* url; 25 | bool live; 26 | 27 | protected: 28 | virtual bool sendData(char packet_type, char data_type, Bytes* bytes); 29 | 30 | public: 31 | RTMPOutPutStream(const char*, bool); 32 | virtual ~RTMPOutPutStream(); 33 | virtual bool open(); 34 | virtual bool setParam(Bytes*); 35 | virtual bool writeHeaders(Bytes*); 36 | virtual bool writeFrame(Bytes*, char, unsigned); 37 | virtual bool flush(); 38 | virtual bool close(); 39 | void setUrl(char*); 40 | 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/rtsp/H264FramedLiveSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * H264FramedLiveSource.hh 3 | * 4 | * Created on: 2015��1��22�� 5 | * Author: maygolf 6 | */ 7 | 8 | /* 9 | * Filename: H264FramedLiveSource.hh 10 | * Auther: chenbin 11 | * Create date: 2013/ 1/22 12 | */ 13 | 14 | #ifndef _H264FRAMEDLIVESOURCE_HH 15 | #define _H264FRAMEDLIVESOURCE_HH 16 | 17 | #include 18 | 19 | #include "live555/liveMedia/FramedSource.hh" 20 | 21 | class H264FramedLiveSource: public FramedSource 22 | { 23 | public: 24 | static H264FramedLiveSource* createNew(UsageEnvironment& env, char const* fileName, unsigned preferredFrameSize = 0, unsigned playTimePerFrame = 0); 25 | 26 | protected: 27 | H264FramedLiveSource(UsageEnvironment& env, char const* fileName, unsigned preferredFrameSize, unsigned playTimePerFrame); 28 | // called only by createNew() 29 | ~H264FramedLiveSource(); 30 | 31 | private: 32 | // redefined virtual functions: 33 | virtual void doGetNextFrame(); 34 | int TransportData(unsigned char* to, unsigned maxSize); 35 | 36 | protected: 37 | FILE *fp; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/rtsp/H264LiveVideoServerMediaSubssion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Filename: H264LiveVideoServerMediaSubssion.cpp 3 | * Auther: chenbin 4 | * Create date: 2012/11/29 5 | */ 6 | 7 | #include 8 | #include 9 | #include "live555/liveMedia/H264VideoStreamFramer.hh" 10 | 11 | H264LiveVideoServerMediaSubssion* 12 | H264LiveVideoServerMediaSubssion::createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource) 13 | { 14 | return new H264LiveVideoServerMediaSubssion(env, fileName, reuseFirstSource); 15 | } 16 | 17 | H264LiveVideoServerMediaSubssion::H264LiveVideoServerMediaSubssion(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource) : 18 | H264VideoFileServerMediaSubsession(env, fileName, reuseFirstSource) 19 | { 20 | strcpy(fFileName, fileName); 21 | } 22 | 23 | H264LiveVideoServerMediaSubssion::~H264LiveVideoServerMediaSubssion() 24 | { 25 | } 26 | 27 | FramedSource* H264LiveVideoServerMediaSubssion::createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate) 28 | { 29 | /* Remain to do : assign estBitrate */ 30 | estBitrate = 1000; // kbps, estimate 31 | 32 | // Create the video source: 33 | H264FramedLiveSource* liveSource = H264FramedLiveSource::createNew(envir(), fFileName); 34 | if (liveSource == NULL) 35 | { 36 | return NULL; 37 | } 38 | 39 | // Create a framer for the Video Elementary Stream: 40 | return H264VideoStreamFramer::createNew(envir(), liveSource); 41 | } 42 | -------------------------------------------------------------------------------- /src/rtsp/H264LiveVideoServerMediaSubssion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filename: H264LiveVideoServerMediaSubssion.hh 3 | * Auther: mlj 4 | * Create date: 2013/ 1/22 5 | */ 6 | #ifndef _H264_LIVE_VIDEO_SERVER_MEDIA_SUBSESSION_HH 7 | #define _H264_LIVE_VIDEO_SERVER_MEDIA_SUBSESSION_HH 8 | #include "live555/liveMedia/H264VideoFileServerMediaSubsession.hh" 9 | 10 | class H264LiveVideoServerMediaSubssion: public H264VideoFileServerMediaSubsession 11 | { 12 | 13 | public: 14 | static H264LiveVideoServerMediaSubssion* 15 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 16 | 17 | protected: 18 | // we're a virtual base class 19 | H264LiveVideoServerMediaSubssion(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 20 | ~H264LiveVideoServerMediaSubssion(); 21 | 22 | protected: 23 | // redefined virtual functions 24 | FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate); 25 | public: 26 | char fFileName[100]; 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/rtsp/Makefile: -------------------------------------------------------------------------------- 1 | rtsp_src += src/rtsp/H264FramedLiveSource.cpp src/rtsp/H264LiveVideoServerMediaSubssion.cpp 2 | 3 | SOURCES += $(rtsp_src) 4 | 5 | rtsp_module += $(patsubst %cpp,%o,$(filter %cpp ,$(rtsp_src))) 6 | rtsp_module += $(patsubst %c,%o,$(filter %c ,$(rtsp_src))) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/server/Makefile: -------------------------------------------------------------------------------- 1 | server_src +=src/server/VideoLiveObservable.cpp src/server/VideoLiveObserver.cpp src/server/VideoLiveServer.cpp src/server/VideoLiveTCPConnection.cpp 2 | 3 | SOURCES+=$(server_src) 4 | 5 | server_module += $(patsubst %cpp,%o,$(filter %cpp ,$(server_src))) 6 | server_module += $(patsubst %c,%o,$(filter %c ,$(server_src))) 7 | -------------------------------------------------------------------------------- /src/server/VideoLiveObservable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VideoLiveObservable.h 3 | * 4 | * Created on: Jan 24, 2015 5 | * Author: ouyangfeng 6 | */ 7 | 8 | #ifndef SRC_SERVER_VIDEOLIVEOBSERVABLE_H_ 9 | #define SRC_SERVER_VIDEOLIVEOBSERVABLE_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "base/utils.h" 15 | #include "media/videorecorder.h" 16 | 17 | #include "server/VideoLiveObserver.h" 18 | 19 | using namespace std; 20 | 21 | class VideoLiveObservable 22 | { 23 | 24 | private: 25 | list obables; 26 | Video_Recorder* recorder; 27 | VencSeqHeader seqhead; 28 | pthread_mutex_t mt; 29 | 30 | protected: 31 | VideoLiveObservable(); 32 | virtual ~VideoLiveObservable(); 33 | 34 | public: 35 | static VideoLiveObservable* getInstance(); 36 | static void init(); 37 | static void destory(VideoLiveObservable*); 38 | VencSeqHeader* registerVideoLiveObserver(VideoLiveObserver*); 39 | void unRegisterVideoLiveObserver(VideoLiveObserver*); 40 | void notification(VencOutputBuffer*); 41 | void cpyVencSeqHeader(VencSeqHeader* ); 42 | 43 | }; 44 | 45 | #endif /* SRC_SERVER_VIDEOLIVEOBSERVABLE_H_ */ 46 | -------------------------------------------------------------------------------- /src/server/VideoLiveObserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VideoLiveObserver.h 3 | * 4 | * Created on: Jan 24, 2015 5 | * Author: ouyangfeng 6 | */ 7 | 8 | #ifndef SRC_SERVER_VIDEOLIVEOBSERVER_H_ 9 | #define SRC_SERVER_VIDEOLIVEOBSERVER_H_ 10 | 11 | #include "media/videorecorder.h" 12 | 13 | #define OUTPUT_BUFFER 1024 * 512 14 | 15 | class VideoLiveObserver 16 | { 17 | 18 | protected: 19 | pthread_mutex_t mt; 20 | pthread_cond_t ct; 21 | VencSeqHeader seqhead; 22 | char *buffer; 23 | int bufferLength; 24 | void cpyVencSeqHeader(VencSeqHeader* head); 25 | void cpyVencOutputBuffer(VencOutputBuffer*); 26 | void resetVencOutputBuffer(); 27 | 28 | public: 29 | VideoLiveObserver(); 30 | virtual ~VideoLiveObserver(); 31 | void update(VencOutputBuffer*); 32 | 33 | }; 34 | 35 | #endif /* SRC_SERVER_VIDEOLIVEOBSERVER_H_ */ 36 | -------------------------------------------------------------------------------- /src/server/VideoLiveServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VideoLiveServer.h 3 | * 4 | * Created on: Jan 23, 2015 5 | * Author: ouyangfeng 6 | */ 7 | 8 | #ifndef SRC_SERVER_VIDEOLIVESERVER_H_ 9 | #define SRC_SERVER_VIDEOLIVESERVER_H_ 10 | 11 | #include "Poco/Util/ServerApplication.h" 12 | #include "Poco/Util/Application.h" 13 | 14 | using Poco::Util::ServerApplication; 15 | using Poco::Util::Application; 16 | 17 | class VideoLiveServer: public ServerApplication 18 | { 19 | 20 | public: 21 | VideoLiveServer(); 22 | virtual ~VideoLiveServer(); 23 | void init(); 24 | 25 | protected: 26 | void initialize(Application& self); 27 | void uninitialize(); 28 | int main(const std::vector& args); 29 | 30 | }; 31 | 32 | #endif /* SRC_SERVER_VIDEOLIVESERVER_H_ */ 33 | -------------------------------------------------------------------------------- /src/server/VideoLiveTCPConnection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VideoLiveTCPConnection.h 3 | * 4 | * Created on: Jan 23, 2015 5 | * Author: ouyangfeng 6 | */ 7 | 8 | #ifndef SRC_SERVER_VIDEOLIVETCPCONNECTION_H_ 9 | #define SRC_SERVER_VIDEOLIVETCPCONNECTION_H_ 10 | 11 | #ifndef VLSERVER_HAND 12 | #define VLSERVER_HAND "vlserver" 13 | #endif 14 | 15 | #include "Poco/Net/TCPServerConnection.h" 16 | #include "Poco/Net/StreamSocket.h" 17 | #include 18 | 19 | #include "VideoLiveObserver.h" 20 | #include "VideoLiveObservable.h" 21 | 22 | #include "base/utils.h" 23 | 24 | using namespace Poco::Net; 25 | 26 | class VideoLiveTCPConnection: public TCPServerConnection, public VideoLiveObserver 27 | { 28 | 29 | private: 30 | bool firstI; 31 | 32 | public: 33 | VideoLiveTCPConnection(const StreamSocket& s); 34 | virtual ~VideoLiveTCPConnection() 35 | { 36 | } 37 | void run(); 38 | void doWork(); 39 | bool hand(); 40 | bool sendHeader(); 41 | bool sendData(const void* buffer, int length); 42 | 43 | }; 44 | 45 | #endif /* SRC_SERVER_VIDEOLIVETCPCONNECTION_H_ */ 46 | -------------------------------------------------------------------------------- /src/server/VideoLiveTCPConnectionFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VideoLiveTCPConnectionFactory.h 3 | * 4 | * Created on: Jan 23, 2015 5 | * Author: ouyangfeng 6 | */ 7 | 8 | #ifndef SRC_SERVER_VIDEOLIVETCPCONNECTIONFACTORY_H_ 9 | #define SRC_SERVER_VIDEOLIVETCPCONNECTIONFACTORY_H_ 10 | 11 | #include "Poco/Net/TCPServerConnectionFactory.h" 12 | #include "Poco/Net/TCPServerConnection.h" 13 | #include "Poco/Net/StreamSocket.h" 14 | #include 15 | 16 | #include "server/VideoLiveTCPConnection.h" 17 | 18 | using namespace Poco; 19 | using namespace Poco::Net; 20 | 21 | 22 | class VideoLiveTCPConnectionFactory: public TCPServerConnectionFactory 23 | { 24 | 25 | public: 26 | VideoLiveTCPConnectionFactory() 27 | { 28 | 29 | } 30 | 31 | TCPServerConnection* createConnection(const StreamSocket& socket) 32 | { 33 | return new VideoLiveTCPConnection(socket); 34 | } 35 | 36 | 37 | }; 38 | 39 | 40 | 41 | 42 | #endif /* SRC_SERVER_VIDEOLIVETCPCONNECTIONFACTORY_H_ */ 43 | -------------------------------------------------------------------------------- /src/vencoder/CDX_Debug.h: -------------------------------------------------------------------------------- 1 | #ifndef CDX_Debug_h 2 | #define CDX_Debug_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #ifndef LOG_NDEBUG 9 | #define LOG_NDEBUG 1 10 | #endif 11 | 12 | #if LOG_NDEBUG 13 | #define LOGD(...) ((void)0) 14 | #define LOGE(...) ((void)0) 15 | #else 16 | #define LOGD(...) ((void)printf("D/" LOG_TAG ": ")); \ 17 | ((void)printf("(%d) ", __LINE__)); \ 18 | ((void)printf(__VA_ARGS__)); \ 19 | ((void)printf("\n")) 20 | 21 | #define LOGE(...) ((void)printf("E/" LOG_TAG ": ")); \ 22 | ((void)printf("(%d) ", __LINE__)); \ 23 | ((void)printf(__VA_ARGS__)); \ 24 | ((void)printf("\n")) 25 | #endif 26 | 27 | #if LOG_NDEBUG 28 | #define LOGV(...) ((void)0) 29 | #define LOGI(...) ((void)0) 30 | #define LOGW(...) ((void)0) 31 | 32 | #else 33 | #define LOGV(...) ((void)printf("V/" LOG_TAG ": ")); \ 34 | ((void)printf("(%d) ", __LINE__)); \ 35 | ((void)printf(__VA_ARGS__)); \ 36 | ((void)printf("\n")) 37 | 38 | #define LOGI(...) ((void)printf("I/" LOG_TAG ": ")); \ 39 | ((void)printf("(%d) ", __LINE__)); \ 40 | ((void)printf(__VA_ARGS__)); \ 41 | ((void)printf("\n")) 42 | 43 | #define LOGW(...) ((void)printf("W/" LOG_TAG ": ")); \ 44 | ((void)printf("(%d) ", __LINE__)); \ 45 | ((void)printf(__VA_ARGS__)); \ 46 | ((void)printf("\n")) 47 | 48 | #endif 49 | 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif /* __cplusplus */ 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/vencoder/CDX_Resource_Manager.h: -------------------------------------------------------------------------------- 1 | #ifndef CDXRESOURCEMANAGE_H 2 | #define CDXRESOURCEMANAGE_H 3 | 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | #endif 9 | 10 | typedef enum CEDARV_USAGE 11 | { 12 | CEDARV_UNKNOWN = 0, 13 | CEDARV_ENCODE_BACKGROUND = 1, 14 | CEDARV_DECODE_BACKGROUND = 2, 15 | CEDARV_ENCODE = 3, 16 | CEDARV_DECODE = 4, 17 | }cedarv_usage_t; 18 | 19 | typedef void* ve_mutex_t; 20 | 21 | int ve_mutex_init(ve_mutex_t* mutex, cedarv_usage_t usage); 22 | void ve_mutex_destroy(ve_mutex_t* mutex); 23 | int ve_mutex_lock(ve_mutex_t* mutex); 24 | int ve_mutex_timed_lock(ve_mutex_t* mutex, int64_t timeout_us); 25 | void ve_mutex_unlock(ve_mutex_t* mutex); 26 | 27 | //int RequestCedarVResource(CEDARV_REQUEST_CONTEXT *req_ctx); 28 | //int ReleaseCedarVResource(CEDARV_REQUEST_CONTEXT *req_ctx); 29 | //int RequestCedarVFrameLevel(CEDARV_REQUEST_CONTEXT *request_ctx); 30 | //int ReleaseCedarVFrameLevel(CEDARV_REQUEST_CONTEXT *req_ctx); 31 | //void CedarVMayReset(); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/vencoder/include_base/CDX_SystemBase.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | -- -- 3 | -- CedarX Multimedia Framework -- 4 | -- -- 5 | -- the Multimedia Framework for Linux/Android System -- 6 | -- -- 7 | -- This software is confidential and proprietary and may be used -- 8 | -- only as expressly authorized by a licensing agreement from -- 9 | -- Softwinner Products. -- 10 | -- -- 11 | -- (C) COPYRIGHT 2011 SOFTWINNER PRODUCTS -- 12 | -- ALL RIGHTS RESERVED -- 13 | -- -- 14 | -- The entire notice above must be reproduced -- 15 | -- on all copies and should not be removed. -- 16 | -- -- 17 | *******************************************************************************/ 18 | 19 | #ifndef CDX_SYSTEMBASE_H 20 | #define CDX_SYSTEMBASE_H 21 | 22 | #include 23 | 24 | CDX_S64 CDX_GetNowUs(); 25 | void hexdump(void * buf, CDX_U32 size); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/vencoder/include_base/threads.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | -- -- 3 | -- CedarX Multimedia Framework -- 4 | -- -- 5 | -- the Multimedia Framework for Linux/Android System -- 6 | -- -- 7 | -- This software is confidential and proprietary and may be used -- 8 | -- only as expressly authorized by a licensing agreement from -- 9 | -- Softwinner Products. -- 10 | -- -- 11 | -- (C) COPYRIGHT 2011 SOFTWINNER PRODUCTS -- 12 | -- ALL RIGHTS RESERVED -- 13 | -- -- 14 | -- The entire notice above must be reproduced -- 15 | -- on all copies and should not be removed. -- 16 | -- -- 17 | *******************************************************************************/ 18 | 19 | #ifndef __THREADS_H_8X3E__ 20 | #define __THREADS_H_8X3E__ 21 | 22 | #include 23 | pthread_attr_t cedarx_thread_set_attr(int policy, int priority); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/vencoder/include_camera/FaceDetectionApi.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __FACE_DETECTION_API_H___ 3 | #define __FACE_DETECTION_API_H___ 4 | 5 | #include 6 | 7 | namespace android { 8 | 9 | typedef int (*face_notify_cb)(int cmd, void * data, void *user); 10 | 11 | enum FACE_NOTITY_CMD{ 12 | FACE_NOTITY_CMD_REQUEST_FRAME, 13 | FACE_NOTITY_CMD_RESULT, 14 | FACE_NOTITY_CMD_POSITION, 15 | FACE_NOTITY_CMD_REQUEST_ORIENTION, 16 | }; 17 | 18 | class CFaceDetection; 19 | 20 | enum FACE_OPS_CMD 21 | { 22 | FACE_OPS_CMD_START, 23 | FACE_OPS_CMD_STOP, 24 | FACE_OPS_CMD_REGISTE_USER, 25 | }; 26 | 27 | struct FocusArea_t 28 | { 29 | int x; 30 | int y; 31 | int x1; 32 | int y1; 33 | }; 34 | 35 | struct FaceDetectionDev 36 | { 37 | void * user; 38 | sp priv; 39 | void (*setCallback)(FaceDetectionDev * dev, face_notify_cb cb); 40 | int (*ioctrl)(FaceDetectionDev * dev, int cmd, int para0, int para1); 41 | }; 42 | 43 | extern int CreateFaceDetectionDev(FaceDetectionDev ** dev); 44 | extern void DestroyFaceDetectionDev(FaceDetectionDev * dev); 45 | 46 | } 47 | 48 | #endif // __FACE_DETECTION_API_H__ 49 | -------------------------------------------------------------------------------- /src/vencoder/include_camera/vdr_overlay.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/src/vencoder/include_camera/vdr_overlay.h -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/cedardev_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __CEDARDEV_API_H__ 2 | #define __CEDARDEV_API_H__ 3 | 4 | enum IOCTL_CMD { 5 | IOCTL_UNKOWN = 0x100, 6 | IOCTL_GET_ENV_INFO, 7 | IOCTL_WAIT_VE, 8 | IOCTL_RESET_VE, 9 | IOCTL_ENABLE_VE, 10 | IOCTL_DISABLE_VE, 11 | IOCTL_SET_VE_FREQ, 12 | 13 | IOCTL_CONFIG_AVS2 = 0x200, 14 | IOCTL_GETVALUE_AVS2 , 15 | IOCTL_PAUSE_AVS2 , 16 | IOCTL_START_AVS2 , 17 | IOCTL_RESET_AVS2 , 18 | IOCTL_ADJUST_AVS2, 19 | IOCTL_ENGINE_REQ, 20 | IOCTL_ENGINE_REL, 21 | IOCTL_ENGINE_CHECK_DELAY, 22 | IOCTL_GET_IC_VER, 23 | IOCTL_ADJUST_AVS2_ABS, 24 | IOCTL_FLUSH_CACHE, 25 | IOCTL_SET_REFCOUNT, 26 | IOCTL_FLUSH_CACHE_ALL, 27 | IOCTL_TEST_VERSION, 28 | 29 | IOCTL_READ_REG = 0x300, 30 | IOCTL_WRITE_REG, 31 | }; 32 | 33 | typedef struct CEDARV_ENV_INFOMATION{ 34 | unsigned int phymem_start; 35 | int phymem_total_size; 36 | unsigned int address_macc; 37 | }cedarv_env_info_t; 38 | 39 | enum CEDARX_CACHE_OP { 40 | CEDARX_DCACHE_FLUSH = 0, 41 | CEDARX_DCACHE_CLEAN_FLUSH, 42 | CEDARX_DCACHE_FLUSH_ALL, 43 | }; 44 | 45 | typedef struct cedarv_cache_range_{ 46 | long start; 47 | long end; 48 | }cedarv_cache_range; 49 | 50 | struct cedarv_regop { 51 | unsigned int addr; 52 | unsigned int value; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/disp/drv_display.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/src/vencoder/include_platform/CHIP_A20/disp/drv_display.h -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/disp/drv_display_sun3i.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/src/vencoder/include_platform/CHIP_A20/disp/drv_display_sun3i.h -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/debug-macro.S: -------------------------------------------------------------------------------- 1 | /* arch/arm/mach-versatile/include/mach/debug-macro.S 2 | * 3 | * Debugging macro include header 4 | * 5 | * Copyright (C) 1994-1999 Russell King 6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License version 2 as 10 | * published by the Free Software Foundation. 11 | * 12 | */ 13 | 14 | .macro addruart,rx 15 | mrc p15, 0, \rx, c1, c0 16 | tst \rx, #1 @ MMU enabled? 17 | moveq \rx, #0x10000000 18 | movne \rx, #0xf1000000 @ virtual base 19 | orr \rx, \rx, #0x001F0000 20 | orr \rx, \rx, #0x00001000 21 | .endm 22 | 23 | #include 24 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/entry-macro.S: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-versatile/include/mach/entry-macro.S 3 | * 4 | * Low-level IRQ helper macros for Versatile platforms 5 | * 6 | * This file is licensed under the terms of the GNU General Public 7 | * License version 2. This program is licensed "as is" without any 8 | * warranty of any kind, whether express or implied. 9 | */ 10 | #include 11 | #include 12 | #include 13 | 14 | .macro disable_fiq 15 | .endm 16 | 17 | .macro get_irqnr_preamble, base, tmp 18 | ldr \base, =VA_VIC_BASE @IO_ADDRESS(VERSATILE_VIC_BASE) 19 | .endm 20 | 21 | .macro arch_ret_to_user, tmp1, tmp2 22 | .endm 23 | 24 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 25 | ldr \irqstat, [\base, #0x08] @ get pending status 26 | mov \irqnr, #0 27 | teq \irqstat, #0 28 | beq 1003f 29 | 30 | 1001: tst \irqstat, #15 31 | bne 1002f 32 | add \irqnr, \irqnr, #4 33 | movs \irqstat, \irqstat, lsr #4 34 | bne 1001b 35 | 1002: tst \irqstat, #1 36 | bne 3000f 37 | add \irqnr, \irqnr, #1 38 | movs \irqstat, \irqstat, lsr #1 39 | bne 1002b 40 | 1003: /* EQ will be set if no irqs pending */ 41 | 42 | ldr \irqstat, [\base, #0x0c] @ get pending status 43 | teq \irqstat, #0 44 | beq 3000f 45 | 46 | mov \irqnr, #32 47 | 2001: tst \irqstat, #15 48 | bne 2002f 49 | add \irqnr, \irqnr, #4 50 | movs \irqstat, \irqstat, lsr #4 51 | bne 2001b 52 | 2002: tst \irqstat, #1 53 | bne 3000f 54 | add \irqnr, \irqnr, #1 55 | movs \irqstat, \irqstat, lsr #1 56 | bne 2002b 57 | 58 | 3000: 59 | .endm 60 | 61 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/hardware.h 3 | * 4 | * This file contains the hardware definitions of the Versatile boards. 5 | * 6 | * Copyright (C) 2003 ARM Limited. 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | #ifndef __ASM_ARCH_HARDWARE_H 23 | #define __ASM_ARCH_HARDWARE_H 24 | 25 | #include 26 | #include 27 | 28 | #undef IO_ADDRESS 29 | #define IO_ADDRESS(x) ((x) + 0xf0000000) 30 | #define __io_address(n) __io(IO_ADDRESS(n)) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/io.h 3 | * 4 | * Copyright (C) 2003 ARM Limited 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | #ifndef __ASM_ARM_ARCH_IO_H 21 | #define __ASM_ARM_ARCH_IO_H 22 | 23 | #define IO_SPACE_LIMIT 0xffffffff 24 | 25 | #define __io(a) __typesafe_io(a) 26 | #define __mem_pci(a) (a) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/memory.h 3 | * 4 | * Copyright (C) 2003 ARM Limited 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | #ifndef __ASM_ARCH_MEMORY_H 21 | #define __ASM_ARCH_MEMORY_H 22 | 23 | /* 24 | * Physical DRAM offset. 25 | */ 26 | #define PHYS_OFFSET UL(0x80000000) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/platform.h 3 | * 4 | * Copyright (c) ARM Limited 2003. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | #ifndef __address_h 22 | #define __address_h 1 23 | 24 | //#define SOFTWINNER_UART0_BASE 0x01c21000 /* Uart 0 */ 25 | #define PIO_BASE 0x01c20800 26 | #define IIC_BASE0 0x01c24000 27 | #define IIC_BASE1 0x01c24400 28 | #define CCM_BASE 0x01c20000 29 | #define PIO_BASE 0x01c20800 30 | 31 | 32 | 33 | #endif 34 | 35 | /* END */ 36 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/sram.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/plat-omap/include/mach/sram.h 3 | * 4 | * Interface for functions that need to be run in internal SRAM 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License version 2 as 8 | * published by the Free Software Foundation. 9 | */ 10 | 11 | #ifndef __ARCH_ARM_OMAP_SRAM_H 12 | #define __ARCH_ARM_OMAP_SRAM_H 13 | 14 | extern int __init aw_sram_init(void); 15 | extern void * aw_sram_push(void * start, unsigned long size); 16 | extern void aw_sram_reprogram_clock(int bypass, u32 factor); 17 | 18 | extern unsigned long __aw_sram_reprogram_clock_sz; 19 | extern void __aw_sram_reprogram_clock(int bypass, u32 factor); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/timex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/timex.h 3 | * 4 | * Versatile architecture timex specifications 5 | * 6 | * Copyright (C) 2003 ARM Limited 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #define CLOCK_TICK_RATE (50000000 / 16) 24 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/mach/vmalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arch/arm/mach-softwinner/include/mach/vmalloc.h 3 | * 4 | * Copyright (C) 2003 ARM Limited 5 | * Copyright (C) 2000 Russell King. 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | #define VMALLOC_END (PAGE_OFFSET + 0x18000000) 22 | -------------------------------------------------------------------------------- /src/vencoder/include_platform/CHIP_A20/sys/eldk_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __ELDK_TYPES_H__ 2 | #define __ELDK_TYPES_H__ 3 | 4 | #ifndef __KERNEL__ 5 | #include 6 | typedef sem_t OS_SEM_DATA; 7 | typedef pthread_mutex_t __krnl_event_t; 8 | #endif 9 | 10 | typedef unsigned long long __u64; 11 | typedef unsigned int __u32; 12 | typedef unsigned short __u16; 13 | typedef unsigned char __u8; 14 | typedef signed long long __s64; 15 | typedef signed int __s32; 16 | typedef signed short __s16; 17 | typedef signed char __s8; 18 | typedef signed char __bool; 19 | 20 | //typedef unsigned long long u64; 21 | //typedef unsigned int u32; 22 | //typedef unsigned short u16; 23 | //typedef unsigned char u8; 24 | //typedef signed long long s64; 25 | //typedef signed int s32; 26 | //typedef signed short s16; 27 | //typedef signed char s8; 28 | //typedef signed char bool; 29 | 30 | 31 | #define EPDK_OK 0 32 | #define EPDK_FAIL -1 33 | #define EPDK_TRUE 1 34 | #define EPDK_FALSE 0 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/vencoder/include_system/cedarx_avs_counter.h: -------------------------------------------------------------------------------- 1 | #ifndef CEDARX_AVS_COUNTER_H 2 | #define CEDARX_AVS_COUNTER_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include 9 | typedef struct CedarxAvscounterContext { 10 | long long sample_time; 11 | long long base_time; 12 | int adjust_ratio; 13 | long long system_base_time; 14 | 15 | pthread_mutex_t mutex; 16 | 17 | void (*reset)(struct CedarxAvscounterContext *context); 18 | void (*get_time)(struct CedarxAvscounterContext *context, long long *curr); 19 | void (*get_time_diff)(struct CedarxAvscounterContext *context, long long *diff); 20 | void (*adjust)(struct CedarxAvscounterContext *context, int val); 21 | }CedarxAvscounterContext; 22 | 23 | CedarxAvscounterContext *cedarx_avs_counter_request(); 24 | int cedarx_avs_counter_release(CedarxAvscounterContext *context); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif /* __cplusplus */ 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/vencoder/include_system/cedarx_hardware.h: -------------------------------------------------------------------------------- 1 | #ifndef CEDARX_HARDWARE_H 2 | #define CEDARX_HARDWARE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | extern int cedarx_hardware_init(int mode); 9 | extern int cedarx_hardware_exit(int mode); 10 | extern void cedarx_register_print(char *func, int line); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif /* __cplusplus */ 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/vencoder/include_vencoder/JpgencLibApi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fecloud/live/ac49f9db2d76787f6cbed0070acd8d3be38a1b25/src/vencoder/include_vencoder/JpgencLibApi.h -------------------------------------------------------------------------------- /src/vencoder/include_vencoder/text.h: -------------------------------------------------------------------------------- 1 | #ifndef _TEXT_H 2 | #define _TEXT_H 3 | 4 | #define COLOR_white (0xffffff) 5 | #define COLOR_red (0xff0000) 6 | #define COLOR_green (0x00ff00) 7 | #define COLOR_blue (0x0000ff) 8 | 9 | /********************************************************************** 10 | * name : DrawInit 11 | * desc : 12 | * args : addr: buffer, w: width, h: height, bpp: bit_per_pixel 13 | * retn : 0: successs <0: fail 14 | ***********************************************************************/ 15 | int DrawInit(unsigned char *addr, unsigned int w, unsigned int h, unsigned int bpp); 16 | 17 | /********************************************************************** 18 | * name : DrawString 19 | * desc : draw text at (x, y) 20 | * args : str_utf8-utf8: utf8 string, x,y, color 21 | * retn : 0 22 | ***********************************************************************/ 23 | int DrawString(char *str_utf8, unsigned int x, unsigned int y, int color); 24 | 25 | #endif //ifndef _TEXT_H 26 | -------------------------------------------------------------------------------- /third/Poco/ASCIIEncoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASCIIEncoding.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/ASCIIEncoding.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: ASCIIEncoding 9 | // 10 | // Definition of the ASCIIEncoding class. 11 | // 12 | // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_ASCIIEncoding_INCLUDED 20 | #define Foundation_ASCIIEncoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API ASCIIEncoding: public TextEncoding 31 | /// 7-bit ASCII text encoding. 32 | { 33 | public: 34 | ASCIIEncoding(); 35 | ~ASCIIEncoding(); 36 | const char* canonicalName() const; 37 | bool isA(const std::string& encodingName) const; 38 | const CharacterMap& characterMap() const; 39 | int convert(const unsigned char* bytes) const; 40 | int convert(int ch, unsigned char* bytes, int length) const; 41 | int queryConvert(const unsigned char* bytes, int length) const; 42 | int sequenceLength(const unsigned char* bytes, int length) const; 43 | 44 | private: 45 | static const char* _names[]; 46 | static const CharacterMap _charMap; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_ASCIIEncoding_INCLUDED 54 | -------------------------------------------------------------------------------- /third/Poco/AbstractObserver.h: -------------------------------------------------------------------------------- 1 | // 2 | // AbstractObserver.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/AbstractObserver.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Notifications 8 | // Module: NotificationCenter 9 | // 10 | // Definition of the AbstractObserver class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_AbstractObserver_INCLUDED 20 | #define Foundation_AbstractObserver_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Notification.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API AbstractObserver 31 | /// The base class for all instantiations of 32 | /// the Observer and NObserver template classes. 33 | { 34 | public: 35 | AbstractObserver(); 36 | AbstractObserver(const AbstractObserver& observer); 37 | virtual ~AbstractObserver(); 38 | 39 | AbstractObserver& operator = (const AbstractObserver& observer); 40 | 41 | virtual void notify(Notification* pNf) const = 0; 42 | virtual bool equals(const AbstractObserver& observer) const = 0; 43 | virtual bool accepts(Notification* pNf) const = 0; 44 | virtual AbstractObserver* clone() const = 0; 45 | virtual void disable() = 0; 46 | }; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_AbstractObserver_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/AbstractPriorityDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AbstractPriorityDelegate.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/AbstractPriorityDelegate.h#3 $ 5 | // 6 | // Library: Foundation 7 | // Package: Events 8 | // Module: AbstractPriorityDelegate 9 | // 10 | // Implementation of the AbstractPriorityDelegate template. 11 | // 12 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_AbstractPriorityDelegate_INCLUDED 20 | #define Foundation_AbstractPriorityDelegate_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/AbstractDelegate.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | template 31 | class AbstractPriorityDelegate: public AbstractDelegate 32 | /// Base class for PriorityDelegate and PriorityExpire. 33 | /// 34 | /// Extends AbstractDelegate with a priority value. 35 | { 36 | public: 37 | AbstractPriorityDelegate(int prio): 38 | _priority(prio) 39 | { 40 | } 41 | 42 | AbstractPriorityDelegate(const AbstractPriorityDelegate& del): 43 | AbstractDelegate(del), 44 | _priority(del._priority) 45 | { 46 | } 47 | 48 | virtual ~AbstractPriorityDelegate() 49 | { 50 | } 51 | 52 | int priority() const 53 | { 54 | return _priority; 55 | } 56 | 57 | protected: 58 | int _priority; 59 | }; 60 | 61 | 62 | } // namespace Poco 63 | 64 | 65 | #endif // Foundation_AbstractPriorityDelegate_INCLUDED 66 | -------------------------------------------------------------------------------- /third/Poco/ActiveStarter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActiveStarter.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/ActiveStarter.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: ActiveObjects 9 | // 10 | // Definition of the ActiveStarter class. 11 | // 12 | // Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_ActiveStarter_INCLUDED 20 | #define Foundation_ActiveStarter_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/ThreadPool.h" 25 | #include "Poco/ActiveRunnable.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | template 32 | class ActiveStarter 33 | /// The default implementation of the StarterType 34 | /// policy for ActiveMethod. It starts the method 35 | /// in its own thread, obtained from the default 36 | /// thread pool. 37 | { 38 | public: 39 | static void start(OwnerType* /*pOwner*/, ActiveRunnableBase::Ptr pRunnable) 40 | { 41 | ThreadPool::defaultPool().start(*pRunnable); 42 | pRunnable->duplicate(); // The runnable will release itself. 43 | } 44 | }; 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_ActiveStarter_INCLUDED 51 | -------------------------------------------------------------------------------- /third/Poco/BasicEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // BasicEvent.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/BasicEvent.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Events 8 | // Module: BasicEvent 9 | // 10 | // Implementation of the BasicEvent template. 11 | // 12 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_BasicEvent_INCLUDED 20 | #define Foundation_BasicEvent_INCLUDED 21 | 22 | 23 | #include "Poco/AbstractEvent.h" 24 | #include "Poco/DefaultStrategy.h" 25 | #include "Poco/AbstractDelegate.h" 26 | #include "Poco/Mutex.h" 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | template 33 | class BasicEvent: public AbstractEvent < 34 | TArgs, DefaultStrategy >, 35 | AbstractDelegate, 36 | TMutex 37 | > 38 | /// A BasicEvent uses the DefaultStrategy which 39 | /// invokes delegates in the order they have been registered. 40 | /// 41 | /// Please see the AbstractEvent class template documentation 42 | /// for more information. 43 | { 44 | public: 45 | BasicEvent() 46 | { 47 | } 48 | 49 | ~BasicEvent() 50 | { 51 | } 52 | 53 | private: 54 | BasicEvent(const BasicEvent& e); 55 | BasicEvent& operator = (const BasicEvent& e); 56 | }; 57 | 58 | 59 | } // namespace Poco 60 | 61 | 62 | #endif // Foundation_BasicEvent_INCLUDED 63 | -------------------------------------------------------------------------------- /third/Poco/BufferAllocator.h: -------------------------------------------------------------------------------- 1 | // 2 | // BufferAllocator.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/BufferAllocator.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Streams 8 | // Module: BufferAllocator 9 | // 10 | // Definition of the BufferAllocator class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_BufferAllocator_INCLUDED 20 | #define Foundation_BufferAllocator_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | template 32 | class BufferAllocator 33 | /// The BufferAllocator used if no specific 34 | /// BufferAllocator has been specified. 35 | { 36 | public: 37 | typedef ch char_type; 38 | 39 | static char_type* allocate(std::streamsize size) 40 | { 41 | return new char_type[static_cast(size)]; 42 | } 43 | 44 | static void deallocate(char_type* ptr, std::streamsize /*size*/) throw() 45 | { 46 | delete [] ptr; 47 | } 48 | }; 49 | 50 | 51 | } // namespace Poco 52 | 53 | 54 | #endif // Foundation_BufferAllocator_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/DOM/AttrMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // AttrMap.h 3 | // 4 | // $Id: //poco/1.4/XML/include/Poco/DOM/AttrMap.h#1 $ 5 | // 6 | // Library: XML 7 | // Package: DOM 8 | // Module: DOM 9 | // 10 | // Definition of the AttrMap class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef DOM_AttrMap_INCLUDED 20 | #define DOM_AttrMap_INCLUDED 21 | 22 | 23 | #include "Poco/XML/XML.h" 24 | #include "Poco/DOM/NamedNodeMap.h" 25 | 26 | 27 | namespace Poco { 28 | namespace XML { 29 | 30 | 31 | class Element; 32 | 33 | 34 | class XML_API AttrMap: public NamedNodeMap 35 | // This implementation of NamedNodeMap is 36 | // returned by Element::attributes() 37 | { 38 | public: 39 | Node* getNamedItem(const XMLString& name) const; 40 | Node* setNamedItem(Node* arg); 41 | Node* removeNamedItem(const XMLString& name); 42 | Node* item(unsigned long index) const; 43 | unsigned long length() const; 44 | 45 | Node* getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const; 46 | Node* setNamedItemNS(Node* arg); 47 | Node* removeNamedItemNS(const XMLString& namespaceURI, const XMLString& localName); 48 | 49 | void autoRelease(); 50 | 51 | protected: 52 | AttrMap(Element* pElement); 53 | ~AttrMap(); 54 | 55 | private: 56 | AttrMap(); 57 | 58 | Element* _pElement; 59 | 60 | friend class Element; 61 | }; 62 | 63 | 64 | } } // namespace Poco::XML 65 | 66 | 67 | #endif // DOM_AttrMap_INCLUDED 68 | -------------------------------------------------------------------------------- /third/Poco/DOM/AutoPtr.h: -------------------------------------------------------------------------------- 1 | // 2 | // AutoPtr.h 3 | // 4 | // $Id: //poco/1.4/XML/include/Poco/DOM/AutoPtr.h#1 $ 5 | // 6 | // Library: XML 7 | // Package: DOM 8 | // Module: DOM 9 | // 10 | // Import Poco::AutoPtr into the XML namespace. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef DOM_DOMAutoPtr_INCLUDED 20 | #define DOM_DOMAutoPtr_INCLUDED 21 | 22 | 23 | #include "Poco/XML/XML.h" 24 | #include "Poco/AutoPtr.h" 25 | 26 | 27 | namespace Poco { 28 | namespace XML { 29 | 30 | 31 | using Poco::AutoPtr; 32 | 33 | 34 | } } // namespace Poco::XML 35 | 36 | 37 | #endif // DOM_DOMAutoPtr_INCLUDED 38 | -------------------------------------------------------------------------------- /third/Poco/DOM/ChildNodesList.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChildNodesList.h 3 | // 4 | // $Id: //poco/1.4/XML/include/Poco/DOM/ChildNodesList.h#1 $ 5 | // 6 | // Library: XML 7 | // Package: DOM 8 | // Module: DOM 9 | // 10 | // Definition of the ChildNodesList class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef DOM_ChildNodesList_INCLUDED 20 | #define DOM_ChildNodesList_INCLUDED 21 | 22 | 23 | #include "Poco/XML/XML.h" 24 | #include "Poco/DOM/NodeList.h" 25 | 26 | 27 | namespace Poco { 28 | namespace XML { 29 | 30 | 31 | class XML_API ChildNodesList: public NodeList 32 | // This implementation of NodeList is returned 33 | // by Node::getChildNodes(). 34 | { 35 | public: 36 | Node* item(unsigned long index) const; 37 | unsigned long length() const; 38 | 39 | void autoRelease(); 40 | 41 | protected: 42 | ChildNodesList(const Node* pParent); 43 | ~ChildNodesList(); 44 | 45 | private: 46 | ChildNodesList(); 47 | 48 | const Node* _pParent; 49 | 50 | friend class AbstractNode; 51 | }; 52 | 53 | 54 | } } // namespace Poco::XML 55 | 56 | 57 | #endif // DOM_ChildNodesList_INCLUDED 58 | -------------------------------------------------------------------------------- /third/Poco/DOM/Comment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Comment.h 3 | // 4 | // $Id: //poco/1.4/XML/include/Poco/DOM/Comment.h#1 $ 5 | // 6 | // Library: XML 7 | // Package: DOM 8 | // Module: DOM 9 | // 10 | // Definition of the DOM Comment class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef DOM_Comment_INCLUDED 20 | #define DOM_Comment_INCLUDED 21 | 22 | 23 | #include "Poco/XML/XML.h" 24 | #include "Poco/DOM/CharacterData.h" 25 | #include "Poco/XML/XMLString.h" 26 | 27 | 28 | namespace Poco { 29 | namespace XML { 30 | 31 | 32 | class XML_API Comment: public CharacterData 33 | /// This interface inherits from CharacterData and represents the content of 34 | /// a comment, i.e., all the characters between the starting ''. Note that this is the definition of a comment in XML, and, in practice, 36 | /// HTML, although some HTML tools may implement the full SGML comment structure. 37 | { 38 | public: 39 | // Node 40 | const XMLString& nodeName() const; 41 | unsigned short nodeType() const; 42 | 43 | protected: 44 | Comment(Document* pOwnerDocument, const XMLString& data); 45 | Comment(Document* pOwnerDocument, const Comment& comment); 46 | ~Comment(); 47 | 48 | Node* copyNode(bool deep, Document* pOwnerDocument) const; 49 | 50 | private: 51 | static const XMLString NODE_NAME; 52 | 53 | friend class Document; 54 | }; 55 | 56 | 57 | } } // namespace Poco::XML 58 | 59 | 60 | #endif // DOM_Comment_INCLUDED 61 | -------------------------------------------------------------------------------- /third/Poco/DirectoryIterator_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // DirectoryIterator_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_UNIX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: DirectoryIterator 9 | // 10 | // Definition of the DirectoryIteratorImpl class for UNIX. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DirectoryIterator_UNIX_INCLUDED 20 | #define Foundation_DirectoryIterator_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API DirectoryIteratorImpl 31 | { 32 | public: 33 | DirectoryIteratorImpl(const std::string& path); 34 | ~DirectoryIteratorImpl(); 35 | 36 | void duplicate(); 37 | void release(); 38 | 39 | const std::string& get() const; 40 | const std::string& next(); 41 | 42 | private: 43 | DIR* _pDir; 44 | std::string _current; 45 | int _rc; 46 | }; 47 | 48 | 49 | // 50 | // inlines 51 | // 52 | const std::string& DirectoryIteratorImpl::get() const 53 | { 54 | return _current; 55 | } 56 | 57 | 58 | inline void DirectoryIteratorImpl::duplicate() 59 | { 60 | ++_rc; 61 | } 62 | 63 | 64 | inline void DirectoryIteratorImpl::release() 65 | { 66 | if (--_rc == 0) 67 | delete this; 68 | } 69 | 70 | 71 | } // namespace Poco 72 | 73 | 74 | #endif // Foundation_DirectoryIterator_UNIX_INCLUDED 75 | -------------------------------------------------------------------------------- /third/Poco/DirectoryIterator_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // DirectoryIterator_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_VMS.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: DirectoryIterator 9 | // 10 | // Definition of the DirectoryIteratorImpl class for OpenVMS. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DirectoryIterator_VMS_INCLUDED 20 | #define Foundation_DirectoryIterator_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API DirectoryIteratorImpl 31 | { 32 | public: 33 | DirectoryIteratorImpl(const std::string& path); 34 | ~DirectoryIteratorImpl(); 35 | 36 | void duplicate(); 37 | void release(); 38 | 39 | const std::string& get() const; 40 | const std::string& next(); 41 | 42 | private: 43 | struct FAB _fab; 44 | struct NAM _nam; 45 | std::string _search; 46 | char _spec[255]; 47 | std::string _current; 48 | int _rc; 49 | }; 50 | 51 | 52 | // 53 | // inlines 54 | // 55 | const std::string& DirectoryIteratorImpl::get() const 56 | { 57 | return _current; 58 | } 59 | 60 | 61 | inline void DirectoryIteratorImpl::duplicate() 62 | { 63 | ++_rc; 64 | } 65 | 66 | 67 | inline void DirectoryIteratorImpl::release() 68 | { 69 | if (--_rc == 0) 70 | delete this; 71 | } 72 | 73 | 74 | } // namespace Poco 75 | 76 | 77 | #endif // Foundation_DirectoryIterator_VMS_INCLUDED 78 | -------------------------------------------------------------------------------- /third/Poco/DirectoryIterator_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // DirectoryIterator_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: DirectoryIterator 9 | // 10 | // Definition of the DirectoryIteratorImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DirectoryIterator_WIN32_INCLUDED 20 | #define Foundation_DirectoryIterator_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API DirectoryIteratorImpl 31 | { 32 | public: 33 | DirectoryIteratorImpl(const std::string& path); 34 | ~DirectoryIteratorImpl(); 35 | 36 | void duplicate(); 37 | void release(); 38 | 39 | const std::string& get() const; 40 | const std::string& next(); 41 | 42 | private: 43 | HANDLE _fh; 44 | WIN32_FIND_DATA _fd; 45 | std::string _current; 46 | int _rc; 47 | }; 48 | 49 | 50 | // 51 | // inlines 52 | // 53 | const std::string& DirectoryIteratorImpl::get() const 54 | { 55 | return _current; 56 | } 57 | 58 | 59 | inline void DirectoryIteratorImpl::duplicate() 60 | { 61 | ++_rc; 62 | } 63 | 64 | 65 | inline void DirectoryIteratorImpl::release() 66 | { 67 | if (--_rc == 0) 68 | delete this; 69 | } 70 | 71 | 72 | } // namespace Poco 73 | 74 | 75 | #endif // Foundation_DirectoryIterator_WIN32_INCLUDED 76 | -------------------------------------------------------------------------------- /third/Poco/DirectoryIterator_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // DirectoryIterator_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_WIN32U.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: DirectoryIterator 9 | // 10 | // Definition of the DirectoryIteratorImpl class for WIN32. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DirectoryIterator_WIN32U_INCLUDED 20 | #define Foundation_DirectoryIterator_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API DirectoryIteratorImpl 31 | { 32 | public: 33 | DirectoryIteratorImpl(const std::string& path); 34 | ~DirectoryIteratorImpl(); 35 | 36 | void duplicate(); 37 | void release(); 38 | 39 | const std::string& get() const; 40 | const std::string& next(); 41 | 42 | private: 43 | HANDLE _fh; 44 | WIN32_FIND_DATAW _fd; 45 | std::string _current; 46 | int _rc; 47 | }; 48 | 49 | 50 | // 51 | // inlines 52 | // 53 | const std::string& DirectoryIteratorImpl::get() const 54 | { 55 | return _current; 56 | } 57 | 58 | 59 | inline void DirectoryIteratorImpl::duplicate() 60 | { 61 | ++_rc; 62 | } 63 | 64 | 65 | inline void DirectoryIteratorImpl::release() 66 | { 67 | if (--_rc == 0) 68 | delete this; 69 | } 70 | 71 | 72 | } // namespace Poco 73 | 74 | 75 | #endif // Foundation_DirectoryIterator_WIN32U_INCLUDED 76 | -------------------------------------------------------------------------------- /third/Poco/DynamicAny.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicAny.h 3 | // 4 | // $Id: //poco/svn/Foundation/include/Poco/DynamicAny.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Dynamic 8 | // Module: Var 9 | // 10 | // Forward header for Var class to maintain backward compatibility. 11 | // 12 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DynamicAny_INCLUDED 20 | #define Foundation_DynamicAny_INCLUDED 21 | 22 | //@ deprecated 23 | #include "Poco/Dynamic/Var.h" 24 | 25 | 26 | #endif // Foundation_DynamicAny_INCLUDED 27 | -------------------------------------------------------------------------------- /third/Poco/DynamicAnyHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicAnyHolder.h 3 | // 4 | // $Id: //poco/svn/Foundation/include/Poco/DynamicAnyHolder.h#3 $ 5 | // 6 | // Library: Foundation 7 | // Package: Dynamic 8 | // Module: VarHolder 9 | // 10 | // Forward header for VarHolder class to maintain backward compatibility 11 | // 12 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DynamicAnyHolder_INCLUDED 20 | #define Foundation_DynamicAnyHolder_INCLUDED 21 | 22 | //@ deprecated 23 | #include "Poco/Dynamic/VarHolder.h" 24 | 25 | 26 | #endif // Foundation_DynamicAnyHolder_INCLUDED 27 | -------------------------------------------------------------------------------- /third/Poco/DynamicStruct.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicStruct.h 3 | // 4 | // $Id: //poco/Main/Foundation/include/Poco/DynamicStruct.h#9 $ 5 | // 6 | // Library: Foundation 7 | // Package: Dynamic 8 | // Module: Struct 9 | // 10 | // Forward header for Struct class to maintain backward compatibility. 11 | // 12 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_DynamicStruct_INCLUDED 20 | #define Foundation_DynamicStruct_INCLUDED 21 | 22 | //@ deprecated 23 | #include "Poco/Dynamic/Struct.h" 24 | 25 | 26 | #endif // Foundation_DynamicStruct_INCLUDED 27 | -------------------------------------------------------------------------------- /third/Poco/Environment_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Environment_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Environment_UNIX.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Environment 9 | // 10 | // Definition of the EnvironmentImpl class for Unix. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Environment_UNIX_INCLUDED 20 | #define Foundation_Environment_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API EnvironmentImpl 32 | { 33 | public: 34 | typedef UInt8 NodeId[6]; /// Ethernet address. 35 | 36 | static std::string getImpl(const std::string& name); 37 | static bool hasImpl(const std::string& name); 38 | static void setImpl(const std::string& name, const std::string& value); 39 | static std::string osNameImpl(); 40 | static std::string osDisplayNameImpl(); 41 | static std::string osVersionImpl(); 42 | static std::string osArchitectureImpl(); 43 | static std::string nodeNameImpl(); 44 | static void nodeIdImpl(NodeId& id); 45 | static unsigned processorCountImpl(); 46 | 47 | private: 48 | typedef std::map StringMap; 49 | 50 | static StringMap _map; 51 | static FastMutex _mutex; 52 | }; 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_Environment_UNIX_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Environment_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Environment_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Environment_VMS.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Environment 9 | // 10 | // Definition of the EnvironmentImpl class for OpenVMS. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Environment_VMS_INCLUDED 20 | #define Foundation_Environment_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API EnvironmentImpl 31 | { 32 | public: 33 | typedef UInt8 NodeId[6]; /// Ethernet address. 34 | 35 | static std::string getImpl(const std::string& name); 36 | static bool hasImpl(const std::string& name); 37 | static void setImpl(const std::string& name, const std::string& value); 38 | static std::string osNameImpl(); 39 | static std::string osDisplayNameImpl(); 40 | static std::string osVersionImpl(); 41 | static std::string osArchitectureImpl(); 42 | static std::string nodeNameImpl(); 43 | static void nodeIdImpl(NodeId& id); 44 | static unsigned processorCountImpl(); 45 | 46 | static std::string getsyi(unsigned short code); 47 | /// a wrapper for $GETSYIW 48 | 49 | static std::string trnlnm(const std::string& name); 50 | 51 | private: 52 | static FastMutex _mutex; 53 | }; 54 | 55 | 56 | } // namespace Poco 57 | 58 | 59 | #endif // Foundation_Environment_VMS_INCLUDED 60 | -------------------------------------------------------------------------------- /third/Poco/Environment_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Environment_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Environment_VX.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Environment 9 | // 10 | // Definition of the EnvironmentImpl class for VxWorks. 11 | // 12 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Environment_VX_INCLUDED 20 | #define Foundation_Environment_VX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API EnvironmentImpl 32 | { 33 | public: 34 | typedef UInt8 NodeId[6]; /// Ethernet address. 35 | 36 | static std::string getImpl(const std::string& name); 37 | static bool hasImpl(const std::string& name); 38 | static void setImpl(const std::string& name, const std::string& value); 39 | static std::string osNameImpl(); 40 | static std::string osDisplayNameImpl(); 41 | static std::string osVersionImpl(); 42 | static std::string osArchitectureImpl(); 43 | static std::string nodeNameImpl(); 44 | static void nodeIdImpl(NodeId& id); 45 | static unsigned processorCountImpl(); 46 | 47 | private: 48 | typedef std::map StringMap; 49 | 50 | static StringMap _map; 51 | static FastMutex _mutex; 52 | }; 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_Environment_VX_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Environment_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Environment_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Environment_WIN32.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Environment 9 | // 10 | // Definition of the EnvironmentImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Environment_WIN32_INCLUDED 20 | #define Foundation_Environment_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API EnvironmentImpl 30 | { 31 | public: 32 | typedef UInt8 NodeId[6]; /// Ethernet address. 33 | 34 | static std::string getImpl(const std::string& name); 35 | static bool hasImpl(const std::string& name); 36 | static void setImpl(const std::string& name, const std::string& value); 37 | static std::string osNameImpl(); 38 | static std::string osDisplayNameImpl(); 39 | static std::string osVersionImpl(); 40 | static std::string osArchitectureImpl(); 41 | static std::string nodeNameImpl(); 42 | static void nodeIdImpl(NodeId& id); 43 | static unsigned processorCountImpl(); 44 | }; 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_Environment_WIN32_INCLUDED 51 | -------------------------------------------------------------------------------- /third/Poco/Environment_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // Environment_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Environment_WIN32U.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Environment 9 | // 10 | // Definition of the EnvironmentImpl class for WIN32. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Environment_WIN32U_INCLUDED 20 | #define Foundation_Environment_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API EnvironmentImpl 30 | { 31 | public: 32 | typedef UInt8 NodeId[6]; /// Ethernet address. 33 | 34 | static std::string getImpl(const std::string& name); 35 | static bool hasImpl(const std::string& name); 36 | static void setImpl(const std::string& name, const std::string& value); 37 | static std::string osNameImpl(); 38 | static std::string osDisplayNameImpl(); 39 | static std::string osVersionImpl(); 40 | static std::string osArchitectureImpl(); 41 | static std::string nodeNameImpl(); 42 | static void nodeIdImpl(NodeId& id); 43 | static unsigned processorCountImpl(); 44 | }; 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_Environment_WIN32U_INCLUDED 51 | -------------------------------------------------------------------------------- /third/Poco/Error.h: -------------------------------------------------------------------------------- 1 | // 2 | // Error.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Error.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Error 9 | // 10 | // Definition of the Error class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Error_INCLUDED 20 | #define Foundation_Error_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API Error 30 | /// The Error class provides utility functions 31 | /// for error reporting. 32 | { 33 | public: 34 | 35 | #ifdef POCO_OS_FAMILY_WINDOWS 36 | static DWORD last(); 37 | /// Utility function returning the last error. 38 | 39 | static std::string getMessage(DWORD errorCode); 40 | /// Utility function translating numeric error code to string. 41 | #else 42 | static int last(); 43 | /// Utility function returning the last error. 44 | 45 | static std::string getMessage(int errorCode); 46 | /// Utility function translating numeric error code to string. 47 | #endif 48 | }; 49 | 50 | 51 | } // namespace Poco 52 | 53 | 54 | #endif // Foundation_Error_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/EventArgs.h: -------------------------------------------------------------------------------- 1 | // 2 | // EventArgs.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/EventArgs.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Events 8 | // Module: EventArgs 9 | // 10 | // Definition of EventArgs. 11 | // 12 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_EventArgs_INCLUDED 20 | #define Foundation_EventArgs_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API EventArgs 30 | /// The purpose of the EventArgs class is to be used as parameter 31 | /// when one doesn't want to send any data. 32 | /// 33 | /// One can use EventArgs as a base class for one's own event arguments 34 | /// but with the arguments being a template parameter this is not 35 | /// necessary. 36 | { 37 | public: 38 | EventArgs(); 39 | 40 | virtual ~EventArgs(); 41 | }; 42 | 43 | 44 | } // namespace Poco 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /third/Poco/Event_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Event_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Event_VX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Event 9 | // 10 | // Definition of the EventImpl class for VxWorks. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Event_VX_INCLUDED 20 | #define Foundation_Event_VX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API EventImpl 32 | { 33 | protected: 34 | EventImpl(bool autoReset); 35 | ~EventImpl(); 36 | void setImpl(); 37 | void waitImpl(); 38 | bool waitImpl(long milliseconds); 39 | void resetImpl(); 40 | 41 | private: 42 | bool _auto; 43 | volatile bool _state; 44 | SEM_ID _sem; 45 | }; 46 | 47 | 48 | } // namespace Poco 49 | 50 | 51 | #endif // Foundation_Event_VX_INCLUDED 52 | -------------------------------------------------------------------------------- /third/Poco/Event_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Event_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Event_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Event 9 | // 10 | // Definition of the EventImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Event_WIN32_INCLUDED 20 | #define Foundation_Event_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API EventImpl 32 | { 33 | protected: 34 | EventImpl(bool autoReset); 35 | ~EventImpl(); 36 | void setImpl(); 37 | void waitImpl(); 38 | bool waitImpl(long milliseconds); 39 | void resetImpl(); 40 | 41 | private: 42 | HANDLE _event; 43 | }; 44 | 45 | 46 | // 47 | // inlines 48 | // 49 | inline void EventImpl::setImpl() 50 | { 51 | if (!SetEvent(_event)) 52 | { 53 | throw SystemException("cannot signal event"); 54 | } 55 | } 56 | 57 | 58 | inline void EventImpl::resetImpl() 59 | { 60 | if (!ResetEvent(_event)) 61 | { 62 | throw SystemException("cannot reset event"); 63 | } 64 | } 65 | 66 | 67 | } // namespace Poco 68 | 69 | 70 | #endif // Foundation_Event_WIN32_INCLUDED 71 | -------------------------------------------------------------------------------- /third/Poco/FIFOEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // FIFOEvent.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/FIFOEvent.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Events 8 | // Module: FIFOEvent 9 | // 10 | // Implementation of the FIFOEvent template. 11 | // 12 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_FIFOEvent_INCLUDED 20 | #define Foundation_FIFOEvent_INCLUDED 21 | 22 | 23 | #include "Poco/AbstractEvent.h" 24 | #include "Poco/FIFOStrategy.h" 25 | #include "Poco/AbstractDelegate.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | //@ deprecated 32 | template 33 | class FIFOEvent: public AbstractEvent < 34 | TArgs, 35 | FIFOStrategy >, 36 | AbstractDelegate, 37 | TMutex 38 | > 39 | /// A FIFOEvent uses internally a FIFOStrategy which guarantees 40 | /// that delegates are invoked in the order they were added to 41 | /// the event. 42 | /// 43 | /// Note that as of release 1.4.2, this is the default behavior 44 | /// implemented by BasicEvent, so this class is provided 45 | /// for backwards compatibility only. 46 | { 47 | public: 48 | FIFOEvent() 49 | { 50 | } 51 | 52 | ~FIFOEvent() 53 | { 54 | } 55 | 56 | private: 57 | FIFOEvent(const FIFOEvent& e); 58 | FIFOEvent& operator = (const FIFOEvent& e); 59 | }; 60 | 61 | 62 | } // namespace Poco 63 | 64 | 65 | #endif // Foundation_FIFOEvent_INCLUDED 66 | -------------------------------------------------------------------------------- /third/Poco/FIFOStrategy.h: -------------------------------------------------------------------------------- 1 | // 2 | // FIFOStrategy.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/FIFOStrategy.h#3 $ 5 | // 6 | // Library: Foundation 7 | // Package: Events 8 | // Module: FIFOStragegy 9 | // 10 | // Implementation of the FIFOStrategy template. 11 | // 12 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_FIFOStrategy_INCLUDED 20 | #define Foundation_FIFOStrategy_INCLUDED 21 | 22 | 23 | #include "Poco/DefaultStrategy.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | //@ deprecated 30 | template 31 | class FIFOStrategy: public DefaultStrategy 32 | /// Note: As of release 1.4.2, DefaultStrategy already 33 | /// implements FIFO behavior, so this class is provided 34 | /// for backwards compatibility only. 35 | { 36 | public: 37 | FIFOStrategy() 38 | { 39 | } 40 | 41 | FIFOStrategy(const FIFOStrategy& s): 42 | DefaultStrategy(s) 43 | { 44 | } 45 | 46 | ~FIFOStrategy() 47 | { 48 | } 49 | 50 | FIFOStrategy& operator = (const FIFOStrategy& s) 51 | { 52 | DefaultStrategy::operator = (s); 53 | return *this; 54 | } 55 | }; 56 | 57 | 58 | } // namespace Poco 59 | 60 | 61 | #endif // Foundation_FIFOStrategy_INCLUDED 62 | -------------------------------------------------------------------------------- /third/Poco/HashFunction.h: -------------------------------------------------------------------------------- 1 | // 2 | // HashFunction.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/HashFunction.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Hashing 8 | // Module: HashFunction 9 | // 10 | // Definition of the HashFunction class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_HashFunction_INCLUDED 20 | #define Foundation_HashFunction_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Hash.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | //@ deprecated 31 | template 32 | struct HashFunction 33 | /// A generic hash function. 34 | { 35 | UInt32 operator () (T key, UInt32 maxValue) const 36 | /// Returns the hash value for the given key. 37 | { 38 | return static_cast(Poco::hash(key)) % maxValue; 39 | } 40 | }; 41 | 42 | 43 | //@ deprecated 44 | template <> 45 | struct HashFunction 46 | /// A generic hash function. 47 | { 48 | UInt32 operator () (const std::string& key, UInt32 maxValue) const 49 | /// Returns the hash value for the given key. 50 | { 51 | return static_cast(Poco::hash(key)) % maxValue; 52 | } 53 | }; 54 | 55 | 56 | } // namespace Poco 57 | 58 | 59 | #endif // Foundation_HashFunctions_INCLUDED 60 | -------------------------------------------------------------------------------- /third/Poco/JSON/JSONException.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSONException.h 3 | // 4 | // $Id$ 5 | // 6 | // Library: JSON 7 | // Package: JSON 8 | // Module: JSONException 9 | // 10 | // Definition of the JSONException class. 11 | // 12 | // Copyright (c) 2012, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef JSON_JSONException_INCLUDED 20 | #define JSON_JSONException_INCLUDED 21 | 22 | 23 | #include "Poco/JSON/JSON.h" 24 | #include "Poco/Exception.h" 25 | 26 | 27 | namespace Poco { 28 | namespace JSON { 29 | 30 | 31 | POCO_DECLARE_EXCEPTION(JSON_API, JSONException, Poco::Exception) 32 | 33 | 34 | }} // namespace Poco::JSON 35 | 36 | 37 | #endif //JSON_JSONException_INCLUDED 38 | -------------------------------------------------------------------------------- /third/Poco/KeyValueArgs.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyValueArgs.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/KeyValueArgs.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Cache 8 | // Module: KeyValueArgs 9 | // 10 | // Definition of the KeyValueArgs class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_KeyValueArgs_INCLUDED 20 | #define Foundation_KeyValueArgs_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | template 30 | class KeyValueArgs 31 | /// Simply event arguments class to transfer a key and a value via an event call. 32 | /// Note that key and value are *NOT* copied, only references to them are stored. 33 | { 34 | public: 35 | KeyValueArgs(const TKey& aKey, const TValue& aVal): 36 | _key(aKey), 37 | _value(aVal) 38 | { 39 | } 40 | 41 | KeyValueArgs(const KeyValueArgs& args): 42 | _key(args._key), 43 | _value(args._value) 44 | { 45 | } 46 | 47 | ~KeyValueArgs() 48 | { 49 | } 50 | 51 | const TKey& key() const 52 | /// Returns a reference to the key, 53 | { 54 | return _key; 55 | } 56 | 57 | const TValue& value() const 58 | /// Returns a Reference to the value. 59 | { 60 | return _value; 61 | } 62 | 63 | protected: 64 | const TKey& _key; 65 | const TValue& _value; 66 | 67 | private: 68 | KeyValueArgs& operator = (const KeyValueArgs& args); 69 | }; 70 | 71 | 72 | } // namespace Poco 73 | 74 | 75 | #endif // Foundation_KeyValueArgs_INCLUDED 76 | -------------------------------------------------------------------------------- /third/Poco/LRUCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // LRUCache.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/LRUCache.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Cache 8 | // Module: LRUCache 9 | // 10 | // Definition of the LRUCache class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_LRUCache_INCLUDED 20 | #define Foundation_LRUCache_INCLUDED 21 | 22 | 23 | #include "Poco/AbstractCache.h" 24 | #include "Poco/LRUStrategy.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | template < 31 | class TKey, 32 | class TValue, 33 | class TMutex = FastMutex, 34 | class TEventMutex = FastMutex 35 | > 36 | class LRUCache: public AbstractCache, TMutex, TEventMutex> 37 | /// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries. 38 | { 39 | public: 40 | LRUCache(long size = 1024): 41 | AbstractCache, TMutex, TEventMutex>(LRUStrategy(size)) 42 | { 43 | } 44 | 45 | ~LRUCache() 46 | { 47 | } 48 | 49 | private: 50 | LRUCache(const LRUCache& aCache); 51 | LRUCache& operator = (const LRUCache& aCache); 52 | }; 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_LRUCache_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Latin1Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Latin1Encoding.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Latin1Encoding.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Latin1Encoding 9 | // 10 | // Definition of the Latin1Encoding class. 11 | // 12 | // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Latin1Encoding_INCLUDED 20 | #define Foundation_Latin1Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Latin1Encoding: public TextEncoding 31 | /// ISO Latin-1 (8859-1) text encoding. 32 | { 33 | public: 34 | Latin1Encoding(); 35 | ~Latin1Encoding(); 36 | const char* canonicalName() const; 37 | bool isA(const std::string& encodingName) const; 38 | const CharacterMap& characterMap() const; 39 | int convert(const unsigned char* bytes) const; 40 | int convert(int ch, unsigned char* bytes, int length) const; 41 | int queryConvert(const unsigned char* bytes, int length) const; 42 | int sequenceLength(const unsigned char* bytes, int length) const; 43 | 44 | private: 45 | static const char* _names[]; 46 | static const CharacterMap _charMap; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_Latin1Encoding_INCLUDED 54 | -------------------------------------------------------------------------------- /third/Poco/Latin2Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Latin2Encoding.h 3 | // 4 | // $Id: //poco/svn/Foundation/include/Poco/Latin2Encoding.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Latin2Encoding 9 | // 10 | // Definition of the Latin2Encoding class. 11 | // 12 | // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Latin2Encoding_INCLUDED 20 | #define Foundation_Latin2Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Latin2Encoding: public TextEncoding 31 | /// ISO Latin-2 (8859-2) text encoding. 32 | /// 33 | /// Latin-2 is basically Latin-1 with the EURO sign plus 34 | /// some other minor changes. 35 | { 36 | public: 37 | Latin2Encoding(); 38 | virtual ~Latin2Encoding(); 39 | const char* canonicalName() const; 40 | bool isA(const std::string& encodingName) const; 41 | const CharacterMap& characterMap() const; 42 | int convert(const unsigned char* bytes) const; 43 | int convert(int ch, unsigned char* bytes, int length) const; 44 | int queryConvert(const unsigned char* bytes, int length) const; 45 | int sequenceLength(const unsigned char* bytes, int length) const; 46 | 47 | private: 48 | static const char* _names[]; 49 | static const CharacterMap _charMap; 50 | }; 51 | 52 | 53 | } // namespace Poco 54 | 55 | 56 | #endif // Foundation_Latin2Encoding_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/Latin9Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Latin9Encoding.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Latin9Encoding.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Latin9Encoding 9 | // 10 | // Definition of the Latin9Encoding class. 11 | // 12 | // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Latin9Encoding_INCLUDED 20 | #define Foundation_Latin9Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Latin9Encoding: public TextEncoding 31 | /// ISO Latin-9 (8859-15) text encoding. 32 | /// 33 | /// Latin-9 is basically Latin-1 with the EURO sign plus 34 | /// some other minor changes. 35 | { 36 | public: 37 | Latin9Encoding(); 38 | ~Latin9Encoding(); 39 | const char* canonicalName() const; 40 | bool isA(const std::string& encodingName) const; 41 | const CharacterMap& characterMap() const; 42 | int convert(const unsigned char* bytes) const; 43 | int convert(int ch, unsigned char* bytes, int length) const; 44 | int queryConvert(const unsigned char* bytes, int length) const; 45 | int sequenceLength(const unsigned char* bytes, int length) const; 46 | 47 | private: 48 | static const char* _names[]; 49 | static const CharacterMap _charMap; 50 | }; 51 | 52 | 53 | } // namespace Poco 54 | 55 | 56 | #endif // Foundation_Latin9Encoding_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/LogFile_STD.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogFile_STD.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/LogFile_STD.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: LogFile 9 | // 10 | // Definition of the LogFileImpl class using iostreams. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_LogFile_STD_INCLUDED 20 | #define Foundation_LogFile_STD_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Timestamp.h" 25 | #include "Poco/FileStream.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API LogFileImpl 32 | /// The implementation of LogFile for non-Windows platforms. 33 | /// The native filesystem APIs are used for 34 | /// total control over locking behavior. 35 | { 36 | public: 37 | LogFileImpl(const std::string& path); 38 | ~LogFileImpl(); 39 | void writeImpl(const std::string& text, bool flush); 40 | UInt64 sizeImpl() const; 41 | Timestamp creationDateImpl() const; 42 | const std::string& pathImpl() const; 43 | 44 | private: 45 | std::string _path; 46 | mutable Poco::FileOutputStream _str; 47 | Timestamp _creationDate; 48 | }; 49 | 50 | 51 | } // namespace Poco 52 | 53 | 54 | #endif // Foundation_LogFile_STD_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/LogFile_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogFile_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/LogFile_VMS.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: LogFile 9 | // 10 | // Definition of the LogFileImpl class using C I/O with OpenVMS extensions. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_LogFile_VMS_INCLUDED 20 | #define Foundation_LogFile_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Timestamp.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API LogFileImpl 32 | /// The implementation of LogFile for OpenVMS. 33 | /// The C Standard Library functions for file I/O 34 | /// are used with OpenVMS-specific extensions to 35 | /// control sharing and locking behavior. 36 | { 37 | public: 38 | LogFileImpl(const std::string& path); 39 | ~LogFileImpl(); 40 | void writeImpl(const std::string& text, bool flush); 41 | UInt64 sizeImpl() const; 42 | Timestamp creationDateImpl() const; 43 | const std::string& pathImpl() const; 44 | 45 | private: 46 | std::string _path; 47 | mutable FILE* _file; 48 | Timestamp _creationDate; 49 | }; 50 | 51 | 52 | } // namespace Poco 53 | 54 | 55 | #endif // Foundation_LogFile_VMS_INCLUDED 56 | -------------------------------------------------------------------------------- /third/Poco/LogFile_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogFile_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/LogFile_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: LogFile 9 | // 10 | // Definition of the LogFileImpl class using the Windows file APIs. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_LogFile_WIN32_INCLUDED 20 | #define Foundation_LogFile_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Timestamp.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API LogFileImpl 32 | /// The implementation of LogFile for Windows. 33 | /// The native filesystem APIs are used for 34 | /// total control over locking behavior. 35 | { 36 | public: 37 | LogFileImpl(const std::string& path); 38 | ~LogFileImpl(); 39 | void writeImpl(const std::string& text, bool flush); 40 | UInt64 sizeImpl() const; 41 | Timestamp creationDateImpl() const; 42 | const std::string& pathImpl() const; 43 | 44 | private: 45 | void createFile(); 46 | 47 | std::string _path; 48 | HANDLE _hFile; 49 | Timestamp _creationDate; 50 | }; 51 | 52 | 53 | } // namespace Poco 54 | 55 | 56 | #endif // Foundation_LogFile_WIN32_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/LogFile_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogFile_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/LogFile_WIN32U.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: LogFile 9 | // 10 | // Definition of the LogFileImpl class using the Windows file APIs. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_LogFile_WIN32U_INCLUDED 20 | #define Foundation_LogFile_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Timestamp.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API LogFileImpl 32 | /// The implementation of LogFile for Windows. 33 | /// The native filesystem APIs are used for 34 | /// total control over locking behavior. 35 | { 36 | public: 37 | LogFileImpl(const std::string& path); 38 | ~LogFileImpl(); 39 | void writeImpl(const std::string& text, bool flush); 40 | UInt64 sizeImpl() const; 41 | Timestamp creationDateImpl() const; 42 | const std::string& pathImpl() const; 43 | 44 | private: 45 | void createFile(); 46 | 47 | std::string _path; 48 | HANDLE _hFile; 49 | Timestamp _creationDate; 50 | }; 51 | 52 | 53 | } // namespace Poco 54 | 55 | 56 | #endif // Foundation_LogFile_WIN32U_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/Mutex_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mutex_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Mutex_VX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Mutex 9 | // 10 | // Definition of the MutexImpl and FastMutexImpl classes for VxWorks. 11 | // 12 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Mutex_VX_INCLUDED 20 | #define Foundation_Mutex_VX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include 26 | #include 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | class Foundation_API MutexImpl 33 | { 34 | protected: 35 | MutexImpl(); 36 | MutexImpl(bool fast); 37 | ~MutexImpl(); 38 | void lockImpl(); 39 | bool tryLockImpl(); 40 | bool tryLockImpl(long milliseconds); 41 | void unlockImpl(); 42 | 43 | private: 44 | SEM_ID _sem; 45 | }; 46 | 47 | 48 | class Foundation_API FastMutexImpl: public MutexImpl 49 | { 50 | protected: 51 | FastMutexImpl(); 52 | ~FastMutexImpl(); 53 | }; 54 | 55 | 56 | // 57 | // inlines 58 | // 59 | inline void MutexImpl::lockImpl() 60 | { 61 | if (semTake(_sem, WAIT_FOREVER) != OK) 62 | throw SystemException("cannot lock mutex"); 63 | } 64 | 65 | 66 | inline bool MutexImpl::tryLockImpl() 67 | { 68 | return semTake(_sem, NO_WAIT) == OK; 69 | } 70 | 71 | 72 | inline void MutexImpl::unlockImpl() 73 | { 74 | if (semGive(_sem) != OK) 75 | throw SystemException("cannot unlock mutex"); 76 | } 77 | 78 | 79 | } // namespace Poco 80 | 81 | 82 | #endif // Foundation_Mutex_VX_INCLUDED 83 | -------------------------------------------------------------------------------- /third/Poco/Mutex_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mutex_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Mutex_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Mutex 9 | // 10 | // Definition of the MutexImpl and FastMutexImpl classes for WIN32. 11 | // 12 | // Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Mutex_WIN32_INCLUDED 20 | #define Foundation_Mutex_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API MutexImpl 32 | { 33 | protected: 34 | MutexImpl(); 35 | ~MutexImpl(); 36 | void lockImpl(); 37 | bool tryLockImpl(); 38 | bool tryLockImpl(long milliseconds); 39 | void unlockImpl(); 40 | 41 | private: 42 | CRITICAL_SECTION _cs; 43 | }; 44 | 45 | 46 | typedef MutexImpl FastMutexImpl; 47 | 48 | 49 | // 50 | // inlines 51 | // 52 | inline void MutexImpl::lockImpl() 53 | { 54 | try 55 | { 56 | EnterCriticalSection(&_cs); 57 | } 58 | catch (...) 59 | { 60 | throw SystemException("cannot lock mutex"); 61 | } 62 | } 63 | 64 | 65 | inline bool MutexImpl::tryLockImpl() 66 | { 67 | try 68 | { 69 | return TryEnterCriticalSection(&_cs) != 0; 70 | } 71 | catch (...) 72 | { 73 | } 74 | throw SystemException("cannot lock mutex"); 75 | } 76 | 77 | 78 | inline void MutexImpl::unlockImpl() 79 | { 80 | LeaveCriticalSection(&_cs); 81 | } 82 | 83 | 84 | } // namespace Poco 85 | 86 | 87 | #endif // Foundation_Mutex_WIN32_INCLUDED 88 | -------------------------------------------------------------------------------- /third/Poco/Mutex_WINCE.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mutex_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Mutex_WINCE.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Mutex 9 | // 10 | // Definition of the MutexImpl and FastMutexImpl classes for WIN32. 11 | // 12 | // Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Mutex_WINCE_INCLUDED 20 | #define Foundation_Mutex_WINCE_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API MutexImpl 32 | { 33 | protected: 34 | MutexImpl(); 35 | ~MutexImpl(); 36 | void lockImpl(); 37 | bool tryLockImpl(); 38 | bool tryLockImpl(long milliseconds); 39 | void unlockImpl(); 40 | 41 | private: 42 | HANDLE _mutex; 43 | }; 44 | 45 | 46 | typedef MutexImpl FastMutexImpl; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_Mutex_WINCE_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/NamedEvent_Android.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_Android.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_Android.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedEvent 9 | // 10 | // Definition of the NamedEventImpl class for Android. 11 | // 12 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedEvent_Android_INCLUDED 20 | #define Foundation_NamedEvent_Android_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API NamedEventImpl 30 | { 31 | protected: 32 | NamedEventImpl(const std::string& name); 33 | ~NamedEventImpl(); 34 | void setImpl(); 35 | void waitImpl(); 36 | }; 37 | 38 | 39 | } // namespace Poco 40 | 41 | 42 | #endif // Foundation_NamedEvent_Android_INCLUDED 43 | -------------------------------------------------------------------------------- /third/Poco/NamedEvent_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_UNIX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedEvent 9 | // 10 | // Definition of the NamedEventImpl class for Unix. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedEvent_UNIX_INCLUDED 20 | #define Foundation_NamedEvent_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) 25 | #include 26 | #endif 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | class Foundation_API NamedEventImpl 33 | { 34 | protected: 35 | NamedEventImpl(const std::string& name); 36 | ~NamedEventImpl(); 37 | void setImpl(); 38 | void waitImpl(); 39 | 40 | private: 41 | std::string getFileName(); 42 | 43 | std::string _name; 44 | #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) 45 | sem_t* _sem; 46 | #else 47 | int _lockfd; // lock file descriptor 48 | int _semfd; // file used to identify semaphore 49 | int _semid; // semaphore id 50 | #endif 51 | }; 52 | 53 | 54 | } // namespace Poco 55 | 56 | 57 | #endif // Foundation_NamedEvent_UNIX_INCLUDED 58 | -------------------------------------------------------------------------------- /third/Poco/NamedEvent_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_VMS.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedEvent 9 | // 10 | // Definition of the NamedEventImpl class for OpenVMS. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedEvent_VMS_INCLUDED 20 | #define Foundation_NamedEvent_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API NamedEventImpl 30 | { 31 | protected: 32 | NamedEventImpl(const std::string& name); 33 | ~NamedEventImpl(); 34 | void setImpl(); 35 | void waitImpl(); 36 | 37 | private: 38 | std::string _name; 39 | unsigned short _mbxChan; 40 | }; 41 | 42 | 43 | } // namespace Poco 44 | 45 | 46 | #endif // Foundation_NamedEvent_VMS_INCLUDED 47 | -------------------------------------------------------------------------------- /third/Poco/NamedEvent_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedEvent 9 | // 10 | // Definition of the NamedEventImpl class for Windows. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedEvent_WIN32_INCLUDED 20 | #define Foundation_NamedEvent_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API NamedEventImpl 31 | { 32 | protected: 33 | NamedEventImpl(const std::string& name); 34 | ~NamedEventImpl(); 35 | void setImpl(); 36 | void waitImpl(); 37 | 38 | private: 39 | std::string _name; 40 | HANDLE _event; 41 | }; 42 | 43 | 44 | } // namespace Poco 45 | 46 | 47 | #endif // Foundation_NamedEvent_WIN32_INCLUDED 48 | -------------------------------------------------------------------------------- /third/Poco/NamedEvent_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedEvent_WIN32U.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedEvent 9 | // 10 | // Definition of the NamedEventImpl class for Windows. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedEvent_WIN32U_INCLUDED 20 | #define Foundation_NamedEvent_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API NamedEventImpl 31 | { 32 | protected: 33 | NamedEventImpl(const std::string& name); 34 | ~NamedEventImpl(); 35 | void setImpl(); 36 | void waitImpl(); 37 | 38 | private: 39 | std::string _name; 40 | std::wstring _uname; 41 | HANDLE _event; 42 | }; 43 | 44 | 45 | } // namespace Poco 46 | 47 | 48 | #endif // Foundation_NamedEvent_WIN32U_INCLUDED 49 | -------------------------------------------------------------------------------- /third/Poco/NamedMutex_Android.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_Android.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_Android.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedMutex 9 | // 10 | // Definition of the NamedMutexImpl class for Android. 11 | // 12 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedMutex_Android_INCLUDED 20 | #define Foundation_NamedMutex_Android_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API NamedMutexImpl 30 | { 31 | protected: 32 | NamedMutexImpl(const std::string& name); 33 | ~NamedMutexImpl(); 34 | void lockImpl(); 35 | bool tryLockImpl(); 36 | void unlockImpl(); 37 | }; 38 | 39 | 40 | } // namespace Poco 41 | 42 | 43 | #endif // Foundation_NamedMutex_Android_INCLUDED 44 | -------------------------------------------------------------------------------- /third/Poco/NamedMutex_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_UNIX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedMutex 9 | // 10 | // Definition of the NamedMutexImpl class for Unix. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedMutex_UNIX_INCLUDED 20 | #define Foundation_NamedMutex_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | #include 26 | #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) 27 | #include 28 | #endif 29 | 30 | 31 | namespace Poco { 32 | 33 | 34 | class Foundation_API NamedMutexImpl 35 | { 36 | protected: 37 | NamedMutexImpl(const std::string& name); 38 | ~NamedMutexImpl(); 39 | void lockImpl(); 40 | bool tryLockImpl(); 41 | void unlockImpl(); 42 | 43 | private: 44 | std::string getFileName(); 45 | 46 | std::string _name; 47 | #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) 48 | sem_t* _sem; 49 | #else 50 | int _lockfd; // lock file descriptor 51 | int _semfd; // file used to identify semaphore 52 | int _semid; // semaphore id 53 | #endif 54 | }; 55 | 56 | 57 | } // namespace Poco 58 | 59 | 60 | #endif // Foundation_NamedMutex_UNIX_INCLUDED 61 | -------------------------------------------------------------------------------- /third/Poco/NamedMutex_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_VMS.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedMutex 9 | // 10 | // Definition of the NamedMutexImpl class for OpenVMS. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedMutex_VMS_INCLUDED 20 | #define Foundation_NamedMutex_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API NamedMutexImpl 32 | { 33 | protected: 34 | NamedMutexImpl(const std::string& name); 35 | ~NamedMutexImpl(); 36 | void lockImpl(); 37 | bool tryLockImpl(); 38 | void unlockImpl(); 39 | 40 | private: 41 | std::string _name; 42 | struct dsc$descriptor_s _nameDesc; 43 | int _lksb[4]; 44 | }; 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_NamedMutex_VMS_INCLUDED 51 | -------------------------------------------------------------------------------- /third/Poco/NamedMutex_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedMutex 9 | // 10 | // Definition of the NamedMutexImpl class for Windows. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedMutex_WIN32_INCLUDED 20 | #define Foundation_NamedMutex_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API NamedMutexImpl 31 | { 32 | protected: 33 | NamedMutexImpl(const std::string& name); 34 | ~NamedMutexImpl(); 35 | void lockImpl(); 36 | bool tryLockImpl(); 37 | void unlockImpl(); 38 | 39 | private: 40 | std::string _name; 41 | HANDLE _mutex; 42 | }; 43 | 44 | 45 | } // namespace Poco 46 | 47 | 48 | #endif // Foundation_NamedMutex_WIN32_INCLUDED 49 | -------------------------------------------------------------------------------- /third/Poco/NamedMutex_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NamedMutex_WIN32U.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: NamedMutex 9 | // 10 | // Definition of the NamedMutexImpl class for Windows. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NamedMutex_WIN32U_INCLUDED 20 | #define Foundation_NamedMutex_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/UnWindows.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API NamedMutexImpl 31 | { 32 | protected: 33 | NamedMutexImpl(const std::string& name); 34 | ~NamedMutexImpl(); 35 | void lockImpl(); 36 | bool tryLockImpl(); 37 | void unlockImpl(); 38 | 39 | private: 40 | std::string _name; 41 | std::wstring _uname; 42 | HANDLE _mutex; 43 | }; 44 | 45 | 46 | } // namespace Poco 47 | 48 | 49 | #endif // Foundation_NamedMutex_WIN32U_INCLUDED 50 | -------------------------------------------------------------------------------- /third/Poco/Net/DatagramSocketImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // DatagramSocketImpl.h 3 | // 4 | // $Id: //poco/1.4/Net/include/Poco/Net/DatagramSocketImpl.h#1 $ 5 | // 6 | // Library: Net 7 | // Package: Sockets 8 | // Module: DatagramSocketImpl 9 | // 10 | // Definition of the DatagramSocketImpl class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_DatagramSocketImpl_INCLUDED 20 | #define Net_DatagramSocketImpl_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/Net/SocketImpl.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Net { 29 | 30 | 31 | class Net_API DatagramSocketImpl: public SocketImpl 32 | /// This class implements an UDP socket. 33 | { 34 | public: 35 | DatagramSocketImpl(); 36 | /// Creates a DatagramSocketImpl. 37 | /// 38 | /// If the system supports IPv6, the socket will 39 | /// be an IPv6 socket. Otherwise, it will be 40 | /// an IPv4 socket. 41 | 42 | explicit DatagramSocketImpl(IPAddress::Family family); 43 | /// Creates an unconnected datagram socket. 44 | /// 45 | /// The socket will be created for the 46 | /// given address family. 47 | 48 | DatagramSocketImpl(poco_socket_t sockfd); 49 | /// Creates a StreamSocketImpl using the given native socket. 50 | 51 | protected: 52 | void init(int af); 53 | 54 | ~DatagramSocketImpl(); 55 | }; 56 | 57 | 58 | } } // namespace Poco::Net 59 | 60 | 61 | #endif // Net_DatagramSocketImpl_INCLUDED 62 | -------------------------------------------------------------------------------- /third/Poco/Net/HTTPBasicStreamBuf.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPBasicStreamBuf.h 3 | // 4 | // $Id: //poco/Main/template/class.h#4 $ 5 | // 6 | // Library: Net 7 | // Package: HTTP 8 | // Module: HTTPBasicStreamBuf 9 | // 10 | // Definition of the HTTPBasicStreamBuf class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_HTTPBasicStreamBuf_INCLUDED 20 | #define Net_HTTPBasicStreamBuf_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/BufferedStreamBuf.h" 25 | #include "Poco/Net/HTTPBufferAllocator.h" 26 | 27 | 28 | namespace Poco { 29 | namespace Net { 30 | 31 | 32 | typedef Poco::BasicBufferedStreamBuf, HTTPBufferAllocator> HTTPBasicStreamBuf; 33 | 34 | 35 | } } // namespace Poco::Net 36 | 37 | 38 | #endif // Net_HTTPBasicStreamBuf_INCLUDED 39 | -------------------------------------------------------------------------------- /third/Poco/Net/HTTPBufferAllocator.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPBufferAllocator.h 3 | // 4 | // $Id: //poco/Main/template/class.h#4 $ 5 | // 6 | // Library: Net 7 | // Package: HTTP 8 | // Module: HTTPBufferAllocator 9 | // 10 | // Definition of the HTTPBufferAllocator class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_HTTPBufferAllocator_INCLUDED 20 | #define Net_HTTPBufferAllocator_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/MemoryPool.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | namespace Net { 30 | 31 | 32 | class Net_API HTTPBufferAllocator 33 | /// A BufferAllocator for HTTP streams. 34 | { 35 | public: 36 | static char* allocate(std::streamsize size); 37 | static void deallocate(char* ptr, std::streamsize size); 38 | 39 | enum 40 | { 41 | BUFFER_SIZE = 4096 42 | }; 43 | 44 | private: 45 | static Poco::MemoryPool _pool; 46 | }; 47 | 48 | 49 | } } // namespace Poco::Net 50 | 51 | 52 | #endif // Net_HTTPBufferAllocator_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/Net/NTPClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // NTPClient.h 3 | // 4 | // $Id: //poco/1.4/Net/include/Poco/Net/NTPClient.h#1 $ 5 | // 6 | // Library: Net 7 | // Package: NTP 8 | // Module: NTPClient 9 | // 10 | // Definition of the NTPClient class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_NTPClient_INCLUDED 20 | #define Net_NTPClient_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/Net/NTPEventArgs.h" 25 | #include "Poco/Net/SocketAddress.h" 26 | #include "Poco/BasicEvent.h" 27 | 28 | 29 | namespace Poco { 30 | namespace Net { 31 | 32 | 33 | class Net_API NTPClient 34 | /// This class provides NTP (Network Time Protocol) client functionality. 35 | { 36 | public: 37 | mutable Poco::BasicEvent response; 38 | 39 | explicit NTPClient(IPAddress::Family family, int timeout = 3000000); 40 | /// Creates an NTP client. 41 | 42 | ~NTPClient(); 43 | /// Destroys the NTP client. 44 | 45 | int request(SocketAddress& address) const; 46 | /// Request the time from the server at address. 47 | /// Notifications are posted for events. 48 | /// 49 | /// Returns the number of valid replies. 50 | 51 | int request(const std::string& address) const; 52 | /// Request the time from the server at address. 53 | /// Notifications are posted for events. 54 | /// 55 | /// Returns the number of valid replies. 56 | 57 | private: 58 | mutable IPAddress::Family _family; 59 | int _timeout; 60 | }; 61 | 62 | 63 | } } // namespace Poco::Net 64 | 65 | 66 | #endif // Net_NTPClient_INCLUDED 67 | -------------------------------------------------------------------------------- /third/Poco/Net/NullPartHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // NullPartHandler.h 3 | // 4 | // $Id: //poco/1.4/Net/include/Poco/Net/NullPartHandler.h#1 $ 5 | // 6 | // Library: Net 7 | // Package: Messages 8 | // Module: NullPartHandler 9 | // 10 | // Definition of the NullPartHandler class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_NullPartHandler_INCLUDED 20 | #define Net_NullPartHandler_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/Net/PartHandler.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Net { 29 | 30 | 31 | class Net_API NullPartHandler: public PartHandler 32 | /// A very special PartHandler that simply discards all data. 33 | { 34 | public: 35 | NullPartHandler(); 36 | /// Creates the NullPartHandler. 37 | 38 | ~NullPartHandler(); 39 | /// Destroys the NullPartHandler. 40 | 41 | void handlePart(const MessageHeader& header, std::istream& stream); 42 | /// Reads and discards all data from the stream. 43 | }; 44 | 45 | 46 | } } // namespace Poco::Net 47 | 48 | 49 | #endif // Net_NullPartHandler_INCLUDED 50 | -------------------------------------------------------------------------------- /third/Poco/Net/RawSocketImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // RawSocketImpl.h 3 | // 4 | // $Id: //poco/1.4/Net/include/Poco/Net/RawSocketImpl.h#1 $ 5 | // 6 | // Library: Net 7 | // Package: Sockets 8 | // Module: RawSocketImpl 9 | // 10 | // Definition of the RawSocketImpl class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_RawSocketImpl_INCLUDED 20 | #define Net_RawSocketImpl_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/Net/SocketImpl.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Net { 29 | 30 | 31 | class Net_API RawSocketImpl: public SocketImpl 32 | /// This class implements a raw socket. 33 | { 34 | public: 35 | RawSocketImpl(); 36 | /// Creates an unconnected IPv4 raw socket with IPPROTO_RAW. 37 | 38 | RawSocketImpl(IPAddress::Family family, int proto = IPPROTO_RAW); 39 | /// Creates an unconnected raw socket. 40 | /// 41 | /// The socket will be created for the 42 | /// given address family. 43 | 44 | RawSocketImpl(poco_socket_t sockfd); 45 | /// Creates a RawSocketImpl using the given native socket. 46 | 47 | protected: 48 | void init(int af); 49 | void init2(int af, int proto); 50 | 51 | ~RawSocketImpl(); 52 | }; 53 | 54 | 55 | } } // namespace Poco::Net 56 | 57 | 58 | #endif // Net_RawSocketImpl_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Net/ServerSocketImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // ServerSocketImpl.h 3 | // 4 | // $Id: //poco/1.4/Net/include/Poco/Net/ServerSocketImpl.h#1 $ 5 | // 6 | // Library: Net 7 | // Package: Sockets 8 | // Module: ServerSocketImpl 9 | // 10 | // Definition of the ServerSocketImpl class. 11 | // 12 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Net_ServerSocketImpl_INCLUDED 20 | #define Net_ServerSocketImpl_INCLUDED 21 | 22 | 23 | #include "Poco/Net/Net.h" 24 | #include "Poco/Net/SocketImpl.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Net { 29 | 30 | 31 | class Net_API ServerSocketImpl: public SocketImpl 32 | /// This class implements a TCP server socket. 33 | { 34 | public: 35 | ServerSocketImpl(); 36 | /// Creates the ServerSocketImpl. 37 | 38 | protected: 39 | virtual ~ServerSocketImpl(); 40 | /// Destroys the ServerSocketImpl. 41 | }; 42 | 43 | 44 | } } // namespace Poco::Net 45 | 46 | 47 | #endif // Net_ServerSocketImpl_INCLUDED 48 | -------------------------------------------------------------------------------- /third/Poco/Notification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Notification.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Notification.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Notifications 8 | // Module: Notification 9 | // 10 | // Definition of the Notification class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Notification_INCLUDED 20 | #define Foundation_Notification_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | #include "Poco/RefCountedObject.h" 26 | #include "Poco/AutoPtr.h" 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | class Foundation_API Notification: public RefCountedObject 33 | /// The base class for all notification classes used 34 | /// with the NotificationCenter and the NotificationQueue 35 | /// classes. 36 | /// The Notification class can be used with the AutoPtr 37 | /// template class. 38 | { 39 | public: 40 | typedef AutoPtr Ptr; 41 | 42 | Notification(); 43 | /// Creates the notification. 44 | 45 | virtual std::string name() const; 46 | /// Returns the name of the notification. 47 | /// The default implementation returns the class name. 48 | 49 | protected: 50 | virtual ~Notification(); 51 | }; 52 | 53 | 54 | } // namespace Poco 55 | 56 | 57 | #endif // Foundation_Notification_INCLUDED 58 | -------------------------------------------------------------------------------- /third/Poco/NullChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // NullChannel.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/NullChannel.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: NullChannel 9 | // 10 | // Definition of the NullChannel class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_NullChannel_INCLUDED 20 | #define Foundation_NullChannel_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Channel.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API NullChannel: public Channel 31 | /// The NullChannel is the /dev/null of Channels. 32 | /// 33 | /// A NullChannel discards all information sent to it. 34 | /// Furthermore, its setProperty() method ignores 35 | /// all properties, so it the NullChannel has the 36 | /// nice feature that it can stand in for any 37 | /// other channel class in a logging configuration. 38 | { 39 | public: 40 | NullChannel(); 41 | /// Creates the NullChannel. 42 | 43 | ~NullChannel(); 44 | /// Destroys the NullChannel. 45 | 46 | void log(const Message& msg); 47 | /// Does nothing. 48 | 49 | void setProperty(const std::string& name, const std::string& value); 50 | /// Ignores both name and value. 51 | }; 52 | 53 | 54 | } // namespace Poco 55 | 56 | 57 | #endif // Foundation_NullChannel_INCLUDED 58 | -------------------------------------------------------------------------------- /third/Poco/Path_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Path_UNIX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: Path 9 | // 10 | // Definition of the PathImpl class fo rUnix. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Path_UNIX_INCLUDED 20 | #define Foundation_Path_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class PathImpl 31 | { 32 | public: 33 | static std::string currentImpl(); 34 | static std::string homeImpl(); 35 | static std::string tempImpl(); 36 | static std::string nullImpl(); 37 | static std::string expandImpl(const std::string& path); 38 | static void listRootsImpl(std::vector& roots); 39 | }; 40 | 41 | 42 | } // namespace Poco 43 | 44 | 45 | #endif // Foundation_Path_UNIX_INCLUDED 46 | -------------------------------------------------------------------------------- /third/Poco/Path_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Path_VMS.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: Path 9 | // 10 | // Definition of the PathImpl class for OpenVMS. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Path_VMS_INCLUDED 20 | #define Foundation_Path_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class PathImpl 31 | { 32 | public: 33 | static std::string currentImpl(); 34 | static std::string homeImpl(); 35 | static std::string tempImpl(); 36 | static std::string nullImpl(); 37 | static std::string expandImpl(const std::string& path); 38 | static void listRootsImpl(std::vector& roots); 39 | }; 40 | 41 | 42 | } // namespace Poco 43 | 44 | 45 | #endif // Foundation_Path_VMS_INCLUDED 46 | -------------------------------------------------------------------------------- /third/Poco/Path_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Path_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: Path 9 | // 10 | // Definition of the PathImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Path_WIN32_INCLUDED 20 | #define Foundation_Path_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API PathImpl 31 | { 32 | public: 33 | static std::string currentImpl(); 34 | static std::string homeImpl(); 35 | static std::string tempImpl(); 36 | static std::string nullImpl(); 37 | static std::string systemImpl(); 38 | static std::string expandImpl(const std::string& path); 39 | static void listRootsImpl(std::vector& roots); 40 | }; 41 | 42 | 43 | } // namespace Poco 44 | 45 | 46 | #endif // Foundation_Path_WIN32_INCLUDED 47 | -------------------------------------------------------------------------------- /third/Poco/Path_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Path_WIN32U.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: Path 9 | // 10 | // Definition of the PathImpl class for WIN32. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Path_WIN32U_INCLUDED 20 | #define Foundation_Path_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API PathImpl 31 | { 32 | public: 33 | static std::string currentImpl(); 34 | static std::string homeImpl(); 35 | static std::string tempImpl(); 36 | static std::string nullImpl(); 37 | static std::string systemImpl(); 38 | static std::string expandImpl(const std::string& path); 39 | static void listRootsImpl(std::vector& roots); 40 | 41 | enum 42 | { 43 | MAX_PATH_LEN = 32767 44 | }; 45 | }; 46 | 47 | 48 | } // namespace Poco 49 | 50 | 51 | #endif // Foundation_Path_WIN32U_INCLUDED 52 | -------------------------------------------------------------------------------- /third/Poco/Path_WINCE.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_WINCE.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Path_WINCE.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Filesystem 8 | // Module: Path 9 | // 10 | // Definition of the PathImpl class for WIN32. 11 | // 12 | // Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Path_WINCE_INCLUDED 20 | #define Foundation_Path_WINCE_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API PathImpl 31 | { 32 | public: 33 | static std::string currentImpl(); 34 | // Returns the root directory 35 | static std::string homeImpl(); 36 | static std::string tempImpl(); 37 | static std::string nullImpl(); 38 | static std::string systemImpl(); 39 | static std::string expandImpl(const std::string& path); 40 | static void listRootsImpl(std::vector& roots); 41 | 42 | enum 43 | { 44 | MAX_PATH_LEN = 32767 45 | }; 46 | }; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_Path_WINCE_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/PipeImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/PipeImpl.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: PipeImpl 9 | // 10 | // Definition of the PipeImpl class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_PipeImpl_INCLUDED 20 | #define Foundation_PipeImpl_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | #if defined(POCO_OS_FAMILY_WINDOWS) 27 | #if defined(_WIN32_WCE) 28 | #include "PipeImpl_DUMMY.h" 29 | #else 30 | #include "Poco/PipeImpl_WIN32.h" 31 | #endif 32 | #elif defined(POCO_OS_FAMILY_UNIX) 33 | #include "Poco/PipeImpl_POSIX.h" 34 | #else 35 | #include "Poco/PipeImpl_DUMMY.h" 36 | #endif 37 | 38 | 39 | #endif // Foundation_PipeImpl_INCLUDED 40 | -------------------------------------------------------------------------------- /third/Poco/PipeImpl_DUMMY.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_DUMMY.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_DUMMY.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: PipeImpl 9 | // 10 | // Definition of the PipeImpl_DUMMY class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_PipeImpl_DUMMY_INCLUDED 20 | #define Foundation_PipeImpl_DUMMY_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/RefCountedObject.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API PipeImpl: public RefCountedObject 31 | /// A dummy implementation of PipeImpl for platforms 32 | /// that do not support pipes. 33 | { 34 | public: 35 | typedef int Handle; 36 | 37 | PipeImpl(); 38 | ~PipeImpl(); 39 | int writeBytes(const void* buffer, int length); 40 | int readBytes(void* buffer, int length); 41 | Handle readHandle() const; 42 | Handle writeHandle() const; 43 | void closeRead(); 44 | void closeWrite(); 45 | }; 46 | 47 | 48 | } // namespace Poco 49 | 50 | 51 | #endif // Foundation_PipeImpl_DUMMY_INCLUDED 52 | -------------------------------------------------------------------------------- /third/Poco/PipeImpl_POSIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_POSIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_POSIX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: PipeImpl 9 | // 10 | // Definition of the PipeImpl class for POSIX. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_PipeImpl_POSIX_INCLUDED 20 | #define Foundation_PipeImpl_POSIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/RefCountedObject.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API PipeImpl: public RefCountedObject 31 | /// A dummy implementation of PipeImpl for platforms 32 | /// that do not support pipes. 33 | { 34 | public: 35 | typedef int Handle; 36 | 37 | PipeImpl(); 38 | ~PipeImpl(); 39 | int writeBytes(const void* buffer, int length); 40 | int readBytes(void* buffer, int length); 41 | Handle readHandle() const; 42 | Handle writeHandle() const; 43 | void closeRead(); 44 | void closeWrite(); 45 | 46 | private: 47 | int _readfd; 48 | int _writefd; 49 | }; 50 | 51 | 52 | } // namespace Poco 53 | 54 | 55 | #endif // Foundation_PipeImpl_POSIX_INCLUDED 56 | -------------------------------------------------------------------------------- /third/Poco/PipeImpl_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/PipeImpl_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Processes 8 | // Module: PipeImpl 9 | // 10 | // Definition of the PipeImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_PipeImpl_WIN32_INCLUDED 20 | #define Foundation_PipeImpl_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/RefCountedObject.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API PipeImpl: public RefCountedObject 32 | /// A dummy implementation of PipeImpl for platforms 33 | /// that do not support pipes. 34 | { 35 | public: 36 | typedef HANDLE Handle; 37 | 38 | PipeImpl(); 39 | ~PipeImpl(); 40 | int writeBytes(const void* buffer, int length); 41 | int readBytes(void* buffer, int length); 42 | Handle readHandle() const; 43 | Handle writeHandle() const; 44 | void closeRead(); 45 | void closeWrite(); 46 | 47 | private: 48 | HANDLE _readHandle; 49 | HANDLE _writeHandle; 50 | }; 51 | 52 | 53 | } // namespace Poco 54 | 55 | 56 | #endif // Foundation_PipeImpl_WIN32_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/Platform_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Platform_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Platform_VX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Platform 9 | // 10 | // Platform and architecture identification macros 11 | // and platform-specific definitions for VxWorks 12 | // 13 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 14 | // and Contributors. 15 | // 16 | // SPDX-License-Identifier: BSL-1.0 17 | // 18 | 19 | 20 | #ifndef Foundation_Platform_VX_INCLUDED 21 | #define Foundation_Platform_VX_INCLUDED 22 | 23 | 24 | #define POCO_NO_SYS_SELECT_H 25 | #define POCO_NO_FPENVIRONMENT 26 | #define POCO_NO_WSTRING 27 | #define POCO_NO_SHAREDMEMORY 28 | #define POCO_NO_SYSLOGCHANNEL 29 | 30 | 31 | #endif // Foundation_Platform_VX_INCLUDED 32 | -------------------------------------------------------------------------------- /third/Poco/Poco.h: -------------------------------------------------------------------------------- 1 | // 2 | // Poco.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Poco.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Foundation 9 | // 10 | // Basic definitions for the POCO libraries. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Poco_INCLUDED 20 | #define Foundation_Poco_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | #endif // Foundation_Poco_INCLUDED 27 | -------------------------------------------------------------------------------- /third/Poco/RWLock_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWLock_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/RWLock_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: RWLock 9 | // 10 | // Definition of the RWLockImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_RWLock_WIN32_INCLUDED 20 | #define Foundation_RWLock_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API RWLockImpl 32 | { 33 | protected: 34 | RWLockImpl(); 35 | ~RWLockImpl(); 36 | void readLockImpl(); 37 | bool tryReadLockImpl(); 38 | void writeLockImpl(); 39 | bool tryWriteLockImpl(); 40 | void unlockImpl(); 41 | 42 | private: 43 | void addWriter(); 44 | void removeWriter(); 45 | DWORD tryReadLockOnce(); 46 | 47 | HANDLE _mutex; 48 | HANDLE _readEvent; 49 | HANDLE _writeEvent; 50 | unsigned _readers; 51 | unsigned _writersWaiting; 52 | unsigned _writers; 53 | }; 54 | 55 | 56 | } // namespace Poco 57 | 58 | 59 | #endif // Foundation_RWLock_WIN32_INCLUDED 60 | -------------------------------------------------------------------------------- /third/Poco/RWLock_WINCE.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWLock_WINCE.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/RWLock_WINCE.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: RWLock 9 | // 10 | // Definition of the RWLockImpl class for WINCE. 11 | // 12 | // Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_RWLock_WINCE_INCLUDED 20 | #define Foundation_RWLock_WINCE_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API RWLockImpl 32 | /// This implementation is based on the one from Stone Steps Inc, 33 | /// licensed under the BSD license. 34 | /// http://forums.stonesteps.ca/thread.asp?t=105 35 | /// 36 | /// Note that with this implementation, writers always take 37 | /// precedence over readers. 38 | { 39 | protected: 40 | RWLockImpl(); 41 | ~RWLockImpl(); 42 | void readLockImpl(); 43 | bool tryReadLockImpl(DWORD timeout = 1); 44 | void writeLockImpl(); 45 | bool tryWriteLockImpl(DWORD timeout = 1); 46 | void unlockImpl(); 47 | 48 | private: 49 | DWORD _readerCount; 50 | DWORD _readerWaiting; 51 | DWORD _writerCount; 52 | DWORD _writerWaiting; 53 | HANDLE _readerGreen; 54 | HANDLE _writerGreen; 55 | CRITICAL_SECTION _cs; 56 | bool _writeLock; 57 | }; 58 | 59 | 60 | } // namespace Poco 61 | 62 | 63 | #endif // Foundation_RWLock_WINCE_INCLUDED 64 | -------------------------------------------------------------------------------- /third/Poco/Runnable.h: -------------------------------------------------------------------------------- 1 | // 2 | // Runnable.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Runnable.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Thread 9 | // 10 | // Definition of the Runnable class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Runnable_INCLUDED 20 | #define Foundation_Runnable_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API Runnable 30 | /// The Runnable interface with the run() method 31 | /// must be implemented by classes that provide 32 | /// an entry point for a thread. 33 | { 34 | public: 35 | Runnable(); 36 | virtual ~Runnable(); 37 | 38 | virtual void run() = 0; 39 | /// Do whatever the thread needs to do. Must 40 | /// be overridden by subclasses. 41 | }; 42 | 43 | 44 | } // namespace Poco 45 | 46 | 47 | #endif // Foundation_Runnable_INCLUDED 48 | -------------------------------------------------------------------------------- /third/Poco/ScopedUnlock.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScopedUnlock.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/ScopedUnlock.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Mutex 9 | // 10 | // Definition of the ScopedUnlock template class. 11 | // 12 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_ScopedUnlock_INCLUDED 20 | #define Foundation_ScopedUnlock_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | template 30 | class ScopedUnlock 31 | /// A class that simplifies thread synchronization 32 | /// with a mutex. 33 | /// The constructor accepts a Mutex and unlocks it. 34 | /// The destructor locks the mutex. 35 | { 36 | public: 37 | inline ScopedUnlock(M& mutex, bool unlockNow = true): _mutex(mutex) 38 | { 39 | if (unlockNow) 40 | _mutex.unlock(); 41 | } 42 | inline ~ScopedUnlock() 43 | { 44 | try 45 | { 46 | _mutex.lock(); 47 | } 48 | catch (...) 49 | { 50 | poco_unexpected(); 51 | } 52 | } 53 | 54 | private: 55 | M& _mutex; 56 | 57 | ScopedUnlock(); 58 | ScopedUnlock(const ScopedUnlock&); 59 | ScopedUnlock& operator = (const ScopedUnlock&); 60 | }; 61 | 62 | 63 | } // namespace Poco 64 | 65 | 66 | #endif // Foundation_ScopedUnlock_INCLUDED 67 | -------------------------------------------------------------------------------- /third/Poco/Semaphore_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Semaphore_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Semaphore_VX.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Semaphore 9 | // 10 | // Definition of the SemaphoreImpl class for VxWorks. 11 | // 12 | // Copyright (c) 2004-20011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Semaphore_VX_INCLUDED 20 | #define Foundation_Semaphore_VX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API SemaphoreImpl 32 | { 33 | protected: 34 | SemaphoreImpl(int n, int max); 35 | ~SemaphoreImpl(); 36 | void setImpl(); 37 | void waitImpl(); 38 | bool waitImpl(long milliseconds); 39 | 40 | private: 41 | SEM_ID _sem; 42 | }; 43 | 44 | 45 | // 46 | // inlines 47 | // 48 | inline void SemaphoreImpl::setImpl() 49 | { 50 | if (semGive(_sem) != OK) 51 | throw SystemException("cannot signal semaphore"); 52 | } 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_Semaphore_VX_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Semaphore_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Semaphore_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Semaphore_WIN32.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Threading 8 | // Module: Semaphore 9 | // 10 | // Definition of the SemaphoreImpl class for WIN32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Semaphore_WIN32_INCLUDED 20 | #define Foundation_Semaphore_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Exception.h" 25 | #include "Poco/UnWindows.h" 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API SemaphoreImpl 32 | { 33 | protected: 34 | SemaphoreImpl(int n, int max); 35 | ~SemaphoreImpl(); 36 | void setImpl(); 37 | void waitImpl(); 38 | bool waitImpl(long milliseconds); 39 | 40 | private: 41 | HANDLE _sema; 42 | }; 43 | 44 | 45 | // 46 | // inlines 47 | // 48 | inline void SemaphoreImpl::setImpl() 49 | { 50 | if (!ReleaseSemaphore(_sema, 1, NULL)) 51 | { 52 | throw SystemException("cannot signal semaphore"); 53 | } 54 | } 55 | 56 | 57 | } // namespace Poco 58 | 59 | 60 | #endif // Foundation_Semaphore_WIN32_INCLUDED 61 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_HPUX.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_HPUX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_HPUX.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for HP-UX. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_HPUX_INCLUDED 20 | #define Foundation_SharedLibrary_HPUX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API SharedLibraryImpl 32 | { 33 | protected: 34 | SharedLibraryImpl(); 35 | ~SharedLibraryImpl(); 36 | void loadImpl(const std::string& path, int flags); 37 | void unloadImpl(); 38 | bool isLoadedImpl() const; 39 | void* findSymbolImpl(const std::string& name); 40 | const std::string& getPathImpl() const; 41 | static std::string suffixImpl(); 42 | 43 | private: 44 | std::string _path; 45 | shl_t _handle; 46 | static FastMutex _mutex; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_SharedLibrary_HPUX_INCLUDED 54 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_UNIX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_UNIX.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for UNIX (dlopen). 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_UNIX_INCLUDED 20 | #define Foundation_SharedLibrary_UNIX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API SharedLibraryImpl 31 | { 32 | protected: 33 | enum Flags 34 | { 35 | SHLIB_GLOBAL_IMPL = 1, 36 | SHLIB_LOCAL_IMPL = 2 37 | }; 38 | 39 | SharedLibraryImpl(); 40 | ~SharedLibraryImpl(); 41 | void loadImpl(const std::string& path, int flags); 42 | void unloadImpl(); 43 | bool isLoadedImpl() const; 44 | void* findSymbolImpl(const std::string& name); 45 | const std::string& getPathImpl() const; 46 | static std::string suffixImpl(); 47 | 48 | private: 49 | std::string _path; 50 | void* _handle; 51 | static FastMutex _mutex; 52 | }; 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_SharedLibrary_UNIX_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_VMS.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_VMS.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_VMS.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for VMS (dlopen). 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_VMS_INCLUDED 20 | #define Foundation_SharedLibrary_VMS_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API SharedLibraryImpl 31 | { 32 | protected: 33 | SharedLibraryImpl(); 34 | ~SharedLibraryImpl(); 35 | void loadImpl(const std::string& path, int flags); 36 | void unloadImpl(); 37 | bool isLoadedImpl() const; 38 | void* findSymbolImpl(const std::string& name); 39 | const std::string& getPathImpl() const; 40 | static std::string suffixImpl(); 41 | 42 | private: 43 | std::string _path; 44 | static FastMutex _mutex; 45 | }; 46 | 47 | 48 | } // namespace Poco 49 | 50 | 51 | #endif // Foundation_SharedLibrary_VMS_INCLUDED 52 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_VX.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_VX.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_VX.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for VxWorks. 11 | // 12 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_VX_INCLUDED 20 | #define Foundation_SharedLibrary_VX_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | class Foundation_API SharedLibraryImpl 32 | { 33 | protected: 34 | SharedLibraryImpl(); 35 | ~SharedLibraryImpl(); 36 | void loadImpl(const std::string& path, int flags); 37 | void unloadImpl(); 38 | bool isLoadedImpl() const; 39 | void* findSymbolImpl(const std::string& name); 40 | const std::string& getPathImpl() const; 41 | static std::string suffixImpl(); 42 | 43 | private: 44 | std::string _path; 45 | MODULE_ID _moduleId; 46 | static FastMutex _mutex; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_SharedLibrary_VX_INCLUDED 54 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_WIN32.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_WIN32.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for Win32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_WIN32_INCLUDED 20 | #define Foundation_SharedLibrary_WIN32_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API SharedLibraryImpl 31 | { 32 | protected: 33 | SharedLibraryImpl(); 34 | ~SharedLibraryImpl(); 35 | void loadImpl(const std::string& path, int flags); 36 | void unloadImpl(); 37 | bool isLoadedImpl() const; 38 | void* findSymbolImpl(const std::string& name); 39 | const std::string& getPathImpl() const; 40 | static std::string suffixImpl(); 41 | 42 | private: 43 | std::string _path; 44 | void* _handle; 45 | static FastMutex _mutex; 46 | }; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_SharedLibrary_WIN32_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/SharedLibrary_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // SharedLibrary_WIN32U.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/SharedLibrary_WIN32U.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: SharedLibrary 8 | // Module: SharedLibrary 9 | // 10 | // Definition of the SharedLibraryImpl class for Win32. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_SharedLibrary_WIN32U_INCLUDED 20 | #define Foundation_SharedLibrary_WIN32U_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Mutex.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API SharedLibraryImpl 31 | { 32 | protected: 33 | SharedLibraryImpl(); 34 | ~SharedLibraryImpl(); 35 | void loadImpl(const std::string& path, int flags); 36 | void unloadImpl(); 37 | bool isLoadedImpl() const; 38 | void* findSymbolImpl(const std::string& name); 39 | const std::string& getPathImpl() const; 40 | static std::string suffixImpl(); 41 | 42 | private: 43 | std::string _path; 44 | void* _handle; 45 | static FastMutex _mutex; 46 | }; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_SharedLibrary_WIN32U_INCLUDED 53 | -------------------------------------------------------------------------------- /third/Poco/StreamChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // StreamChannel.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/StreamChannel.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Logging 8 | // Module: StreamChannel 9 | // 10 | // Definition of the StreamChannel class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_StreamChannel_INCLUDED 20 | #define Foundation_StreamChannel_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/Channel.h" 25 | #include "Poco/Mutex.h" 26 | #include 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | class Foundation_API StreamChannel: public Channel 33 | /// A channel that writes to an ostream. 34 | /// 35 | /// Only the message's text is written, followed 36 | /// by a newline. 37 | /// 38 | /// Chain this channel to a FormattingChannel with an 39 | /// appropriate Formatter to control what is contained 40 | /// in the text. 41 | { 42 | public: 43 | StreamChannel(std::ostream& str); 44 | /// Creates the channel. 45 | 46 | void log(const Message& msg); 47 | /// Logs the given message to the channel's stream. 48 | 49 | protected: 50 | virtual ~StreamChannel(); 51 | 52 | private: 53 | std::ostream& _str; 54 | FastMutex _mutex; 55 | }; 56 | 57 | 58 | } // namespace Poco 59 | 60 | 61 | #endif // Foundation_StreamChannel_INCLUDED 62 | -------------------------------------------------------------------------------- /third/Poco/Util/IntValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // IntValidator.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/IntValidator.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Options 8 | // Module: IntValidator 9 | // 10 | // Definition of the IntValidator class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_IntValidator_INCLUDED 20 | #define Util_IntValidator_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/Util/Validator.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Util { 29 | 30 | 31 | class Util_API IntValidator: public Validator 32 | /// The IntValidator tests whether the option argument, 33 | /// which must be an integer, lies within a given range. 34 | { 35 | public: 36 | IntValidator(int min, int max); 37 | /// Creates the IntValidator. 38 | 39 | ~IntValidator(); 40 | /// Destroys the IntValidator. 41 | 42 | void validate(const Option& option, const std::string& value); 43 | /// Validates the value for the given option by 44 | /// testing whether it's an integer that lies within 45 | /// a given range. 46 | 47 | private: 48 | IntValidator(); 49 | 50 | int _min; 51 | int _max; 52 | }; 53 | 54 | 55 | } } // namespace Poco::Util 56 | 57 | 58 | #endif // Util_IntValidator_INCLUDED 59 | -------------------------------------------------------------------------------- /third/Poco/Util/LoggingSubsystem.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoggingSubsystem.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/LoggingSubsystem.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Application 8 | // Module: LoggingSubsystem 9 | // 10 | // Definition of the LoggingSubsystem class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_LoggingSubsystem_INCLUDED 20 | #define Util_LoggingSubsystem_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/Util/Subsystem.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Util { 29 | 30 | 31 | class Util_API LoggingSubsystem: public Subsystem 32 | /// The LoggingSubsystem class initializes the logging 33 | /// framework using the LoggingConfigurator. 34 | /// 35 | /// It also sets the Application's logger to 36 | /// the logger specified by the "application.logger" 37 | /// property, or to "Application" if the property 38 | /// is not specified. 39 | { 40 | public: 41 | LoggingSubsystem(); 42 | const char* name() const; 43 | 44 | protected: 45 | void initialize(Application& self); 46 | void uninitialize(); 47 | ~LoggingSubsystem(); 48 | }; 49 | 50 | 51 | } } // namespace Poco::Util 52 | 53 | 54 | #endif // Util_LoggingSubsystem_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/Util/MapConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // MapConfiguration.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/MapConfiguration.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Configuration 8 | // Module: MapConfiguration 9 | // 10 | // Definition of the MapConfiguration class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_MapConfiguration_INCLUDED 20 | #define Util_MapConfiguration_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/Util/AbstractConfiguration.h" 25 | #include 26 | 27 | 28 | namespace Poco { 29 | namespace Util { 30 | 31 | 32 | class Util_API MapConfiguration: public AbstractConfiguration 33 | /// An implementation of AbstractConfiguration that stores configuration data in a map. 34 | { 35 | public: 36 | MapConfiguration(); 37 | /// Creates an empty MapConfiguration. 38 | 39 | void clear(); 40 | /// Clears the configuration. 41 | 42 | protected: 43 | typedef std::map StringMap; 44 | typedef StringMap::const_iterator iterator; 45 | 46 | bool getRaw(const std::string& key, std::string& value) const; 47 | void setRaw(const std::string& key, const std::string& value); 48 | void enumerate(const std::string& key, Keys& range) const; 49 | void removeRaw(const std::string& key); 50 | ~MapConfiguration(); 51 | 52 | iterator begin() const; 53 | iterator end() const; 54 | 55 | private: 56 | StringMap _map; 57 | }; 58 | 59 | 60 | } } // namespace Poco::Util 61 | 62 | 63 | #endif // Util_MapConfiguration_INCLUDED 64 | -------------------------------------------------------------------------------- /third/Poco/Util/OptionException.h: -------------------------------------------------------------------------------- 1 | // 2 | // OptionException.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/OptionException.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Options 8 | // Module: OptionException 9 | // 10 | // Definition of the OptionException class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_OptionException_INCLUDED 20 | #define Util_OptionException_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/Exception.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Util { 29 | 30 | 31 | POCO_DECLARE_EXCEPTION(Util_API, OptionException, Poco::DataException) 32 | POCO_DECLARE_EXCEPTION(Util_API, UnknownOptionException, OptionException) 33 | POCO_DECLARE_EXCEPTION(Util_API, AmbiguousOptionException, OptionException) 34 | POCO_DECLARE_EXCEPTION(Util_API, MissingOptionException, OptionException) 35 | POCO_DECLARE_EXCEPTION(Util_API, MissingArgumentException, OptionException) 36 | POCO_DECLARE_EXCEPTION(Util_API, InvalidArgumentException, OptionException) 37 | POCO_DECLARE_EXCEPTION(Util_API, UnexpectedArgumentException, OptionException) 38 | POCO_DECLARE_EXCEPTION(Util_API, IncompatibleOptionsException, OptionException) 39 | POCO_DECLARE_EXCEPTION(Util_API, DuplicateOptionException, OptionException) 40 | POCO_DECLARE_EXCEPTION(Util_API, EmptyOptionException, OptionException) 41 | 42 | 43 | } } // namespace Poco::Util 44 | 45 | 46 | #endif // Util_OptionException_INCLUDED 47 | -------------------------------------------------------------------------------- /third/Poco/Util/RegExpValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // RegExpValidator.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/RegExpValidator.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Options 8 | // Module: RegExpValidator 9 | // 10 | // Definition of the RegExpValidator class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_RegExpValidator_INCLUDED 20 | #define Util_RegExpValidator_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/Util/Validator.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Util { 29 | 30 | 31 | class Util_API RegExpValidator: public Validator 32 | /// This validator matches the option value against 33 | /// a regular expression. 34 | { 35 | public: 36 | RegExpValidator(const std::string& regexp); 37 | /// Creates the RegExpValidator, using the given regular expression. 38 | 39 | ~RegExpValidator(); 40 | /// Destroys the RegExpValidator. 41 | 42 | void validate(const Option& option, const std::string& value); 43 | /// Validates the value for the given option by 44 | /// matching it with the regular expression. 45 | 46 | private: 47 | RegExpValidator(); 48 | 49 | std::string _regexp; 50 | }; 51 | 52 | 53 | } } // namespace Poco::Util 54 | 55 | 56 | #endif // Util_RegExpValidator_INCLUDED 57 | -------------------------------------------------------------------------------- /third/Poco/Util/Validator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Validator.h 3 | // 4 | // $Id: //poco/1.4/Util/include/Poco/Util/Validator.h#1 $ 5 | // 6 | // Library: Util 7 | // Package: Options 8 | // Module: Validator 9 | // 10 | // Definition of the Validator class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Util_Validator_INCLUDED 20 | #define Util_Validator_INCLUDED 21 | 22 | 23 | #include "Poco/Util/Util.h" 24 | #include "Poco/RefCountedObject.h" 25 | 26 | 27 | namespace Poco { 28 | namespace Util { 29 | 30 | 31 | class Option; 32 | 33 | 34 | class Util_API Validator: public Poco::RefCountedObject 35 | /// Validator specifies the interface for option validators. 36 | /// 37 | /// Option validators provide a simple way for the automatic 38 | /// validation of command line argument values. 39 | { 40 | public: 41 | virtual void validate(const Option& option, const std::string& value) = 0; 42 | /// Validates the value for the given option. 43 | /// Does nothing if the value is valid. 44 | /// 45 | /// Throws an OptionException otherwise. 46 | 47 | protected: 48 | Validator(); 49 | /// Creates the Validator. 50 | 51 | virtual ~Validator(); 52 | /// Destroys the Validator. 53 | }; 54 | 55 | 56 | } } // namespace Poco::Util 57 | 58 | 59 | #endif // Util_Validator_INCLUDED 60 | -------------------------------------------------------------------------------- /third/Poco/ValidArgs.h: -------------------------------------------------------------------------------- 1 | // 2 | // ValidArgs.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/ValidArgs.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Cache 8 | // Module: ValidArgs 9 | // 10 | // Definition of the ValidArgs class. 11 | // 12 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_ValidArgs_INCLUDED 20 | #define Foundation_ValidArgs_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | template 30 | class ValidArgs 31 | { 32 | public: 33 | ValidArgs(const TKey& key): 34 | _key(key), 35 | _isValid(true) 36 | { 37 | } 38 | 39 | ValidArgs(const ValidArgs& args): 40 | _key(args._key), 41 | _isValid(args._isValid) 42 | { 43 | } 44 | 45 | ~ValidArgs() 46 | { 47 | } 48 | 49 | const TKey& key() const 50 | { 51 | return _key; 52 | } 53 | 54 | bool isValid() const 55 | { 56 | return _isValid; 57 | } 58 | 59 | void invalidate() 60 | { 61 | _isValid = false; 62 | } 63 | 64 | protected: 65 | const TKey& _key; 66 | bool _isValid; 67 | 68 | private: 69 | ValidArgs& operator = (const ValidArgs& args); 70 | }; 71 | 72 | 73 | } // namespace Poco 74 | 75 | 76 | #endif // Foundation_ValidArgs_INCLUDED 77 | -------------------------------------------------------------------------------- /third/Poco/Version.h: -------------------------------------------------------------------------------- 1 | // 2 | // Version.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Version.h#10 $ 5 | // 6 | // Library: Foundation 7 | // Package: Core 8 | // Module: Version 9 | // 10 | // Version information for the POCO C++ Libraries. 11 | // 12 | // Copyright (c) 2004-2012, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Version_INCLUDED 20 | #define Foundation_Version_INCLUDED 21 | 22 | 23 | // 24 | // Version Information 25 | // 26 | // Since 1.6.0, we're using Semantic Versioning 2.0 27 | // (http://semver.org/spec/v2.0.0.html) 28 | // 29 | // Version format is 0xAABBCCDD, where 30 | // - AA is the major version number, 31 | // - BB is the minor version number, 32 | // - CC is the patch version number, and 33 | // - DD is the pre-release designation/number. 34 | // The pre-release designation hex digits have a special meaning: 35 | // 00: final/stable releases 36 | // Dx: development releases 37 | // Ax: alpha releases 38 | // Bx: beta releases 39 | // 40 | #define POCO_VERSION 0x01060000 41 | 42 | 43 | #endif // Foundation_Version_INCLUDED 44 | -------------------------------------------------------------------------------- /third/Poco/Windows1250Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Windows1250Encoding.h 3 | // 4 | // $Id: //poco/svn/Foundation/include/Poco/Windows1250Encoding.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Windows1250Encoding 9 | // 10 | // Definition of the Windows1250Encoding class. 11 | // 12 | // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Windows1250Encoding_INCLUDED 20 | #define Foundation_Windows1250Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Windows1250Encoding: public TextEncoding 31 | /// Windows Codepage 1250 text encoding. 32 | /// Based on: http://msdn.microsoft.com/en-us/goglobal/cc305143 33 | { 34 | public: 35 | Windows1250Encoding(); 36 | ~Windows1250Encoding(); 37 | const char* canonicalName() const; 38 | bool isA(const std::string& encodingName) const; 39 | const CharacterMap& characterMap() const; 40 | int convert(const unsigned char* bytes) const; 41 | int convert(int ch, unsigned char* bytes, int length) const; 42 | int queryConvert(const unsigned char* bytes, int length) const; 43 | int sequenceLength(const unsigned char* bytes, int length) const; 44 | 45 | private: 46 | static const char* _names[]; 47 | static const CharacterMap _charMap; 48 | }; 49 | 50 | 51 | } // namespace Poco 52 | 53 | 54 | #endif // Foundation_Windows1250Encoding_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/Windows1251Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Windows1251Encoding.h 3 | // 4 | // $Id: //poco/svn/Foundation/include/Poco/Windows1251Encoding.h#2 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Windows1251Encoding 9 | // 10 | // Definition of the Windows1251Encoding class. 11 | // 12 | // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Windows1251Encoding_INCLUDED 20 | #define Foundation_Windows1251Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Windows1251Encoding: public TextEncoding 31 | /// Windows Codepage 1251 text encoding. 32 | /// Based on: http://msdn.microsoft.com/en-us/goglobal/cc305144 33 | { 34 | public: 35 | Windows1251Encoding(); 36 | ~Windows1251Encoding(); 37 | const char* canonicalName() const; 38 | bool isA(const std::string& encodingName) const; 39 | const CharacterMap& characterMap() const; 40 | int convert(const unsigned char* bytes) const; 41 | int convert(int ch, unsigned char* bytes, int length) const; 42 | int queryConvert(const unsigned char* bytes, int length) const; 43 | int sequenceLength(const unsigned char* bytes, int length) const; 44 | 45 | private: 46 | static const char* _names[]; 47 | static const CharacterMap _charMap; 48 | }; 49 | 50 | 51 | } // namespace Poco 52 | 53 | 54 | #endif // Foundation_Windows1251Encoding_INCLUDED 55 | -------------------------------------------------------------------------------- /third/Poco/Windows1252Encoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // Windows1252Encoding.h 3 | // 4 | // $Id: //poco/1.4/Foundation/include/Poco/Windows1252Encoding.h#1 $ 5 | // 6 | // Library: Foundation 7 | // Package: Text 8 | // Module: Windows1252Encoding 9 | // 10 | // Definition of the Windows1252Encoding class. 11 | // 12 | // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef Foundation_Windows1252Encoding_INCLUDED 20 | #define Foundation_Windows1252Encoding_INCLUDED 21 | 22 | 23 | #include "Poco/Foundation.h" 24 | #include "Poco/TextEncoding.h" 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | class Foundation_API Windows1252Encoding: public TextEncoding 31 | /// Windows Codepage 1252 text encoding. 32 | { 33 | public: 34 | Windows1252Encoding(); 35 | ~Windows1252Encoding(); 36 | const char* canonicalName() const; 37 | bool isA(const std::string& encodingName) const; 38 | const CharacterMap& characterMap() const; 39 | int convert(const unsigned char* bytes) const; 40 | int convert(int ch, unsigned char* bytes, int length) const; 41 | int queryConvert(const unsigned char* bytes, int length) const; 42 | int sequenceLength(const unsigned char* bytes, int length) const; 43 | 44 | private: 45 | static const char* _names[]; 46 | static const CharacterMap _charMap; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_Windows1252Encoding_INCLUDED 54 | -------------------------------------------------------------------------------- /third/Poco/XML/XMLException.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLException.h 3 | // 4 | // $Id: //poco/1.4/XML/include/Poco/XML/XMLException.h#1 $ 5 | // 6 | // Library: XML 7 | // Package: XML 8 | // Module: XMLException 9 | // 10 | // Definition of the XMLException class. 11 | // 12 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 13 | // and Contributors. 14 | // 15 | // SPDX-License-Identifier: BSL-1.0 16 | // 17 | 18 | 19 | #ifndef XML_XMLException_INCLUDED 20 | #define XML_XMLException_INCLUDED 21 | 22 | 23 | #include "Poco/XML/XML.h" 24 | #include "Poco/Exception.h" 25 | 26 | 27 | namespace Poco { 28 | namespace XML { 29 | 30 | 31 | POCO_DECLARE_EXCEPTION(XML_API, XMLException, Poco::RuntimeException) 32 | /// The base class for all XML-related exceptions like SAXException 33 | /// and DOMException. 34 | 35 | 36 | } } // namespace Poco::XML 37 | 38 | 39 | #endif // XML_XMLException_INCLUDED 40 | -------------------------------------------------------------------------------- /third/librtmp/librtmp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | incdir=${prefix}/include 5 | 6 | Name: librtmp 7 | Description: RTMP implementation 8 | Version: @VERSION@ 9 | Requires: @CRYPTO_REQ@ 10 | URL: http://rtmpdump.mplayerhq.hu 11 | Libs: -L${libdir} -lrtmp -lz @PUBLIC_LIBS@ 12 | Libs.private: @PRIVATE_LIBS@ 13 | Cflags: -I${incdir} 14 | -------------------------------------------------------------------------------- /third/live555/BasicUsageEnvironment/BasicUsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "BasicUsageEnvironment" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _BASICUSAGEENVIRONMENT_VERSION_HH 5 | #define _BASICUSAGEENVIRONMENT_VERSION_HH 6 | 7 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2015.01.04" 8 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1420329600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /third/live555/UsageEnvironment/Boolean.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | #ifndef _BOOLEAN_HH 17 | #define _BOOLEAN_HH 18 | 19 | #if defined(__BORLANDC__) || (!defined(USE_LIVE555_BOOLEAN) && defined(_MSC_VER) && _MSC_VER >= 1400) 20 | // Use the "bool" type defined by the Borland compiler, and MSVC++ 8.0, Visual Studio 2005 and higher 21 | typedef bool Boolean; 22 | #define False false 23 | #define True true 24 | #else 25 | typedef unsigned char Boolean; 26 | #ifndef __MSHTML_LIBRARY_DEFINED__ 27 | #ifndef False 28 | const Boolean False = 0; 29 | #endif 30 | #ifndef True 31 | const Boolean True = 1; 32 | #endif 33 | 34 | #endif 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /third/live555/UsageEnvironment/UsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "UsageEnvironment" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _USAGEENVIRONMENT_VERSION_HH 5 | #define _USAGEENVIRONMENT_VERSION_HH 6 | 7 | #define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2015.01.04" 8 | #define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1420329600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /third/live555/UsageEnvironment/strDup.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | 17 | #ifndef _STRDUP_HH 18 | #define _STRDUP_HH 19 | 20 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 21 | // A C++ equivalent to the standard C routine "strdup()". 22 | // This generates a char* that can be deleted using "delete[]" 23 | // Header 24 | 25 | #include 26 | 27 | char* strDup(char const* str); 28 | // Note: strDup(NULL) returns NULL 29 | 30 | char* strDupSize(char const* str); 31 | // Like "strDup()", except that it *doesn't* copy the original. 32 | // (Instead, it just allocates a string of the same size as the original.) 33 | 34 | char* strDupSize(char const* str, size_t& resultBufSize); 35 | // An alternative form of "strDupSize()" that also returns the size of the allocated buffer. 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /third/live555/groupsock/IOHandlers.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "mTunnel" multicast access service 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // IO event handlers 19 | // C++ header 20 | 21 | #ifndef _IO_HANDLERS_HH 22 | #define _IO_HANDLERS_HH 23 | 24 | #ifndef _NET_INTERFACE_HH 25 | #include "NetInterface.hh" 26 | #endif 27 | 28 | // Handles incoming data on sockets: 29 | void socketReadHandler(Socket* sock, int mask); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /third/live555/groupsock/groupsock_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "groupsock" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _GROUPSOCK_VERSION_HH 5 | #define _GROUPSOCK_VERSION_HH 6 | 7 | #define GROUPSOCK_LIBRARY_VERSION_STRING "2015.01.04" 8 | #define GROUPSOCK_LIBRARY_VERSION_INT 1420329600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /third/live555/liveMedia/FramedFileSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // Framed File Sources 19 | // C++ header 20 | 21 | #ifndef _FRAMED_FILE_SOURCE_HH 22 | #define _FRAMED_FILE_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class FramedFileSource: public FramedSource { 29 | protected: 30 | FramedFileSource(UsageEnvironment& env, FILE* fid); // abstract base class 31 | virtual ~FramedFileSource(); 32 | 33 | protected: 34 | FILE* fFid; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /third/live555/liveMedia/MP3Transcoder.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // MP3 Transcoder 19 | // C++ header 20 | 21 | #ifndef _MP3_TRANSCODER_HH 22 | #define _MP3_TRANSCODER_HH 23 | 24 | #ifndef _MP3_ADU_HH 25 | #include "MP3ADU.hh" 26 | #endif 27 | #ifndef _MP3_ADU_TRANSCODER_HH 28 | #include "MP3ADUTranscoder.hh" 29 | #endif 30 | 31 | class MP3Transcoder: public MP3FromADUSource { 32 | public: 33 | static MP3Transcoder* createNew(UsageEnvironment& env, 34 | unsigned outBitrate /* in kbps */, 35 | FramedSource* inputSource); 36 | 37 | protected: 38 | MP3Transcoder(UsageEnvironment& env, 39 | MP3ADUTranscoder* aduTranscoder); 40 | // called only by createNew() 41 | virtual ~MP3Transcoder(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /third/live555/liveMedia/OutputFile.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // Common routines for opening/closing named output files 19 | // C++ header 20 | 21 | #ifndef _OUTPUT_FILE_HH 22 | #define _OUTPUT_FILE_HH 23 | 24 | #include 25 | #include 26 | 27 | FILE* OpenOutputFile(UsageEnvironment& env, char const* fileName); 28 | 29 | void CloseOutputFile(FILE* fid); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /third/live555/liveMedia/QCELPAudioRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // Qualcomm "PureVoice" (aka. "QCELP") Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _QCELP_AUDIO_RTP_SOURCE_HH 22 | #define _QCELP_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _RTP_SOURCE_HH 25 | #include "RTPSource.hh" 26 | #endif 27 | 28 | class QCELPAudioRTPSource { 29 | public: 30 | static FramedSource* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs, 32 | RTPSource*& resultRTPSource, 33 | unsigned char rtpPayloadFormat = 12, 34 | unsigned rtpTimestampFrequency = 8000); 35 | // This returns a source to read from, but "resultRTPSource" will 36 | // point to RTP-related state. 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /third/live555/liveMedia/TextRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for text codecs (abstract base class) 19 | // C++ header 20 | 21 | #ifndef _TEXT_RTP_SINK_HH 22 | #define _TEXT_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class TextRTPSink: public MultiFramedRTPSink { 29 | protected: 30 | TextRTPSink(UsageEnvironment& env, 31 | Groupsock* rtpgs, unsigned char rtpPayloadType, 32 | unsigned rtpTimestampFrequency, 33 | char const* rtpPayloadFormatName); 34 | // (we're an abstract base class) 35 | virtual ~TextRTPSink(); 36 | 37 | private: // redefined virtual functions: 38 | virtual char const* sdpMediaType() const; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /third/live555/liveMedia/VideoRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 2.1 of the License, or (at your 5 | option) any later version. (See .) 6 | 7 | This library is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public License 13 | along with this library; if not, write to the Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | **********/ 16 | // "liveMedia" 17 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for video codecs (abstract base class) 19 | // C++ header 20 | 21 | #ifndef _VIDEO_RTP_SINK_HH 22 | #define _VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class VideoRTPSink: public MultiFramedRTPSink { 29 | protected: 30 | VideoRTPSink(UsageEnvironment& env, 31 | Groupsock* rtpgs, unsigned char rtpPayloadType, 32 | unsigned rtpTimestampFrequency, 33 | char const* rtpPayloadFormatName); 34 | // (we're an abstract base class) 35 | virtual ~VideoRTPSink(); 36 | 37 | private: // redefined virtual functions: 38 | virtual char const* sdpMediaType() const; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /third/live555/liveMedia/liveMedia_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "liveMedia" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _LIVEMEDIA_VERSION_HH 5 | #define _LIVEMEDIA_VERSION_HH 6 | 7 | #define LIVEMEDIA_LIBRARY_VERSION_STRING "2015.01.04" 8 | #define LIVEMEDIA_LIBRARY_VERSION_INT 1420329600 9 | 10 | #endif 11 | --------------------------------------------------------------------------------