xine-lib: xine-lib-1.2.13/src/input/libreal/real.c File Reference

xine-lib 1.2.13-20230125hg15249

Macros | Functions | Variables
real.c File Reference
`#include <stdio.h>`
`#include <string.h>`
`#include "real.h"`
`#include "asmrp.h"`
`#include "sdpplin.h"`
`#include <xine/xineutils.h>`
`#include <xine/xine_buffer.h>`
`#include "bswap.h"`

## Macros
#define | LOG_MODULE "real"
#define | LOG_VERBOSE
#define | XOR_TABLE_LEN 37
#define | _X_BE_32C(x, y)
#define | _X_LE_32C(x, y)
#define | MAX_DESC_BUF (20 * 1024 * 1024)
| maximum size of the rtsp description, must be < INT_MAX

## Functions
static void | hash (uint8_t *field, const uint8_t *param)
static void | call_hash (uint8_t *key, const uint8_t *challenge, unsigned int len)
static void | calc_response (uint8_t *result, uint8_t *field)
static void | calc_response_string (char *result, const uint8_t *challenge)
void | real_calc_response_and_checksum (char *response, char *chksum, char *challenge)
static int | select_mlti_data (const char *mlti_chunk, int mlti_size, int selection, char **out)
rmff_header_t * | real_parse_sdp (char *data, char **stream_rules, uint32_t bandwidth)
int | real_get_rdt_chunk (rtsp_t *rtsp_session, unsigned char **buffer)
rmff_header_t * | real_setup_and_get_header (rtsp_t *rtsp_session, uint32_t bandwidth)

## Variables
static const unsigned char | xor_table []

## Macro Definition Documentation

## ◆ _X_BE_32C

#define _X_BE_32C | ( |  | x,
|  |  | y )

Value:
do { \
uint32_t X = be2me_32((y)); \
memcpy((x), &X, sizeof(uint32_t)); \
} while(0)
be2me_32
#define be2me_32(x)
Definition ffmpeg_bswap.h:168

Referenced by real_calc_response_and_checksum().

## ◆ _X_LE_32C

#define _X_LE_32C | ( |  | x,
|  |  | y )

Value:
do { \
uint32_t X = le2me_32((y)); \
memcpy((x), &X, sizeof(uint32_t)); \
} while(0)
le2me_32
#define le2me_32(x)
Definition ffmpeg_bswap.h:171

Referenced by call_hash(), and hash().

## ◆ LOG_MODULE

#define LOG_MODULE "real"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_DESC_BUF

#define MAX_DESC_BUF (20 * 1024 * 1024)

maximum size of the rtsp description, must be < INT_MAX

Referenced by real_setup_and_get_header().

## ◆ XOR_TABLE_LEN

#define XOR_TABLE_LEN 37

Referenced by real_calc_response_and_checksum().

## Function Documentation

## ◆ calc_response()

static void calc_response | ( | uint8_t * | result,
|  | uint8_t * | field )
| static

References _X_LE_32, call_hash(), field, and lprintf.

Referenced by calc_response_string().

## ◆ calc_response_string()

static void calc_response_string | ( | char * | result,
|  | const uint8_t * | challenge )
| static

References calc_response(), call_hash(), and field.

Referenced by real_calc_response_and_checksum().

## ◆ call_hash()

static void call_hash | ( | uint8_t * | key,
|  | const uint8_t * | challenge,
|  | unsigned int | len )
| static

References _X_LE_32, _X_LE_32C, hash(), key, and lprintf.

Referenced by calc_response(), and calc_response_string().

## ◆ hash()

static void hash | ( | uint8_t * | field,
|  | const uint8_t * | param )
| static

References _X_LE_32, _X_LE_32C, field, lprintf, and xine_hexdump().

Referenced by _config_fat_entry_hash(), and call_hash().

## ◆ real_calc_response_and_checksum()

void real_calc_response_and_checksum | ( | char * | response,
|  | char * | chksum,
|  | char * | challenge )

References _X_BE_32C, calc_response_string(), NULL, xor_table, and XOR_TABLE_LEN.

Referenced by real_setup_and_get_header().

## ◆ real_get_rdt_chunk()

int real_get_rdt_chunk | ( | rtsp_t * | rtsp_session,
|  | unsigned char ** | buffer )

References _X_BE_32, rmff_pheader_t::flags, rmff_pheader_t::length, lprintf, rmff_pheader_t::object_version, rmff_pheader_t::reserved, rmff_dump_pheader(), rtsp_read_data(), rmff_pheader_t::stream_number, rmff_pheader_t::timestamp, xine_buffer_ensure_size, and xine_hexdump().

Referenced by rtsp_session_read().

## ◆ real_parse_sdp()

rmff_header_t * real_parse_sdp | ( | char * | data,
|  | char ** | stream_rules,
|  | uint32_t | bandwidth )

References sdpplin_t::abstract, sdpplin_stream_t::asm_rule_book, asmrp_match(), sdpplin_t::author, sdpplin_stream_t::avg_bit_rate, sdpplin_stream_t::avg_packet_size, rmff_header_t::cont, sdpplin_t::copyright, rmff_header_t::data, sdpplin_stream_t::duration, rmff_header_t::fileheader, sdpplin_t::flags, lprintf, MAX, sdpplin_stream_t::max_bit_rate, sdpplin_stream_t::max_packet_size, sdpplin_stream_t::mime_type, sdpplin_stream_t::mlti_data, sdpplin_stream_t::mlti_data_size, NULL, sdpplin_stream_t::preroll, rmff_header_t::prop, rmff_fix_header(), rmff_new_cont(), rmff_new_dataheader(), rmff_new_fileheader(), rmff_new_mdpr(), rmff_new_prop(), sdpplin_free(), sdpplin_parse(), select_mlti_data(), sdpplin_stream_t::start_time, sdpplin_t::stream, sdpplin_t::stream_count, sdpplin_stream_t::stream_id, sdpplin_stream_t::stream_name, rmff_header_t::streams, sdpplin_t::title, xine_buffer_free, xine_buffer_init(), and xine_buffer_strcat.

Referenced by real_setup_and_get_header().

## ◆ real_setup_and_get_header()

rmff_header_t * real_setup_and_get_header | ( | rtsp_t * | rtsp_session,
|  | uint32_t | bandwidth )

References rmff_cont_t::author, rmff_header_t::cont, rmff_cont_t::copyright, lprintf, MAX_DESC_BUF, NULL, rmff_prop_t::num_streams, rmff_header_t::prop, real_calc_response_and_checksum(), real_parse_sdp(), rmff_fix_header(), rtsp_get_mrl(), rtsp_read_data(), rtsp_request_describe(), rtsp_request_setparameter(), rtsp_request_setup(), rtsp_schedule_field(), rtsp_search_answers(), rtsp_send_ok(), rmff_cont_t::title, xine_buffer_ensure_size, xine_buffer_free, and xine_buffer_init().

Referenced by rtsp_session_start().

## ◆ select_mlti_data()

static int select_mlti_data | ( | const char * | mlti_chunk,
|  | int | mlti_size,
|  | int | selection,
|  | char ** | out )
| static

References _X_BE_16, _X_BE_32, lprintf, xine_buffer_copyin, and xine_hexdump().

Referenced by real_parse_sdp().

## Variable Documentation

## ◆ xor_table

const unsigned char xor_table[]
| static

Initial value:
= {
0x05, 0x18, 0x74, 0xd0, 0x0d, 0x09, 0x02, 0x53,
0xc0, 0x01, 0x05, 0x05, 0x67, 0x03, 0x19, 0x70,
0x08, 0x27, 0x66, 0x10, 0x10, 0x72, 0x08, 0x09,
0x63, 0x11, 0x03, 0x71, 0x08, 0x08, 0x70, 0x02,
0x10, 0x57, 0x05, 0x18, 0x54, 0x00, 0x00, 0x00 }

Referenced by real_calc_response_and_checksum().