#include "avformat.h"
#include "mms.h"
#include "internal.h"
#include "avio_internal.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/bytestream.h"
#include "network.h"
#include "url.h"
Go to the source code of this file.
Data Structures | |
struct | MMSTContext |
Defines | |
#define | LOCAL_ADDRESS 0xc0a80081 |
#define | LOCAL_PORT 1037 |
Enumerations | |
enum | MMSCSPacketType { CS_PKT_INITIAL = 0x01, CS_PKT_PROTOCOL_SELECT = 0x02, CS_PKT_MEDIA_FILE_REQUEST = 0x05, CS_PKT_START_FROM_PKT_ID = 0x07, CS_PKT_STREAM_PAUSE = 0x09, CS_PKT_STREAM_CLOSE = 0x0d, CS_PKT_MEDIA_HEADER_REQUEST = 0x15, CS_PKT_TIMING_DATA_REQUEST = 0x18, CS_PKT_USER_PASSWORD = 0x1a, CS_PKT_KEEPALIVE = 0x1b, CS_PKT_STREAM_ID_REQUEST = 0x33 } |
Client to server packet types. More... | |
enum | MMSSCPacketType { SC_PKT_CLIENT_ACCEPTED = 0x01, SC_PKT_PROTOCOL_ACCEPTED = 0x02, SC_PKT_PROTOCOL_FAILED = 0x03, SC_PKT_MEDIA_PKT_FOLLOWS = 0x05, SC_PKT_MEDIA_FILE_DETAILS = 0x06, SC_PKT_HEADER_REQUEST_ACCEPTED = 0x11, SC_PKT_TIMING_TEST_REPLY = 0x15, SC_PKT_PASSWORD_REQUIRED = 0x1a, SC_PKT_KEEPALIVE = 0x1b, SC_PKT_STREAM_STOPPED = 0x1e, SC_PKT_STREAM_CHANGING = 0x20, SC_PKT_STREAM_ID_ACCEPTED = 0x21, SC_PKT_CANCEL = -1, SC_PKT_NO_DATA = -2, SC_PKT_ASF_HEADER = 0x010000, SC_PKT_ASF_MEDIA = 0x010001 } |
Server to client packet types. More... | |
Functions | |
static void | start_command_packet (MMSTContext *mmst, MMSCSPacketType packet_type) |
Create MMST command packet header. | |
static void | insert_command_prefixes (MMSContext *mms, uint32_t prefix1, uint32_t prefix2) |
Add prefixes to MMST command packet. | |
static int | send_command_packet (MMSTContext *mmst) |
Send a prepared MMST command packet. | |
static void | mms_put_utf16 (MMSContext *mms, const uint8_t *src) |
static int | send_time_test_data (MMSTContext *mmst) |
static int | send_protocol_select (MMSTContext *mmst) |
static int | send_media_file_request (MMSTContext *mmst) |
static void | handle_packet_stream_changing_type (MMSTContext *mmst) |
static int | send_keepalive_packet (MMSTContext *mmst) |
static void | pad_media_packet (MMSContext *mms) |
Pad media packets smaller than max_packet_size and/or adjust read position after a seek. | |
static MMSSCPacketType | get_tcp_server_response (MMSTContext *mmst) |
Read incoming MMST media, header or command packet. | |
static int | mms_safe_send_recv (MMSTContext *mmst, int(*send_fun)(MMSTContext *mmst), const MMSSCPacketType expect_type) |
static int | send_media_header_request (MMSTContext *mmst) |
static int | send_startup_packet (MMSTContext *mmst) |
Send the initial handshake. | |
static int | send_stream_selection_request (MMSTContext *mmst) |
Send MMST stream selection command based on the AVStream->discard values. | |
static int | send_close_packet (MMSTContext *mmst) |
static int | mms_close (URLContext *h) |
Close the MMSH/MMST connection. | |
static int | send_media_packet_request (MMSTContext *mmst) |
static void | clear_stream_buffers (MMSContext *mms) |
static int | mms_open (URLContext *h, const char *uri, int flags) |
static int | mms_read (URLContext *h, uint8_t *buf, int size) |
Read ASF data through the protocol. | |
Variables | |
URLProtocol | ff_mmst_protocol |
#define LOCAL_ADDRESS 0xc0a80081 |
#define LOCAL_PORT 1037 |
enum MMSCSPacketType |
enum MMSSCPacketType |
Server to client packet types.
static void clear_stream_buffers | ( | MMSContext * | mms | ) | [static] |
static MMSSCPacketType get_tcp_server_response | ( | MMSTContext * | mmst | ) | [static] |
Read incoming MMST media, header or command packet.
Definition at line 238 of file mmst.c.
Referenced by mms_safe_send_recv().
static void handle_packet_stream_changing_type | ( | MMSTContext * | mmst | ) | [static] |
static void insert_command_prefixes | ( | MMSContext * | mms, | |
uint32_t | prefix1, | |||
uint32_t | prefix2 | |||
) | [static] |
Add prefixes to MMST command packet.
Definition at line 118 of file mmst.c.
Referenced by send_close_packet(), send_keepalive_packet(), send_media_file_request(), send_media_header_request(), send_media_packet_request(), send_protocol_select(), send_startup_packet(), and send_time_test_data().
static int mms_close | ( | URLContext * | h | ) | [static] |
static int mms_open | ( | URLContext * | h, | |
const char * | uri, | |||
int | flags | |||
) | [static] |
static void mms_put_utf16 | ( | MMSContext * | mms, | |
const uint8_t * | src | |||
) | [static] |
Definition at line 155 of file mmst.c.
Referenced by send_media_file_request(), send_protocol_select(), and send_startup_packet().
static int mms_read | ( | URLContext * | h, | |
uint8_t * | buf, | |||
int | size | |||
) | [static] |
static int mms_safe_send_recv | ( | MMSTContext * | mmst, | |
int(*)(MMSTContext *mmst) | send_fun, | |||
const MMSSCPacketType | expect_type | |||
) | [static] |
static void pad_media_packet | ( | MMSContext * | mms | ) | [static] |
Pad media packets smaller than max_packet_size and/or adjust read position after a seek.
Definition at line 228 of file mmst.c.
Referenced by get_tcp_server_response().
static int send_close_packet | ( | MMSTContext * | mmst | ) | [static] |
static int send_command_packet | ( | MMSTContext * | mmst | ) | [static] |
Send a prepared MMST command packet.
Definition at line 126 of file mmst.c.
Referenced by send_close_packet(), send_keepalive_packet(), send_media_file_request(), send_media_header_request(), send_media_packet_request(), send_protocol_select(), send_startup_packet(), send_stream_selection_request(), and send_time_test_data().
static int send_keepalive_packet | ( | MMSTContext * | mmst | ) | [static] |
static int send_media_file_request | ( | MMSTContext * | mmst | ) | [static] |
static int send_media_header_request | ( | MMSTContext * | mmst | ) | [static] |
static int send_media_packet_request | ( | MMSTContext * | mmst | ) | [static] |
static int send_protocol_select | ( | MMSTContext * | mmst | ) | [static] |
static int send_startup_packet | ( | MMSTContext * | mmst | ) | [static] |
static int send_stream_selection_request | ( | MMSTContext * | mmst | ) | [static] |
Send MMST stream selection command based on the AVStream->discard values.
Definition at line 437 of file mmst.c.
Referenced by mms_open().
static int send_time_test_data | ( | MMSTContext * | mmst | ) | [static] |
static void start_command_packet | ( | MMSTContext * | mmst, | |
MMSCSPacketType | packet_type | |||
) | [static] |
Create MMST command packet header.
Definition at line 100 of file mmst.c.
Referenced by send_close_packet(), send_keepalive_packet(), send_media_file_request(), send_media_header_request(), send_media_packet_request(), send_protocol_select(), send_startup_packet(), send_stream_selection_request(), and send_time_test_data().