UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
h264_rtp.cpp File Reference
#include <cctype>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include "compat/strings.h"
#include "debug.h"
#include "host.h"
#include "lib_common.h"
#include "rtp/rtp.h"
#include "rtsp/rtsp_utils.h"
#include "transmit.h"
#include "tv.h"
#include "types.h"
#include "utils/color_out.h"
#include "utils/sdp.h"
#include "video_codec.h"
#include "video_rxtx.hpp"
#include "video_rxtx/h264_rtp.hpp"
Include dependency graph for h264_rtp.cpp:

Go to the source code of this file.

Macros

#define MOD_NAME   "[vrxtx/h264_rtp] "
 

Functions

static video_rxtx * create_video_rxtx_h264_std (std::map< std::string, param_u > const &params)
 
static int get_rtsp_server_port (const char *config)
 
 REGISTER_MODULE (rtsp, &h264_video_rxtx_info, LIBRARY_CLASS_VIDEO_RXTX, VIDEO_RXTX_ABI_VERSION)
 
static void rtps_server_usage ()
 

Variables

static const struct video_rxtx_info h264_video_rxtx_info
 

Detailed Description

Macro Definition Documentation

◆ MOD_NAME

#define MOD_NAME   "[vrxtx/h264_rtp] "

Definition at line 64 of file h264_rtp.cpp.

Function Documentation

◆ create_video_rxtx_h264_std()

static video_rxtx * create_video_rxtx_h264_std ( std::map< std::string, param_u > const & params)
static

Definition at line 194 of file h264_rtp.cpp.

195{
196 int rtsp_port;
197 const char *rtsp_port_str = static_cast<const char *>(params.at("opts").ptr);
198 if (strlen(rtsp_port_str) == 0) {
199 rtsp_port = 0;
200 } else {
201 if (strcmp(rtsp_port_str, "help") == 0) {
203 return nullptr;
204 }
205 rtsp_port = get_rtsp_server_port(rtsp_port_str);
206 if (rtsp_port == -1) {
207 return nullptr;
208 }
209 }
210 return new h264_rtp_video_rxtx(params, rtsp_port);
211}
static int get_rtsp_server_port(const char *config)
Definition h264_rtp.cpp:170
static void rtps_server_usage()
Definition h264_rtp.cpp:162

References get_rtsp_server_port(), and rtps_server_usage().

Here is the call graph for this function:

◆ get_rtsp_server_port()

static int get_rtsp_server_port ( const char * config)
static

Definition at line 170 of file h264_rtp.cpp.

170 {
171 if (strncmp(config, "port:", 5) != 0 &&
172 strncmp(config, "port=", 5) != 0) {
173 log_msg(LOG_LEVEL_ERROR, "\n[RTSP SERVER] ERROR - please, check usage.\n");
175 return -1;
176 }
177 if (strlen(config) == 5) {
178 log_msg(LOG_LEVEL_ERROR, "\n[RTSP SERVER] ERROR - please, enter a port number.\n");
180 return -1;
181 }
182 if (config[4] == ':') {
183 MSG(WARNING, "deprecated usage - use port=number, not port:number!\n");
184 }
185 int port = atoi(config + 5);
186 if (port < 0 || port > 65535 || !isdigit(config[5])) {
187 log_msg(LOG_LEVEL_ERROR, "\n[RTSP SERVER] ERROR - please, enter a valid port number.\n");
189 return -1;
190 }
191 return port;
192}
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59
#define MSG(l, fmt,...)
Definition debug.h:96

References LOG_LEVEL_ERROR, log_msg(), MSG, and rtps_server_usage().

Referenced by create_video_rxtx_h264_std().

Here is the call graph for this function:

◆ REGISTER_MODULE()

REGISTER_MODULE ( rtsp ,
& h264_video_rxtx_info,
LIBRARY_CLASS_VIDEO_RXTX ,
VIDEO_RXTX_ABI_VERSION  )

◆ rtps_server_usage()

static void rtps_server_usage ( )
static

Definition at line 162 of file h264_rtp.cpp.

162 {
163 printf("\n[RTSP SERVER] usage:\n");
164 color_printf("\t" TBOLD("-x rtsp[:port=number]") "\n");
165 printf("\t\tdefault rtsp server port number: 8554\n\n");
166
168}
int color_printf(const char *format,...)
#define TBOLD(x)
Definition color_out.h:70
void sdp_print_supported_codecs(void)
Definition sdp.c:652

References color_printf(), sdp_print_supported_codecs(), and TBOLD.

Referenced by create_video_rxtx_h264_std(), and get_rtsp_server_port().

Here is the call graph for this function:

Variable Documentation

◆ h264_video_rxtx_info

const struct video_rxtx_info h264_video_rxtx_info
static
Initial value:
= {
"RTP standard (using RTSP)",
}
static video_rxtx * create_video_rxtx_h264_std(std::map< std::string, param_u > const &params)
Definition h264_rtp.cpp:194

Definition at line 213 of file h264_rtp.cpp.

213 {
214 "RTP standard (using RTSP)",
216};