Giter Site home page Giter Site logo

sourcey / libsourcey Goto Github PK

View Code? Open in Web Editor NEW
1.3K 131.0 343.0 35.35 MB

C++14 evented IO libraries for high performance networking and media based applications

Home Page: https://sourcey.com/libsourcey

License: GNU Lesser General Public License v2.1

CMake 5.83% C++ 69.81% C 0.21% JavaScript 8.25% HTML 15.16% Objective-C++ 0.35% CSS 0.31% Makefile 0.02% Dockerfile 0.05%

libsourcey's Introduction

LibSourcey

C++ Networking Evolved

Circle CI Doxygen

LibSourcey is a collection of cross platform C++14 modules and classes that provide developers with an arsenal for rapidly developing high performance network based p2p and media streaming applications. Think of it as the power and performance of libuv combined with the features of FFmpeg, OpenCV and WebRTC, all integrated with the ease and readability of the stl (C++ Standard Library).

Basic features

  • Event-based IO — Core modules are built on top of libuv (the underlying C library that powers nodejs) and use event-based asynchronous IO throughout to maximize performance and minimize concurrency reliance for building mission critical native and server side apps.

  • Cross platform — The codebase is cross platform and should compile on any system with access to a modern C++14 compiler.

  • Modular libraries — Libraries are modular for easy integration into your existing projects, so you can just "include what you need" without incurring extra incumbent bloat.

  • Well tested — Core modules are well tested with unit tests and stress tested daily in production.

  • Clean and readable code — Modern C++ design principles have been adhered to throughout for clean and readable code.

  • Easy packaging and installation — LibSourcey can be compiled and installed on most platforms with CMake. For straight forward distribution and integration with existing projects the libraries be also packaged as a deb, rpm, tar.gz, zip, and more formats with a single command.

  • Docker images — Semantically versioned images are available on Docker Hub. Just type docker pull sourcey/libsourcey to grab the latest.

  • Solid networking layer — At the core of LibSourcey is a solid and blazing fast networking layer build on libuv and openssl primitives, with TCP, SSL and UDP socket implementations.

  • Web servers and clients — A HTTP stack is provided that includes servers, clients, WebSockets, media streaming, file transfers, and authentication. The HTTP parser is based on the super-fast C code used by nginx.

  • Media streaming and encoding — The av library consists of thin wrappers around FFmpeg and OpenCV for media capture, encoding, recording, streaming, analysis and more.

  • Realtime messaging — LibSourcey aims to bridge the gap between desktop, mobile and web by providing performance oriented messaging solutions that work across all platforms.

    • Socket.IO — Socket.IO C++ client that supports the latest protocol revision 4 (>= 1.0). Read more about Socket.IO.
    • Symple — Sourcey's home grown realtime messaging protocol that works over the top of Socket.IO to provide rostering, presence and many other features necessary for building online games and chat applications. More about Symple.
  • WebRTC support — WebRTC native support allows you to build p2p desktop and server side applications that inherit LibSourcey's realtime messaging and media capabilities. Take a look at the examples for how to stream live webcam and microphone streams to the browser, and also how to record live WebRTC streams on the server side.

Getting started

See the installation guides in the docs to get started playing with LibSourcey.

A few examples

What better way to get acquainted with a new library then with some tasty code examples.

HTTP echo server

Lets start with the classic HTTP echo server, which looks something like this:

http::Server srv{ "127.0.0.1", 1337 };
srv.Connection += [](http::ServerConnection::Ptr conn) {
    conn->Payload += [](http::ServerConnection& conn, const MutableBuffer& buffer) {
        conn.send(bufferCast<const char*>(buffer), buffer.size());
        conn.close();
    };
};
srv.start();

Pretty neat right? Its crazy fast too, especially on Linux kernel 3.9 or newer where its optimized to use of kernel level multicore socket load balancing. Don't take our word for it though, here are some benchmarks using wrk:

LibSourcey httpechoserver

$ wrk -d10s --timeout 2s http://localhost:1337
Running 10s test @ http://localhost:1337
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   265.76us  472.62us  12.42ms   97.51%
    Req/Sec    18.84k     1.26k   21.57k    74.50%
  375060 requests in 10.01s, 20.39MB read
Requests/sec:  37461.50
Transfer/sec:      2.04MB

Nodejs echo server

$ wrk -d10s --timeout 2s http://localhost:1337
Running 10s test @ http://localhost:1337
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   502.70us  715.11us  14.83ms   97.90%
    Req/Sec    11.69k     1.46k   14.52k    70.50%
  232667 requests in 10.01s, 21.97MB read
Requests/sec:  23236.33
Transfer/sec:      2.19MB

As you can see the httpechoserver is almost twice as fast as the dead simple nodejs echo server, which is not a bad performance gain over one of the web's leading technologies thats touted for it's performance. Check the httpechoserver sample for the full code, including the nodejs echo server we used for benchmarking.

Processes

Interacting with system processes and piping IO doesn't have to be painful. The following code will run the ping sourcey.com and with stdio and exit callbacks:

Process proc{ "ping", "sourcey.com" };
proc.onstdout = [](std::string line)
{
    // handle process output
};
proc.onexit = [](std::int64_t status)
{
    // handle process exit
};
proc.spawn();

// write some random data to the stdin pipe
proc.in() << "random data"

Packet Stream

A good starting point for learning LibSourcey is the PacketStream, which lets you create a dynamic delegate chain for piping, processing and outputting arbitrary data packets. This method of layering packet processors and makes it possible to develop complex data processing applications on the fly.

For example, the code below captures a live webcam stream, encodes it into H.264, and then finally broadcasts it in realtime over the internet:

// Create a PacketStream to pass packets from the
// input device captures -> encoder -> socket
PacketStream stream;

// Setup the encoder options
av::EncoderOptions options;
options.oformat = av::Format{"MP4", "mp4",
    { "H.264", "libx264", 640, 480, 25, 48000, 128000, "yuv420p" },
    { "AAC", "aac", 2, 44100, 64000, "fltp" }};

// Create a device manager instance to enumerate system devices
av::DeviceManager devman;
av::Device device;

// Create and attach the default video capture
av::VideoCapture::Ptr video;
if (devman.getDefaultCamera(device)) {
    video.open(device.id, 640, 480);
    video.getEncoderFormat(options.iformat);
    stream.attachSource(video, true);
}

// Create and attach the default audio capture
av::AudioCapture::Ptr audio;
if (devman.getDefaultMicrophone(device)) {
    audio.open(device.id, 2, 44100);
    audio.getEncoderFormat(options.iformat);
    stream.attachSource(audio, true);
}

// Create and attach the multiplex encoder
av::MultiplexPacketEncoder::Ptr encoder(options);
stream.attach(encoder);

// Attach the output net::Socket instance (instantiated elsewhere)
// to broadcast encoded packets over the network
stream.attach(socket);

// Start the stream
// This method call will start the device captures and begin
// pumping encoded media into the output socket
stream.start();

There are plenty more demos and sample code to play with over on the examples page.

Contributors

A massive thanks to everyone who has contributed to making LibSourcey awesome:

  • Kam Low (@auscaster) — Primary developer
  • Yury Shulbn (@yuryshubin) — iOS build toolchain and platform fixes
  • Vinci Xu (@VinciShark) — Windows documentation, testing and updates
  • Michael Fig (@michael-fig) — Fixed compiler flags to build without FFmpeg
  • Hyunuk Kim (@surinkim) — Fixed std::codecvt unicode character conversion on Windows
  • Damian Zelim (@ZelimDamian) — Fixed compiler flags for OS X build
  • Norm Ovenseri (@normano) — Added verbose logging output to build system
  • Alexey (@deilos) — Fixed cross-platform FFmpeg build script
  • Kryton (@Malesio) — Fixed segfaults in samples and tidied up Valgrind warnings

Contributing

Pull Requests are always welcome, so if you fix or make anything better then feel free to float a PR back upstream :)

  1. Fork LibSourcey on Github
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

libsourcey's People

Contributors

alexflint avatar auscaster avatar cksmith avatar deilos avatar infinityproject16 avatar inouiw avatar lutsykigor avatar malesio avatar michaelfig avatar mr-kakorin avatar normano avatar r-gerard avatar surinkim avatar vincishark avatar yuryshubin avatar zelimdamian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libsourcey's Issues

Build problem on Mac: jsoncpp

Hi!

I'm having some trouble building the code. Once I run

$ make

it stops at 17%

Console output:
[ 16%] Building C object deps/libuv/CMakeFiles/libuv.dir/src/unix/darwin-proctitle.c.o
Linking C shared library liblibuv.dylib
ld: warning: directory not found for option '-L/home/deploy/build/lib'
[ 16%] Built target libuv
Scanning dependencies of target jsoncpp
[ 17%] Building CXX object deps/jsoncpp/CMakeFiles/jsoncpp.dir/jsoncpp.cpp.o
Linking CXX shared library libjsoncpp.dylib
ld: warning: directory not found for option '-L/home/deploy/build/lib'
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [deps/jsoncpp/libjsoncpp.dylib] Error 1
make[1]: *** [deps/jsoncpp/CMakeFiles/jsoncpp.dir/all] Error 2
make: *** [all] Error 2

Apparently it fails to find a library when linking—libjsoncpp.dylib. So does this mean that it cannot build jsoncpp ..?

Sorry if this error seems too newbie!

—N

WebRTC recording with OpenCV integration?

Bountysource

Is there an example of using OpenCV to process frames from a live WebRTC video stream? As an example, say you wanted to perform some basic feature detection (e.g. canny edge detection) on frames as they streamed in from a WebRTC peer; how would you accomplish this with libsourcey?

I noticed the WebRTC Native Video Recorder sample and this bit of code:

        Signaler app(options);

        Idler rtc(app.loop,
                  [](void* arg) {
                      // TraceL << "Running WebRTC loop" << endl;
                      auto thread = reinterpret_cast<rtc::Thread*>(arg);
                      thread->ProcessMessages(10);
                  },
                  rtc::Thread::Current());

It's not clear to me though how I would integrate OpenCV to process frames as they were received. Is there something like a "frame received" event/object? Recording the stream is also desirable, so it seems like this example is a good place to start out, but I would also like to access the frames as images before they are recorded. Thanks.

"Undefined symbols for architecture x86_64" on MAC OS

Hi,
I got failed compiling (linking) libsourcey regarding "Undefined symbols for architecture x86_64".

  • My MAC OS: OS X 10.9.5
  • The compiling (linking) failed message is as below:

Linking C shared library libminizip.dylib
Building C object deps/libuv/CMakeFiles/libuv.dir/src/unix/getaddrinfo.c.o
ld: warning: directory not found for option '-L/home/deploy/build/lib'
Undefined symbols for architecture x86_64:
"_crc32", referenced from:
_unzReadCurrentFile in unzip.c.o
_zipWriteInFileInZip in zip.c.o
....

Could you give any guide for me to fix it?
Thanks.

Notes:
I was following instruction from LibSourcey as following
git clone https://github.com/sourcey/libsourcey.git
cd libsourcey
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE # extra cmake commands here...
make
(Note that I got other issue with missing -lrt, which was fixed by removing dependency on lrt).

What is correct way to create websocket client

I tried following code with latest master, can someone please help me

#include <thread>
#include "scy/util.h"
#include "scy/http/client.h"
#include "scy/http/websocket.h"

using namespace std; using namespace scy; using namespace scy::http; using namespace scy::http::ws;

#define WS_URL "ws://echo.websocket.org:80"

class WSClient : public ws::ConnectionAdapter{
public:
  static WSClient* New(const char* url){
    ClientConnection::Ptr cconn = createConnection(URL(WS_URL));
    cconn->send();
    std::this_thread::sleep_for(std::chrono::milliseconds(5000));
    cout << "\nafter 5 seconds sleep\n" << endl;
    Connection* conn = (Connection*)(cconn.get());
    WSClient* wsc = nullptr;
    wsc = new WSClient(*conn, ClientSide);
    wsc->sendClientRequest();
    return wsc;
  }
private:
  WSClient(scy::http::Connection& con, scy::http::ws::Mode mode) :ConnectionAdapter(con, mode){

  }
  virtual void onSocketConnect() override{
    cout << "onSocketConnect" << endl;
  }
  virtual void onHandshakeComplete() override{
    cout << "onHandshakeComplete" << endl;
  }
};

int main(int argc, char const *argv[]){
  Logger::instance().add(new ConsoleChannel("debug", LTrace));
  WSClient* ws = WSClient::New(WS_URL);
  while(true) std::this_thread::sleep_for(std::chrono::milliseconds(2000000));
  return 0;
}

And this is the output I get

09:08:13 [debug] [scy::http::URL::URL()(36)] Parse char: ws://echo.websocket.org:80
09:08:13 [debug] [scy::http::URL::parse()(95)] Parsing: ws://echo.websocket.org:80
09:08:13 [trace] [scy::net::Socket::Socket()(37):0x288dfc] Create
09:08:13 [trace] [scy::net::TCPSocket::TCPSocket()(33):0x288da4] Create
09:08:13 [trace] [scy::net::TCPSocket::init()(49):0x288da4] Init
09:08:13 [trace] [scy::PacketStream::PacketStream()(37):0x298fb4] Create
09:08:13 [trace] [scy::PacketStream::PacketStream()(37):0x2990f4] Create
09:08:13 [trace] [scy::http::Connection::Connection()(43):0x298ef8] Create: 0x288dfc
09:08:13 [trace] [scy::http::ClientConnection::ClientConnection()(45):0x298ef8] Create: ws://echo.websocket.org:80
09:08:13 [trace] [scy::http::Parser::init()(74):0x299988] Init: 1
09:08:13 [trace] [scy::http::ConnectionAdapter::ConnectionAdapter()(297):0x2998c0] Create: 0x298ef8
09:08:13 [trace] [scy::http::Connection::replaceAdapter()(131):0x298ef8] Replace adapter: 0x2998c4
09:08:13 [trace] [scy::http::ws::WebSocketAdapter::WebSocketAdapter()(70):0x299df8] Create
09:08:13 [trace] [scy::http::Connection::replaceAdapter()(131):0x298ef8] Replace adapter: 0x299df8
09:08:13 [trace] [scy::http::Connection::replaceAdapter()(134):0x298ef8] Replace adapter: Delete existing: 0x2998c4
09:08:13 [trace] [scy::GarbageCollector::GarbageCollector()(39)] Create
09:08:13 [trace] [scy::http::ClientConnection::connect()(139):0x298ef8] Connecting
09:08:13 [trace] [scy::net::Socket::connect()(49):0x288dfc] Connect to host: echo.websocket.org:80

after 5 seconds sleep

09:08:18 [trace] [scy::http::ws::WebSocketAdapter::WebSocketAdapter()(70):0x29a660] Create
09:08:18 [trace] [scy::http::ws::WebSocketAdapter::sendClientRequest()(129):0x29a660] Client request: GET  HTTP/1.1
Connection: Upgrade
Host: echo.websocket.org
Sec-WebSocket-Key: YU1nS2dPQWxub01WQjZQQQ==
Sec-WebSocket-Version: 13
Upgrade: websocket


09:08:18 [trace] [scy::net::TCPSocket::send()(156):0x288da4] Send: 156
09:08:18 [warn] [scy::net::TCPSocket::send()(162)] Send error

pointer to ICE implementation needed

The Readme mentions

Full ICE stack ... based on LibSourcey architecture

While this library looks great (I try to replace libnice) I can't spot an ICE agent or similar in the sources. I found webrtc/include/scy/webrtc/peerconnection.h which seems to be based on webrtc (which I still need to install).
Where do I have to look?

CMake error with FindWebRTC.cmake

Hi,
after #115 resolved, I pull the latest code. But it seems that release version of cmake have some prombles. I get the following error:
CMake Error at cmake/FindWebRTC.cmake:114 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
cmake/LibSourceyIncludes.cmake:47 (find_package)
cmake/LibSourceyIncludes.cmake:90 (find_dependency)
src/webrtc/CMakeLists.txt:4 (include_dependency)
and Release of WEBRTC Variables looks like disk name is missing:
-- Release Libraries: /Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib/amd64/vccorlibd.lib;/Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib/amd64/vcomp.lib;...
So I think somewhere still have bugs?

Windows libsourcey cmake error.

qq 20161015113144

Windows10 x64 with ffmpeg installed already. But cmake can't find ffmepg relative libs.
Also miss other libs' paths in cmake's configure.

http example "httpechoserverd" crashes under stress test from wrk benchmark.

Example command: ./httpechoserverd
Test Command: wrk -t12 -c400 -d30s http://127.0.0.1:1337/index.html
Stack Strace:

#0 0x00007ffff66d0428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007ffff66d202a in __GI_abort () at abort.c:89 #2 0x00007ffff66c8bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x5d8213 "_parser.data != this", file=file@entry=0x5d81d8 "/mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp", line=line@entry=68, function=function@entry=0x5d8360 <scy::http::Parser::init(http_parser_type)::__PRETTY_FUNCTION__> "void scy::http::Parser::init(http_parser_type)") at assert.c:92 #3 0x00007ffff66c8c82 in __GI___assert_fail (assertion=0x5d8213 "_parser.data != this", file=0x5d81d8 "/mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp", line=68, function=0x5d8360 <scy::http::Parser::init(http_parser_type)::__PRETTY_FUNCTION__> "void scy::http::Parser::init(http_parser_type)") at assert.c:101 #4 0x0000000000573188 in scy::http::Parser::init (this=0x875ea8, type=HTTP_REQUEST) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp:68 #5 0x0000000000572f09 in scy::http::Parser::Parser (this=0x875ea8, type=HTTP_REQUEST) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp:53 #6 0x000000000056d05c in scy::http::ConnectionAdapter::ConnectionAdapter (this=0x875d40, connection=..., type=HTTP_REQUEST) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/connection.cpp:265 #7 0x000000000055ac80 in scy::http::ServerAdapter::ServerAdapter (this=0x875d40, connection=...) at /mnt/repos/cctv/sourcey/libsourcey/src/http/include/scy/http/server.h:77 #8 0x000000000055c701 in scy::http::ServerConnection::ServerConnection (this=0x549a9eb0, server=..., socket=std::shared_ptr (count 8724656, weak -1) 0x7fffffffa6e0) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/server.cpp:164 #9 0x000000000055ba4b in scy::http::Server::createConnection (this=0x7fffffffdc20, sock=std::shared_ptr (count 4, weak 0) 0x853920) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/server.cpp:88 #10 0x000000000055c0e1 in scy::http::Server::onSocketAccept (this=0x7fffffffdc20, sock=std::shared_ptr (count 4, weak 0) 0x853860) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/server.cpp:129 #11 0x00000000005694eb in scy::ClassDelegate<scy::http::Server, void, std::shared_ptr<scy::net::TCPSocket> const&>::operator() (this=0x855450, args#0=std::shared_ptr (count 4, weak 0) 0x853860) at /mnt/repos/cctv/sourcey/libsourcey/src/base/include/scy/delegate.h:80 #12 0x00000000005b5dfc in scy::Signal<void (std::shared_ptr<scy::net::TCPSocket> const&)>::emit(std::shared_ptr<scy::net::TCPSocket> const&) (this=0x8522c8, args#0=std::shared_ptr (count 4, weak 0) 0x853860) at /mnt/repos/cctv/sourcey/libsourcey/src/base/include/scy/signal.h:209 #13 0x00000000005b4a71 in scy::net::TCPSocket::acceptConnection (this=0x8520b0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:183 #14 0x00000000005b5518 in scy::net::TCPSocket::onAcceptConnection (this=0x8520b0, status=0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:309 #15 0x00000000005b3860 in scy::net::internal::onAcceptConnection (handle=0x852330, status=0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:58 #16 0x000000000059262d in uv__server_io (loop=0x81eca0 <default_loop_struct>, w=0x8523b8, events=1) at /mnt/repos/cctv/sourcey/libsourcey/vendor/libuv/src/unix/stream.c:551 #17 0x0000000000599bd9 in uv__io_poll (loop=0x81eca0 <default_loop_struct>, timeout=2400) at /mnt/repos/cctv/sourcey/libsourcey/vendor/libuv/src/unix/linux-core.c:365 #18 0x00000000005852eb in uv_run (loop=0x81eca0 <default_loop_struct>, mode=UV_RUN_DEFAULT) at /mnt/repos/cctv/sourcey/libsourcey/vendor/libuv/src/unix/core.c:351 #19 0x000000000052efa1 in scy::uv::waitForShutdown(std::function<void (void*)>, void*, uv_loop_s*) (callback=..., opaque=0x7fffffffdc20, loop=0x81eca0 <default_loop_struct>) at /mnt/repos/cctv/sourcey/libsourcey/src/uv/include/scy/uv/uvpp.h:227 #20 0x0000000000531936 in main (argc=1, argv=0x7fffffffddb8) at /mnt/repos/cctv/sourcey/libsourcey/src/http/samples/httpechoserver/httpechoserver.cpp:29

lambda function error idler.cpp

During the generating project files step of libsourcey i get the following error:
/work/libsourcey/src/base/src/idler.cpp: In lambda function:
/work/libsourcey/src/base/src/idler.cpp:75:22: error: 'this' was not captured for this lambda function

when looking for a solution i came accros this issue:
http://stackoverflow.com/questions/4940259/lambdas-require-capturing-this-to-call-static-member-function

trying this out i get the following error:
work/libsourcey/src/base/src/idler.cpp:82:3: error: cannot convert 'scy::Idler::startAsync()::<lambda(uv_idle_t*)>' to 'uv_idle_cb {aka void ()(uv_idle_s)}' for argument '2' to 'int uv_idle_start(uv_idle_t*, uv_idle_cb)'

MSYS2-MINGW64 g++ failed due to codecvt and unique pointer.

There have been some inconsistencies with UTF16/8 and the missing local for UTF-8 but I is is feel not confident that this fitting here. Would be happ to get some helpful advice here....
I am working on GCC 5.3, MSYS, mingw w 64 bit...thanks

cd 'C:\0000000-build\libsourcey'
C:\0000000-binutils\msys2\usr\bin\make.exe -f Makefile clean

CLEAN SUCCESSFUL (total time: 3s)
cd 'C:\0000000-build\libsourcey'
C:\0000000-binutils\msys2\usr\bin\make.exe -f Makefile
[ 1%] Generating zlib1rc.obj
[ 1%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/adler32.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/adler32.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* adler32.c -- compute the Adler-32 checksum of a data stream
^
[ 2%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/compress.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/compress.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* compress.c -- compress a memory buffer
^
[ 2%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/crc32.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/crc32.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* crc32.c -- compute the CRC-32 of a data stream
^
[ 3%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/deflate.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/deflate.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* deflate.c -- compress data using the deflation algorithm
^
[ 3%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/gzclose.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzclose.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzclose.c -- zlib gzclose() function
^
[ 4%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/gzlib.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzlib.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzlib.c -- zlib functions common to reading and writing gzip files
^
[ 4%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/gzread.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzread.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzread.c -- zlib functions for reading gzip files
^
[ 5%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/gzwrite.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzwrite.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzwrite.c -- zlib functions for writing gzip files
^
[ 5%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/inflate.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inflate.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inflate.c -- zlib decompression
^
[ 6%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/infback.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/infback.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* infback.c -- inflate using a call-back interface
^
[ 6%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/inftrees.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inftrees.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inftrees.c -- generate Huffman trees for efficient decoding
^
[ 7%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/inffast.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inffast.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inffast.c -- fast decoding
^
[ 7%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/trees.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/trees.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* trees.c -- output deflated data using Huffman coding
^
[ 8%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/uncompr.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/uncompr.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* uncompr.c -- decompress a memory buffer
^
[ 8%] Building C object src/archo/vendor/zlib/CMakeFiles/zlib.dir/zutil.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/zutil.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* zutil.c -- target dependent utility functions for the compression library
^
[ 9%] Linking C shared library libzlib.dll
[ 9%] Built target zlib
[ 9%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/adler32.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/adler32.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* adler32.c -- compute the Adler-32 checksum of a data stream
^
[ 10%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/compress.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/compress.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* compress.c -- compress a memory buffer
^
[ 10%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/crc32.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/crc32.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* crc32.c -- compute the CRC-32 of a data stream
^
[ 11%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/deflate.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/deflate.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* deflate.c -- compress data using the deflation algorithm
^
[ 11%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/gzclose.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzclose.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzclose.c -- zlib gzclose() function
^
[ 12%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/gzlib.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzlib.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzlib.c -- zlib functions common to reading and writing gzip files
^
[ 12%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/gzread.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzread.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzread.c -- zlib functions for reading gzip files
^
[ 13%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/gzwrite.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/gzwrite.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* gzwrite.c -- zlib functions for writing gzip files
^
[ 13%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/inflate.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inflate.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inflate.c -- zlib decompression
^
[ 14%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/infback.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/infback.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* infback.c -- inflate using a call-back interface
^
[ 14%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/inftrees.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inftrees.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inftrees.c -- generate Huffman trees for efficient decoding
^
[ 15%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/inffast.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/inffast.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* inffast.c -- fast decoding
^
[ 15%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/trees.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/trees.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* trees.c -- output deflated data using Huffman coding
^
[ 16%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/uncompr.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/uncompr.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* uncompr.c -- decompress a memory buffer
^
[ 16%] Building C object src/archo/vendor/zlib/CMakeFiles/zlibstatic.dir/zutil.obj
C:/0000000-build/libsourcey/src/archo/vendor/zlib/zutil.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* zutil.c -- target dependent utility functions for the compression library
^
[ 17%] Linking C static library libzlibstatic.a
[ 17%] Built target zlibstatic
[ 17%] Building C object src/archo/vendor/minizip/CMakeFiles/minizip.dir/ioapi.c.obj
C:/0000000-build/libsourcey/src/archo/vendor/minizip/ioapi.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* ioapi.h -- IO base function header for compress/uncompress .zip
^
[ 18%] Building C object src/archo/vendor/minizip/CMakeFiles/minizip.dir/mztools.c.obj
C:/0000000-build/libsourcey/src/archo/vendor/minizip/mztools.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/*
^
[ 18%] Building C object src/archo/vendor/minizip/CMakeFiles/minizip.dir/unzip.c.obj
C:/0000000-build/libsourcey/src/archo/vendor/minizip/unzip.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* unzip.c -- IO for uncompress .zip files using zlib
^
[ 19%] Building C object src/archo/vendor/minizip/CMakeFiles/minizip.dir/zip.c.obj
C:/0000000-build/libsourcey/src/archo/vendor/minizip/zip.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* zip.c -- IO on .zip files using zlib
^
[ 19%] Building C object src/archo/vendor/minizip/CMakeFiles/minizip.dir/iowin32.c.obj
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* iowin32.c -- IO base function header for compress/uncompress .zip
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c: In function 'win32_open64_file_func':
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:106:17: warning: implicit declaration of function 'CreateFile2' [-Wimplicit-function-declaration]
hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:106:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:97:17: warning: unused variable 'mode_fopen' [-Wunused-variable]
const char* mode_fopen = NULL;
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c: In function 'win32_open64_file_funcA':
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:137:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:126:17: warning: unused variable 'mode_fopen' [-Wunused-variable]
const char* mode_fopen = NULL;
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c: In function 'win32_open64_file_funcW':
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:158:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hFile = CreateFile2((LPCWSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition,NULL);
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:150:17: warning: unused variable 'mode_fopen' [-Wunused-variable]
const char* mode_fopen = NULL;
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c: In function 'win32_open_file_func':
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:179:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:170:17: warning: unused variable 'mode_fopen' [-Wunused-variable]
const char* mode_fopen = NULL;
^
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c: In function 'win32_seek64_file_func':
C:/0000000-build/libsourcey/src/archo/vendor/minizip/iowin32.c:348:11: warning: variable 'dwMoveMethod' set but not used [-Wunused-but-set-variable]
DWORD dwMoveMethod=0xFFFFFFFF;
^
[ 20%] Linking C static library libminizipd.a
[ 20%] Built target minizip
[ 21%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/fs-poll.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/fs-poll.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 21%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/inet.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/inet.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/*
^
[ 22%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/threadpool.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/threadpool.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 22%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/uv-common.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/uv-common.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 23%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/version.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/version.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 23%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/async.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/async.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 24%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/core.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/core.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/core.c:38:18: warning: 'default_loop_struct' defined but not used [-Wunused-variable]
static uv_loop_t default_loop_struct;
^
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/core.c:39:19: warning: 'default_loop_ptr' defined but not used [-Wunused-variable]
static uv_loop_t* default_loop_ptr;
^
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/core.c:52:12: warning: 'uv__crt_dbg_report_handler' defined but not used [-Wunused-function]
static int uv__crt_dbg_report_handler(int report_type, char message, int *ret_val) {
^
[ 24%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/dl.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/dl.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 25%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/error.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/error.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 25%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/fs-event.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/fs-event.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 26%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/fs.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/fs.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 26%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/getaddrinfo.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/getaddrinfo.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 27%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/getnameinfo.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/getnameinfo.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 27%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/handle.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/handle.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 28%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/loop-watcher.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/loop-watcher.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 28%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/pipe.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/pipe.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 29%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/poll.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/poll.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 29%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/process-stdio.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/process-stdio.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 30%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/process.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/process.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 30%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/req.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/req.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 31%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/signal.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/signal.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 31%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/stream.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/stream.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 32%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/tcp.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/tcp.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 32%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/thread.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/thread.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 33%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/timer.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/timer.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 33%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/tty.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/tty.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 34%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/udp.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/udp.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 34%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/util.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/util.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 35%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/winapi.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/winapi.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 35%] Building C object src/uv/vendor/libuv/CMakeFiles/libuv.dir/src/win/winsock.c.obj
C:/0000000-build/libsourcey/src/uv/vendor/libuv/src/win/winsock.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
^
[ 36%] Linking C static library liblibuv.a
[ 36%] Built target libuv
[ 36%] Building C object src/http/vendor/http_parser/CMakeFiles/http_parser.dir/http_parser.c.obj
C:/0000000-build/libsourcey/src/http/vendor/http_parser/http_parser.c:1:0: warning: -fPIC ignored for target (all code is position independent)
/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
^
[ 37%] Linking C static library libhttp_parserd.a
[ 37%] Built target http_parser
[ 38%] Building CXX object src/json/vendor/jsoncpp/CMakeFiles/jsoncpp.dir/jsoncpp.cpp.obj
C:/0000000-build/libsourcey/src/json/vendor/jsoncpp/jsoncpp.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).
^
[ 38%] Linking CXX static library libjsoncppd.a
[ 38%] Built target jsoncpp
Scanning dependencies of target rtaudio
[ 38%] Building CXX object src/media/vendor/rtaudio/CMakeFiles/rtaudio.dir/RtAudio.cpp.obj
C:/0000000-build/libsourcey/src/media/vendor/rtaudio/RtAudio.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/***********************************************************************_/
^
C:/0000000-build/libsourcey/src/media/vendor/rtaudio/RtAudio.cpp:65:22: warning: 'std::_cxx11::string convertCharPointerToStdString(const char)' defined but not used [-Wunused-function]
static std::string convertCharPointerToStdString(const char _text)
^
[ 39%] Linking CXX shared library librtaudio.dll
[ 39%] Built target rtaudio
Scanning dependencies of target uv
[ 39%] Linking CXX static library libscy_uv_094d.a
[ 39%] Built target uv
Scanning dependencies of target base
[ 39%] Building CXX object src/base/CMakeFiles/base.dir/src/application.cpp.obj
C:/0000000-build/libsourcey/src/base/src/application.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 40%] Building CXX object src/base/CMakeFiles/base.dir/src/async.cpp.obj
C:/0000000-build/libsourcey/src/base/src/async.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 40%] Building CXX object src/base/CMakeFiles/base.dir/src/base64.cpp.obj
C:/0000000-build/libsourcey/src/base/src/base64.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 41%] Building CXX object src/base/CMakeFiles/base.dir/src/buffer.cpp.obj
C:/0000000-build/libsourcey/src/base/src/buffer.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 41%] Building CXX object src/base/CMakeFiles/base.dir/src/configuration.cpp.obj
C:/0000000-build/libsourcey/src/base/src/configuration.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 42%] Building CXX object src/base/CMakeFiles/base.dir/src/datetime.cpp.obj
C:/0000000-build/libsourcey/src/base/src/datetime.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
C:/0000000-build/libsourcey/src/base/src/datetime.cpp: In static member function 'static int scy::Timezone::utcOffset()':
C:/0000000-build/libsourcey/src/base/src/datetime.cpp:735:11: warning: unused variable 'dstFlag' [-Wunused-variable]
DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
^
C:/0000000-build/libsourcey/src/base/src/datetime.cpp: In static member function 'static std::__cxx11::string scy::Timezone::standardName()':
C:/0000000-build/libsourcey/src/base/src/datetime.cpp:778:11: warning: unused variable 'dstFlag' [-Wunused-variable]
DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
^
C:/0000000-build/libsourcey/src/base/src/datetime.cpp: In static member function 'static std::__cxx11::string scy::Timezone::dstName()':
C:/0000000-build/libsourcey/src/base/src/datetime.cpp:795:11: warning: unused variable 'dstFlag' [-Wunused-variable]
DWORD dstFlag = GetTimeZoneInformation(&tzInfo);
^
[ 42%] Building CXX object src/base/CMakeFiles/base.dir/src/exception.cpp.obj
C:/0000000-build/libsourcey/src/base/src/exception.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
[ 43%] Building CXX object src/base/CMakeFiles/base.dir/src/filesystem.cpp.obj
C:/0000000-build/libsourcey/src/base/src/filesystem.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
//
^
In file included from C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/fstream:40:0,
from C:/0000000-build/libsourcey/src/base/include/scy/logger.h:30,
from C:/0000000-build/libsourcey/src/base/src/filesystem.cpp:21:
C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/bits/unique_ptr.h: In instantiation of 'void std::default_delete<_Tp>::operator()(Tp) const [with _Tp = std::codecvt<char16_t, char, int>]':
C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/bits/unique_ptr.h:236:17: required from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = std::codecvt<char16_t, char, int>; _Dp = std::default_delete<std::codecvt<char16_t, char, int> >]'
C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/bits/locale_conv.h:218:7: required from here
C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/bits/codecvt.h:486:7: error: 'virtual std::codecvt<char16_t, char, int>::~codecvt()' is protected
~codecvt();
^
In file included from C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/memory:81:0,
from C:/0000000-build/libsourcey/src/base/include/scy/async.h:29,
from C:/0000000-build/libsourcey/src/base/include/scy/thread.h:27,
from C:/0000000-build/libsourcey/src/base/include/scy/logger.h:25,
from C:/0000000-build/libsourcey/src/base/src/filesystem.cpp:21:
C:/0000000-binutils/msys2/mingw64/include/c++/5.3.0/bits/unique_ptr.h:76:2: error: within this context
delete __ptr;
^
src/base/CMakeFiles/base.dir/build.make:238: recipe for target 'src/base/CMakeFiles/base.dir/src/filesystem.cpp.obj' failed
make[2]: *** [src/base/CMakeFiles/base.dir/src/filesystem.cpp.obj] Error 1
CMakeFiles/Makefile2:295: recipe for target 'src/base/CMakeFiles/base.dir/all' failed
make[1]: *** [src/base/CMakeFiles/base.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

BUILD FAILED (exit value 2, total time: 51s)

time::ticks() compiler error

In the latest build, getting the below build errors:
7>------ Build started: Project: echoserver, Configuration: Debug Win32 ------
7> echoserver.cpp
7>e:\codebase\libsourcey\src\net\samples\echoserver\udpechoserver.h(49): error C2039: 'ticks' : is not a member of 'scy::time'
7>e:\codebase\libsourcey\src\net\samples\echoserver\udpechoserver.h(49): error C3861: 'ticks': identifier not found

In the time.h files the ticks() member is inside #if 0 so unable to reach for compiler.

For now, as a workaround, I have set PRINT_LATENCY_PACKET to be 0 and got it resolved - but the right way could be to use same compiler condition for both the ticks() and this PRINT_LATENCY_PACKET

Xcode build

Hi!

I've just experienced some troubles to compile libsourcey project using Xcode. It seems that cmake doesn't properly link targets between each other. For example, to build 'stun' target I manually put some lines to linker options (see screenshot). And that is the problem for other targets too.

image

libsourcey make error on macOS

Hi,
I'm trying to compile libsourcey per your instructions on macOS. I'm receiving this error after typing "make":

15%] Linking C shared library liblibuv.dylib
ld: warning: directory not found for option '-L/usr/local/share/scy/vendor/lib'
Undefined symbols for architecture x86_64:
"_pthread_barrier_destroy", referenced from:
_uv_barrier_destroy in thread.c.o
"_pthread_barrier_init", referenced from:
_uv_barrier_init in thread.c.o
"_pthread_barrier_wait", referenced from:
_uv_barrier_wait in thread.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [vendor/libuv/liblibuv.dylib] Error 1
make[1]: *** [vendor/libuv/CMakeFiles/libuv.dir/all] Error 2
make: *** [all] Error 2

I don't see the file vendor/libuv/liblibuv.dylib it is looking for. Was it supposed to be built by the Makefile?

Thanks!

size_t not defined in libsourcey/.../byteorder.h?

Trying to figure out what is going on with this error. Does this have to do something with the code?

cmake -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2j/include/ -DCXX_STANDARD=11 -DCXX_STANDARD_REQUIRED=ON -DCMAKE_BUILD_TYPE=RELEASE ..

[ 33%] Building CXX object src/base/CMakeFiles/base.dir/src/buffer.cpp.o
In file included from /Users/norm/projects/libsourcey/src/base/src/buffer.cpp:12:
In file included from /Users/norm/projects/libsourcey/src/base/include/scy/buffer.h:16:
/Users/norm/projects/libsourcey/src/base/include/scy/byteorder.h:37:37: error: no type named 'size_t' in namespace 'std'
inline void set8(void* memory, std::size_t offset, std::uint8_t v)
~~~~~^
/Users/norm/projects/libsourcey/src/base/include/scy/byteorder.h:42:51: error: no type named 'size_t' in namespace 'std'
inline std::uint8_t get8(const void* memory, std::size_t offset)
~~~~~^
In file included from /Users/norm/projects/libsourcey/src/base/src/buffer.cpp:12:
In file included from /Users/norm/projects/libsourcey/src/base/include/scy/buffer.h:17:
In file included from /Users/norm/projects/libsourcey/src/base/include/scy/memory.h:16:
In file included from /Users/norm/projects/libsourcey/src/base/include/scy/logger.h:20:
/Users/norm/projects/libsourcey/src/base/include/scy/thread.h:47:56: warning: base class 'scy::Runner' is uninitialized when used here to access
'scy::Runner::_context' [-Wuninitialized]
_thread(internal::runAsync<Function, Args...>, _context,
^
1 warning and 2 errors generated.
make[2]: *** [src/base/CMakeFiles/base.dir/src/buffer.cpp.o] Error 1
make[1]: *** [src/base/CMakeFiles/base.dir/all] Error 2
make: *** [all] Error 2

Platform:
Host: Darwin 16.1.0 x86_64
CMake: 3.7.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: RELEASE

-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- C++ flags (Release): -std=c++11 -stdlib=libc++ -O3 -DNDEBUG
-- C++ flags (Debug): -std=c++11 -stdlib=libc++ -g
-- C Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- C flags (Release): -O3 -DNDEBUG
-- C flags (Debug): -g
-- Linker flags (Release):
-- Linker flags (Debug):

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

'error LNK2001:unresolved external symbol' when using codecvt, char16_t.

When compile echoserver project, I got below link error.
(Visual Studio 2015 Update3 version 14.0.25424.00)

1>scy_base_094d.lib(filesystem.obj) : error LNK2001: "__declspec(dllimport) public: static class std::locale::id std::codecvt<char16_t,char,struct _Mbstatet>::id" (__imp_?id@?$codecvt@_SDU_Mbstatet@@@std@@2V0locale@2@A) 

This is an already reported issue to microsoft, however, it seems like that it's still not fixed in update3 lately.
link1
link2

After reading above articles, I've modified std::string trnascode(const sd::string& path) function a little bit, and I've tested that compile/execution echoserver have no problem.

Could you check this pull request? #90

Thank you for your time.

OSX/Make Build: Error linking against libscy_uv.a

I'm attempting to use libsourcey in a C++ library, using CMake and Make to build libsourcey as an external project. Unfortunately, OSX's version of ar does not allow libraries that contain only headers, like libscy_uv.

Is there a way to prevent it from linking against libscv_uv? I'm fairly new to CMake, so I might be building it incorrectly.

CMakeLists.txt:

project(project1)
include(ExternalProject)

ExternalProject_Add(libsourcey
    SOURCE_DIR ${PROJECT_SOURCE_DIR}/libsourcey
    DOWNLOAD_COMMAND ""
    CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=0 -DLIBRARY_OUTPUT_PATH:PATH= -DBUILD_APPLICATIONS:BOOL=0 -DWITH_FFMPEG:BOOL=0 -DWITH_OPENSSL:BOOL=0 -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_BACKWARDS_COMPATIBILITY:STRING=2.8
    )
# ...
add_library(project1 MODULE ...)
target_link_libraries(project1 ...)
add_dependencies(project1 libsourcey)
#...

Build Error:

Linking CXX static library libscy_uv.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
make[5]: *** [src/uv/libscy_uv.a] Error 1
make[4]: *** [src/uv/CMakeFiles/uv.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [plugins/project1/libsourcey-prefix/src/libsourcey-stamp/libsourcey-build] Error 2
make[1]: *** [plugins/project1/CMakeFiles/libsourcey.dir/all] Error 2
make: *** [all] Error 2

Unable to build WebRTC using webrtcbuilds on win64 system

Hi,
I have been attempting unsuccessfully to get WebRTC (using the script at https://github.com/sourcey/webrtcbuilds ) on a Win64 system. I am attempting to follow the build command that was said to work in #119 .

First, I hit an "Unresolved dependencies" error:

$ ./build.sh -l jsoncpp -e ENABLE_RTTI
Host OS: win
Target OS: win
Target CPU: x64
Checking webrtcbuilds dependencies
Checking depot-tools
Building revision: 78d89778b435854e9c25d0b0ae489b13da28436e
Associated revision number: 17015
Checking out WebRTC revision (this will take awhile): 78d89778b435854e9c25d0b0ae489b13da28436e
[...]
Checking WebRTC dependencies
Patching WebRTC source
Compiling WebRTC
Generating project files with: rtc_include_tests=false enable_iterator_debugging=false target_os="win" target_cpu="x64"
ERROR Unresolved dependencies.
//:default(//build/toolchain/win:x64)
  needs //webrtc:webrtc(//build/toolchain/win:x64)

Based on vsimon/webrtcbuilds#39, I followed a suggestion to manually change
local common_args="rtc_include_tests=false enable_iterator_debugging=false" #is_component_build=false"
to
local common_args="rtc_include_tests=true enable_iterator_debugging=false" #is_component_build=false"
in util.sh. This gets me past the unresolved dependency error, but then I end up with a linker warning being treated as an error and stopping the compilation process early.

$ ./build.sh -l jsoncpp -e ENABLE_RTTI
Host OS: win
Target OS: win
Target CPU: x64
Checking webrtcbuilds dependencies
Checking depot-tools
Building revision: a1991c517598fda9c9c0cf8876886e3968436ff9
Associated revision number: 17016
Checking out WebRTC revision (this will take awhile): a1991c517598fda9c9c0cf8876886e3968436ff9
[...]
[51/389] LINK audio_device_tests.exe audio_device_tests.exe.pdb
FAILED: audio_device_tests.exe audio_device_tests.exe.pdb
E:/webrtc/001/webrtcbuilds/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./audio_device_tests.exe /PDB:./audio_device_tests.exe.pdb @./audio_device_tests.exe.rsp
uuid.lib(unknwn_i.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
LINK : error LNK1218: warning treated as error; no output file generated
[...]
ninja: build stopped: subcommand failed.

It's unclear to me even what this error means or how to resolve it. Do you have a known working set of build instructions for a particular webrtc revision/release, or can you please help me figure out what to do next to get this built? I have been struggling with getting libsourcey built for several days now. Thank you!

macOS CMAKE error on symple app

When running CMAKE in macOS for the /libsourcey/src/symple app, see this error:

CMake Error at CMakeLists.txt:1 (ask_build_sourcey_module):
Unknown CMake command "ask_build_sourcey_module".

Undefined reference to scy::av::AVPacketEncoder

in CMakeLists.txt:
target_link_libraries(untitled2 ${Boost_LIBRARIES} scy_base scy_crypto scy_net scy_http scy_media scy_util scy_archo scy_socketio scy_turn ${FFmpeg_LIBRARIES} rtaudio avcodec asound libuv crypto http_parser postproc avdevice-ffmpeg swscale avcodec-ffmpeg avdevice avformat-ffmpeg avutil avformat avfilter avcodec swscale-ffmpeg postproc-ffmpeg postproc-ffmpeg avutil-ffmpeg avresample-ffmpeg swresample-ffmpeg avfilter-ffmpeg swresample minizip z pthread)

MakeFiles/untitled2.dir/main.cpp.o: In function MPEGResponder::MPEGResponder(scy::http::ServerConnection&)': /home/pwera/untiitled2/Newros/src/SourceyEx/CryptoEx.hpp:61: undefined reference to scy::av::AVPacketEncoder::AVPacketEncoder(scy::av::EncoderOptions const&, bool)'
collect2: error: ld returned 1 exit status

When i copied all cmake modules (which comes from libsourcey folder) to
/usr/share/cmake-3.2/Modules
and add
find_package(FFmpeg REQUIRED) in CMakeLists.txt
i got Error:Unknown CMake command "set_module_notfound".

Sorry for my poor english :P

Issues with compiling samples on windows.

I'm having issues compiling on windows.

I generate solution files and compile static libraries but when trying to compile samples I get bunch of unresolved references such as Logger and some more. Should I try to add all static libraries manually as linked libraries for samples ?

Should I generate libsourcey.dll from all modules and then link samples to that dll ?
If so, how do I generate one dll from multiple modules since it seems to me all modules are separate projects and I am not sure how to make on dll of all of them ?

Is there more info about compiling beside official page, or has anyone had issues with compiling on windows?
Maybe prebuilt binaries are available?

TURNMediaProvider in exmaple

i see the TURNMediaProvider exmaple in turn example.

it seems that use this TURNMediaProvider and generate some ice candidate to some other webrtc peer, then i can have a true real time broadcast system?

forget to put SCY_EXTERN before class name

#ifdef SCY_WIN
#ifndef SCY_SHARED_LIBRARY // libsourcey.h
#define SCY_EXTERN __declspec(dllexport)
#else
#define SCY_EXTERN __declspec(dllimport)
#endif
#else
#define SCY_EXTERN // nothing
#endif

glad to see these are defined, but forget to put SCY_EXTERN in front of the class name, so the built dll does not export any symbols (check with dependency walker) and does not work in windows, please fix

More samples

I started playing with libsourcey because of its video streaming potential (integration with mpeg + websockets etc). But the samples are very simplistic and give very little idea how to this. Could someone please point me in the right direction?

parallel http requests example

is there any code snippet in libsourcey that handles a large numebr of http requests (to different urls) efficiently? I suppose async is the expertise of libuv.

e.g. 64 threads that maintain 640 connections and doing 640000 requests

Compiling on ArchLinux

I wanted to test Pacm command tool. So I tried to compile LibSourcey on my ArchLinux. However, I keep getting compilation errors after compilation errors.
I cloned the repo and followed the instructions of the "README.md" (using cmake).

I get this :

libsourcey-master/deps/libuv/src/unix/kqueue.c:31:23: erreur fatale: sys/event.h : Aucun fichier ou dossier de ce type

Basically, it says that "sys/event.h" does not exist.
I think, it is because "kqueue.c" should not be compiled on linux. "sys/event.h" is present only on BSDs unix. Moreover, when I compile the libuv "0.11.25" from their site on the same machine, it works smoothly.
Finally, in their project file "uv.gyp" the following lines are quite clear to me:

[ 'OS in "mac freebsd dragonflybsd openbsd netbsd".split()', {
    'sources': [ 'src/unix/kqueue.c'],
}],

I deleted the line in the "CMakeLists.txt" and it (seems to) work(s).

The next one is a syntax error:

/home/jpi/Dev/libsourcey-master/src/net/include/scy/net/socket.h:236:13: erreur: stray ‘#’ in program
namespace { #include "unix/internal.h" } // uv__stream_fd

My g++ (version: g++ (GCC) 4.9.1 20140903) does not accept that. We need the "#include" at the start of the line. I cut this line in 3 and it works.

I have other errors but I think it will be too long to list them. Can I easily compile LibSourcey on a distro like ArchLinux ?

If it is pertinent, I can continue to chase those bugs and then submit a pull request. Or just switch to a distro supported or a Windows.

WebRTC compile errors

Hi, I'm following your instructions on building your version of WebRTC on macOS. (I believe I need to do this in order to compile libsourcey with WebRTC capability.) It worked for a while, then stopped with this error:

Checking WebRTC dependencies
Patching WebRTC source
Compiling WebRTC
Generating project files with: rtc_include_tests=false enable_iterator_debugging=false target_os="mac" target_cpu="x64"
ERROR Unresolved dependencies.
//:default(//build/toolchain/mac:clang_x64)
needs //webrtc:webrtc(//build/toolchain/mac:clang_x64)

FYI, I wasn't able to get the build.sh program to run as written in the instructions, but this seemed to work after I put a -d at the end:

./build.sh -l jsoncpp -e -d

Do you know what that error of unresolved dependencies refers to?

Thanks!

FindOpenCV.cmake semi-broken

The code has a few bugs, one in the handling of a passed-in 'OpenCV_INCLUDE_DIR' - which is required to include the 'opencv2' part of the path and the version detection, another with part of the auto-detection of the include path being commented out and a third with the detection of the libraries, where it doesn't attempt to look in the correct places for libraries on a distribution setup to be (primarily) 64bit but with some 32bit libraries installed for legacy and/or applications which are not provided as 64bit.

I have a patch which fixes 2 of the 3 issues noted that I can provide if necessary. The first issue is one that I'm not certain how to properly fix, as I don't use CMake enough to be fully familiar and comfortable with the language, but the other two have been fixed.

Could NOT find FFmpeg (missing: FFmpeg_INCLUDE_DIRS) in Mint17

When I trie to compile libsourcey in Linux Mint 17, here is my command

git clone https://github.com/sourcey/libsourcey
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE

then I got following output:

-- Detected version of GNU GCC: 48 (408)
-- checking for one of the modules 'libswresample'
CMake Error at /usr/local/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find FFmpeg (missing: FFmpeg_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  cmake/LibSourceyIncludes.cmake:327 (find_package_handle_standard_args)
  cmake/FindFFmpeg.cmake:57 (set_module_found)
  cmake/LibSourceyIncludes.cmake:105 (find_package)
  CMakeLists.txt:325 (include_dependency)


-- Configuring incomplete, errors occurred!
See also "/home/bevin/Downloads/libsourcey/build/CMakeFiles/CMakeOutput.log".

Undefined symbol nativeSocketFd__

Undefined symbols for architecture x86_64:
  "scy::turn::nativeSocketFd__(uv_stream_s*)", referenced from:
      int scy::turn::setServerSocketBufSize<uv_tcp_s>(scy::uv::Handle&, int) in tcpconnectionpair.o

Function int nativeSocketFd__(uv_stream_t* handle) defined but not implemented.

Visual Studio 2015 compilation/linking errors

Hello again,
Thanks to the latest updates, I've been able to get further in building libsourcey, but I am still having difficulties at the final step. I can build WebRTC and have CMake detect it and generate the VS solution, but when I try to build the solution (in Debug or Release), I get a flurry of errors in several of the projects.

I have successfully built WebRTC as described in https://github.com/sourcey/libsourcey/blob/master/doc/installation-windows.md (I am using branch-heads/57).

Here is my CMake output:

$ cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=ON -DBUILD_MODULES=ON -DBUILD_APPLICATIONS=ON -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DWITH_FFMPEG=ON -DWITH_WEBRTC=ON -DWEBRTC_ROOT_DIR=E:/webrtc/003/webrtc-checkout/src
-- Including module archo
-- Including module test archotests
-- Including dependency: FFmpeg
-- Including module av
-- Including dependency: FFmpeg
-- Including module sample deviceenumerator
-- Including dependency: FFmpeg
-- Including module sample devicerecorder
-- Including module test avtests
-- Including module base
-- Including module test basetests
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module crypto
-- Including module test cryptotests
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module http
-- Including module sample httpechoserver
-- Including module test httptests
-- Including module json
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module net
-- Including module sample echoserver
-- Including module test nettests
-- Including module sched
-- Including module test schedtests
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module socketio
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module test socketiotests
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module stun
-- Including module test stuntests
-- Including dependency: SSL
-- Including BoringSSL
-- Including dependency: WebRTC
-- Including module symple
-- Including module sample sympleconsole
-- Including module test sympletests
-- Including module turn
-- Including module sample turnserver
-- Including module test turnclienttest
-- Including module util
-- Including module uv
-- Including dependency: WebRTC
CMake Warning at src/webrtc/CMakeLists.txt:7 (message):
  Compiling WebRTC libraries with `BUILD_SHARED_LIBS=OFF` is recommended


-- Including module webrtc
-- Including dependency: WebRTC
-- Including dependency: FFmpeg
-- Including module sample webrtcstreamer
-- Including dependency: WebRTC
-- Including dependency: FFmpeg
-- Including module sample webrtcrecorder
-- Parsing 'libsourcey.h.cmake'
--
--   Platform:
--     Host:                        Windows 10.0.14393 AMD64
--     CMake:                       3.7.0-rc1
--     CMake generator:             Visual Studio 14 2015 Win64
--     CMake build tool:            C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
--     MSVC:                        1900
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--     C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /wd4251 /MD /O2 /Ob2 /DNDEBUG   /Zi
--     C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
--     C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--     C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /MD /O2 /Ob2 /DNDEBUG  /Zi
--     C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
--     Linker flags (Release):      /machine:x64  /SAFESEH:NO /INCREMENTAL:NO  /debug
--     Linker flags (Debug):        /machine:x64  /SAFESEH:NO /debug /INCREMENTAL
--
--   Build Components:
--
--      Dependencies:               libuv;zlib;minizip;http_parser
--      Modules:                    archo;av;base;crypto;http;json;net;sched;socketio;stun;symple;turn;util;uv;webrtc
--      Applications:
--      Samples:                    av;http;net;socketio;symple;turn;webrtc
--      Tests:                      archo;av;base;crypto;http;net;sched;socketio;stun;symple;turn
--
--   Other third-party libraries:
--
--     Use OpenSSL:                 YES
--     Use FFmpeg:                  YES
--     Use OpenCV:                  NO
--     Use WebRTC:                  YES
--     Use Poco:                    NO
--     Use wxWidgets:               NO
--
--     Install path:                E:/Libs/libsourcey/build/install
--
--     libsourcey.h is in:          E:/Libs/libsourcey/build/install/include/libsourcey.h
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: E:/Libs/libsourcey/build

Some of the libsourcey projects (e.g. "base") compile just fine, but others do not. Here is a sampling of the ~800 errors VS spits out at me:

13>------ Build started: Project: basetests, Configuration: Debug x64 ------
9>  cipher.cpp
10>  configuration.cpp
11>  audiobuffer.cpp
12>  zipfile.cpp
13>  basetests.cpp
11>  audiocapture.cpp
9>  crypto.cpp
12>     Creating library E:/Libs/libsourcey/build/archo/Debug/scy_archod.lib and object E:/Libs/libsourcey/build/archo/Debug/scy_archod.exp
12>zipfile.obj : error LNK2019: unresolved external symbol "public: __cdecl scy::LogStream::LogStream(enum scy::LogLevel,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,void const *,char const *)" (??0LogStream@scy@@QEAA@W4LogLevel@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HPEBXPEBD@Z) referenced in function "public: void __cdecl scy::archo::ZipFile::extract(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?extract@ZipFile@archo@scy@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
12>zipfile.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl scy::fs::dirname(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?dirname@fs@scy@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z) referenced in function "public: bool __cdecl scy::archo::ZipFile::extractCurrentFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?extractCurrentFile@ZipFile@archo@scy@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
12>zipfile.obj : error LNK2019: unresolved external symbol "void __cdecl scy::fs::mkdirr(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?mkdirr@fs@scy@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "public: bool __cdecl scy::archo::ZipFile::extractCurrentFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?extractCurrentFile@ZipFile@archo@scy@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
12>zipfile.obj : error LNK2019: unresolved external symbol "void __cdecl scy::fs::addnode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?addnode@fs@scy@@YAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z) referenced in function "public: bool __cdecl scy::archo::ZipFile::extractCurrentFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?extractCurrentFile@ZipFile@archo@scy@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
12>zipfile.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl scy::fs::transcode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?transcode@fs@scy@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z) referenced in function "public: void __cdecl scy::archo::ZipFile::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?open@ZipFile@archo@scy@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
12>zipfile.obj : error LNK2001: unresolved external symbol "char const scy::fs::delimiter" (?delimiter@fs@scy@@3DB)
12>E:\Libs\libsourcey\build\archo\Debug\scy_archod.dll : fatal error LNK1120: 6 unresolved externals
9>E:\Libs\libsourcey\src\crypto\include\scy/crypto/x509certificate.h(98): error C2039: 'set': is not a member of 'std'
9>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream(12): note: see declaration of 'std'
9>E:\Libs\libsourcey\src\crypto\include\scy/crypto/x509certificate.h(98): error C2061: syntax error: identifier 'set'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(229): error C2039: 'set': is not a member of 'std'
9>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream(12): note: see declaration of 'std'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(229): error C2061: syntax error: identifier 'set'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(231): error C2065: 'domainNames': undeclared identifier
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(231): error C2228: left of '.clear' must have class/struct/union
9>  E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(231): note: type is 'unknown-type'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(240): error C2065: 'domainNames': undeclared identifier
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(240): error C2228: left of '.insert' must have class/struct/union
9>  E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(240): note: type is 'unknown-type'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(247): error C2065: 'domainNames': undeclared identifier
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(247): error C2228: left of '.empty' must have class/struct/union
9>  E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(247): note: type is 'unknown-type'
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(248): error C2065: 'domainNames': undeclared identifier
9>E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(248): error C2228: left of '.insert' must have class/struct/union
9>  E:\Libs\libsourcey\src\crypto\src\x509certificate.cpp(248): note: type is 'unknown-type'

I suspect there is something related to the recent work in exchanging OpenSSL with BoringSSL and trying to exclude these x509 certificates that was incomplete.

Please let me know if there is more data/logs I can provide you. Thanks!

Correct WebRTC building instructions

I managed to build the current WebRTC using the sourcey webrtcbuilds, but I'm stuck on the jsoncpp blacklisting. Even adding the -l jsoncpp when building webrtc still copies the jsoncpp symbols and this makes webrtcstreamerd linking impossible i.e.

../../../vendor/jsoncpp/libjsoncpp.a(jsoncpp.cpp.o): In function Json::Writer::~Writer()': /src/libsourcey/vendor/jsoncpp/jsoncpp.cpp:4395: multiple definition of Json::Writer::~Writer()'
/src/webrtcbuilds/out/src/out/Debug/obj/third_party/jsoncpp/jsoncpp/json_writer.o:/src/webrtcbuilds/out/src/out/Debug/../../third_party/jsoncpp/source/src/lib_json/json_writer.cpp:187: first defined here

Ask: reason for poor performance, http echo

Tried to benchmark the ./http/samples/httpechoserver/httpechoserver

on my machine:

Linux 4.7.0-1-amd64 #1 SMP BlankOn 4.7.8-1 (2016-10-22) x86_64 GNU/Linux

     λ wrk (master): ./wrk -d10s --timeout 2s http://localhost:1337
Running 10s test @ http://localhost:1337
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.23ms    5.28ms  44.54ms   81.62%
    Req/Sec     0.93k     2.43k   10.23k    91.67%
  18074 requests in 10.09s, 582.56KB read
  Socket errors: connect 0, read 18074, write 0, timeout 0
Requests/sec:   1792.13
Transfer/sec:     57.76KB

Seems really slow compared to node-based http server

Could you help me to investigate more? Did I do something wrong?

I used this flag: -DCMAKE_BUILD_TYPE=RELEASE

WebRTC cmake code broken

As I've tried to have all dependencies installed I was a bit surprised when I was told that WebRTC wasn't found, repeatedly. After having had to modify the FindOpenCV.cmake to cover for a primarily 64bit system (with full 32bit multi-lib to cover for legacy applications), I looked in the code to find WebRTC.

Rather than having a number of options for locating the include directory, there is only one - a Windows path that seems oddly specific to a single developers system. Following it is a chunk of code for finding the libraries that is, oddly enough, platform agnostic, but guarded by a condition that could not be met.

This command will only work on Windows and if you are using a setup the same as the original developers:

find_path(WebRTC_INCLUDE_DIR
NAMES
webrtc/config.h
PATHS
D:/dev/lib/webrtc/trunk
)

It is followed with this conditional guarding the rest of the code:

----------------------------------------------------------------------

Find WebRTC libraries

----------------------------------------------------------------------

set(_DEBUG_PATHS D:/dev/lib/webrtc/trunk/build/Debug/lib)
set(_RELEASE_PATHS D:/dev/lib/webrtc/trunk/build/Release/lib)

webrtc

sourcey_find_library(WebRTC
NAMES webrtc_utility
DEBUG_PATHS ${_DEBUG_PATHS}
RELEASE_PATHS ${_RELEASE_PATHS})

if(WebRTC_LIBRARY AND WebRTC_INCLUDE_DIR)

Note that the paths given are, again, Windows specific and specific to the original developers setup.

A quick 'git blame' gives me a name and when these lines were added/changed to what they are, but that doesn't help much. If I was more familiar with CMake I'd provide a patch.

webrtc library path in cmake always reset to not found

hello, I set 'WEBRTC_INCLUDE_DIR=E:/WebRTC-Win/webrtc/src' in cmake gui. Then click 'Configure' button and find the output is

Could NOT find WEBRTC (missing:  WEBRTC_LIBRARY)
Failed to include dependency: WebRTC. Please build and install dependencies before using CMake.

So I manually select webrtc.lib which in E:/WebRTC-Win/webrtc/src/out/Debug/obj/webrtc/ to 'WEBRTC_LIBRARY_DEBUG'. But if I click 'Configure' button this paramater will be reset to 'WEBRTC_LIBRARY_DEBUG-NOTFOUND'.
I read the cmake file and find 'PATHS_DEBUG ${WEBRTC_INCLUDE_DIR}/${_WEBRTC_SUFFIX_DEBUG}'. So I copy webrtc.lib from above path to E:/WebRTC-Win/webrtc/srcout/Debug and set 'WEBRTC_LIBRARY_DEBUG' again. But after configure it always reset 'WEBRTC_LIBRARY_DEBUG' to 'NOTFOUND'.
Did I do something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.