浏览代码

Z991239-1812 #comment other 优化广告播放功能

陈礼鹏80274480 4 年之前
父节点
当前提交
cf74f4c0b5

+ 3 - 3
Other/libmediaplayer/libmediaplayer.cpp

@@ -182,7 +182,7 @@ public:
 		}
 
 		pParam->eType = eVideo_Type;
-		pParam->eWindType = eVideoSize_Type;
+		pParam->eWindType = eFullScreen_Type;
 		size_t uValidCount = 0;
 		for (int i = 0; i < m_stPlayConfig.nFileCnt && i < MAX_FILECOUNT; i++) {
 			char strFileName[MAX_PATH] = { 0 };
@@ -234,7 +234,7 @@ public:
 		sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
 		if (strcmp(strNow, m_stPlayConfig.strVideoRunTime_S) < 0 || strcmp(strNow, m_stPlayConfig.strVideoRunTime_E) >= 0)
 		{
-			m_pHostApi->Debug("Now is %s, play video rejected!", strNow);
+			m_pHostApi->Debug("Now is %s, video play start time is %s, video play stop time is %s, play video rejected!", strNow, m_stPlayConfig.strVideoRunTime_S, m_stPlayConfig.strVideoRunTime_E);
 			iRet = 0;
 			return iRet;
 		}
@@ -286,7 +286,7 @@ public:
 		sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
 		if (strcmp(strNow, m_stPlayConfig.strVideoRunTime_S) < 0 || strcmp(strNow, m_stPlayConfig.strVideoRunTime_E) >= 0)
 		{
-			m_pHostApi->Debug("Now is %s, play video rejected!", strNow);
+			m_pHostApi->Debug("Now is %s, video play start time is %s, video play stop time is %s, play video rejected!", strNow, m_stPlayConfig.strVideoRunTime_S, m_stPlayConfig.strVideoRunTime_E);
 			iRet = 0;
 			return iRet;
 		}

+ 1 - 1
Other/libmediaplayer/video.cpp

@@ -432,7 +432,7 @@ static int open_video_playing(void *arg)
 	Uint32 uWindFlag = get_video_playing_wind_size(is->eWindType);
     // 1. 创建SDL窗口,SDL 2.0支持多窗口
     //    SDL_Window即运行程序后弹出的视频窗口,同SDL 1.x中的SDL_Surface
-    is->sdl_video.window = SDL_CreateWindow(NULL, 
+    is->sdl_video.window = SDL_CreateWindow("rvc media player", 
                               SDL_WINDOWPOS_UNDEFINED,// 不关心窗口X坐标
                               SDL_WINDOWPOS_UNDEFINED,// 不关心窗口Y坐标
                               is->sdl_video.rect.w, 

+ 10 - 4
Other/libpictureplayer/CPicturePlayer.cpp

@@ -131,7 +131,7 @@ int CPicturePlayer::Init(rvc_picture_player_param_t* tparam)
 	m_show_height = idispaly_height;
 
 	//1.创建播放窗体
-	m_window = SDL_CreateWindow("图片播放器",
+	m_window = SDL_CreateWindow("rvc picture player",
 		idispalycx,// 不关心窗口X坐标
 		idispalycy,// 不关心窗口Y坐标
 		idispaly_width,
@@ -244,8 +244,6 @@ bool CPicturePlayer::StartPicPlay()
 
 	SDL_Quit();
 
-	m_pHostApi->PicDebug("set m_bplaying = false");
-	m_bplaying = false;
 	bRet = true;
 
 	return bRet;
@@ -257,7 +255,7 @@ int CPicturePlayer::StopPicPlay()
 	int iRet = -1;
 
 	m_busrstop = true;
-	m_pHostApi->PicDebug("stop picture play, set usr stop flag true.");
+	m_pHostApi->PicDebug("stop picture play, set user stop flag true.");
 
 	iRet = 0;
 
@@ -270,3 +268,11 @@ bool CPicturePlayer::GetPicPlayingFlag()
 	m_pHostApi->PicDebug("m_bplaying flag is %s", m_bplaying ? "true" : "false");
 	return m_bplaying;
 }
+
+
+bool CPicturePlayer::SetPicPlayingFlag(bool bret)
+{
+	m_bplaying = bret;
+	m_pHostApi->PicDebug("after set m_bplaying flag is %s", m_bplaying ? "true" : "false");
+	return true;
+}

+ 1 - 0
Other/libpictureplayer/CPicturePlayer.h

@@ -71,6 +71,7 @@ public:
 	bool StartPicPlay();
 	int StopPicPlay();
 	bool GetPicPlayingFlag();
+	bool SetPicPlayingFlag(bool bret);
 	size_t GetVideoDisplayInfo();
 
 public:

+ 9 - 3
Other/libpictureplayer/libpictureplayer.cpp

@@ -49,8 +49,10 @@ public:
 		if (0 != iThreadId)
 		{
 			bret = true;
-			pthreadid = &iThreadId;
+			*(int64_t*)pthreadid = iThreadId;
 		}
+
+		return bret;
 	}
 
 	bool StartPlayMedia(CPicPlayConfig& config)
@@ -71,8 +73,7 @@ public:
 		if (0 == GetPicturePlayingParams(&tplayer_param)) {
 			if (0 == m_Player->Init(&tplayer_param))
 			{
-				m_pHostApi->PicDebug("Init Picture Player Success.");
-				m_pHostApi->PicDebug("Start Picture Play Success.");
+				m_pHostApi->PicDebug("init picture player success and begin start picture play.");
 				int err = pthread_create(&m_PlayThreadId, NULL, PicturePlayingFunc, m_Player);
 				if (0 == err) {
 					m_pHostApi->PicDebug("create picture play thread[%u] success.", m_PlayThreadId);
@@ -84,6 +85,9 @@ public:
 					m_pHostApi->PicDebug("create picture play thread failed.");
 				}
 			}
+			else {
+				m_pHostApi->PicDebug("init picture player failed!");
+			}
 		}
 		else {
 			m_pHostApi->PicDebug("Get Picture Playing Params failed!");
@@ -248,6 +252,8 @@ void* PicturePlayingFunc(void* param)
 
 	is->StartPicPlay();
 
+	is->SetPicPlayingFlag(false);
+
 	is->m_pHostApi->PicDebug("leave PicturePlayingFunc");
 
 	return 0;