|
|
@@ -4,17 +4,20 @@
|
|
|
#include "screencapture.h"
|
|
|
#include <screencodec.h>
|
|
|
|
|
|
-#include "..\mod_assistantchannel\AssistantChannel_client_g.h"
|
|
|
+#include "mod_assistantchannel/AssistantChannel_client_g.h"
|
|
|
using namespace AssistantChannel;
|
|
|
-#include "..\mod_Assistantchannel\chan_protocol.h"
|
|
|
+#include "mod_assistantchannel/chan_protocol.h"
|
|
|
|
|
|
-#include "..\\mod_assistantchannel\\VideoDesc.h"
|
|
|
+#include "mod_assistantchannel/VideoDesc.h"
|
|
|
// add by ly 20150514
|
|
|
#include "jpeg2k.h"
|
|
|
#include "ScreenShot_server_g.h"
|
|
|
#include "cv.h"
|
|
|
#include "highgui.h"
|
|
|
#include "cxcore.h"
|
|
|
+
|
|
|
+#include "CommEntityUtil.hpp"
|
|
|
+
|
|
|
using namespace ScreenShot;
|
|
|
|
|
|
#define LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE 0x50500001 //ÐÖúͨµÀÖØÆô
|
|
|
@@ -243,8 +246,13 @@ public:
|
|
|
screen_encoder_session_destroy(m_enc_session);
|
|
|
m_enc_session = NULL;
|
|
|
}
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
+#else
|
|
|
+ int cx, cy;
|
|
|
+ getScreenSize(&cx, &cy);
|
|
|
+#endif
|
|
|
if (m_bIsWallMachine)
|
|
|
{
|
|
|
cy = cy-640;
|
|
|
@@ -264,8 +272,13 @@ public:
|
|
|
void Capture(int id)
|
|
|
{
|
|
|
CSystemStaticInfo SysInfo;
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
+#else
|
|
|
+ int cx, cy;
|
|
|
+ getScreenSize(&cx, &cy);
|
|
|
+#endif
|
|
|
RECT rc = {0, 0, cx, cy};
|
|
|
int size = 0;
|
|
|
int err = screencapture_capture(&rc, NULL, &size);
|
|
|
@@ -331,14 +344,19 @@ public:
|
|
|
}
|
|
|
|
|
|
free(buf);
|
|
|
- LOG_TRACE("encode size = %d Bytes, time = %d", Info.data.m_iLength, GetTickCount());
|
|
|
+ LOG_TRACE("encode size = %d Bytes, time = %d", Info.data.m_iLength, SP::Module::Comm::RVCGetTickCount());
|
|
|
}
|
|
|
|
|
|
void Capture1(int id)
|
|
|
{
|
|
|
CSystemStaticInfo SysInfo;
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
+#else
|
|
|
+ int cx, cy;
|
|
|
+ getScreenSize(&cx, &cy);
|
|
|
+#endif
|
|
|
RECT rc = {0, 0, cx, cy};
|
|
|
int size = 0;
|
|
|
int err = screencapture_capture(&rc, NULL, &size);
|
|
|
@@ -385,7 +403,7 @@ public:
|
|
|
//DumpCaptureDat((const char*)Info.data.m_pData, Info.data.m_iLength);
|
|
|
m_pChannelClient->Send(Info);
|
|
|
free(buf);
|
|
|
- LOG_TRACE("encode size = %d Bytes, time = %d", Info.data.m_iLength, GetTickCount());
|
|
|
+ LOG_TRACE("encode size = %d Bytes, time = %d", Info.data.m_iLength, SP::Module::Comm::RVCGetTickCount());
|
|
|
}
|
|
|
|
|
|
void Capture2(RECT *lprc, CBlob &image)
|
|
|
@@ -459,8 +477,13 @@ void CScreenShotSession::Handle_StartScreenShot(SpReqAnsContext<ScreenShotServic
|
|
|
{
|
|
|
Dbg("accepted params: %d, %d, %d, %d", ctx->Req.Left, ctx->Req.Top, ctx->Req.Width, ctx->Req.Height);
|
|
|
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
+#else
|
|
|
+ int cx, cy;
|
|
|
+ getScreenSize(&cx, &cy);
|
|
|
+#endif
|
|
|
if (ctx->Req.Left < 0 || ctx->Req.Left > cx || ctx->Req.Width <= 0 || ctx->Req.Width > cx ||
|
|
|
ctx->Req.Top < 0 || ctx->Req.Top > cy || ctx->Req.Height <= 0 || ctx->Req.Height > cy)
|
|
|
{
|