44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
// Project_ServerVedioPush.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||
//
|
||
#include <Windows.h>
|
||
#include <iostream>
|
||
#include <thread>
|
||
#include <mutex>
|
||
|
||
#include "Task_Ffmpeg/TaskFfmpeg.h"
|
||
#include "Task_PingMoniotor/TaskPingMoniotor.h"
|
||
#include "Task_NetMonitor/TaskNetMonitor.h"
|
||
|
||
using namespace std;
|
||
|
||
int main()
|
||
{
|
||
int ret;
|
||
thread threadFfmpegPushVedio;
|
||
thread threadPing;
|
||
printf("Strat Initing \r\n");
|
||
Sleep(3000);
|
||
/* 初始化 */
|
||
ret = Task_FfmpegInit();
|
||
if (ret < 0) {
|
||
system("pause");
|
||
exit(0);
|
||
}
|
||
ret = PingMoniotorInit();
|
||
if (ret < 0) {
|
||
system("pause");
|
||
exit(0);
|
||
}
|
||
|
||
/* 创建一个FFMPEG推流转码的线程 */
|
||
threadFfmpegPushVedio = thread(Task_FfmpegPushVedio);
|
||
/* 创建一个本地的ping线程,用于判断对方是否已经上线 */
|
||
threadPing = thread(Task_PingMoniotor);
|
||
/* 等待推流线程结束 */
|
||
threadFfmpegPushVedio.join();
|
||
/* 等待本地的ping线程结束 */
|
||
threadPing.join();
|
||
system("pause");
|
||
exit(0);
|
||
}
|