xine-lib 1.2.11
Data Structures | Macros | Typedefs | Functions | Variables
mms.c File Reference
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <time.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include "bswap.h"
#include "http_helper.h"
#include "mms.h"
#include "../demuxers/asfheader.h"

Data Structures

struct  mms_buffer_s
 
struct  mms_packet_header_s
 
struct  mms_s
 

Macros

#define ICONV_CONST   const
 
#define LOG_MODULE   "mms"
 
#define LOG_VERBOSE
 
#define MMST_PORT   1755
 
#define BUF_SIZE   102400
 
#define CMD_HEADER_LEN   40
 
#define CMD_PREFIX_LEN   8
 
#define CMD_BODY_LEN   1024
 
#define ASF_HEADER_LEN   8192
 
#define MMS_PACKET_ERR   0
 
#define MMS_PACKET_COMMAND   1
 
#define MMS_PACKET_ASF_HEADER   2
 
#define MMS_PACKET_ASF_PACKET   3
 
#define ASF_HEADER_PACKET_ID_TYPE   2
 
#define ASF_MEDIA_PACKET_ID_TYPE   4
 
#define D2Q(d)
 
#define print_command(data, len)
 

Typedefs

typedef struct mms_buffer_s mms_buffer_t
 
typedef struct mms_packet_header_s mms_packet_header_t
 

Functions

static void mms_buffer_init (mms_buffer_t *mms_buffer, char *buffer)
 
static void mms_buffer_put_8 (mms_buffer_t *mms_buffer, uint8_t value)
 
static void mms_buffer_put_32 (mms_buffer_t *mms_buffer, uint32_t value)
 
static void mms_buffer_put_64 (mms_buffer_t *mms_buffer, uint64_t value)
 
static int send_command (mms_t *this, int command, uint32_t prefix1, uint32_t prefix2, int length)
 
static void string_utf16 (int unused, char *dest, const char *src, int len)
 
static int get_packet_header (mms_t *this, mms_packet_header_t *header)
 
static int get_packet_command (mms_t *this, uint32_t packet_len)
 
static int get_answer (mms_t *this)
 
static int get_asf_header (mms_t *this)
 
static int interp_asf_header (mms_t *this)
 
static int mmst_valid_proto (const char *proto)
 
static void report_progress (xine_stream_t *stream, int p)
 
static int mms_tcp_connect (mms_t *this)
 
static void mms_gen_guid (char guid[])
 
static int mms_choose_best_streams (mms_t *this)
 
mms_tmms_connect (xine_stream_t *stream, const char *url, int bandwidth)
 
static int get_media_packet (mms_t *this)
 
size_t mms_peek_header (mms_t *this, char *data, size_t maxsize)
 
int mms_read (mms_t *this, char *data, int len)
 
void mms_close (mms_t *this)
 
uint32_t mms_get_length (mms_t *this)
 
off_t mms_get_current_pos (mms_t *this)
 
void mms_set_start_time (mms_t *this, int time_offset)
 

Variables

static const char mmst_proto_s [][8] = { "mms", "mmst", "" }
 

Macro Definition Documentation

◆ ASF_HEADER_LEN

#define ASF_HEADER_LEN   8192

◆ ASF_HEADER_PACKET_ID_TYPE

#define ASF_HEADER_PACKET_ID_TYPE   2

◆ ASF_MEDIA_PACKET_ID_TYPE

#define ASF_MEDIA_PACKET_ID_TYPE   4

◆ BUF_SIZE

#define BUF_SIZE   102400

◆ CMD_BODY_LEN

#define CMD_BODY_LEN   1024

◆ CMD_HEADER_LEN

#define CMD_HEADER_LEN   40

◆ CMD_PREFIX_LEN

#define CMD_PREFIX_LEN   8

◆ D2Q

#define D2Q (   d)
Value:
({\
union { double db; long long qw; } _tmp;\
_tmp.db = d;\
_tmp.qw;\
})\

◆ ICONV_CONST

#define ICONV_CONST   const

◆ LOG_MODULE

#define LOG_MODULE   "mms"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MMS_PACKET_ASF_HEADER

#define MMS_PACKET_ASF_HEADER   2

◆ MMS_PACKET_ASF_PACKET

#define MMS_PACKET_ASF_PACKET   3

◆ MMS_PACKET_COMMAND

#define MMS_PACKET_COMMAND   1

◆ MMS_PACKET_ERR

#define MMS_PACKET_ERR   0

◆ MMST_PORT

#define MMST_PORT   1755

◆ print_command

#define print_command (   data,
  len 
)

Typedef Documentation

◆ mms_buffer_t

typedef struct mms_buffer_s mms_buffer_t

◆ mms_packet_header_t

Function Documentation

◆ get_answer()

static int get_answer ( mms_t this)
static

◆ get_asf_header()

static int get_asf_header ( mms_t this)
static

◆ get_media_packet()

static int get_media_packet ( mms_t this)
static

◆ get_packet_command()

static int get_packet_command ( mms_t this,
uint32_t  packet_len 
)
static

◆ get_packet_header()

static int get_packet_header ( mms_t this,
mms_packet_header_t header 
)
static

◆ interp_asf_header()

static int interp_asf_header ( mms_t this)
static

◆ mms_buffer_init()

static void mms_buffer_init ( mms_buffer_t mms_buffer,
char *  buffer 
)
static

◆ mms_buffer_put_32()

static void mms_buffer_put_32 ( mms_buffer_t mms_buffer,
uint32_t  value 
)
static

◆ mms_buffer_put_64()

static void mms_buffer_put_64 ( mms_buffer_t mms_buffer,
uint64_t  value 
)
static

References mms_buffer_s::buffer, and mms_buffer_s::pos.

Referenced by mms_read().

◆ mms_buffer_put_8()

static void mms_buffer_put_8 ( mms_buffer_t mms_buffer,
uint8_t  value 
)
static

◆ mms_choose_best_streams()

static int mms_choose_best_streams ( mms_t this)
static

◆ mms_close()

void mms_close ( mms_t this)

◆ mms_connect()

mms_t * mms_connect ( xine_stream_t stream,
const char *  url,
int  bandwidth 
)

◆ mms_gen_guid()

static void mms_gen_guid ( char  guid[])
static

References NULL.

Referenced by mms_connect().

◆ mms_get_current_pos()

off_t mms_get_current_pos ( mms_t this)

◆ mms_get_length()

uint32_t mms_get_length ( mms_t this)

Referenced by mms_plugin_get_length().

◆ mms_peek_header()

size_t mms_peek_header ( mms_t this,
char *  data,
size_t  maxsize 
)

◆ mms_read()

int mms_read ( mms_t this,
char *  data,
int  len 
)

◆ mms_set_start_time()

void mms_set_start_time ( mms_t this,
int  time_offset 
)

Referenced by mms_plugin_seek_time().

◆ mms_tcp_connect()

static int mms_tcp_connect ( mms_t this)
static

◆ mmst_valid_proto()

static int mmst_valid_proto ( const char *  proto)
static

References lprintf, and mmst_proto_s.

Referenced by mms_connect().

◆ report_progress()

static void report_progress ( xine_stream_t stream,
int  p 
)
static

◆ send_command()

static int send_command ( mms_t this,
int  command,
uint32_t  prefix1,
uint32_t  prefix2,
int  length 
)
static

◆ string_utf16()

static void string_utf16 ( int  unused,
char *  dest,
const char *  src,
int  len 
)
static

Referenced by mms_connect().

Variable Documentation

◆ mmst_proto_s

const char mmst_proto_s[][8] = { "mms", "mmst", "" }
static

Referenced by mmst_valid_proto().