mirror of
http://www.pogo.org.uk/~mark/trx.git
synced 2025-07-01 04:52:05 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0c5ab0dfc1 | ||
![]() |
5c844e6996 | ||
![]() |
69b6537303 | ||
![]() |
85fe843d61 |
2
README
2
README
@ -1,6 +1,6 @@
|
|||||||
trx: Realtime audio over IP
|
trx: Realtime audio over IP
|
||||||
|
|
||||||
(C) Copyright 2012 Mark Hills <mark@xwax.org>
|
(C) Copyright 2020 Mark Hills <mark@xwax.org>
|
||||||
|
|
||||||
See the COPYING file for licensing terms.
|
See the COPYING file for licensing terms.
|
||||||
|
|
||||||
|
2
device.c
2
device.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
2
device.h
2
device.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
2
notice.h
2
notice.h
@ -1,6 +1,6 @@
|
|||||||
#ifndef NOTICE_H
|
#ifndef NOTICE_H
|
||||||
#define NOTICE_H
|
#define NOTICE_H
|
||||||
|
|
||||||
#define COPYRIGHT "trx (C) Copyright 2014 Mark Hills <mark@xwax.org>"
|
#define COPYRIGHT "trx (C) Copyright 2020 Mark Hills <mark@xwax.org>"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
11
rx.c
11
rx.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -60,6 +60,15 @@ static RtpSession* create_rtp_recv(const char *addr_desc, const int port,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* oRTP in RECVONLY mode attempts to send RTCP packets and
|
||||||
|
* segfaults (v4.3.0 tested)
|
||||||
|
*
|
||||||
|
* https://stackoverflow.com/questions/43591690/receiving-rtcp-issues-within-ortp-library
|
||||||
|
*/
|
||||||
|
|
||||||
|
rtp_session_enable_rtcp(session, FALSE);
|
||||||
|
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
19
sched.c
19
sched.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -17,6 +17,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <pthread.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -28,23 +30,20 @@
|
|||||||
int go_realtime(void)
|
int go_realtime(void)
|
||||||
{
|
{
|
||||||
int max_pri;
|
int max_pri;
|
||||||
struct sched_param sp;
|
const struct sched_param sp = {
|
||||||
|
.sched_priority = REALTIME_PRIORITY,
|
||||||
if (sched_getparam(0, &sp)) {
|
};
|
||||||
perror("sched_getparam");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
max_pri = sched_get_priority_max(SCHED_FIFO);
|
max_pri = sched_get_priority_max(SCHED_FIFO);
|
||||||
sp.sched_priority = REALTIME_PRIORITY;
|
|
||||||
|
|
||||||
if (sp.sched_priority > max_pri) {
|
if (sp.sched_priority > max_pri) {
|
||||||
fprintf(stderr, "Invalid priority (maximum %d)\n", max_pri);
|
fprintf(stderr, "Invalid priority (maximum %d)\n", max_pri);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sched_setscheduler(0, SCHED_FIFO, &sp)) {
|
errno = pthread_setschedparam(pthread_self(), SCHED_FIFO, &sp);
|
||||||
perror("sched_setscheduler");
|
if (errno) {
|
||||||
|
perror("pthread_setschedparam");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
sched.h
2
sched.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
3
tx.c
3
tx.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Mark Hills <mark@xwax.org>
|
* Copyright (C) 2020 Mark Hills <mark@xwax.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -245,7 +245,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
ortp_init();
|
ortp_init();
|
||||||
ortp_scheduler_init();
|
ortp_scheduler_init();
|
||||||
ortp_set_log_level_mask(NULL, ORTP_WARNING|ORTP_ERROR);
|
|
||||||
session = create_rtp_send(addr, port);
|
session = create_rtp_send(addr, port);
|
||||||
assert(session != NULL);
|
assert(session != NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user