Skip to content

Commit c2325ae

Browse files
committed
bump some logs
1 parent 3101458 commit c2325ae

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

source_code/DibHelper.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,12 @@ void AddMouse(HDC hMemDC, LPRECT lpRect, HDC hScrDC, HWND hwnd) {
102102
__int64 start = StartCounter();
103103
POINT p;
104104

105-
// GetCursorPos(&p); // get current x, y 0.008 ms
106-
107105
CURSORINFO globalCursor;
108-
globalCursor.cbSize = sizeof(CURSORINFO); // could cache I guess...
106+
globalCursor.cbSize = sizeof(CURSORINFO); // could cache I guess...wait what if they change the cursor though? :)
109107
::GetCursorInfo(&globalCursor);
110108
HCURSOR hcur = globalCursor.hCursor;
111109

112-
GetCursorPos(&p);
110+
GetCursorPos(&p); // redundant?
113111
if(hwnd)
114112
ScreenToClient(hwnd, &p); // 0.010ms
115113

@@ -129,9 +127,11 @@ void AddMouse(HDC hMemDC, LPRECT lpRect, HDC hScrDC, HWND hwnd) {
129127
}
130128
}
131129

132-
DrawIcon(hMemDC, p.x-lpRect->left, p.y-lpRect->top, hcur); // 0.042ms
130+
int x= p.x-lpRect->left;
131+
int y = p.y-lpRect->top;
132+
DrawIcon(hMemDC, x, y, hcur); // 0.042ms
133133
if(show_performance)
134-
LocalOutput("add mouse took %.02f ms", GetCounterSinceStartMillis(start)); // sum takes around 0.125 ms
134+
LocalOutput("add mouse at %d,%d took %.02f ms", x, y, GetCounterSinceStartMillis(start)); // sum takes around 0.125 ms
135135
}
136136

137137
// partially from http://cboard.cprogramming.com/windows-programming/44278-regqueryvalueex.html

source_code/PushSource.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<CallingConvention>StdCall</CallingConvention>
8989
</ClCompile>
9090
<Link>
91-
<AdditionalDependencies>strmbase.lib;winmm.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
91+
<AdditionalDependencies>strmbase.lib;winmm.lib;msvcrt.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
9292
<AdditionalLibraryDirectories>..\..\BaseClasses\x64\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
9393
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
9494
<ModuleDefinitionFile>PushSource.def</ModuleDefinitionFile>

source_code/PushSource.x64.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<CallingConvention>StdCall</CallingConvention>
134134
</ClCompile>
135135
<Link>
136-
<AdditionalDependencies>strmbasd.lib;winmm.lib;msvcrtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
136+
<AdditionalDependencies>strmbasd.lib;winmm.lib;msvcrtd.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
137137
<AdditionalLibraryDirectories>..\..\BaseClasses\x64\Debug\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
138138
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
139139
<ModuleDefinitionFile>PushSource.def</ModuleDefinitionFile>
@@ -233,7 +233,7 @@
233233
<CallingConvention>StdCall</CallingConvention>
234234
</ClCompile>
235235
<Link>
236-
<AdditionalDependencies>strmbase.lib;winmm.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
236+
<AdditionalDependencies>strmbase.lib;winmm.lib;msvcrt.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
237237
<AdditionalLibraryDirectories>..\..\BaseClasses\x64\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
238238
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
239239
<ModuleDefinitionFile>PushSource.def</ModuleDefinitionFile>

source_code/PushSourceDesktop.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
7979

8080
// Get the dimensions of the capture thing-er
8181
m_rCaptureCoordinates.left = m_rCaptureCoordinates.top = 0;
82-
m_rCaptureCoordinates.right = GetDeviceCaps(hScrDc, HORZRES); // NB this *fails* for dual monitor support currently... but we just get the wrong width by default, at least with aero windows 7 both can capture both monitors
83-
m_rCaptureCoordinates.bottom = GetDeviceCaps(hScrDc, VERTRES);
82+
// blind guess at DPI reports?
83+
int logPixelsX = GetDeviceCaps(hScrDc, LOGPIXELSX); // default 96
84+
int logPixelsY = GetDeviceCaps(hScrDc, LOGPIXELSY); // default 96
85+
// NB this *fails* for dual monitor support currently... but we just get the wrong width by default, at least with aero windows 7 both can capture both monitors
86+
m_rCaptureCoordinates.right = logPixelsX * GetDeviceCaps(hScrDc, HORZRES)/ 96;
87+
m_rCaptureCoordinates.bottom = logPixelsY * GetDeviceCaps(hScrDc, VERTRES) / 96;
8488

8589
// now read some custom settings...
8690
WarmupCounter();
@@ -122,7 +126,7 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
122126
m_iCaptureConfigHeight = m_rCaptureCoordinates.bottom - m_rCaptureCoordinates.top;
123127
ASSERT_RAISE(m_iCaptureConfigHeight > 0);
124128

125-
// purpose of stretch is to "shrink" itat capture time, in case that saves cpu...I think...
129+
// purpose of stretch is to "shrink" it at capture time, in case that saves cpu...I think...
126130
m_iStretchToThisConfigWidth = read_config_setting(TEXT("stretch_to_width"), 0, false);
127131
m_iStretchToThisConfigHeight = read_config_setting(TEXT("stretch_to_height"), 0, false);
128132
m_iStretchMode = read_config_setting(TEXT("stretch_mode_high_quality_if_1"), 0, true); // guess it's either stretch mode 0 or 1
@@ -149,7 +153,7 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
149153
m_millisToSleepBeforePollForChanges = read_config_setting(TEXT("millis_to_sleep_between_poll_for_dedupe_changes"), 10, true);
150154

151155
wchar_t out[10000];
152-
swprintf(out, 10000, L"default/from reg read config as: %dx%d -> %dx%d (%d top %d bottom %d l %d r) %dfps, dedupe? %d, millis between dedupe polling %d, m_bReReadRegistry? %d hwnd:%d \n",
156+
swprintf(out, 10000, L"default/from reg got config as: %dx%d -> %dx%d (%d top %d bottom %d l %d r) %dfps, dedupe? %d, millis between dedupe polling %d, m_bReReadRegistry? %d hwnd:%d \n",
153157
m_iCaptureConfigHeight, m_iCaptureConfigWidth, getCaptureDesiredFinalHeight(), getCaptureDesiredFinalWidth(), m_rCaptureCoordinates.top, m_rCaptureCoordinates.bottom, m_rCaptureCoordinates.left, m_rCaptureCoordinates.right, config_max_fps, m_bDeDupe, m_millisToSleepBeforePollForChanges, m_bReReadRegistry, m_iHwndToTrack);
154158

155159
// warmup the debugging message system
@@ -277,7 +281,7 @@ HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
277281
// the swprintf costs like 0.04ms (25000 fps LOL)
278282
double m_fFpsSinceBeginningOfTime = ((double) m_iFrameNumber)/(GetTickCount() - globalStart)*1000;
279283
swprintf(out, L"done video frame! total frames: %d this one %dx%d -> (%dx%d) took: %.02Lfms, %.02f ave fps (%.02f is the theoretical max fps based on this round, ave. possible fps %.02f, fastest round fps %.02f, negotiated fps %.06f), frame missed %d",
280-
m_iFrameNumber, m_iCaptureConfigHeight, m_iCaptureConfigWidth, getNegotiatedFinalWidth(), getNegotiatedFinalHeight(), millisThisRoundTook, m_fFpsSinceBeginningOfTime, 1.0*1000/millisThisRoundTook,
284+
m_iFrameNumber, m_iCaptureConfigWidth, m_iCaptureConfigHeight, getNegotiatedFinalWidth(), getNegotiatedFinalHeight(), millisThisRoundTook, m_fFpsSinceBeginningOfTime, 1.0*1000/millisThisRoundTook,
281285
/* average */ 1.0*1000*m_iFrameNumber/sumMillisTook, 1.0*1000/fastestRoundMillis, GetFps(), countMissed);
282286
LocalOutput(out);
283287
set_config_string_setting(L"frame_stats", out);
@@ -594,11 +598,11 @@ HRESULT CPushPinDesktop::DecideBufferSize(IMemAllocator *pAlloc,
594598
GetVersionEx((LPOSVERSIONINFO)&version);
595599
if(version.dwMajorVersion >= 6) { // meaning vista +
596600
if(read_config_setting(TEXT("disable_aero_for_vista_plus_if_1"), 0, true) == 1) {
597-
printf("turning aero off/disabling aero");
601+
LocalOutput("turning aero off/disabling aero");
598602
turnAeroOn(false);
599603
}
600604
else {
601-
printf("leaving aero on");
605+
LocalOutput("leaving aero on");
602606
turnAeroOn(true);
603607
}
604608
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)