Skip to content

Commit 5936aa9

Browse files
committed
Update StreamRecorder to support latest WebRTC
1 parent bf7b893 commit 5936aa9

File tree

4 files changed

+47
-284
lines changed

4 files changed

+47
-284
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
NAME := sourcey/libsourcey
2+
VERSION := $$(cat VERSION)
3+
4+
git_release:
5+
git add VERSION
6+
git add . --update
7+
git commit --message="Release ${VERSION}"
8+
git tag --annotate --message="Release ${VERSION}" ${VERSION}
9+
git push --follow-tags
10+
11+
docker_build:
12+
docker build -t ${NAME}:latest -t ${NAME}:v${VERSION} .
13+
14+
docker_push:
15+
docker push ${NAME}
16+
17+
docker_login:
18+
docker log -u ${DOCKER_USER} -p ${DOCKER_PASS}

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ LibSourcey is a collection of cross platform C++14 modules and classes that prov
2424

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

27-
* **Networking layer**A solid network layer is absolutely essential. The networking layer contains TCP, SSL and UDP socket implementations that combine `libuv` under the hood for blazing fast networking, and `openssl` for security and encryption.
27+
* **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](https://sourcey.com/libsourcey/installation#building-packages).
2828

29-
* **Media streaming and encoding**The `av` library consists of thin wrappers around `FFmpeg` and `OpenCV` for media capture, encoding, recording, streaming, analysis and more.
29+
* **Docker images**Semantically versioned images are available on [Docker Hub](https://hub.docker.com/r/sourcey/libsourcey/). Just type `docker pull sourcey/libsourcey` to grab the latest.
3030

31-
* **Easy install**LibSourcey can be packaged as a `deb`, `rpm`, `tar.gz`, `zip` and many other formats with a [single command](https://sourcey.com/libsourcey/installation#building-packages) for straight forward distribution and integration.
31+
* **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.
3232

3333
* **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`.
3434

35+
* **Media streaming and encoding** — The `av` library consists of thin wrappers around `FFmpeg` and `OpenCV` for media capture, encoding, recording, streaming, analysis and more.
36+
3537
* **Realtime messaging** — LibSourcey aims to bridge the gap between desktop, mobile and web by providing performance oriented messaging solutions that work across all platforms.
3638
* **Socket.IO** — Socket.IO C++ client that supports the latest protocol revision 4 (>= 1.0). Read more about [Socket.IO](http://socket.io).
3739
* **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](https://sourcey.com/symple).
@@ -44,12 +46,30 @@ LibSourcey is a collection of cross platform C++14 modules and classes that prov
4446
* **STUN** — [RFC 5389](http://tools.ietf.org/rfc/rfc5389) implementation that includes support for ICE and TURN and TURN TCP messages.
4547
* **TURN** — Server and client stack that supports both [RFC 5766 (Traversal Using Relays around NAT)](http://tools.ietf.org/rfc/rfc5766) and [RFC 6062 (Traversal Using Relays around NAT Extensions for TCP Allocations)](http://tools.ietf.org/rfc/rfc6062) specifications.s
4648
* **SDP** — [RFC 4566](http://tools.ietf.org/rfc/rfc4566) implementation that includes extra support for ICE headers.
47-
-->
49+
-->
4850

4951
## Getting started
5052

5153
See the [installation guides](https://sourcey.com/libsourcey/installation) in the docs to get started playing with LibSourcey.
5254

55+
56+
<!--
57+
TODO: move to docs
58+
### Using Docker
59+
60+
Building with Docker:
61+
62+
```
63+
sudo docker build .
64+
```
65+
66+
Docker images are available on Docker Hub: https://hub.docker.com/r/sourcey/libsourcey/
67+
68+
```
69+
sudo docker pull sourcey/libsourcey
70+
```
71+
-->
72+
5373
## A few examples
5474

5575
What better way to get acquainted with a new library then with some tasty code examples.
@@ -122,7 +142,7 @@ proc.spawn();
122142
proc.in() << "random data"
123143
~~~
124144
125-
#### PacketStream
145+
#### Packet Stream
126146
127147
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.
128148

package-lock.json

Lines changed: 0 additions & 276 deletions
This file was deleted.

src/webrtc/src/streamrecorder.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ void StreamRecorder::OnFrame(const webrtc::VideoFrame& yuvframe)
9393
if (_encoder.isActive()) {
9494
// Set AVFrame->data pointers manually so we don't need to copy any data
9595
// or convert the pixel format from YUV to some contiguous format.
96+
auto yuvbuffer = yuvframe.video_frame_buffer()->GetI420();
9697
auto frame = _encoder.video()->frame;
97-
frame->data[0] = (uint8_t*)yuvframe.video_frame_buffer()->DataY();
98-
frame->data[1] = (uint8_t*)yuvframe.video_frame_buffer()->DataU();
99-
frame->data[2] = (uint8_t*)yuvframe.video_frame_buffer()->DataV();
98+
frame->data[0] = (uint8_t*)yuvbuffer->DataY();
99+
frame->data[1] = (uint8_t*)yuvbuffer->DataU();
100+
frame->data[2] = (uint8_t*)yuvbuffer->DataV();
100101
frame->width = yuvframe.width();
101102
frame->height = yuvframe.height();
102103
frame->pts = AV_NOPTS_VALUE; // set by encoder

0 commit comments

Comments
 (0)