-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathVideojj.cpp
More file actions
43 lines (36 loc) · 786 Bytes
/
Videojj.cpp
File metadata and controls
43 lines (36 loc) · 786 Bytes
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
36
37
38
39
40
41
42
43
#include <stdlib.h>
#include <string.h>
#include "vadbg.h"
#include "Videojj.h"
CVideojj::CVideojj()
{
}
CVideojj::~CVideojj()
{
int i;
for (i = 0; i < _vVjjSEI.size(); i++)
{
delete _vVjjSEI[i].szUD;
}
}
int CVideojj::Process(unsigned char *pNalu, int nNaluLen, int nTimeStamp)
{
if (pNalu[4] != 0x06 || pNalu[5] != 0x05)
return 0;
unsigned char *p = pNalu + 4 + 2;
while (*p++ == 0xff);
const char *szVideojjUUID = "VideojjLeonUUID";
char *pp = (char *)p;
for (int i = 0; i < strlen(szVideojjUUID); i++)
{
if (pp[i] != szVideojjUUID[i])
return 0;
}
VjjSEI sei;
sei.nTimeStamp = nTimeStamp;
sei.nLen = nNaluLen - (pp - (char *)pNalu) - 16 - 1;
sei.szUD = new char[sei.nLen];
memcpy(sei.szUD, pp + 16, sei.nLen);
_vVjjSEI.push_back(sei);
return 1;
}