@@ -79,8 +79,12 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
79
79
80
80
// Get the dimensions of the capture thing-er
81
81
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 ;
84
88
85
89
// now read some custom settings...
86
90
WarmupCounter ();
@@ -122,7 +126,7 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
122
126
m_iCaptureConfigHeight = m_rCaptureCoordinates.bottom - m_rCaptureCoordinates.top ;
123
127
ASSERT_RAISE (m_iCaptureConfigHeight > 0 );
124
128
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...
126
130
m_iStretchToThisConfigWidth = read_config_setting (TEXT (" stretch_to_width" ), 0 , false );
127
131
m_iStretchToThisConfigHeight = read_config_setting (TEXT (" stretch_to_height" ), 0 , false );
128
132
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)
149
153
m_millisToSleepBeforePollForChanges = read_config_setting (TEXT (" millis_to_sleep_between_poll_for_dedupe_changes" ), 10 , true );
150
154
151
155
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 " ,
153
157
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);
154
158
155
159
// warmup the debugging message system
@@ -277,7 +281,7 @@ HRESULT CPushPinDesktop::FillBuffer(IMediaSample *pSample)
277
281
// the swprintf costs like 0.04ms (25000 fps LOL)
278
282
double m_fFpsSinceBeginningOfTime = ((double ) m_iFrameNumber)/(GetTickCount () - globalStart)*1000 ;
279
283
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,
281
285
/* average */ 1.0 *1000 *m_iFrameNumber/sumMillisTook, 1.0 *1000 /fastestRoundMillis, GetFps (), countMissed);
282
286
LocalOutput (out);
283
287
set_config_string_setting (L" frame_stats" , out);
@@ -594,11 +598,11 @@ HRESULT CPushPinDesktop::DecideBufferSize(IMemAllocator *pAlloc,
594
598
GetVersionEx ((LPOSVERSIONINFO)&version);
595
599
if (version.dwMajorVersion >= 6 ) { // meaning vista +
596
600
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" );
598
602
turnAeroOn (false );
599
603
}
600
604
else {
601
- printf (" leaving aero on" );
605
+ LocalOutput (" leaving aero on" );
602
606
turnAeroOn (true );
603
607
}
604
608
}
0 commit comments