Skip to content

Commit

Permalink
Merge pull request #73 from aws-samples/develop
Browse files Browse the repository at this point in the history
v1.1.1 doc improvements and V4L2 bug fix
  • Loading branch information
codingspirit authored Sep 20, 2022
2 parents 1c12d95 + b0c614d commit c415bb1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Getting started with out-of-box KVS WebRTC sample](#getting-started-with-out-of-box-kvs-webrtc-sample)
- [Getting started with out-of-box KVS Producer sample](#getting-started-with-out-of-box-kvs-producer-sample)
- [Getting started with out-of-box save frame sample](#getting-started-with-out-of-box-save-frame-sample)
- [Cross compile FILE board](#cross-compile-file-board)
- [Platform Implementation Guide](#platform-implementation-guide)
- [Contributing](#contributing)
- [Code Of Conduct](#code-of-conduct)
Expand All @@ -20,11 +21,14 @@

## Supported Boards

- FILE(Dummy boards that can capture from [sample frames](resources/frames/))
- x86/x64(By selecting board `V4L2` or `FILE`)
- RPi(By selecting board `V4L2` or `FILE`)
- Ingenic T31(By selecting board `T31` or `FILE`)
- Fullhan FH8626V100(By selecting board `FH8626V100` or `FILE`)
| Name | Description | CMake Parameter | Status |
| ------------------ | --------------------------------------------------------------------- | -------------------------------- | ------------------ |
| FILE | Dummy boards that can capture from [sample frames](resources/frames/) | `-DBOARD=FILE` | :heavy_check_mark: |
| x86/x64 | Capture from V4L2 device or capture from dummy frames | `-DBOARD=V4L2` or `-DBOARD=FILE` | :heavy_check_mark: |
| Raspberry Pi | Capture from V4L2 device or capture from dummy frames | `-DBOARD=V4L2` or `-DBOARD=FILE` | :heavy_check_mark: |
| Ingenic T31 | IPC SoC designed by Ingenic | `-DBOARD=T31` | :heavy_check_mark: |
| Fullhan FH8626V100 | IPC SoC designed by Fullhan | `-DBOARD=FH8626V100` | :heavy_check_mark: |


## Getting started with out-of-box KVS WebRTC sample

Expand Down Expand Up @@ -121,6 +125,30 @@ make
```
4. Execute sample on your board: `./saveframe-static $FILE_NAME`
## Cross compile FILE board
To cross compile `FILE` board sample, user need to setup `CC`, `CXX`, `USE_MUCLIBC` and `BOARD_DESTINATION_PLATFORM`.
For ARM boards with uclibc:
```bash
export CC=${YOUR_C_TOOLCHAIN}
export CXX=${YOUR_CXX_TOOLCHAIN}
cd amazon-kinesis-video-streams-media-interface
mkdir build; cd build
cmake .. -DBOARD=FILE -DUSE_MUCLIBC=ON -DBOARD_DESTINATION_PLATFORM=arm-unknown-linux-uclibc
```
> If board is using glibc, use cmake command `cmake .. -DBOARD=FILE -DUSE_MUCLIBC=OFF -DBOARD_DESTINATION_PLATFORM=arm-unknown-linux-gnu` instead.
For MIPS boards with uclibc:
```bash
export CC=${YOUR_C_TOOLCHAIN}
export CXX=${YOUR_CXX_TOOLCHAIN}
cd amazon-kinesis-video-streams-media-interface
mkdir build; cd build
cmake .. -DBOARD=FILE -DUSE_MUCLIBC=ON -DBOARD_DESTINATION_PLATFORM=mips-unknown-linux-uclibc
```
> If board is using glibc, use cmake command `cmake .. -DBOARD=FILE -DUSE_MUCLIBC=OFF -DBOARD_DESTINATION_PLATFORM=mips-unknown-linux-gnu` instead.
## Platform Implementation Guide
To adapt other platforms SDKs with **Amazon Kinesis Video Streams Media Interface**, you need to implement interfaces in *include/com/amazonaws/kinesis/video/capturer/VideoCapturer.h*, *include/com/amazonaws/kinesis/video/capturer/AudioCapturer.h* and *include/com/amazonaws/kinesis/video/player/AudioPlayer.h*:
Expand Down
2 changes: 1 addition & 1 deletion samples/webrtc/source/kvsWebRTCClientMaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "com/amazonaws/kinesis/video/capturer/VideoCapturer.h"
#include "com/amazonaws/kinesis/video/player/AudioPlayer.h"

#define VIDEO_FRAME_BUFFER_SIZE_BYTES (160 * 1024UL)
#define VIDEO_FRAME_BUFFER_SIZE_BYTES (256 * 1024UL)
#define AUDIO_FRAME_BUFFER_SIZE_BYTES (1024UL)
#define HUNDREDS_OF_NANOS_IN_A_MICROSECOND 10LL

Expand Down
4 changes: 2 additions & 2 deletions source/V4L2/V4L2VideoCapturer.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int videoCapturerAcquireStream(VideoCapturerHandle handle)
V4L2_HANDLE_NULL_CHECK(handle);
V4L2_HANDLE_GET(handle);

if (!v4l2CapturerStartStreaming(v4l2Handle->privHandle)) {
if (v4l2CapturerStartStreaming(v4l2Handle->privHandle)) {
LOG("Failed to acquire stream");
return -EAGAIN;
}
Expand Down Expand Up @@ -205,7 +205,7 @@ int videoCapturerReleaseStream(VideoCapturerHandle handle)
V4L2_HANDLE_NULL_CHECK(handle);
V4L2_HANDLE_GET(handle);

if (!v4l2CapturerStopStreaming(v4l2Handle->privHandle)) {
if (v4l2CapturerStopStreaming(v4l2Handle->privHandle)) {
LOG("Failed to release stream");
return -EAGAIN;
}
Expand Down

0 comments on commit c415bb1

Please sign in to comment.