rvrtpbuffer.c

来自「基于h323协议的软phone」· C语言 代码 · 共 54 行

C
54
字号
/*

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.

*/

#include "rvstdio.h"
#include "rvrtpbuffer.h"

#ifdef __cplusplus
extern "C" {
#endif


RvBool buffAddToBuffer(RvRtpBuffer* to, RvRtpBuffer* from, RvUint32 offset)
{
    if (from->length + offset <= to->length)
    {
        memcpy((RvUint8*)to->buffer + offset, from->buffer, from->length);

        return RV_TRUE;
    }

    return RV_FALSE;
}

RvBool buffValid(RvRtpBuffer* buff, RvUint32 size)
{
    return (size <= buff->length  &&  buff->buffer);
}

RvRtpBuffer buffCreate(void* data,int size)
{
    RvRtpBuffer buff;

    buff.buffer = (unsigned char*)data;
    buff.length = size;
    return buff;
}


#ifdef __cplusplus
}
#endif



⌨️ 快捷键说明

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