Skip to content

Commit

Permalink
Release 1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagailo committed Jul 17, 2018
1 parent 71a407e commit cd53f20
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 261 deletions.
6 changes: 3 additions & 3 deletions RTSSCustomOSD/AssemblyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ using namespace System::Security::Permissions;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("RTSS")];
[assembly:AssemblyTitleAttribute("RTSSSharedMemoryNET")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("")];
[assembly:AssemblyProductAttribute("RTSS")];
[assembly:AssemblyCopyrightAttribute("Copyright (c)")];
[assembly:AssemblyProductAttribute("RTSSSharedMemoryNET")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) Spencer Hakim 2014")];

This comment has been minimized.

Copy link
@vyshka

vyshka Jul 17, 2018

This row is very questionable

This comment has been minimized.

Copy link
@Jagailo

Jagailo Jul 17, 2018

Author Owner

But why? I use this custom OSD for RTSS.
According to the license of LGPL-3.0, on which this library is distributed, I have the right to use this library even for commercial purposes, but copyrights must be specified. I didn't remove the copyright in the code and added a link in the README.md to the author's repository.

This comment has been minimized.

Copy link
@Jagailo
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];

Expand Down
76 changes: 0 additions & 76 deletions RTSSCustomOSD/EncoderPluginTypes.h

This file was deleted.

100 changes: 1 addition & 99 deletions RTSSCustomOSD/OSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define TICKS_PER_MICROSECOND 10
#define RTSS_VERSION(x, y) ((x << 16) + y)

namespace RTSS {
namespace RTSSSharedMemoryNET {

///<param name="entryName">
///The name of the OSD entry. Should be unique and not more than 255 chars once converted to ANSI.
Expand Down Expand Up @@ -79,104 +79,6 @@ namespace RTSS {
return ver;
}

DWORD OSD::EmbedGraphArray(DWORD dwOffset, FLOAT lpBuffer, DWORD dwBufferPos, DWORD dwBufferSize, LONG dwWidth, LONG dwHeight, LONG dwMargin, FLOAT fltMin, FLOAT fltMax, DWORD dwFlags)
{
return EmbedGraph(dwOffset, &lpBuffer, dwBufferPos, dwBufferSize, dwWidth, dwHeight, dwMargin, fltMin, fltMax, dwFlags);
}

/////////////////////////////////////////////////////////////////////////////
DWORD OSD::EmbedGraph(DWORD dwOffset, FLOAT* lpBuffer, DWORD dwBufferPos, DWORD dwBufferSize, LONG dwWidth, LONG dwHeight, LONG dwMargin, FLOAT fltMin, FLOAT fltMax, DWORD dwFlags)
{
DWORD dwResult = 0;

HANDLE hMapFile = NULL;
LPRTSS_SHARED_MEMORY pMem = NULL;
openSharedMemory(&hMapFile, &pMem);

if (hMapFile)
{
LPVOID pMapAddr = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
LPRTSS_SHARED_MEMORY pMem = (LPRTSS_SHARED_MEMORY)pMapAddr;

if (pMem)
{
for (DWORD dwPass = 0; dwPass<2; dwPass++)
//1st pass : find previously captured OSD slot
//2nd pass : otherwise find the first unused OSD slot and capture it
{
for (DWORD dwEntry = 1; dwEntry<pMem->dwOSDArrSize; dwEntry++)
//allow primary OSD clients (i.e. EVGA Precision / MSI Afterburner) to use the first slot exclusively, so third party
//applications start scanning the slots from the second one
{
auto pEntry = (RTSS_SHARED_MEMORY::LPRTSS_SHARED_MEMORY_OSD_ENTRY)((LPBYTE)pMem + pMem->dwOSDArrOffset + (dwEntry * pMem->dwOSDEntrySize));

if (dwPass)
{
if (!strlen(pEntry->szOSDOwner))
strcpy_s(pEntry->szOSDOwner, sizeof(pEntry->szOSDOwner), m_entryName);
}

if (!strcmp(pEntry->szOSDOwner, m_entryName))
{
if (pMem->dwVersion >= 0x0002000c)
//embedded graphs are supported for v2.12 and higher shared memory
{
if (dwOffset + sizeof(RTSS_EMBEDDED_OBJECT_GRAPH) + dwBufferSize * sizeof(FLOAT) > sizeof(pEntry->buffer))
//validate embedded object offset and size and ensure that we don't overrun the buffer
{
UnmapViewOfFile(pMapAddr);

CloseHandle(hMapFile);

return 0;
}

LPRTSS_EMBEDDED_OBJECT_GRAPH lpGraph = (LPRTSS_EMBEDDED_OBJECT_GRAPH)(pEntry->buffer + dwOffset);
//get pointer to object in buffer

lpGraph->header.dwSignature = RTSS_EMBEDDED_OBJECT_GRAPH_SIGNATURE;
lpGraph->header.dwSize = sizeof(RTSS_EMBEDDED_OBJECT_GRAPH) + dwBufferSize * sizeof(FLOAT);
lpGraph->header.dwWidth = dwWidth;
lpGraph->header.dwHeight = dwHeight;
lpGraph->header.dwMargin = dwMargin;
lpGraph->dwFlags = dwFlags;
lpGraph->fltMin = fltMin;
lpGraph->fltMax = fltMax;
lpGraph->dwDataCount = dwBufferSize;

if (lpBuffer && dwBufferSize)
{
for (DWORD dwPos = 0; dwPos<dwBufferSize; dwPos++)
{
FLOAT fltData = lpBuffer[dwBufferPos];

lpGraph->fltData[dwPos] = (fltData == 120) ? 0 : fltData;

dwBufferPos = (dwBufferPos + 1) & (dwBufferSize - 1);
}
}

dwResult = lpGraph->header.dwSize;
}

break;
}
}

if (dwResult)
break;
}


UnmapViewOfFile(pMapAddr);
}

closeSharedMemory(hMapFile, pMem);

}

return dwResult;
}
///<summary>
///Text should be no longer than 4095 chars once converted to ANSI. Lower case looks awful.
///</summary>
Expand Down
9 changes: 3 additions & 6 deletions RTSSCustomOSD/OSD.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// OSD.h

#pragma once

Expand All @@ -7,7 +8,7 @@ using namespace System;
using namespace System::Collections::Generic;
using namespace System::Runtime::InteropServices;

namespace RTSS {
namespace RTSSSharedMemoryNET {

public ref class OSD
{
Expand All @@ -26,11 +27,7 @@ namespace RTSS {
System::Version^ get();
}

DWORD EmbedGraphArray(DWORD dwOffset, FLOAT lpBuffer, DWORD dwBufferPos, DWORD dwBufferSize, LONG dwWidth, LONG dwHeight, LONG dwMargin, FLOAT fltMin, FLOAT fltMax, DWORD dwFlags);

DWORD EmbedGraph(DWORD dwOffset, FLOAT * lpBuffer, DWORD dwBufferPos, DWORD dwBufferSize, LONG dwWidth, LONG dwHeight, LONG dwMargin, FLOAT fltMin, FLOAT fltMax, DWORD dwFlags);

void Update(String^ text);
void Update(String^ text);
static array<OSDEntry^>^ GetOSDEntries();
static array<AppEntry^>^ GetAppEntries();

Expand Down
23 changes: 0 additions & 23 deletions RTSSCustomOSD/RTSSHooksTypes.h

This file was deleted.

43 changes: 1 addition & 42 deletions RTSSCustomOSD/RTSSSharedMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ typedef struct RTSS_SHARED_MEMORY

char szOSDEx[4096];
//extended OSD slot text
BYTE buffer[262144];

} RTSS_SHARED_MEMORY_OSD_ENTRY, *LPRTSS_SHARED_MEMORY_OSD_ENTRY;

//application descriptor structure
Expand Down Expand Up @@ -454,45 +454,4 @@ typedef struct RTSS_SHARED_MEMORY

} RTSS_SHARED_MEMORY, *LPRTSS_SHARED_MEMORY;
/////////////////////////////////////////////////////////////////////////////
typedef struct RTSS_EMBEDDED_OBJECT
{
DWORD dwSignature;
//embedded object signature
DWORD dwSize;
//embedded object size in bytes
LONG dwWidth;
//embedded object width in pixels (if positive) or in chars (if negative)
LONG dwHeight;
//embedded object height in pixels (if positive) or in chars (if negative)
LONG dwMargin;
//embedded object margin in pixels
} RTSS_EMBEDDED_OBJECT, *LPRTSS_EMBEDDED_OBJECT;
/////////////////////////////////////////////////////////////////////////////
#define RTSS_EMBEDDED_OBJECT_GRAPH_SIGNATURE 'GR00'
/////////////////////////////////////////////////////////////////////////////
#define RTSS_EMBEDDED_OBJECT_GRAPH_FLAG_FILLED 1
#define RTSS_EMBEDDED_OBJECT_GRAPH_FLAG_FRAMERATE 2
#define RTSS_EMBEDDED_OBJECT_GRAPH_FLAG_FRAMETIME 4
#define RTSS_EMBEDDED_OBJECT_GRAPH_FLAG_BAR 8
/////////////////////////////////////////////////////////////////////////////
#pragma warning (disable : 4200)

typedef struct RTSS_EMBEDDED_OBJECT_GRAPH
{
RTSS_EMBEDDED_OBJECT header;
//embedded object header

DWORD dwFlags;
//bitmask containing RTSS_EMBEDDED_OBJECT_GRAPH_FLAG_XXX flags
FLOAT fltMin;
//graph mininum value
FLOAT fltMax;
//graph maximum value
DWORD dwDataCount;
//count of data samples in fltData array
FLOAT fltData[0];
//graph data samples array

} RTSS_EMBEDDED_OBJECT_GRAPH, *LPRTSS_EMBEDDED_OBJECT_GRAPH;
/////////////////////////////////////////////////////////////////////////////
#endif //_RTSS_SHARED_MEMORY_INCLUDED_
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -21,9 +21,8 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{53939D64-D853-4B4C-A4F9-2FCE48502725}</ProjectGuid>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>RTSS</RootNamespace>
<RootNamespace>RTSSSharedMemoryNET</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<ProjectName>RTSS</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand All @@ -36,7 +35,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand All @@ -50,7 +49,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions RTSSCustomOSD/Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace System;
using namespace System::Drawing;
using namespace System::Diagnostics;

namespace RTSS {
namespace RTSSSharedMemoryNET {
[Flags]
public enum class AppFlags
{
Expand Down Expand Up @@ -44,6 +44,7 @@ namespace RTSS {
RequestCaptureProgress = VIDEOCAPTUREFLAG_REQUEST_CAPTURE_PROGRESS,
RequestCaptureStop = VIDEOCAPTUREFLAG_REQUEST_CAPTURE_STOP,
RequestCaptureOSD = VIDEOCAPTUREFLAG_REQUEST_CAPTURE_OSD,

INTERNAL_RESIZE = VIDEOCAPTUREFLAG_INTERNAL_RESIZE,
MASK = (VIDEOCAPTUREFLAG_REQUEST_CAPTURE_START | VIDEOCAPTUREFLAG_REQUEST_CAPTURE_PROGRESS | VIDEOCAPTUREFLAG_REQUEST_CAPTURE_STOP),
};
Expand Down Expand Up @@ -125,6 +126,4 @@ namespace RTSS {
Int64 AudioCapturePTTEventPush2; //2.6+
Int64 AudioCapturePTTEventRelease2; //2.6+
};


}
2 changes: 2 additions & 0 deletions RTSSCustomOSD/Utilities.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once

//http://stackoverflow.com/a/673336/489071
template <typename T>
public ref class using_auto_ptr
{
Expand Down
2 changes: 1 addition & 1 deletion YAKD.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YAKD", "YAKD\YAKD.csproj", "{76F40033-6E9A-4CE1-94E6-BC2C348C2BA2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTSS", "RTSSCustomOSD\RTSS.vcxproj", "{53939D64-D853-4B4C-A4F9-2FCE48502725}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTSSSharedMemoryNET", "RTSSCustomOSD\RTSSSharedMemoryNET.vcxproj", "{53939D64-D853-4B4C-A4F9-2FCE48502725}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion YAKD/Utils/RTSSHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RTSS;
using RTSSSharedMemoryNET;
using System;
using System.Diagnostics;
using System.IO;
Expand Down
Loading

0 comments on commit cd53f20

Please sign in to comment.