⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtp.h

📁 h.248协议源码
💻 H
字号:
/*

NOTICE:
This document contains information that is proprietary to RADVision LTD..
No part of this publication may be reproduced in any form whatsoever without 
written prior approval by RADVision LTD..

RADVision LTD. reserves the right to revise this publication and make changes 
without obligation to notify any person of such revisions or changes.

*/ 
#ifdef __cplusplus
extern "C" {
#endif

#ifndef __RTP_H
#define __RTP_H

#include "rvtypes.h"
#include "rvthread.h"
#include "rvpriority.h"
#include "rvinet.h"
#include "rvsocket.h"
#include "rvsocketengine.h"
#include "rtpstd.h"

DECLARE_OPAQUE(HRTPSESSION);

#ifndef __RTCP_H    
DECLARE_OPAQUE(HRTCPSESSION);
#endif

typedef struct {
    IN OUT  RvUint32  timestamp;
    IN OUT  RvBool    marker;
    IN OUT  RvUint8    payload;
    
    OUT     RvUint32  sSrc;
    OUT     RvUint16  sequenceNumber;
    OUT     int     sByte;
    OUT     int     len;
} rtpParam;

typedef void (*LPRTPEVENTHANDLER)
    (
        IN  HRTPSESSION  hRTP,
        IN  void *       context
    );

typedef RvSocketEngine rtpEngine;

typedef struct 
{
	RvMutex mutex;
    int isAllocated;
    RvSocket socket;
    RvUint32 sSrc;
    RvUint32 sSrcMask;
    RvUint32 sSrcPattern;
    LPRTPEVENTHANDLER eventHandler;
    void* context;
    RvUint16 sequenceNumber;
    RvUint32 ip;
    RvInetPort port;
    RvBool useSequenceNumber;
    HRTCPSESSION hRTCP;
	rtpEngine* engine;
	RvSocketListener listener;
#ifdef _ATM_
    RvUint8* atmAddr;         /* remote ATM Address (local insocket)
    RvUint32 addrLength;       ATM Address length
    RvUint16 selector;         STM selector*/
    RvBool bUseATM;
#endif
} rtpSession;		/* HRTPSESSION */ 


                       /* == Basic RTP Functions == */
RVVXDAPI
RvInt32 VXDCALLCONV rtpInit(void);

RVVXDAPI
RvInt32 VXDCALLCONV rtpInitEx(RvUint32 ip);

RVVXDAPI
void VXDCALLCONV rtpEnd(void);

RVVXDAPI
rtpEngine* VXDCALLCONV rtpEngineConstruct(
	IN rtpEngine*	engine,
	IN RvPriority	priority);

RVVXDAPI
void VXDCALLCONV rtpEngineDestruct(
	IN rtpEngine*	engine);

RVVXDAPI
int VXDCALLCONV rtpGetAllocationSize(void);

RVVXDAPI
HRTPSESSION VXDCALLCONV rtpOpenFrom(
        IN  RvUint16  port,
        IN  RvUint32  ssrcPattern,
        IN  RvUint32  ssrcMask,
	IN  void*   buffer,
	IN  int	    bufferSize);
	
RVVXDAPI
HRTPSESSION VXDCALLCONV rtpOpen(
        IN  RvUint16  port,
        IN  RvUint32  ssrcPattern,
        IN  RvUint32  ssrcMask);

RVVXDAPI
HRTPSESSION VXDCALLCONV rtpOpenEx(
        IN  RvUint16  port,
        IN  RvUint32  ssrcPattern,
        IN  RvUint32  ssrcMask,
        IN  char *  cname);

RVVXDAPI
RvUint32 VXDCALLCONV rtpClose(
        IN  HRTPSESSION  hRTP);

RVVXDAPI
RvUint32 VXDCALLCONV rtpGetSSRC(
        IN  HRTPSESSION  hRTP);

RVVXDAPI
void VXDCALLCONV rtpSetEventHandler(
        IN  HRTPSESSION        hRTP,
        IN  LPRTPEVENTHANDLER  eventHandler,
        IN  void *             context);

RVVXDAPI
void VXDCALLCONV rtpSetEventHandlerEx(
        IN  HRTPSESSION			hRTP,
		IN	rtpEngine*			engine,
        IN  LPRTPEVENTHANDLER	eventHandler,
        IN  void*				context);

RVVXDAPI
void VXDCALLCONV rtpSetRemoteAddress(
        IN  HRTPSESSION  hRTP,
        IN  RvUint32       ip,
        IN  RvUint16       port);
   
RVVXDAPI
RvInt32 VXDCALLCONV rtpWrite(
        IN  HRTPSESSION  hRTP,
        IN  void  *      buf,
        IN  RvInt32        len,
        IN  rtpParam *   p);

RVVXDAPI
RvInt32 VXDCALLCONV rtpRead(
        IN   HRTPSESSION  hRTP,
        IN   void *       buf,
        IN   RvInt32        len,
        OUT  rtpParam *   p);

RVVXDAPI
RvInt32 VXDCALLCONV rtpReadEx(
        IN   HRTPSESSION  hRTP,
        IN   void *       buf,
        IN   RvInt32        len,
        IN   RvUint32       timestamp,
        OUT  rtpParam *   p);

RVVXDAPI
RvUint16 VXDCALLCONV rtpGetPort(
        IN  HRTPSESSION  hRTP);


RVVXDAPI
char * VXDCALLCONV rtpGetVersion(void);

RVVXDAPI
RvUint32 VXDCALLCONV rtpGetVersionNum(void);


                    /* == ENDS: Basic RTP Functions == */



                     /* == Accessory RTP Functions == */


RVVXDAPI
HRTCPSESSION VXDCALLCONV rtpGetRTCPSession(
        IN  HRTPSESSION  hRTP);


RVVXDAPI
RvInt32 VXDCALLCONV rtpSetRTCPSession(
        IN  HRTPSESSION   hRTP,
        IN  HRTCPSESSION  hRTCP);

RVVXDAPI
RvInt32 VXDCALLCONV rtpGetHeaderLength(void);

RVVXDAPI
RvUint32 VXDCALLCONV rtpRegenSSRC(
        IN  HRTPSESSION  hRTP);

RVVXDAPI
RvInt32 VXDCALLCONV rtpSetGroupAddress(
        IN  HRTPSESSION  hRTP,
        IN  RvUint32       ip);

RVVXDAPI
RvInt32 VXDCALLCONV rtpResume(
        IN  HRTPSESSION  hRTP);

RVVXDAPI 
RvInt32 VXDCALLCONV rtpUseSequenceNumber(
        IN  HRTPSESSION  hRTP);

RVVXDAPI 
RvInt32 VXDCALLCONV rtpSetReceiveBufferSize(
                IN HRTPSESSION  hRTP,
		IN int size);

RVVXDAPI 
RvInt32 VXDCALLCONV rtpSetTrasmitBufferSize(
                IN HRTPSESSION  hRTP,
		IN int size);

RVVXDAPI 
RvInt32 VXDCALLCONV rtpGetAvailableBytes(
                IN HRTPSESSION  hRTP);

               /* == ENDS: Accessory RTP Functions == */




#endif  /* __RTP_H */
#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -