zhangzengfei
2022-07-20 c90c3e794bdd95127d0c34ff1d9e8759d18a0445
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
#ifndef __TOOL__H__
#define __TOOL__H__
 
#include <string.h>
#include <iostream>
#include <ctype.h>
 
 
using namespace std;
 
#ifdef  __cplusplus
extern "C" 
{
#endif
    char* base64MyEncode(char const* origSigned, unsigned origLength);
 
    int GetClockTime();
    bool IsVideoPayloadType(int type);
    bool IsPsHeader(unsigned char *data);
    
    char* strMyDup(char const* str);
    // Note: strDup(NULL) returns NULL
 
    char* strMyDupSize(char const* str);
    // Like "strDup()", except that it *doesn't* copy the original.
    // (Instead, it just allocates a string of the same size as the original.)
 
    char* strMyDupSize2(char const* str, size_t& resultBufSize);
    // An alternative form of "strDupSize()" that also returns the size of the allocated buffer.
#ifdef __cplusplus
}
#endif
 
#endif