Skip to content

Commit

Permalink
Import latest release-7.2 files from old repo
Browse files Browse the repository at this point in the history
  • Loading branch information
c-g-owen committed Sep 7, 2021
1 parent 40d373e commit dba969e
Show file tree
Hide file tree
Showing 43 changed files with 1,093 additions and 157 deletions.
14 changes: 14 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
ChangeLog for AVS -- latest on top!

==============================================================================
AVS Release 7.2

Date: May 10, 2021
GIT: https://github.com/wearezeta/avs/tree/release-7.2
Android: Android NDK r14b
iOS: iOS SDK 12.2
OSX: MacOS SDK 10.14
Linux: Ubuntu x86_64 18.04 (LTS)

Summary: - Selective forwarding of video

Hotfixes:

==============================================================================
AVS Release 7.1

Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

# Master version number
#
VER_MAJOR := 7
VER_MINOR := 1

ifeq ($(BUILD_NUMBER),)
VER_PATCH := local
Expand All @@ -35,14 +33,15 @@ endif

VER_BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo "")

ifeq ($(VER_BRANCH),master)
ifeq ($(word 1, $(subst -, , $(VER_BRANCH))), release)
AVS_PROJECT := avs
AVS_RELEASE := 1
VER_MAJOR_MINOR := $(word 2, $(subst -, , $(VER_BRANCH)))
AVS_VERSION := $(VER_MAJOR_MINOR).$(VER_PATCH)
else
AVS_PROJECT := avsmaster
AVS_RELEASE := 0
AVS_VERSION := 0.0.$(VER_PATCH)
else
AVS_PROJECT := avs
AVS_RELEASE := 1
AVS_VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
endif

MK_COMPONENTS := toolchain contrib avs tools test android iosx dist
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,17 @@ When reporting bugs against AVS please include the following:
- Exact time when call was started/stopped
- Name/OS of device
- Adb logcat for Android

Run-time libraries
------------------
FROM ubuntu:16.04
RUN apt-get install -qqy --no-install-recommends \
libprotobuf-c-dev \
libc6-dev-i386 \
libreadline-dev \
libx11-dev \
libxcomposite-dev \
libxdamage-dev \
libxrender-dev \
libc++-dev \
libc++abi-dev
44 changes: 44 additions & 0 deletions docs/api/api_changes_7.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

Changes introduced in AVS 7.2
=============================

AVS 7.2 comes with selective video, allowing clients to request a subset of available videos to receive. An additional call and mode value are available:

#define WCALL_VSTREAMS_LIST 0

int wcall_request_video_streams(WUSER_HANDLE wuser,
const char *convid,
int mode,
const char *json);


export enum VSTREAMS {
LIST = 0
}

requestVideoStreams(
wuser: number,
convid: string,
mode: number,
json: string
): number

The mode parameter can only be WCALL_VSTREAMS_LIST at present. json is a string containing a JSON blob similar to wcall_set_clients_for_conv:

{
"convid":"01234567-89ab-cdef-0123-456789abcdef",
"clients":[
{"userid":"01234567-89ab-cdef-0123-456789abcdef","clientid":"0123456789abcdef"}
]
}

The videoStreamHandler callback on web can now receive null for the streams to allow the user for the stream to be switched. When receiving videoStreamHandler with null streams, the video element used to render the video for that user should be disconnected and/or removed. The function now looks as follows:

export type VideoStreamHandler = (
convid: string,
remote_userid: string,
remote_clientid: string,
streams: readonly MediaStream[] | null
) => void;


4 changes: 4 additions & 0 deletions include/avs_ccall.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ int ccall_set_quality_interval(struct icall *icall, uint64_t interval);

int ccall_update_mute_state(const struct icall* icall);

int ccall_request_video_streams(struct icall *icall,
struct list *clientl,
enum icall_stream_mode mode);

int ccall_msg_recv(struct icall* icall,
uint32_t curr_time,
uint32_t msg_time,
Expand Down
8 changes: 7 additions & 1 deletion include/avs_ecall.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ typedef void (ecall_confpart_h)(struct ecall *ecall,
const struct econn_message *msg,
void *arg);


int ecall_set_confpart_handler(struct ecall *ecall,
ecall_confpart_h confparth);

typedef void (ecall_confstreams_h)(struct ecall *ecall,
const struct econn_message *msg,
void *arg);

int ecall_set_confstreams_handler(struct ecall *ecall,
ecall_confstreams_h confstreamsh);

int ecall_dce_send(struct ecall *ecall, struct mbuf *mb);

int ecall_dce_sendmsg(struct ecall *ecall, struct econn_message *msg);
Expand Down
33 changes: 27 additions & 6 deletions include/avs_econn.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ enum econn_msg {
ECONN_GROUP_SETUP = 0x08,

/* Conference call: */
ECONN_CONF_CONN = 0x09,
ECONN_CONF_START = 0x0A,
ECONN_CONF_END = 0x0B,
ECONN_CONF_PART = 0x0C,
ECONN_CONF_KEY = 0x0D,
ECONN_CONF_CHECK = 0x0E,
ECONN_CONF_CONN = 0x09,
ECONN_CONF_START = 0x0A,
ECONN_CONF_END = 0x0B,
ECONN_CONF_PART = 0x0C,
ECONN_CONF_KEY = 0x0D,
ECONN_CONF_CHECK = 0x0E,
ECONN_CONF_STREAMS = 0x0F,

ECONN_UPDATE = 0x10,
ECONN_REJECT = 0x11,
Expand Down Expand Up @@ -198,6 +199,11 @@ struct econn_message {
struct confkey {
struct list keyl; /* list of struct econn_key_info */
} confkey;

struct confstreams {
struct list streaml; /* list of struct econn_stream_info */
char *mode;
} confstreams;
} u;
};

Expand All @@ -222,6 +228,14 @@ struct econn_key_info {
uint32_t dlen;
struct le le;
};

/* key data for CONF_STREAMS message */
struct econn_stream_info {
char userid[ECONN_ID_LEN];
uint32_t quality;
struct le le;
};

/**
* Indicates an incoming call on this ECONN.
* Should only be called once per ECONN.
Expand Down Expand Up @@ -268,6 +282,10 @@ typedef void (econn_confpart_h)(struct econn *econn,
const struct econn_message *msg,
void *arg);

typedef void (econn_confstreams_h)(struct econn *econn,
const struct econn_message *msg,
void *arg);

typedef void (econn_ping_h)(struct econn *econn, bool response, void *arg);

/**
Expand Down Expand Up @@ -312,6 +330,7 @@ int econn_alloc(struct econn **econnp,
econn_update_resp_h *update_resph,
econn_alert_h *alerth,
econn_confpart_h *confparth,
econn_confstreams_h *confstreamsh,
econn_ping_h *pingh,
econn_close_h *closeh, void *arg);
int econn_start(struct econn *conn, const char *sdp,
Expand Down Expand Up @@ -398,6 +417,8 @@ struct econn_key_info *econn_key_info_alloc(size_t keysz);

int econn_send_ping(struct econn *conn, bool response);

struct econn_stream_info *econn_stream_info_alloc(const char *userid,
uint32_t quality);
struct vector {
uint8_t *bytes;
size_t len;
Expand Down
10 changes: 10 additions & 0 deletions include/avs_icall.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ enum icall_audio_state {
ICALL_AUDIO_STATE_NETWORK_PROBLEM = 2,
};

enum icall_stream_mode {
ICALL_STREAM_MODE_DEFAULT = 0
};

struct icall_client {
struct le le;
char *userid;
char *clientid;
int quality;
};

/* Used in place of uploss/downloss in the quality handler,
Expand Down Expand Up @@ -109,6 +114,9 @@ typedef int (icall_set_quality_interval)(struct icall *icall,
typedef int (icall_dce_send)(struct icall *icall, struct mbuf *mb);
typedef void (icall_set_clients)(struct icall* icall, struct list *clientl);
typedef int (icall_update_mute_state)(const struct icall* icall);
typedef int (icall_request_video_streams)(struct icall *icall,
struct list *clientl,
enum icall_stream_mode mode);

typedef int (icall_debug)(struct re_printf *pf, const struct icall* icall);
typedef int (icall_stats)(struct re_printf *pf, const struct icall* icall);
Expand Down Expand Up @@ -206,6 +214,7 @@ struct icall {
icall_dce_send *dce_send;
icall_set_clients *set_clients;
icall_update_mute_state *update_mute_state;
icall_request_video_streams *request_video_streams;
icall_debug *debug;
icall_stats *stats;

Expand Down Expand Up @@ -256,6 +265,7 @@ void icall_set_functions(struct icall *icall,
icall_dce_send *dce_send,
icall_set_clients *set_clients,
icall_update_mute_state *update_ute_state,
icall_request_video_streams *request_video_streams,
icall_debug *debug,
icall_stats *stats);

Expand Down
2 changes: 2 additions & 0 deletions include/avs_peerflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ void capture_source_handle_frame(struct avs_vidframe *frame);
int peerflow_get_userid_for_ssrc(struct peerflow* pf,
uint32_t csrc,
bool video,
char **userid_real,
char **clientid_real,
char **userid_hash);
#ifdef __cplusplus
}
Expand Down
21 changes: 17 additions & 4 deletions include/avs_wcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ struct mediamgr *wcall_mediamgr(WUSER_HANDLE wuser);

void wcall_handle_frame(struct avs_vidframe *frame);

int wcall_set_proxy(const char *host, int port);

/**
* Client list management (conference calls).
*/
typedef void (wcall_req_clients_h)(WUSER_HANDLE wuser,
const char *convid, void *arg);

Expand All @@ -486,17 +491,25 @@ int wcall_set_clients_for_conv(WUSER_HANDLE wuser,
const char *convid,
const char *json);


/**
* Active speaker (conference calls).
*/
typedef void (wcall_active_speaker_h)(WUSER_HANDLE wuser,
const char *convid,
const char *json_levels, void *arg);

void wcall_set_active_speaker_handler(WUSER_HANDLE wuser,
wcall_active_speaker_h *activeh);

int wcall_set_proxy(const char *host, int port);


#define WCALL_VSTREAMS_LIST 0
/**
* Video stream selection (conference calls).
*/
int wcall_request_video_streams(WUSER_HANDLE wuser,
const char *convid,
int mode,
const char *json);

/*
* Netprobe
*/
Expand Down
25 changes: 23 additions & 2 deletions iosx/src/flowmgr/AVSVideoViewOSX.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ @implementation AVSVideoViewOSX
NSLock *_lock;
BOOL _newFrame;
BOOL _firstFrame;
BOOL _drawBlank;
NSString *_userid;
CVDisplayLinkRef _displayLink;
}

Expand Down Expand Up @@ -292,6 +294,7 @@ - (BOOL) handleFrame:(struct avs_vidframe*) frame
frame->w, frame->h);
_firstFrame = NO;
}
_drawBlank = NO;
[_context makeCurrentContext];

if (_texWidth != (GLsizei)frame->ys || _texHeight != frame->h) {
Expand Down Expand Up @@ -382,16 +385,19 @@ - (CVReturn)getFrameForTime:(const CVTimeStamp*)outputTime
[_context makeCurrentContext];

if (_forceRecalc) {
NSScreen *nsscreen = [[NSScreen screens] objectAtIndex: 0];
GLfloat scale = nsscreen.backingScaleFactor;
NSRect frameRect = self.frame;
glViewport(0, 0, frameRect.size.width, frameRect.size.height);
glViewport(0, 0, frameRect.size.width * scale, frameRect.size.height * scale);
[self setupVertices];
_forceRecalc = NO;
}

glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);

glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);
if (!_drawBlank)
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);

glSwapAPPLE();
_newFrame = NO;
Expand Down Expand Up @@ -451,6 +457,21 @@ - (void)viewDidMoveToWindow

[super viewDidMoveToWindow];
}

- (void) setUserid:(NSString*)userid
{
[_lock lock];
_userid = userid;
_drawBlank = YES;
_newFrame = YES;
[_lock unlock];
}

- (NSString*) userid
{
return _userid;
}

- (void)dealloc
{
CVDisplayLinkStop(_displayLink);
Expand Down
Loading

0 comments on commit dba969e

Please sign in to comment.