20230201_1811_emb/1811ServerVedioPushTool/ServerVedioPushTool/Src/Usr/App/Project_ServerVedioPush.cpp
Rjh913828050 fddc46ab1b 类型:更新
内容:1811项目下位机软件第一版完整程序
人员:任家豪
2024-07-31 08:45:23 +08:00

44 lines
1.1 KiB
C++
Raw Permalink 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 <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);
}