mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Remove files
This commit is contained in:
@@ -1,21 +1,15 @@
|
||||
#include "record_desktop_wgc.h"
|
||||
|
||||
#include "utils_string.h"
|
||||
|
||||
#include "system_error.h"
|
||||
#include "error_define.h"
|
||||
#include "log_helper.h"
|
||||
|
||||
BOOL WINAPI EnumMonitorProc(HMONITOR hmonitor, HDC hdc, LPRECT lprc,
|
||||
LPARAM data) {
|
||||
|
||||
MONITORINFOEX info_ex;
|
||||
info_ex.cbSize = sizeof(MONITORINFOEX);
|
||||
|
||||
GetMonitorInfo(hmonitor, &info_ex);
|
||||
|
||||
if (info_ex.dwFlags == DISPLAY_DEVICE_MIRRORING_DRIVER)
|
||||
return true;
|
||||
if (info_ex.dwFlags == DISPLAY_DEVICE_MIRRORING_DRIVER) return true;
|
||||
|
||||
if (info_ex.dwFlags & MONITORINFOF_PRIMARY) {
|
||||
*(HMONITOR *)data = hmonitor;
|
||||
@@ -34,7 +28,6 @@ HMONITOR GetPrimaryMonitor() {
|
||||
|
||||
namespace am {
|
||||
|
||||
|
||||
record_desktop_wgc::record_desktop_wgc() {}
|
||||
|
||||
record_desktop_wgc::~record_desktop_wgc() {
|
||||
@@ -44,8 +37,7 @@ record_desktop_wgc::~record_desktop_wgc() {
|
||||
|
||||
int record_desktop_wgc::init(const RECORD_DESKTOP_RECT &rect, const int fps) {
|
||||
int error = AE_NO;
|
||||
if (_inited == true)
|
||||
return error;
|
||||
if (_inited == true) return error;
|
||||
|
||||
_fps = fps;
|
||||
_rect = rect;
|
||||
@@ -73,8 +65,6 @@ int record_desktop_wgc::init(const RECORD_DESKTOP_RECT &rect, const int fps) {
|
||||
} while (0);
|
||||
|
||||
if (error != AE_NO) {
|
||||
al_debug("%s,last error:%s", err2str(error),
|
||||
system_error::error2str(GetLastError()).c_str());
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -82,7 +72,7 @@ int record_desktop_wgc::init(const RECORD_DESKTOP_RECT &rect, const int fps) {
|
||||
|
||||
int record_desktop_wgc::start() {
|
||||
if (_running == true) {
|
||||
al_warn("record desktop duplication is already running");
|
||||
// al_warn("record desktop duplication is already running");
|
||||
return AE_NO;
|
||||
}
|
||||
|
||||
@@ -98,29 +88,26 @@ int record_desktop_wgc::start() {
|
||||
|
||||
int record_desktop_wgc::pause() {
|
||||
_paused = true;
|
||||
if (session_)
|
||||
session_->pause();
|
||||
if (session_) session_->pause();
|
||||
return AE_NO;
|
||||
}
|
||||
|
||||
int record_desktop_wgc::resume() {
|
||||
_paused = false;
|
||||
if (session_)
|
||||
session_->resume();
|
||||
if (session_) session_->resume();
|
||||
return AE_NO;
|
||||
}
|
||||
|
||||
int record_desktop_wgc::stop() {
|
||||
_running = false;
|
||||
|
||||
if (session_)
|
||||
session_->stop();
|
||||
if (session_) session_->stop();
|
||||
|
||||
return AE_NO;
|
||||
}
|
||||
|
||||
void record_desktop_wgc::on_frame(const wgc_session::wgc_session_frame &frame) {
|
||||
al_debug("wgc on frame");
|
||||
// al_debug("wgc on frame");
|
||||
AVFrame *av_frame = av_frame_alloc();
|
||||
|
||||
av_frame->pts = av_gettime_relative();
|
||||
@@ -136,8 +123,7 @@ void record_desktop_wgc::on_frame(const wgc_session::wgc_session_frame &frame) {
|
||||
av_image_fill_arrays(av_frame->data, av_frame->linesize, frame.data,
|
||||
AV_PIX_FMT_BGRA, frame.width, frame.height, 1);
|
||||
|
||||
if (_on_data)
|
||||
_on_data(av_frame);
|
||||
if (_on_data) _on_data(av_frame);
|
||||
|
||||
av_frame_free(&av_frame);
|
||||
}
|
||||
@@ -145,10 +131,9 @@ void record_desktop_wgc::on_frame(const wgc_session::wgc_session_frame &frame) {
|
||||
void record_desktop_wgc::clean_up() {
|
||||
_inited = false;
|
||||
|
||||
if (session_)
|
||||
session_->release();
|
||||
if (session_) session_->release();
|
||||
|
||||
session_ = nullptr;
|
||||
}
|
||||
|
||||
} // namespace am
|
||||
} // namespace am
|
||||
Reference in New Issue
Block a user