diff --git a/.cproject b/.cproject
index 324cecf6..c5bd7ca1 100644
--- a/.cproject
+++ b/.cproject
@@ -124,10 +124,11 @@
diff --git a/X64/src/Codec/subdir.mk b/X64/src/Codec/subdir.mk
index f44ce977..3055ec4a 100644
--- a/X64/src/Codec/subdir.mk
+++ b/X64/src/Codec/subdir.mk
@@ -20,7 +20,7 @@ CPP_DEPS += \
src/Codec/%.o: ../src/Codec/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/Device/subdir.mk b/X64/src/Device/subdir.mk
index fc0a81e8..8de402f4 100644
--- a/X64/src/Device/subdir.mk
+++ b/X64/src/Device/subdir.mk
@@ -23,7 +23,7 @@ CPP_DEPS += \
src/Device/%.o: ../src/Device/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/H264/subdir.mk b/X64/src/H264/subdir.mk
index b14f1173..ce551c31 100644
--- a/X64/src/H264/subdir.mk
+++ b/X64/src/H264/subdir.mk
@@ -36,7 +36,7 @@ CPP_DEPS += \
src/H264/%.o: ../src/H264/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/Http/subdir.mk b/X64/src/Http/subdir.mk
index 474c19ab..bfd4cee8 100644
--- a/X64/src/Http/subdir.mk
+++ b/X64/src/Http/subdir.mk
@@ -20,7 +20,7 @@ CPP_DEPS += \
src/Http/%.o: ../src/Http/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/MedaiFile/CRC/subdir.mk b/X64/src/MedaiFile/CRC/subdir.mk
deleted file mode 100644
index ecc04ed8..00000000
--- a/X64/src/MedaiFile/CRC/subdir.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
-# Add inputs and outputs from these tool invocations to the build variables
-CPP_SRCS += \
-../src/MedaiFile/CRC/crc32.cpp
-
-OBJS += \
-./src/MedaiFile/CRC/crc32.o
-
-CPP_DEPS += \
-./src/MedaiFile/CRC/crc32.d
-
-
-# Each subdirectory must supply rules for building sources it contributes
-src/MedaiFile/CRC/%.o: ../src/MedaiFile/CRC/%.cpp
- @echo 'Building file: $<'
- @echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
- @echo 'Finished building: $<'
- @echo ' '
-
-
diff --git a/X64/src/MedaiFile/subdir.mk b/X64/src/MedaiFile/subdir.mk
deleted file mode 100644
index 365065ab..00000000
--- a/X64/src/MedaiFile/subdir.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-################################################################################
-
-# Add inputs and outputs from these tool invocations to the build variables
-CPP_SRCS += \
-../src/MedaiFile/HLSMaker.cpp \
-../src/MedaiFile/MediaReader.cpp \
-../src/MedaiFile/MediaRecorder.cpp \
-../src/MedaiFile/Mp4Maker.cpp \
-../src/MedaiFile/TSMaker.cpp
-
-OBJS += \
-./src/MedaiFile/HLSMaker.o \
-./src/MedaiFile/MediaReader.o \
-./src/MedaiFile/MediaRecorder.o \
-./src/MedaiFile/Mp4Maker.o \
-./src/MedaiFile/TSMaker.o
-
-CPP_DEPS += \
-./src/MedaiFile/HLSMaker.d \
-./src/MedaiFile/MediaReader.d \
-./src/MedaiFile/MediaRecorder.d \
-./src/MedaiFile/Mp4Maker.d \
-./src/MedaiFile/TSMaker.d
-
-
-# Each subdirectory must supply rules for building sources it contributes
-src/MedaiFile/%.o: ../src/MedaiFile/%.cpp
- @echo 'Building file: $<'
- @echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
- @echo 'Finished building: $<'
- @echo ' '
-
-
diff --git a/X64/src/MediaFile/subdir.mk b/X64/src/MediaFile/subdir.mk
new file mode 100644
index 00000000..57b13075
--- /dev/null
+++ b/X64/src/MediaFile/subdir.mk
@@ -0,0 +1,39 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+CPP_SRCS += \
+../src/MediaFile/HLSMaker.cpp \
+../src/MediaFile/MediaReader.cpp \
+../src/MediaFile/MediaRecorder.cpp \
+../src/MediaFile/Mp4Maker.cpp \
+../src/MediaFile/TSMaker.cpp \
+../src/MediaFile/crc32.cpp
+
+OBJS += \
+./src/MediaFile/HLSMaker.o \
+./src/MediaFile/MediaReader.o \
+./src/MediaFile/MediaRecorder.o \
+./src/MediaFile/Mp4Maker.o \
+./src/MediaFile/TSMaker.o \
+./src/MediaFile/crc32.o
+
+CPP_DEPS += \
+./src/MediaFile/HLSMaker.d \
+./src/MediaFile/MediaReader.d \
+./src/MediaFile/MediaRecorder.d \
+./src/MediaFile/Mp4Maker.d \
+./src/MediaFile/TSMaker.d \
+./src/MediaFile/crc32.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/MediaFile/%.o: ../src/MediaFile/%.cpp
+ @echo 'Building file: $<'
+ @echo 'Invoking: Cross G++ Compiler'
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
diff --git a/X64/src/Player/subdir.mk b/X64/src/Player/subdir.mk
index fed7de90..b7c078a5 100644
--- a/X64/src/Player/subdir.mk
+++ b/X64/src/Player/subdir.mk
@@ -23,7 +23,7 @@ CPP_DEPS += \
src/Player/%.o: ../src/Player/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/RTP/subdir.mk b/X64/src/RTP/subdir.mk
index d0e0f88b..e12e8942 100644
--- a/X64/src/RTP/subdir.mk
+++ b/X64/src/RTP/subdir.mk
@@ -20,7 +20,7 @@ CPP_DEPS += \
src/RTP/%.o: ../src/RTP/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/Rtmp/subdir.mk b/X64/src/Rtmp/subdir.mk
index 38d66b49..bba3208f 100644
--- a/X64/src/Rtmp/subdir.mk
+++ b/X64/src/Rtmp/subdir.mk
@@ -44,7 +44,7 @@ CPP_DEPS += \
src/Rtmp/%.o: ../src/Rtmp/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/Rtsp/subdir.mk b/X64/src/Rtsp/subdir.mk
index 80841ab1..52b9533f 100644
--- a/X64/src/Rtsp/subdir.mk
+++ b/X64/src/Rtsp/subdir.mk
@@ -41,7 +41,7 @@ CPP_DEPS += \
src/Rtsp/%.o: ../src/Rtsp/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/Shell/subdir.mk b/X64/src/Shell/subdir.mk
index f46e55f6..ceb3819a 100644
--- a/X64/src/Shell/subdir.mk
+++ b/X64/src/Shell/subdir.mk
@@ -20,7 +20,7 @@ CPP_DEPS += \
src/Shell/%.o: ../src/Shell/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/src/subdir.mk b/X64/src/subdir.mk
index d712db41..55e8894d 100644
--- a/X64/src/subdir.mk
+++ b/X64/src/subdir.mk
@@ -17,7 +17,7 @@ CPP_DEPS += \
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/X64/test/subdir.mk b/X64/test/subdir.mk
index 632c9cd0..ab58fa77 100644
--- a/X64/test/subdir.mk
+++ b/X64/test/subdir.mk
@@ -20,7 +20,7 @@ CPP_DEPS += \
test/%.o: ../test/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
- g++ -std=c++1y -DENABLE_FAAC -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_MEDIAFILE -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
+ g++ -std=c++1y -DENABLE_RTSP2RTMP -DENABLE_RTMP2RTSP -DENABLE_HLS -DENABLE_MP4V2 -DENABLE_FAAC -DENABLE_X264 -I"/home/xzl/git/ZLMediaKit/src" -I../../ZLToolKit/src -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
diff --git a/src/MediaFile/MediaReader.cpp b/src/MediaFile/MediaReader.cpp
index 8b7c8e84..6b3d746a 100644
--- a/src/MediaFile/MediaReader.cpp
+++ b/src/MediaFile/MediaReader.cpp
@@ -16,7 +16,7 @@ using namespace ZL::Util;
namespace ZL {
namespace MediaFile {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
MediaReader::MediaReader(const string &strApp, const string &strId) {
static string recordPath = mINI::Instance()[Config::Record::kFilePath];
auto strFileName = recordPath + "/" + strApp + "/" + strId;
@@ -301,10 +301,10 @@ void MediaReader::seek(int iSeekTime,bool bReStart){
}
}
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
RtspMediaSource::Ptr MediaReader::onMakeRtsp(const string &strApp, const string &strId) {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
static string appName = mINI::Instance()[Config::Record::kAppName];
if (strApp != appName) {
return nullptr;
@@ -319,12 +319,12 @@ RtspMediaSource::Ptr MediaReader::onMakeRtsp(const string &strApp, const string
}
#else
return nullptr;
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
}
RtmpMediaSource::Ptr MediaReader::onMakeRtmp(const string &strApp, const string &strId) {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
static string appName = mINI::Instance()[Config::Record::kAppName];
if (strApp != appName) {
return nullptr;
@@ -339,7 +339,7 @@ RtmpMediaSource::Ptr MediaReader::onMakeRtmp(const string &strApp, const string
}
#else
return nullptr;
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
}
diff --git a/src/MediaFile/MediaReader.h b/src/MediaFile/MediaReader.h
index 862999c1..d4f06aa1 100644
--- a/src/MediaFile/MediaReader.h
+++ b/src/MediaFile/MediaReader.h
@@ -12,9 +12,9 @@
#include "Rtsp/RtspMediaSource.h"
#include "Rtmp/RtmpMediaSource.h"
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
#include
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
using namespace ZL::DEV;
using namespace ZL::Rtsp;
@@ -32,7 +32,7 @@ public:
static RtmpMediaSource::Ptr onMakeRtmp(const string &strApp, const string &strId);
private:
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
MP4FileHandle m_hMP4File = MP4_INVALID_FILE_HANDLE;
MP4TrackId m_video_trId = MP4_INVALID_TRACK_ID;
uint32_t m_video_ms = 0;
@@ -76,7 +76,7 @@ private:
inline bool readAudioSample(int iTimeInc = 0);
inline void writeH264(uint8_t *pucData,int iLen,uint32_t uiStamp);
inline void writeAAC(uint8_t *pucData,int iLen,uint32_t uiStamp);
-#endif
+#endif //ENABLE_MP4V2
};
} /* namespace MediaFile */
diff --git a/src/MediaFile/MediaRecorder.cpp b/src/MediaFile/MediaRecorder.cpp
index 64bf1234..4e74c81e 100644
--- a/src/MediaFile/MediaRecorder.cpp
+++ b/src/MediaFile/MediaRecorder.cpp
@@ -19,42 +19,47 @@ namespace ZL {
namespace MediaFile {
MediaRecorder::MediaRecorder(const string &strApp,const string &strId,const std::shared_ptr &pPlayer) {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_HLS
static string hlsPrefix = mINI::Instance()[Config::Http::kHttpPrefix];
static string hlsPath = mINI::Instance()[Config::Hls::kFilePath];
static uint32_t hlsBufSize = mINI::Instance()[Config::Hls::kFileBufSize].as();
static uint32_t hlsDuration = mINI::Instance()[Config::Hls::kSegmentDuration].as();
static uint32_t hlsNum = mINI::Instance()[Config::Hls::kSegmentNum].as();
+ m_hlsMaker.reset(new HLSMaker(hlsPath + "/" + strApp + "/" + strId + "/hls.m3u8",
+ hlsPrefix + "/" + strApp + "/" + strId + "/",
+ hlsBufSize,hlsDuration,hlsNum));
+#endif //ENABLE_HLS
+
+#ifdef ENABLE_MP4V2
static string recordPath = mINI::Instance()[Config::Record::kFilePath];
static string recordAppName = mINI::Instance()[Config::Record::kAppName];
-
-
- m_hlsMaker.reset(new HLSMaker(hlsPath + "/" + strApp + "/" + strId + "/hls.m3u8",
- hlsPrefix + "/" + strApp + "/" + strId + "/",
- hlsBufSize,hlsDuration,hlsNum));
-
m_mp4Maker.reset(new Mp4Maker(recordPath + "/" + recordAppName + "/" + strApp + "/" + strId + "/",
strApp,strId,pPlayer));
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
}
MediaRecorder::~MediaRecorder() {
}
void MediaRecorder::inputH264(void* pData, uint32_t ui32Length, uint32_t ui32TimeStamp, int iType) {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_HLS
m_hlsMaker->inputH264(pData, ui32Length, ui32TimeStamp * 90, iType);
- m_mp4Maker->inputH264(pData, ui32Length, ui32TimeStamp, iType);
+#endif //ENABLE_HLS
-#endif //ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
+ m_mp4Maker->inputH264(pData, ui32Length, ui32TimeStamp, iType);
+#endif //ENABLE_MP4V2
}
void MediaRecorder::inputAAC(void* pData, uint32_t ui32Length, uint32_t ui32TimeStamp) {
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_HLS
m_hlsMaker->inputAAC(pData, ui32Length, ui32TimeStamp * 90);
+#endif //ENABLE_HLS
+
+#ifdef ENABLE_MP4V2
m_mp4Maker->inputAAC(pData, ui32Length, ui32TimeStamp);
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
}
} /* namespace MediaFile */
diff --git a/src/MediaFile/MediaRecorder.h b/src/MediaFile/MediaRecorder.h
index a36c2c82..7f5d7ca0 100644
--- a/src/MediaFile/MediaRecorder.h
+++ b/src/MediaFile/MediaRecorder.h
@@ -10,10 +10,14 @@
#include
#include "Player/PlayerBase.h"
-#ifdef ENABLE_MEDIAFILE
+
+#ifdef ENABLE_MP4V2
#include "Mp4Maker.h"
+#endif //ENABLE_MP4V2
+
+#ifdef ENABLE_HLS
#include "HLSMaker.h"
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_HLS
using namespace std;
using namespace ZL::Player;
@@ -37,10 +41,14 @@ public:
uint32_t ui32Length,
uint32_t ui32TimeStamp);
private:
-#ifdef ENABLE_MEDIAFILE
+
+#ifdef ENABLE_HLS
std::shared_ptr m_hlsMaker;
+#endif //ENABLE_HLS
+
+#ifdef ENABLE_MP4V2
std::shared_ptr m_mp4Maker;
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
};
diff --git a/src/MediaFile/Mp4Maker.cpp b/src/MediaFile/Mp4Maker.cpp
index a138edf9..d29b8081 100644
--- a/src/MediaFile/Mp4Maker.cpp
+++ b/src/MediaFile/Mp4Maker.cpp
@@ -1,5 +1,5 @@
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
#include
#include
@@ -187,4 +187,4 @@ void Mp4Maker::closeFile() {
} /* namespace ZL */
-#endif //ENABLE_MEDIAFILE
+#endif //ENABLE_MP4V2
diff --git a/src/MediaFile/Mp4Maker.h b/src/MediaFile/Mp4Maker.h
index d87e8e87..2cd971ec 100644
--- a/src/MediaFile/Mp4Maker.h
+++ b/src/MediaFile/Mp4Maker.h
@@ -8,7 +8,7 @@
#ifndef MP4MAKER_H_
#define MP4MAKER_H_
-#ifdef ENABLE_MEDIAFILE
+#ifdef ENABLE_MP4V2
#include
#include
@@ -77,6 +77,6 @@ private:
} /* namespace MediaFile */
} /* namespace ZL */
-#endif ///ENABLE_MEDIAFILE
+#endif ///ENABLE_MP4V2
#endif /* MP4MAKER_H_ */