Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stable (#105)
Browse files Browse the repository at this point in the history
* cmake: bump min. version 3.10 (#79)

* auframe: auframe_bytes_to_timestamp use uint64_t

The correct type for timestamp is `uint64_t`.

* ci: migrate from make to CMake (#81)

* cmake: install improvements (#83)

* cmake: add static and shared targets (#84)

* cmake: add win32 linklibs (#85)

* update copyright/license

* debian: use dh-cmake (#86)

* debian: release build

* vid/frame: fix possbile overflow multiplication (#87)

Found by CodeQL: Multiplication result may overflow 'unsigned int'
before it is converted to 'size_t'.

* cmake: add pkgconfig (fixes #90) (#91)

* cmake/pkgconfig: fix name

* cmake: fix shared API soversion (aligned with make) (#89)

* release v2.8.0 (#92)

* cmake: add pre-release version handling (#95)

* cmake,mk: bump dev version

* README.md: Update build instructions for cmake (#96)

* aubuf: exclude non compatible CXX functions (#97)

* auframe: skip level calculation if format is RAW (#99)

* ci: use actions/checkout@v3 (#101)

* vidframe_draw_point: add NV12 and NV21 pixel format (#102)

* prepare 2.9.0 (#104)

* version 2.9.0

Co-authored-by: Sebastian Reimers <hallo@studio-link.de>
Co-authored-by: Christian Spielberger <c.spielberger@commend.com>
Co-authored-by: Robert Scheck <robert-scheck@users.noreply.github.com>
4 people authored Nov 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e9a4aa8 commit 09a8313
Showing 10 changed files with 120 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
CC: ${{ matrix.compiler }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: sreimers/pr-dependency-action@v0.5
with:
2 changes: 1 addition & 1 deletion .github/workflows/ccheck.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: ccheck
run: |
wget "https://raw.githubusercontent.com/baresip/baresip/stable/test/ccheck.py"
6 changes: 3 additions & 3 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y mingw-w64
- uses: actions/checkout@v2 # needed for pr checkout
- uses: actions/checkout@v3 # needed for pr checkout

- uses: sreimers/pr-dependency-action@v0.5
with:
@@ -31,7 +31,7 @@ jobs:
mv re baresip-win32/
mv retest baresip-win32/
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: baresip-win32/rem

@@ -64,7 +64,7 @@ jobs:

steps:
- uses: actions/download-artifact@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: baresip

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [v2.9.0] - 2022-11-01

## What's Changed
* cmake: add pre-release version handling by @sreimers in https://github.com/baresip/rem/pull/95
* README.md: Update build instructions for cmake by @robert-scheck in https://github.com/baresip/rem/pull/96
* aubuf: exclude non compatible CXX functions by @sreimers in https://github.com/baresip/rem/pull/97
* auframe: skip level calculation if format is RAW by @alfredh in https://github.com/baresip/rem/pull/99
* ci: use actions/checkout@v3 by @sreimers in https://github.com/baresip/rem/pull/101
* vidframe_draw_point: add NV12 and NV21 pixel format by @alfredh in https://github.com/baresip/rem/pull/102


**Full Changelog**: https://github.com/baresip/rem/compare/v2.8.0...v2.9.0


## [v2.8.0] - 2022-10-01

* cmake: bump min. version 3.10 by @sreimers in https://github.com/baresip/rem/pull/79
24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -12,14 +12,24 @@
cmake_minimum_required(VERSION 3.10)

project(rem
VERSION 2.8.0
VERSION 2.9.0
LANGUAGES C
HOMEPAGE_URL https://github.com/baresip/rem
DESCRIPTION "Audio and video processing media library"
)

set(PROJECT_SOVERSION 3) # bump if ABI breaks

# Pre-release identifier, comment out on a release
# Increment for breaking changes (dev2, dev3...)
#set(PROJECT_VERSION_PRE dev)

if(PROJECT_VERSION_PRE)
set(PROJECT_VERSION_FULL ${PROJECT_VERSION}-${PROJECT_VERSION_PRE})
else()
set(PROJECT_VERSION_FULL ${PROJECT_VERSION})
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

##############################################################################
@@ -67,6 +77,18 @@ endif()

find_package(re CONFIG REQUIRED HINTS ../re/cmake)

list(APPEND RE_DEFINITIONS
-DVERSION="${PROJECT_VERSION_FULL}"
-DVER_MAJOR=${PROJECT_VERSION_MAJOR}
-DVER_MINOR=${PROJECT_VERSION_MINOR}
-DVER_PATCH=${PROJECT_VERSION_PATCH}
)

##############################################################################
#
# Source/Header section
#

set(SRCS
src/aac/aac.c
src/au/fmt.c
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

# Main version number
VER_MAJOR := 2
VER_MINOR := 8
VER_MINOR := 9
VER_PATCH := 0

# Development version, comment out on a release
@@ -26,7 +26,7 @@ else
VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)-$(VER_PRE)
endif
OPT_SPEED := 1
LIBRE_MIN := 2.8.0
LIBRE_MIN := 2.9.0

ifndef LIBRE_MK
LIBRE_MK := $(shell [ -f ../re/mk/re.mk ] && \
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -31,11 +31,40 @@ librem is using GNU makefiles, and [libre](https://github.com/baresip/re)
must be installed before building.


### Build with default options
### Build with debug enabled

```
$ make
$ sudo make install
$ cmake -B build
$ cmake --build build -j
$ sudo cmake --install build
$ sudo ldconfig
```

On some distributions, /usr/local/lib may not be included in ld.so.conf.
You can check with `grep "/usr/local/lib" /etc/ld.so.conf.d/*.conf`
and add if necessary:

```
$ echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/libc.conf
$ sudo ldconfig
```


### Build with release

```
$ cmake -B build -DCMAKE_BUILD_TYPE=Release
$ cmake --build build -j
$ sudo cmake --install build
$ sudo ldconfig
```

### Build with clang compiler

```
$ cmake -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ cmake --build build -j
$ sudo cmake --install build
$ sudo ldconfig
```

29 changes: 16 additions & 13 deletions include/rem_aubuf.h
Original file line number Diff line number Diff line change
@@ -25,6 +25,21 @@ int aubuf_debug(struct re_printf *pf, const struct aubuf *ab);
size_t aubuf_cur_size(const struct aubuf *ab);
void aubuf_drop_auframe(struct aubuf *ab, const struct auframe *af);


static inline int aubuf_append(struct aubuf *ab, struct mbuf *mb)
{
return aubuf_append_auframe(ab, mb, NULL);
}


static inline int aubuf_get_samp(struct aubuf *ab, uint32_t ptime,
int16_t *sampv, size_t sampc)
{
return aubuf_get(ab, ptime, (uint8_t *)sampv, sampc * 2);
}


#ifndef __cplusplus
static inline int aubuf_write(struct aubuf *ab, const uint8_t *p, size_t sz)
{
struct auframe af = {
@@ -40,12 +55,6 @@ static inline int aubuf_write(struct aubuf *ab, const uint8_t *p, size_t sz)
}


static inline int aubuf_append(struct aubuf *ab, struct mbuf *mb)
{
return aubuf_append_auframe(ab, mb, NULL);
}


static inline int aubuf_write_samp(struct aubuf *ab, const int16_t *sampv,
size_t sampc)
{
@@ -91,10 +100,4 @@ static inline void aubuf_read_samp(struct aubuf *ab, int16_t *sampv,

aubuf_read_auframe(ab, &af);
}


static inline int aubuf_get_samp(struct aubuf *ab, uint32_t ptime,
int16_t *sampv, size_t sampc)
{
return aubuf_get(ab, ptime, (uint8_t *)sampv, sampc * 2);
}
#endif
3 changes: 3 additions & 0 deletions src/auframe/auframe.c
Original file line number Diff line number Diff line change
@@ -96,6 +96,9 @@ double auframe_level(struct auframe *af)
if (!af)
return AULEVEL_UNDEF;

if (af->fmt == AUFMT_RAW)
return AULEVEL_UNDEF;

if (af->level == AULEVEL_UNDEF)
af->level = aulevel_calc_dbov(af->fmt, af->sampv, af->sampc);

25 changes: 25 additions & 0 deletions src/vid/draw.c
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ void vidframe_draw_point(struct vidframe *f, unsigned x, unsigned y,
{
uint8_t *yp, *up, *vp;
uint32_t *p;
size_t uv_offset;

if (!f)
return;
@@ -59,6 +60,30 @@ void vidframe_draw_point(struct vidframe *f, unsigned x, unsigned y,
*p = (uint32_t)r << 16 | (uint32_t)g << 8 | b;
break;

case VID_FMT_NV12:
uv_offset = (f->linesize[1] * (y/2) + x) & ~1;

yp = f->data[0] + f->linesize[0] * y + x;
up = f->data[1] + uv_offset;
vp = f->data[1] + uv_offset + 1;

yp[0] = rgb2y(r, g, b);
up[0] = rgb2u(r, g, b);
vp[0] = rgb2v(r, g, b);
break;

case VID_FMT_NV21:
uv_offset = (f->linesize[1] * (y/2) + x) & ~1;

yp = f->data[0] + f->linesize[0] * y + x;
up = f->data[1] + uv_offset + 1;
vp = f->data[1] + uv_offset;

yp[0] = rgb2y(r, g, b);
up[0] = rgb2u(r, g, b);
vp[0] = rgb2v(r, g, b);
break;

default:
(void)re_fprintf(stderr, "vidframe_draw_point:"
" unsupported format %s\n",

0 comments on commit 09a8313

Please sign in to comment.