Skip to content

Commit bf0c088

Browse files
committed
0.3.2 beta 1
Lots of internal changes after TODO cleanups, nothing major.
1 parent 018f5ec commit bf0c088

23 files changed

+302
-172
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
Next (0.3.2)
1+
0.3.2
22
- Most throws now lead to error popup
3-
- Using VP design icon
43
- keyboard shortcut added for renderer reset (r)
54
- Renderer can now be selected by command line option /renderer, example: /renderer "DirectShow - Video Renderer"
65
- Command line options /renderer [name] and /fullscreen together now immediately leads to fullscreen again (fire-and-forget)
76
- Extended the DirectShow start-stop options to include non-stop and smart selection options
8-
- Windowed video window black background and logo
7+
- Using VP design icon
8+
- Windowed video window now has black background and logo
9+
- The renderer used now self-identifies in a static so that the user knows what's under the hood
10+
- Internal cleanups
911

1012
0.3.1
1113
- Default frame timing changed to clock+theo as multiple users reported blips in clock-clock

TODO.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
Roadmap
22
=======
33

4-
0.3.2: GUI
5-
- Cleanup TODOs
6-
- If the blackmagic capture thread throws that's never shown a new one is spun up silently, try-catch external calls, make errors visible
7-
- If the CAM thread throws that's never shown, make errors visible
8-
- invertedVertical from the blackmagic not used because it's inverted?!?
9-
- Let the chosen renderer id itself in the GUI
10-
11-
0.4.0: Interlaced support & upscaling
4+
0.4.0: Upscaling
125
- Change display modes to be real frame interval and display interval
13-
- Support for interlaced formats
6+
- Change pixelformat to be something between that and an encoding format?
7+
- Add support for interlaced formats (but no testing or further plumbing)
148
- Optionally force YCbCr422 to YCbCr420 so that the renderer can do the upscaling
159

1610
1.0.0: Out of beta
@@ -25,7 +19,7 @@ Roadmap
2519
- Cropping-zoom in y and x dimensions
2620
- Auto shifting (hwf)
2721

28-
Ideas for later:
22+
Stuff & ideas to do for later:
2923
- Integrate MPV renderer (that would be a non-DirectShow renderer, so quite some plumbing required)
3024
- CaptureInput as a first-class citizen rather than a POD (rename to capture device input?)
3125
- Toggelable HDCP on video output through the win32 Output Protection Manager
@@ -37,4 +31,13 @@ Ideas for later:
3731
constant we can probably get a near constant-time renderer going.
3832
- Build a git version to version.rc generator and use that to set VS_VERSION_INFO version etc
3933
- Make group names clickable and open help page
40-
- Add menu bar with help link
34+
- Add menu bar with help link
35+
- Support for interlaced modes (don't have hardware which does this)
36+
- If the blackmagic capture thread throws that's never shown a new one is spun up silently, try-catch external calls, make errors visible
37+
- If the CAM thread throws that's never shown, make errors visible
38+
- Replace GDI drawing with MFC
39+
- Clean up all TODOs
40+
41+
Can't fix:
42+
- DeckLink cannot handle 12bit YUV
43+
- DeckLink forces YUV 444 to 422

src/CCie1931Control.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ BEGIN_MESSAGE_MAP(CCie1931Control, CStatic)
2020
END_MESSAGE_MAP()
2121

2222

23+
CCie1931Control::CCie1931Control()
24+
{
25+
m_cie1931xyBmp = (HBITMAP)LoadImage(
26+
GetModuleHandle(nullptr), MAKEINTRESOURCE(IDB_CIE1931XY),
27+
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
28+
29+
if (!m_cie1931xyBmp)
30+
throw std::runtime_error("Failed to load CIE1931XY bitmap");
31+
}
32+
33+
34+
CCie1931Control::~CCie1931Control()
35+
{
36+
DeleteObject(m_cie1931xyBmp);
37+
}
38+
39+
2340
void CCie1931Control::SetColorSpace(ColorSpace colorSpace)
2441
{
2542
m_colorSpace = colorSpace;
@@ -36,23 +53,6 @@ void CCie1931Control::SetHDRData(std::shared_ptr<HDRData> hdrData)
3653

3754
void CCie1931Control::OnPaint(void)
3855
{
39-
// TODO: This is using the GDI, probably also possible though MFC
40-
41-
// Load bitmap on first use
42-
// TODO: Figure how to get OnCreate() called here. Apparently not happening because this is a custom widget which
43-
// is hook up to the resource generated magic something. Destructors also not allowed. So nevermind and just leak
44-
// for now until I can be arsed to figure it out.
45-
// details: https://social.msdn.microsoft.com/Forums/en-US/c659741c-5330-406d-92c7-c089a48872ff/ccustomcontroloncreate-not-called?forum=vcgeneral
46-
if (!m_cie1931xyBmp)
47-
{
48-
m_cie1931xyBmp = (HBITMAP)LoadImage(
49-
GetModuleHandle(nullptr), MAKEINTRESOURCE(IDB_CIE1931XY),
50-
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
51-
52-
if (!m_cie1931xyBmp)
53-
throw std::runtime_error("Failed to load CIE1931XY bitmap");
54-
}
55-
5656
//
5757
// Figure out usable rectangle and where to draw
5858
//

src/CCie1931Control.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class CCie1931Control:
2323
{
2424
public:
2525

26+
CCie1931Control();
27+
virtual ~CCie1931Control();
28+
2629
// Set colorspace
2730
void SetColorSpace(ColorSpace);
2831

src/FullscreenWindow.cpp renamed to src/FullscreenVideoWindow.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include <stdafx.h>
1010

11-
#include "FullscreenWindow.h"
11+
#include "FullscreenVideoWindow.h"
1212

1313

14-
FullscreenWindow::FullscreenWindow()
14+
FullscreenVideoWindow::FullscreenVideoWindow()
1515
{
1616
}
1717

1818

19-
FullscreenWindow::~FullscreenWindow()
19+
FullscreenVideoWindow::~FullscreenVideoWindow()
2020
{
2121
if (m_hwnd)
2222
{
@@ -26,21 +26,21 @@ FullscreenWindow::~FullscreenWindow()
2626
}
2727

2828

29-
LRESULT CALLBACK FullscreenWindow::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
29+
LRESULT CALLBACK FullscreenVideoWindow::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
3030
{
31-
FullscreenWindow* pThis = nullptr;
31+
FullscreenVideoWindow* pThis = nullptr;
3232

3333
if (uMsg == WM_NCCREATE)
3434
{
3535
CREATESTRUCT* pCreate = (CREATESTRUCT*)lParam;
36-
pThis = (FullscreenWindow*)pCreate->lpCreateParams;
36+
pThis = (FullscreenVideoWindow*)pCreate->lpCreateParams;
3737
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pThis);
3838

3939
pThis->m_hwnd = hwnd;
4040
}
4141
else
4242
{
43-
pThis = (FullscreenWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
43+
pThis = (FullscreenVideoWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
4444
}
4545

4646
if (pThis)
@@ -51,15 +51,15 @@ LRESULT CALLBACK FullscreenWindow::WindowProc(HWND hwnd, UINT uMsg, WPARAM wPara
5151
}
5252

5353

54-
void FullscreenWindow::Create(HMONITOR hmon, HWND parentWindow)
54+
void FullscreenVideoWindow::Create(HMONITOR hmon, HWND parentWindow)
5555
{
5656
//
5757
// Register the window class
5858
//
5959

6060
WNDCLASS wc = { 0 };
6161

62-
wc.lpfnWndProc = FullscreenWindow::WindowProc;
62+
wc.lpfnWndProc = FullscreenVideoWindow::WindowProc;
6363
wc.hInstance = GetModuleHandle(nullptr);
6464
wc.lpszClassName = FULLSCREEN_WINDOW_CLASS_NAME;
6565

@@ -73,9 +73,9 @@ void FullscreenWindow::Create(HMONITOR hmon, HWND parentWindow)
7373
if (!GetMonitorInfo(hmon, &mi))
7474
throw std::runtime_error("Failed to get monitor info");
7575

76-
// When debugging it's REALLY handy to not cover the whole screen and capture key inputs...
7776
LONG width = mi.rcMonitor.right - mi.rcMonitor.left;
7877
#ifdef _DEBUG
78+
// When debugging it's REALLY handy to not cover the whole screen and capture key inputs...
7979
width = width / 5;
8080
#endif
8181

@@ -98,7 +98,7 @@ void FullscreenWindow::Create(HMONITOR hmon, HWND parentWindow)
9898
}
9999

100100

101-
LRESULT __forceinline FullscreenWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
101+
LRESULT __forceinline FullscreenVideoWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
102102
{
103103
switch (uMsg)
104104
{

src/HDRData.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ bool HDRData::operator == (const HDRData& other) const
2828
CieEquals(whitePointX, other.whitePointX) &&
2929
CieEquals(whitePointY, other.whitePointY) &&
3030

31-
// TODO: Make dedicated luminance comparators
32-
fabs(masteringDisplayMaxLuminance-other.masteringDisplayMaxLuminance) < 0.0001 &&
33-
fabs(masteringDisplayMinLuminance-other.masteringDisplayMinLuminance) < 0.0001 &&
31+
LumenEqual(masteringDisplayMaxLuminance, other.masteringDisplayMaxLuminance) &&
32+
LumenEqual(masteringDisplayMinLuminance, other.masteringDisplayMinLuminance) &&
3433

35-
fabs(maxCll-other.maxCll) < 0.0001 &&
36-
fabs(maxFall-other.maxFall) < 0.0001;
34+
LumenEqual(maxCll, other.maxCll) &&
35+
LumenEqual(maxFall, other.maxFall);
3736
}
3837

3938

@@ -59,3 +58,9 @@ bool HDRData::IsValid() const
5958
maxCll > 0 &&
6059
maxFall > 0;
6160
}
61+
62+
63+
bool LumenEqual(double a, double b)
64+
{
65+
return fabs(a - b) < 0.00001;
66+
}

src/HDRData.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ class HDRData
4242

4343

4444
typedef std::shared_ptr<HDRData> HDRDataSharedPtr;
45+
46+
47+
// Check if 2 lumen values are effectively equal
48+
bool LumenEqual(double a, double b);

src/IRenderer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ struct IRendererCallback
3939
// Note that this will be synchronous with calls to the renderer. No external thread
4040
// will cause calls. Most likely this will be a result of OnWindowsEvent() and Stop() handling.
4141
virtual void OnRendererState(RendererState rendererState) = 0;
42+
43+
// The renderer can report a human-readable string to say what it's doing
44+
// No need to do anything but just display.
45+
virtual void OnRendererDetailString(const CString& details) = 0;
4246
};
4347

4448

src/RendererId.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright(C) 2021 Dennis Fleurbaaij <mail@dennisfleurbaaij.com>
3+
*
4+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
5+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
6+
* You should have received a copy of the GNU General Public License along with this program. If not, see < https://www.gnu.org/licenses/>.
7+
*/
8+
9+
10+
#include <stdafx.h>
11+
12+
#include "RendererId.h"
13+
14+
15+
bool RendererId::operator< (const RendererId& other) const {
16+
return name < other.name;
17+
}

src/RendererId.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright(C) 2021 Dennis Fleurbaaij <mail@dennisfleurbaaij.com>
3+
*
4+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
5+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
6+
* You should have received a copy of the GNU General Public License along with this program. If not, see < https://www.gnu.org/licenses/>.
7+
*/
8+
9+
#pragma once
10+
11+
12+
/*
13+
* Identifies a renderer by GUID.
14+
* Works great for DirectShow, but will need revising once we get away from it.
15+
*/
16+
struct RendererId
17+
{
18+
CString name;
19+
GUID guid;
20+
21+
bool operator< (const RendererId& other) const;
22+
};

0 commit comments

Comments
 (0)