Create formats folder for all different media types
This makes the folder structure much cleaner and media-specific files are more clearly separated from RTP/RTCP etc. files
This commit is contained in:
parent
f642569ae5
commit
098287098c
20
Makefile
20
Makefile
|
|
@ -1,27 +1,25 @@
|
|||
.PHONY: all clean obj install
|
||||
|
||||
CXX = g++
|
||||
CFLAGS = -g -Wall -Wextra -O2 -std=c++11 -DNDEBUG
|
||||
CXXFLAGS = -g -Wall -Wextra -O2 -std=c++11 -DNDEBUG -Isrc -fPIC
|
||||
|
||||
SOURCES = $(wildcard src/*.cc)
|
||||
MODULES := src/formats
|
||||
-include $(patsubst %, %/module.mk, $(MODULES))
|
||||
OBJECTS := $(patsubst %.cc, %.o, $(filter %.cc, $(SOURCES)))
|
||||
|
||||
SOURCES=$(wildcard src/*.cc)
|
||||
OBJECTS=$(addprefix obj/,$(notdir $(SOURCES:.cc=.o)))
|
||||
TARGET = libkvzrtp.a
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
install: $(TARGET)
|
||||
install -m 577 $(TARGET) /usr/local/lib/
|
||||
mkdir -p /usr/local/include/kvzrtp
|
||||
mkdir -p /usr/local/include/kvzrtp /usr/local/include/kvzrtp/formats
|
||||
cp src/*.hh /usr/local/include/kvzrtp
|
||||
cp src/formats/*.hh /usr/local/include/kvzrtp/formats
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(AR) rcs $@ $(OBJECTS)
|
||||
|
||||
obj/%.o: src/%.cc | obj
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
obj:
|
||||
@mkdir -p $@
|
||||
|
||||
clean:
|
||||
rm -rf obj $(TARGET)
|
||||
rm -f src/*.o src/formats/*.o $(TARGET)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ CXXFLAGS = -Wall -Wextra -O2 -std=c++11 -g
|
|||
all: kvzrtp jrtp ccrtp live555 ortp ffmpeg
|
||||
|
||||
kvzrtp:
|
||||
$(CXX) $(CXXFLAGS) -o main_kvzrtp kvzrtp.cc util/util.cc -lkvazaar -lkvzrtp -lpthread
|
||||
$(CXX) $(CXXFLAGS) -o main_kvzrtp kvzrtp.cc util/util.cc -lkvzrtp -lkvazaar -lpthread
|
||||
|
||||
jrtp:
|
||||
$(CXX) $(CXXFLAGS) -o main_jrtp jrtp.cc util/util.cc -lkvazaar -ljrtp -lpthread
|
||||
|
|
|
|||
18
kvzrtp.pro
18
kvzrtp.pro
|
|
@ -23,13 +23,10 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
QMAKE_CXXFLAGS += -DNDEBUG
|
||||
QMAKE_CXXFLAGS += -DNDEBUG -Isrc
|
||||
|
||||
SOURCES += \
|
||||
src/send.cc \
|
||||
src/rtp_opus.cc \
|
||||
src/rtp_hevc.cc \
|
||||
src/rtp_generic.cc \
|
||||
src/reader.cc \
|
||||
src/lib.cc \
|
||||
src/frame.cc \
|
||||
|
|
@ -43,14 +40,14 @@ SOURCES += \
|
|||
src/clock.cc \
|
||||
src/hostname.cc \
|
||||
src/queue.cc \
|
||||
src/random.cc
|
||||
src/random.cc \
|
||||
src/formats/opus.cc \
|
||||
src/formats/hevc.cc \
|
||||
src/formats/generic.cc
|
||||
|
||||
HEADERS += \
|
||||
src/writer.hh \
|
||||
src/send.hh \
|
||||
src/rtp_opus.hh \
|
||||
src/rtp_hevc.hh \
|
||||
src/rtp_generic.hh \
|
||||
src/rtcp.hh \
|
||||
src/reader.hh \
|
||||
src/lib.hh \
|
||||
|
|
@ -66,7 +63,10 @@ HEADERS += \
|
|||
src/clock.hh \
|
||||
src/hostname.hh \
|
||||
src/queue.hh \
|
||||
src/random.hh
|
||||
src/random.hh \
|
||||
src/formats/opus.hh \
|
||||
src/formats/hevc.hh \
|
||||
src/formats/generic.hh
|
||||
|
||||
unix {
|
||||
target.path = /usr/lib
|
||||
|
|
|
|||
|
|
@ -11,10 +11,11 @@
|
|||
#include "debug.hh"
|
||||
#include "queue.hh"
|
||||
#include "random.hh"
|
||||
#include "rtp_hevc.hh"
|
||||
#include "rtp_opus.hh"
|
||||
#include "util.hh"
|
||||
|
||||
#include "formats/hevc.hh"
|
||||
#include "formats/opus.hh"
|
||||
|
||||
kvz_rtp::connection::connection(bool reader):
|
||||
config_(nullptr),
|
||||
socket_(),
|
||||
|
|
|
|||
|
|
@ -12,11 +12,12 @@
|
|||
#include "debug.hh"
|
||||
#include "conn.hh"
|
||||
#include "reader.hh"
|
||||
#include "rtp_generic.hh"
|
||||
#include "send.hh"
|
||||
#include "util.hh"
|
||||
#include "writer.hh"
|
||||
|
||||
#include "formats/generic.hh"
|
||||
|
||||
// TODO implement frame splitting if data_len > MTU
|
||||
rtp_error_t kvz_rtp::generic::push_frame(kvz_rtp::connection *conn, uint8_t *data, size_t data_len, int flags)
|
||||
{
|
||||
|
|
@ -5,11 +5,12 @@
|
|||
#include "conn.hh"
|
||||
#include "debug.hh"
|
||||
#include "reader.hh"
|
||||
#include "rtp_hevc.hh"
|
||||
#include "queue.hh"
|
||||
#include "send.hh"
|
||||
#include "writer.hh"
|
||||
|
||||
#include "formats/hevc.hh"
|
||||
|
||||
#define PTR_DIFF(a, b) ((ptrdiff_t)((char *)(a) - (char *)(b)))
|
||||
|
||||
#define RTP_FRAME_MAX_DELAY 50
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "rtp_generic.hh"
|
||||
#include "formats/generic.hh"
|
||||
|
||||
namespace kvz_rtp {
|
||||
class connection;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
SOURCES += \
|
||||
src/formats/generic.cc \
|
||||
src/formats/hevc.cc \
|
||||
src/formats/opus.cc
|
||||
|
|
@ -3,9 +3,10 @@
|
|||
|
||||
#include "conn.hh"
|
||||
#include "debug.hh"
|
||||
#include "rtp_opus.hh"
|
||||
#include "send.hh"
|
||||
|
||||
#include "formats/opus.hh"
|
||||
|
||||
/* Validity of arguments is checked by kvz_rtp::sender. We just need to relay them there */
|
||||
rtp_error_t kvz_rtp::opus::push_frame(connection *conn, uint8_t *data, uint32_t data_len, int flags)
|
||||
{
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "rtp_generic.hh"
|
||||
#include "formats/generic.hh"
|
||||
|
||||
namespace kvz_rtp {
|
||||
namespace opus {
|
||||
|
|
@ -4,8 +4,9 @@
|
|||
#include "debug.hh"
|
||||
#include "frame.hh"
|
||||
#include "reader.hh"
|
||||
#include "rtp_hevc.hh"
|
||||
#include "rtp_opus.hh"
|
||||
|
||||
#include "formats/hevc.hh"
|
||||
#include "formats/opus.hh"
|
||||
|
||||
#define RTP_HEADER_VERSION 2
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "debug.hh"
|
||||
#include "conn.hh"
|
||||
#include "rtp_generic.hh"
|
||||
#include "formats/generic.hh"
|
||||
#include "send.hh"
|
||||
#include "util.hh"
|
||||
#include "writer.hh"
|
||||
|
|
|
|||
|
|
@ -15,11 +15,12 @@ using namespace mingw;
|
|||
#include <iostream>
|
||||
|
||||
#include "debug.hh"
|
||||
#include "rtp_opus.hh"
|
||||
#include "rtp_hevc.hh"
|
||||
#include "rtp_generic.hh"
|
||||
#include "writer.hh"
|
||||
|
||||
#include "formats/opus.hh"
|
||||
#include "formats/hevc.hh"
|
||||
#include "formats/generic.hh"
|
||||
|
||||
kvz_rtp::writer::writer(std::string dst_addr, int dst_port):
|
||||
connection(false),
|
||||
dst_addr_(dst_addr),
|
||||
|
|
|
|||
Loading…
Reference in New Issue