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

Data Structures

struct  mmsh_s
 

Macros

#define LOG_MODULE   "mmsh"
 
#define LOG_VERBOSE
 
#define USERAGENT   "User-Agent: NSPlayer/4.1.0.3856\r\n"
 
#define CLIENTGUID   "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}\r\n"
 
#define MMSH_PORT   80
 
#define MMSH_UNKNOWN   0
 
#define MMSH_SEEKABLE   1
 
#define MMSH_LIVE   2
 
#define CHUNK_HEADER_LENGTH   4
 
#define EXT_HEADER_LENGTH   8
 
#define CHUNK_TYPE_RESET   0x4324
 
#define CHUNK_TYPE_DATA   0x4424
 
#define CHUNK_TYPE_END   0x4524
 
#define CHUNK_TYPE_ASF_HEADER   0x4824
 
#define CHUNK_SIZE   65536 /* max chunk size */
 
#define ASF_HEADER_SIZE   8192 /* max header size */
 
#define SCRATCH_SIZE   1024
 
#define mmsh_FirstRequest
 
#define mmsh_SeekableRequest
 
#define mmsh_LiveRequest
 

Functions

static int send_command (mmsh_t *this, char *cmd)
 
static int get_answer (mmsh_t *this)
 
static int get_chunk_header (mmsh_t *this)
 
static int get_header (mmsh_t *this)
 
static int interp_header (mmsh_t *this)
 
static int mmsh_valid_proto (const char *proto)
 
static void report_progress (xine_stream_t *stream, int p)
 
static int mmsh_tcp_connect (mmsh_t *this)
 
static int mmsh_connect_int (mmsh_t *this, int bandwidth)
 
static int mmsh_connect_int2 (mmsh_t *this, int bandwidth)
 
mmsh_tmmsh_connect (xine_stream_t *stream, const char *url, int bandwidth)
 
static int get_media_packet (mmsh_t *this)
 
size_t mmsh_peek_header (mmsh_t *this, char *data, size_t maxsize)
 
int mmsh_read (mmsh_t *this, char *data, int len)
 
void mmsh_close (mmsh_t *this)
 
uint32_t mmsh_get_length (mmsh_t *this)
 
off_t mmsh_get_current_pos (mmsh_t *this)
 
void mmsh_set_start_time (mmsh_t *this, int time_offset)
 

Variables

static const char mmsh_proto_s [][8] = { "mms", "mmsh", "" }
 

Macro Definition Documentation

◆ ASF_HEADER_SIZE

#define ASF_HEADER_SIZE   8192 /* max header size */

◆ CHUNK_HEADER_LENGTH

#define CHUNK_HEADER_LENGTH   4

◆ CHUNK_SIZE

#define CHUNK_SIZE   65536 /* max chunk size */

◆ CHUNK_TYPE_ASF_HEADER

#define CHUNK_TYPE_ASF_HEADER   0x4824

◆ CHUNK_TYPE_DATA

#define CHUNK_TYPE_DATA   0x4424

◆ CHUNK_TYPE_END

#define CHUNK_TYPE_END   0x4524

◆ CHUNK_TYPE_RESET

#define CHUNK_TYPE_RESET   0x4324

◆ CLIENTGUID

#define CLIENTGUID   "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}\r\n"

◆ EXT_HEADER_LENGTH

#define EXT_HEADER_LENGTH   8

◆ LOG_MODULE

#define LOG_MODULE   "mmsh"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ mmsh_FirstRequest

#define mmsh_FirstRequest
Value:
"GET %s HTTP/1.0\r\n" \
"Accept: */*\r\n" \
USERAGENT \
"Host: %s:%d\r\n" \
"Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=0:0,request-context=%u,max-duration=0\r\n" \
CLIENTGUID \
"Connection: Close\r\n\r\n"

◆ MMSH_LIVE

#define MMSH_LIVE   2

◆ mmsh_LiveRequest

#define mmsh_LiveRequest
Value:
"GET %s HTTP/1.0\r\n" \
"Accept: */*\r\n" \
USERAGENT \
"Host: %s:%d\r\n" \
"Pragma: no-cache,rate=1.000000,request-context=%u\r\n" \
"Pragma: xPlayStrm=1\r\n" \
CLIENTGUID \
"Pragma: stream-switch-count=%d\r\n" \
"Pragma: stream-switch-entry=%s\r\n" \
"Connection: Close\r\n\r\n"

◆ MMSH_PORT

#define MMSH_PORT   80

◆ MMSH_SEEKABLE

#define MMSH_SEEKABLE   1

◆ mmsh_SeekableRequest

#define mmsh_SeekableRequest
Value:
"GET %s HTTP/1.0\r\n" \
"Accept: */*\r\n" \
USERAGENT \
"Host: %s:%d\r\n" \
"Pragma: no-cache,rate=1.000000,stream-time=%u,stream-offset=%u:%u,request-context=%u,max-duration=%u\r\n" \
CLIENTGUID \
"Pragma: xPlayStrm=1\r\n" \
"Pragma: stream-switch-count=%d\r\n" \
"Pragma: stream-switch-entry=%s\r\n" /* ffff:1:0 ffff:2:0 */ \
"Connection: Close\r\n\r\n"

◆ MMSH_UNKNOWN

#define MMSH_UNKNOWN   0

◆ SCRATCH_SIZE

#define SCRATCH_SIZE   1024

◆ USERAGENT

#define USERAGENT   "User-Agent: NSPlayer/4.1.0.3856\r\n"

Function Documentation

◆ get_answer()

static int get_answer ( mmsh_t this)
static

◆ get_chunk_header()

static int get_chunk_header ( mmsh_t this)
static

◆ get_header()

static int get_header ( mmsh_t this)
static

◆ get_media_packet()

static int get_media_packet ( mmsh_t this)
static

◆ interp_header()

static int interp_header ( mmsh_t this)
static

◆ mmsh_close()

void mmsh_close ( mmsh_t this)

◆ mmsh_connect()

mmsh_t * mmsh_connect ( xine_stream_t stream,
const char *  url,
int  bandwidth 
)

◆ mmsh_connect_int()

static int mmsh_connect_int ( mmsh_t this,
int  bandwidth 
)
static

◆ mmsh_connect_int2()

static int mmsh_connect_int2 ( mmsh_t this,
int  bandwidth 
)
static

◆ mmsh_get_current_pos()

off_t mmsh_get_current_pos ( mmsh_t this)

◆ mmsh_get_length()

uint32_t mmsh_get_length ( mmsh_t this)

Referenced by mms_plugin_get_length().

◆ mmsh_peek_header()

size_t mmsh_peek_header ( mmsh_t this,
char *  data,
size_t  maxsize 
)

References lprintf.

Referenced by mms_plugin_get_optional_data().

◆ mmsh_read()

int mmsh_read ( mmsh_t this,
char *  data,
int  len 
)

◆ mmsh_set_start_time()

void mmsh_set_start_time ( mmsh_t this,
int  time_offset 
)

Referenced by mms_plugin_seek_time().

◆ mmsh_tcp_connect()

static int mmsh_tcp_connect ( mmsh_t this)
static

◆ mmsh_valid_proto()

static int mmsh_valid_proto ( const char *  proto)
static

References lprintf, and mmsh_proto_s.

Referenced by mmsh_connect().

◆ report_progress()

static void report_progress ( xine_stream_t stream,
int  p 
)
static

◆ send_command()

static int send_command ( mmsh_t this,
char *  cmd 
)
static

Variable Documentation

◆ mmsh_proto_s

const char mmsh_proto_s[][8] = { "mms", "mmsh", "" }
static

Referenced by mmsh_valid_proto().