如何实现最小的RTSP服务器
1个回答
展开全部
//////////h264.h///////
// MPEG2RTP.h
#include <stdio.h>
#include <stdlib.h>
//#include <conio.h>
#include <string.h>
//#include <winsock2.h>
//#include <winsock2.h>
//#include "mem.h"
//
#define PACKET_BUFFER_END (unsigned int)0x00000000
#define MAX_RTP_PKT_LENGTH 1400
#define DEST_IP "192.168.0.30"
#define DEST_PORT 8800
#define H264 96
typedef struct
{
/**//* byte 0 */
unsigned char csrc_len:4; /**//* expect 0 */
unsigned char extension:1; /**//* expect 1, see RTP_OP below */
unsigned char padding:1; /**//* expect 0 */
unsigned char version:2; /**//* expect 2 */
/**//* byte 1 */
unsigned char payload:7; /**//* RTP_PAYLOAD_RTSP */
unsigned char marker:1; /**//* expect 1 */
/**//* bytes 2, 3 */
unsigned short seq_no;
/**//* bytes 4-7 */
unsigned long timestamp;
/**//* bytes 8-11 */
unsigned long ssrc; /**//* stream number is used here. */
} RTP_FIXED_HEADER;
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char NRI:2;
unsigned char F:1;
} NALU_HEADER; /**//* 1 BYTES */
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char NRI:2;
unsigned char F:1;
} FU_INDICATOR; /**//* 1 BYTES */
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char R:1;
unsigned char E:1;
unsigned char S:1;
} FU_HEADER; /**//* 1 BYTES */
// MPEG2RTP.h
#include <stdio.h>
#include <stdlib.h>
//#include <conio.h>
#include <string.h>
//#include <winsock2.h>
//#include <winsock2.h>
//#include "mem.h"
//
#define PACKET_BUFFER_END (unsigned int)0x00000000
#define MAX_RTP_PKT_LENGTH 1400
#define DEST_IP "192.168.0.30"
#define DEST_PORT 8800
#define H264 96
typedef struct
{
/**//* byte 0 */
unsigned char csrc_len:4; /**//* expect 0 */
unsigned char extension:1; /**//* expect 1, see RTP_OP below */
unsigned char padding:1; /**//* expect 0 */
unsigned char version:2; /**//* expect 2 */
/**//* byte 1 */
unsigned char payload:7; /**//* RTP_PAYLOAD_RTSP */
unsigned char marker:1; /**//* expect 1 */
/**//* bytes 2, 3 */
unsigned short seq_no;
/**//* bytes 4-7 */
unsigned long timestamp;
/**//* bytes 8-11 */
unsigned long ssrc; /**//* stream number is used here. */
} RTP_FIXED_HEADER;
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char NRI:2;
unsigned char F:1;
} NALU_HEADER; /**//* 1 BYTES */
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char NRI:2;
unsigned char F:1;
} FU_INDICATOR; /**//* 1 BYTES */
typedef struct {
//byte 0
unsigned char TYPE:5;
unsigned char R:1;
unsigned char E:1;
unsigned char S:1;
} FU_HEADER; /**//* 1 BYTES */
Jtti
2024-10-10 广告
2024-10-10 广告
Jtti是一家新加坡全球网络基础服务商,为数百万个网站提供支持,提供香港服务器、新加坡服务器等多种全球服务器,自营全球多个数据中心,为用户提供优质的网络资源和服务。
JTTI服务器整体性能是非常不错的,拥有CN2 GIA+BGP优化线路,多...
点击进入详情页
本回答由Jtti提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询