20230201_1811_emb/1811ServerVedioPushTool/ServerVedioPushTool/Src/Usr/App/Project_ServerVedioPush.cpp
Rjh913828050 78f3903d1d 类型:重构
内容:1811项目下位机软件第一版完整程序
人员:任家豪
2023-10-08 13:56:23 +08:00

46 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Project_ServerVedioPush.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#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;
/* 初始化 */
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);
}