apps/netutils: Add RTP tools

This commit is contained in:
Tiago Medicci Serrano 2023-02-24 12:14:22 -03:00 committed by Xiang Xiao
parent b00f612470
commit a6c41fbaeb
5 changed files with 313 additions and 0 deletions

2
netutils/rtptools/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/rtptools
/*.tar.gz

131
netutils/rtptools/Kconfig Normal file
View File

@ -0,0 +1,131 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config NETUTILS_RTPTOOLS
bool "Enable RTP Tools"
default n
---help---
RTP Tools is a set of small applications
that can be used for processing RTP data.
if NETUTILS_RTPTOOLS
config NETUTILS_RTPTOOLS_VERSION
string "RTP Tools version"
default "9356740cb0c264577e0f9505e682e53a1e0996d5"
menuconfig RTPTOOLS_APPS
tristate "RTP Tools Applications"
default y
---help---
Enable RTP Tools Applications
if RTPTOOLS_APPS
config NETUTILS_RTPTOOLS_DEFAULT_TASK_STACKSIZE
int "RTP Tools apps default stack size"
default 12288
config NETUTILS_RTPTOOLS_RTPPLAY
bool "Enable rtpplay"
default n
---help---
Play back RTP sessions recorded by rtpdump.
if NETUTILS_RTPTOOLS_RTPPLAY
config NETUTILS_RTPTOOLS_RTPPLAY_PROGNAME
string "Program name"
default "rtpplay"
---help---
This is the name of the program that will be used.
config NETUTILS_RTPTOOLS_RTPPLAY_PRIORITY
int "rtpplay task priority"
default 100
config NETUTILS_RTPTOOLS_RTPPLAY_STACKSIZE
int "rtpplay stack size"
default NETUTILS_RTPTOOLS_DEFAULT_TASK_STACKSIZE
endif # NETUTILS_RTPTOOLS_RTPPLAY
config NETUTILS_RTPTOOLS_RTPSEND
bool "Enable rtpsend"
default n
---help---
Generate RTP packets from textual description,
generated by hand or rtpdump.
if NETUTILS_RTPTOOLS_RTPSEND
config NETUTILS_RTPTOOLS_RTPSEND_PROGNAME
string "Program name"
default "rtpsend"
---help---
This is the name of the program that will be used.
config NETUTILS_RTPTOOLS_RTPSEND_PRIORITY
int "rtpsend task priority"
default 100
config NETUTILS_RTPTOOLS_RTPSEND_STACKSIZE
int "rtpsend stack size"
default NETUTILS_RTPTOOLS_DEFAULT_TASK_STACKSIZE
endif # NETUTILS_RTPTOOLS_RTPSEND
config NETUTILS_RTPTOOLS_RTPDUMP
bool "Enable rtpdump"
default y
---help---
Parse and print RTP packets, generating output
files suitable for rtpplay and rtpsend.
if NETUTILS_RTPTOOLS_RTPDUMP
config NETUTILS_RTPTOOLS_RTPDUMP_PROGNAME
string "Program name"
default "rtpdump"
---help---
This is the name of the program that will be used.
config NETUTILS_RTPTOOLS_RTPDUMP_PRIORITY
int "rtpdump task priority"
default 100
config NETUTILS_RTPTOOLS_RTPDUMP_STACKSIZE
int "rtpdump stack size"
default NETUTILS_RTPTOOLS_DEFAULT_TASK_STACKSIZE
endif # NETUTILS_RTPTOOLS_RTPDUMP
config NETUTILS_RTPTOOLS_RTPTRANS
bool "Enable rtptrans"
default n
---help---
RTP translator between unicast and multicast networks.
if NETUTILS_RTPTOOLS_RTPTRANS
config NETUTILS_RTPTOOLS_RTPTRANS_PROGNAME
string "Program name"
default "rtptrans"
---help---
This is the name of the program that will be used.
config NETUTILS_RTPTOOLS_RTPTRANS_PRIORITY
int "rtptrans task priority"
default 100
config NETUTILS_RTPTOOLS_RTPTRANS_STACKSIZE
int "rtptrans stack size"
default NETUTILS_RTPTOOLS_DEFAULT_TASK_STACKSIZE
endif # NETUTILS_RTPTOOLS_RTPTRANS
endif # RTPTOOLS_APPS
endif # NETUTILS_RTPTOOLS

View File

@ -0,0 +1,27 @@
############################################################################
# apps/netutils/rtptools/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_NETUTILS_RTPTOOLS),)
CONFIGURED_APPS += $(APPDIR)/netutils/rtptools
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/netutils/rtptools/rtptools/include
CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/netutils/rtptools/rtptools/include
endif

116
netutils/rtptools/Makefile Normal file
View File

@ -0,0 +1,116 @@
############################################################################
# apps/netutils/rtptools/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
RTPTOOLS_VERSION := $(patsubst "%",%,$(CONFIG_NETUTILS_RTPTOOLS_VERSION))
RTPTOOLS_TARBALL = $(RTPTOOLS_VERSION).tar.gz
RTPTOOLS_UNPACK = rtptools
RTPTOOLS_SRCDIR = $(RTPTOOLS_UNPACK)
DEPPATH += --dep-path $(RTPTOOLS_SRCDIR)
VPATH += :$(RTPTOOLS_SRCDIR)
CFLAGS += -Wno-maybe-uninitialized -Wno-strict-prototypes
CFLAGS += -Wno-unused-function -Wno-format -Wno-shadow
CSRCS += multimer.c
CSRCS += notify.c
CSRCS += payload.c
CSRCS += rd.c
CSRCS += utils.c
ifeq ($(CONFIG_ENDIAN_BIG),y)
RTP_BIG_ENDIAN = 1
else
RTP_BIG_ENDIAN = 0
endif
ifneq ($(CONFIG_RTPTOOLS_APPS),)
MODULE = $(CONFIG_RTPTOOLS_APPS)
ifeq ($(CONFIG_NETUTILS_RTPTOOLS_RTPPLAY),y)
PROGNAME += $(CONFIG_NETUTILS_RTPTOOLS_RTPPLAY_PROGNAME)
PRIORITY += $(CONFIG_NETUTILS_RTPTOOLS_RTPPLAY_PRIORITY)
STACKSIZE += $(CONFIG_NETUTILS_RTPTOOLS_RTPPLAY_STACKSIZE)
MAINSRC += $(RTPTOOLS_UNPACK)/rtpplay.c
endif
ifeq ($(CONFIG_NETUTILS_RTPTOOLS_RTPSEND),y)
PROGNAME += $(CONFIG_NETUTILS_RTPTOOLS_RTPSEND_PROGNAME)
PRIORITY += $(CONFIG_NETUTILS_RTPTOOLS_RTPSEND_PRIORITY)
STACKSIZE += $(CONFIG_NETUTILS_RTPTOOLS_RTPSEND_STACKSIZE)
MAINSRC += $(RTPTOOLS_UNPACK)/rtpsend.c
endif
ifeq ($(CONFIG_NETUTILS_RTPTOOLS_RTPDUMP),y)
PROGNAME += $(CONFIG_NETUTILS_RTPTOOLS_RTPDUMP_PROGNAME)
PRIORITY += $(CONFIG_NETUTILS_RTPTOOLS_RTPDUMP_PRIORITY)
STACKSIZE += $(CONFIG_NETUTILS_RTPTOOLS_RTPDUMP_STACKSIZE)
MAINSRC += $(RTPTOOLS_UNPACK)/rtpdump.c
endif
ifeq ($(CONFIG_NETUTILS_RTPTOOLS_RTPTRANS),y)
PROGNAME += $(CONFIG_NETUTILS_RTPTOOLS_RTPTRANS_PROGNAME)
PRIORITY += $(CONFIG_NETUTILS_RTPTOOLS_RTPTRANS_PRIORITY)
STACKSIZE += $(CONFIG_NETUTILS_RTPTOOLS_RTPTRANS_STACKSIZE)
MAINSRC += $(RTPTOOLS_UNPACK)/rtptrans.c
endif
endif
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(RTPTOOLS_UNPACK)/.git),)
$(RTPTOOLS_UNPACK)$(DELIM)config.h: $(RTPTOOLS_UNPACK)
$(Q) cp config.h $@
else
$(RTPTOOLS_UNPACK)$(DELIM)config.h:
$(Q) cp config.h $@
endif
$(RTPTOOLS_TARBALL):
@echo "Downloading: $(RTPTOOLS_TARBALL)"
$(Q) curl -O -L https://github.com/irtlab/rtptools/archive/$(RTPTOOLS_TARBALL)
$(RTPTOOLS_UNPACK): $(RTPTOOLS_TARBALL)
$(Q) echo "Unpacking: $(RTPTOOLS_TARBALL) -> $(RTPTOOLS_UNPACK)"
$(Q) tar zxf $(RTPTOOLS_TARBALL)
$(Q) mv $(RTPTOOLS_UNPACK)-$(RTPTOOLS_VERSION) $(RTPTOOLS_UNPACK)
$(Q) touch $(RTPTOOLS_UNPACK)
context:: $(RTPTOOLS_UNPACK)$(DELIM)config.h
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(RTPTOOLS_UNPACK)/.git),)
distclean::
$(call DELFILE, $(RTPTOOLS_TARBALL))
$(call DELDIR, $(RTPTOOLS_UNPACK))
endif
include $(APPDIR)/Application.mk

View File

@ -0,0 +1,37 @@
/****************************************************************************
* apps/netutils/rtptools/config.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifdef CONFIG_ENDIAN_BIG
#define RTP_BIG_ENDIAN 1
#else
#define RTP_BIG_ENDIAN 0
#endif
#define HAVE_MSGCONTROL 1