Drop RTSP support. It's crappy and I no longer care about it
This commit is contained in:
parent
42adea653d
commit
76c3336e4e
6 changed files with 0 additions and 1286 deletions
2
Makefile
2
Makefile
|
@ -55,8 +55,6 @@ SRCS = src/main.c \
|
|||
src/parser_latm.c \
|
||||
src/tsdemux.c \
|
||||
src/bitstream.c \
|
||||
src/rtsp.c \
|
||||
src/rtp.c \
|
||||
src/htsp.c \
|
||||
src/serviceprobe.c \
|
||||
src/htsmsg.c \
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "tvheadend.h"
|
||||
#include "tcp.h"
|
||||
#include "http.h"
|
||||
#include "rtsp.h"
|
||||
#include "access.h"
|
||||
|
||||
static void *http_server;
|
||||
|
@ -498,7 +497,6 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill)
|
|||
|
||||
switch(hc->hc_version) {
|
||||
case RTSP_VERSION_1_0:
|
||||
rval = rtsp_process_request(hc);
|
||||
break;
|
||||
|
||||
case HTTP_VERSION_1_0:
|
||||
|
@ -780,7 +778,6 @@ http_serve(int fd, void *opaque, struct sockaddr_in *peer,
|
|||
free(hc.hc_username);
|
||||
free(hc.hc_password);
|
||||
|
||||
rtsp_disconncet(&hc);
|
||||
http_arg_flush(&hc.hc_args);
|
||||
http_arg_flush(&hc.hc_req_args);
|
||||
|
||||
|
|
136
src/rtp.c
136
src/rtp.c
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* tvheadend, RTP interface
|
||||
* Copyright (C) 2007 Andreas Öman
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "tvheadend.h"
|
||||
#include "rtp.h"
|
||||
|
||||
void
|
||||
rtp_send_mpv(rtp_send_t *sender, void *opaque, rtp_stream_t *rs,
|
||||
const uint8_t *data, size_t len,
|
||||
int64_t pts)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
int s;
|
||||
int payloadsize = RTP_MAX_PACKET_SIZE - (4 + 4 + 4 + 4);
|
||||
uint8_t *buf;
|
||||
|
||||
if(data[0] != 0x00 || data[1] != 0x00 || data[2] != 0x01)
|
||||
return; // Not a startcode, something is fishy
|
||||
|
||||
if(data[3] == 0xb3) {
|
||||
// Sequence Start code, set Begin-Of-Sequence
|
||||
flags |= 1 << 13;
|
||||
}
|
||||
while(len > 0) {
|
||||
|
||||
s = len > payloadsize ? payloadsize : len;
|
||||
|
||||
buf = rs->rs_buf;
|
||||
buf[0] = 0x80;
|
||||
buf[1] = 32 | (len == payloadsize ? 0x80 : 0);
|
||||
buf[2] = rs->rs_seq >> 8;
|
||||
buf[3] = rs->rs_seq;
|
||||
|
||||
buf[4] = pts >> 24;
|
||||
buf[5] = pts >> 16;
|
||||
buf[6] = pts >> 8;
|
||||
buf[7] = pts;
|
||||
|
||||
buf[8] = 0;
|
||||
buf[9] = 0;
|
||||
buf[10] = 0;
|
||||
buf[11] = 0;
|
||||
|
||||
buf[12] = flags >> 24;
|
||||
buf[13] = flags >> 16;
|
||||
buf[14] = flags >> 8;
|
||||
buf[15] = flags;
|
||||
|
||||
memcpy(buf + 16, data, s);
|
||||
|
||||
len -= s;
|
||||
data += s;
|
||||
|
||||
sender(opaque, buf, s + 16);
|
||||
rs->rs_seq++;
|
||||
|
||||
flags = 0;
|
||||
|
||||
}
|
||||
assert(len == 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtp_send_mpa(rtp_send_t *sender, void *opaque, rtp_stream_t *rs,
|
||||
const uint8_t *data, size_t len,
|
||||
int64_t pts)
|
||||
{
|
||||
int payloadsize = RTP_MAX_PACKET_SIZE - (4 + 4 + 4 + 4);
|
||||
int offset = 0, s;
|
||||
uint8_t *buf;
|
||||
|
||||
while(len > 0) {
|
||||
|
||||
s = len > payloadsize ? payloadsize : len;
|
||||
|
||||
buf = rs->rs_buf;
|
||||
buf[0] = 0x80;
|
||||
buf[1] = 14;
|
||||
buf[2] = rs->rs_seq >> 8;
|
||||
buf[3] = rs->rs_seq;
|
||||
|
||||
buf[4] = pts >> 24;
|
||||
buf[5] = pts >> 16;
|
||||
buf[6] = pts >> 8;
|
||||
buf[7] = pts;
|
||||
|
||||
buf[8] = 0;
|
||||
buf[9] = 0;
|
||||
buf[10] = 0;
|
||||
buf[11] = 0;
|
||||
|
||||
buf[12] = 0;
|
||||
buf[13] = 0;
|
||||
buf[14] = offset >> 8;
|
||||
buf[15] = offset;
|
||||
|
||||
memcpy(buf + 16, data, s);
|
||||
|
||||
len -= s;
|
||||
data += s;
|
||||
|
||||
sender(opaque, buf, s + 16);
|
||||
rs->rs_seq++;
|
||||
|
||||
offset += s;
|
||||
|
||||
}
|
||||
assert(len == 0);
|
||||
}
|
39
src/rtp.h
39
src/rtp.h
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Tvheadend, RTP streamer
|
||||
* Copyright (C) 2007, 2009 Andreas Öman
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef RTP_H_
|
||||
#define RTP_H_
|
||||
|
||||
typedef void (rtp_send_t)(void *opaque, void *buf, size_t len);
|
||||
|
||||
#define RTP_MAX_PACKET_SIZE 1472
|
||||
|
||||
typedef struct rtp_stream {
|
||||
uint16_t rs_seq;
|
||||
|
||||
int rs_ptr;
|
||||
uint8_t rs_buf[RTP_MAX_PACKET_SIZE];
|
||||
} rtp_stream_t;
|
||||
|
||||
void rtp_send_mpv(rtp_send_t *sender, void *opaque, rtp_stream_t *rs,
|
||||
const uint8_t *data, size_t len, int64_t pts);
|
||||
|
||||
void rtp_send_mpa(rtp_send_t *sender, void *opaque, rtp_stream_t *rs,
|
||||
const uint8_t *data, size_t len, int64_t pts);
|
||||
|
||||
#endif /* RTP_H_ */
|
1076
src/rtsp.c
1076
src/rtsp.c
File diff suppressed because it is too large
Load diff
30
src/rtsp.h
30
src/rtsp.h
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* tvheadend, RTSP interface
|
||||
* Copyright (C) 2007 Andreas Öman
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef RTSP_H_
|
||||
#define RTSP_H_
|
||||
|
||||
#include "http.h"
|
||||
|
||||
int rtsp_process_request(http_connection_t *hc);
|
||||
|
||||
void rtsp_disconncet(http_connection_t *hc);
|
||||
|
||||
void rtsp_init(void);
|
||||
|
||||
#endif /* RTSP_H_ */
|
Loading…
Add table
Reference in a new issue