Selaa lähdekoodia

Z991240-947 #comment bugfix:解决销售record启动崩溃问题

胡琛80272472 4 vuotta sitten
vanhempi
sitoutus
11237c0382

+ 2 - 2
Module/mod_SalesRecorder/CMakeLists.txt

@@ -23,9 +23,9 @@ target_link_directories(${MODULE_NAME} PRIVATE
 
 # 添加实体需要依赖的其他共享库(包括系统库)
 if(WIN32)
-set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} ${RVCCOMM_LIB} wmpplayer)
+set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} ${RVCCOMM_LIB} wmpplayer libwmvrecord)
 else(WIN32)
-set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} ${RVCCOMM_LIB} mediaplayer )
+set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} ${RVCCOMM_LIB} mediaplayer libwmvrecord)
 endif(WIN32)
 
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})

+ 1 - 0
Other/libwmvrecord/CMakeLists.txt

@@ -62,6 +62,7 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${OTHER_LIB_BASE_DIR}/libaudions
 	${OTHER_LIB_BASE_DIR}/libaudiotransqueue
 	${OTHER_LIB_BASE_DIR}/rvcmediacommon/common_video
+	${OTHER_LIB_BASE_DIR}/libvideoframework
 	)
 
 

+ 6 - 6
Other/libwmvrecord/FFmpegWriter.cpp

@@ -473,7 +473,7 @@ static void close_stream(AVFormatContext *oc, OutputStream *ost)
 /**************************************************************/
 /* media file output */
 
-BOOL FFmpegWriter::InitWmvWriter(char* filename, int width, int height, int colorbit, int nfps,
+BOOL FFmpegWmvWriter::InitWmvWriter(char* filename, int width, int height, int colorbit, int nfps,
     int nSanplePsec, int nchannels, int nBitPerSample, int nmaxspacing, int nquality, int nOutBitRate, int iAudioType)
 {
     int ret;
@@ -562,7 +562,7 @@ BOOL FFmpegWriter::InitWmvWriter(char* filename, int width, int height, int colo
 
 
 
-BOOL FFmpegWriter::StartWrite() {
+BOOL FFmpegWmvWriter::StartWrite() {
 	AVDictionary *opt = NULL;
 
     /* Write the stream header, if any. */
@@ -577,7 +577,7 @@ BOOL FFmpegWriter::StartWrite() {
 }
 
 
-BOOL FFmpegWriter::End() {
+BOOL FFmpegWmvWriter::End() {
     /* Write the trailer, if any. The trailer must be written before you
      * close the CodecContexts open when you wrote the header; otherwise
      * av_write_trailer() may try to use memory that was freed on
@@ -593,7 +593,7 @@ BOOL FFmpegWriter::End() {
 	return TRUE;
 }
 
-void FFmpegWriter::Close(){
+void FFmpegWmvWriter::Close(){
     /* Close each codec. */
     if (have_video)
         close_stream(oc, video_st);
@@ -616,7 +616,7 @@ void FFmpegWriter::Close(){
     }
 }
 
-BOOL FFmpegWriter::ReceiveAudioData(BYTE* pData, DWORD len) {
+BOOL FFmpegWmvWriter::ReceiveAudioData(BYTE* pData, DWORD len) {
 	if (oc == NULL || audio_st == NULL || !have_audio){
 		return FALSE;
 	}
@@ -629,7 +629,7 @@ BOOL FFmpegWriter::ReceiveAudioData(BYTE* pData, DWORD len) {
 }
 
 
-BOOL FFmpegWriter::ReceiveVideoData(BYTE* pData, DWORD len) {
+BOOL FFmpegWmvWriter::ReceiveVideoData(BYTE* pData, DWORD len) {
 	if (oc == NULL || video_st == NULL || !have_video){
 		return FALSE;
 	}

+ 3 - 3
Other/libwmvrecord/FFmpegWriter.h

@@ -31,11 +31,11 @@ extern "C"
 typedef struct OutputStream_t OutputStream;
 
 
-class FFmpegWriter
+class FFmpegWmvWriter
 {
 public:
-	FFmpegWriter():video_st(NULL),audio_st(NULL),fmt(NULL),oc(NULL),audio_codec(NULL),video_codec(NULL),have_video(0),have_audio(0){};
-	virtual ~FFmpegWriter();
+	FFmpegWmvWriter() {video_st = NULL; audio_st = NULL; fmt = NULL; oc = NULL; audio_codec = NULL; video_codec = NULL; have_video = 0; have_audio = 0;};
+	~FFmpegWmvWriter();
 private://ÄÚ²¿³ÉÔ±±äÁ¿
 	OutputStream *video_st;
 	OutputStream *audio_st;

+ 2 - 2
Other/libwmvrecord/libwmvrecord.cpp

@@ -305,7 +305,7 @@ private:
 	//ÒôƵƴ½ÓµÄ»º³åÇø´óС;
 	int m_iAudioBufferSize;
 	//wmv recorder
-	FFmpegWriter*m_pWriter;
+	FFmpegWmvWriter*m_pWriter;
 
 	//audio noise suppression
 	IAudioNs *m_pAudioNsObj;
@@ -350,7 +350,7 @@ private:
 	BOOL StartRecord()
 	{
 		ResetEvent(m_hEventWait);
-		m_pWriter = new FFmpegWriter;
+		m_pWriter = new FFmpegWmvWriter;
 		if (m_bIsAudioNsOn){
 			m_pAudioNsObj = CreateIAudioNsObj();
 		}