Skip to content

Commit 5a08c46

Browse files
committed
add flv parse
0 parents  commit 5a08c46

17 files changed

+2543
-0
lines changed

FileParse.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.21005.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileParse", "FileParse\FileParse.vcxproj", "{3DE5DFCF-B3DC-41A1-918B-9FF67F0D8B26}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Win32 = Debug|Win32
11+
Release|Win32 = Release|Win32
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3DE5DFCF-B3DC-41A1-918B-9FF67F0D8B26}.Debug|Win32.ActiveCfg = Debug|Win32
15+
{3DE5DFCF-B3DC-41A1-918B-9FF67F0D8B26}.Debug|Win32.Build.0 = Debug|Win32
16+
{3DE5DFCF-B3DC-41A1-918B-9FF67F0D8B26}.Release|Win32.ActiveCfg = Release|Win32
17+
{3DE5DFCF-B3DC-41A1-918B-9FF67F0D8B26}.Release|Win32.Build.0 = Release|Win32
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

FileParse/AVFile.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include "AVFile.h"
2+
3+
CAVFile::CAVFile()
4+
{
5+
m_pFile = NULL;
6+
}
7+
8+
CAVFile::~CAVFile()
9+
{
10+
}
11+
12+
bool CAVFile::LoadFile(std::string strFile)
13+
{
14+
m_pFile = fopen(strFile.c_str(), "rb");
15+
if (!m_pFile)
16+
{
17+
printf("m_pFile is null.");
18+
return false;
19+
}
20+
21+
bool bResult = ParseFile();
22+
fclose(m_pFile);
23+
m_pFile = NULL;
24+
return bResult;
25+
}
26+
27+
int CAVFile::ByteToInt(byte Type[], int iCount)
28+
{
29+
int iRes = 0;
30+
int iOffset = 0;
31+
for (int i = iCount - 1; i >= 0; i--)
32+
{
33+
iRes += Type[i] << (iOffset * 8);
34+
iOffset++;
35+
}
36+
37+
return iRes;
38+
}

FileParse/AVFile.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
#include <string>
3+
4+
typedef unsigned char byte;
5+
6+
// ÒôÊÓÆµÎļþ;
7+
class CAVFile
8+
{
9+
public:
10+
CAVFile();
11+
virtual ~CAVFile();
12+
13+
bool LoadFile(std::string strFile);
14+
15+
virtual bool ParseFile() = 0;
16+
17+
int ByteToInt(byte Type[], int iCount);
18+
19+
protected:
20+
FILE* m_pFile;
21+
};

FileParse/AudioFile.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "AudioFile.h"
2+
3+
CAudioFile::CAudioFile()
4+
{
5+
}
6+
7+
CAudioFile::~CAudioFile()
8+
{
9+
}

FileParse/AudioFile.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
#include "AVFile.h"
3+
4+
class CAudioFile: public CAVFile
5+
{
6+
public:
7+
CAudioFile();
8+
virtual ~CAudioFile();
9+
};

0 commit comments

Comments
 (0)