-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfileParser.cpp
More file actions
48 lines (43 loc) · 873 Bytes
/
fileParser.cpp
File metadata and controls
48 lines (43 loc) · 873 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
44
45
46
47
48
#include <string.h>
#include <stdio.h>
#include "fileParser.h"
#include "h264FileParser.h"
#include "socket_type.h"
fileSdpGenerator::fileSdpGenerator(void)
{
}
fileSdpGenerator::~fileSdpGenerator(void)
{
}
fileSdpGenerator* fileSdpGenerator::createNew(const char *file_name)
{
fileSdpGenerator *parser=0;
/*char prefix[256],suffix[256];
if(2!=sscanf(file_name,"%[^.].%s",prefix,suffix))
{
return 0;
}*/
const char *pStuffix = nullptr;
for (int i = strlen(file_name); i>1 ; i--)
{
if (file_name[i]=='.')
{
pStuffix = file_name + i + 1;
break;
}
}
if (pStuffix==nullptr)
{
return nullptr;
}
if (stricmp(pStuffix,"264")==0||stricmp(pStuffix,"h264")==0)
{
parser=h264FileSdpGenerator::createNew(file_name);
}
else if (stricmp(pStuffix, "flv")==0)
{
//parser=
parser = flvFileSdpGenerator::createNew(file_name);
}
return parser;
}