Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin Jae-yeon committed May 11, 2017
1 parent 7da3bda commit 608d9f5
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 23 deletions.
4 changes: 2 additions & 2 deletions DaramCam.Test/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main ( void )
hWnd = DCGetActiveWindowFromProcess ( process );*/

///// Image Capture
/*SHCreateStreamOnFileEx ( TEXT ( "Z:\\Test.png" ), STGM_READWRITE | STGM_CREATE, 0, false, 0, &stream );
/**/SHCreateStreamOnFileEx ( TEXT ( "Z:\\Test.png" ), STGM_READWRITE | STGM_CREATE, 0, false, 0, &stream );

//DCScreenCapturer * screenCapturer = new DCCreateGDIScreenCapturer ( hWnd );
//DCScreenCapturer * screenCapturer = DCCreateGDIScreenCapturer ( 0 );
Expand Down Expand Up @@ -71,7 +71,7 @@ int main ( void )
delete screenCapturer;/**/

///// Audio Capture
/**/
/*
std::vector<CComPtr<IMMDevice>> devices;
DCGetMultimediaDevices ( devices );
Expand Down
2 changes: 0 additions & 2 deletions DaramCam/DaramCam.DXGIScreenCapturer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ DCDXGIScreenCapturer::DCDXGIScreenCapturer ( DCDXGIScreenCapturerRange range )
RECT outputRect;
dxgiManager->GetOutputRect ( outputRect );
capturedBitmap.Resize ( outputRect.right - outputRect.left, outputRect.bottom - outputRect.top, 4 );

Capture ();
}

DCDXGIScreenCapturer::~DCDXGIScreenCapturer ()
Expand Down
10 changes: 10 additions & 0 deletions DaramCam/DaramCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#pragma comment ( lib, "Kernel32.lib" )
#pragma comment ( lib, "Psapi.lib" )

#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment ( lib, "GdiPlus.lib" )

ULONG_PTR g_gdiplusToken;
IWICImagingFactory * g_piFactory;

void DCStartup ()
Expand All @@ -20,6 +25,9 @@ void DCStartup ()

CoInitializeEx ( NULL, COINIT_APARTMENTTHREADED );

GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup ( &g_gdiplusToken, &gdiplusStartupInput, NULL );

CoCreateInstance ( CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, ( LPVOID* ) &g_piFactory );
}

Expand All @@ -28,6 +36,8 @@ void DCShutdown ()
if ( g_piFactory )
g_piFactory->Release ();

GdiplusShutdown ( g_gdiplusToken );

CoUninitialize ();
}

Expand Down
13 changes: 1 addition & 12 deletions DaramCam/External Libraries/DXGIManager/DXGIManager.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "DXGIManager.h"
#include <gdiplus.h>

#pragma comment ( lib, "GdiPlus.lib" )
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment ( lib, "d3d11.lib" )

Expand Down Expand Up @@ -183,7 +182,6 @@ DXGIManager::DXGIManager()

DXGIManager::~DXGIManager()
{
GdiplusShutdown(m_gdiplusToken);

if(m_pBuf)
{
Expand Down Expand Up @@ -285,9 +283,6 @@ HRESULT DXGIManager::Init()
if(m_bInitialized)
return S_OK;

GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);

HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)(&m_spDXGIFactory1) );
if( FAILED(hr) )
{
Expand Down Expand Up @@ -361,12 +356,6 @@ HRESULT DXGIManager::Init()
}
}

hr = m_spWICFactory.CoCreateInstance(CLSID_WICImagingFactory);
if( FAILED(hr) )
{
return hr;
}

m_bInitialized = true;

return S_OK;
Expand Down
3 changes: 0 additions & 3 deletions DaramCam/External Libraries/DXGIManager/DXGIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <DXGITYPE.h>
#include <DXGI1_2.h>
#include <d3d11.h>
#include <Wincodec.h>
#include <vector>
#include <memory>

Expand Down Expand Up @@ -86,7 +85,5 @@ class DXGIManager
RECT m_rcCalcedRect;
BYTE* m_pBuf;

CComPtr<IWICImagingFactory> m_spWICFactory;
ULONG_PTR m_gdiplusToken;
DXGIPointerInfo* m_pDXGIPointer;
};
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# DaramCam
Screen Capturing and Recording Library for Windows

## Current Support Capturers
## Current Supports
### Current Support Capturers
* GDI Screen Capturer (per Window)
* DXGI 1.2 Screen Capturer (per Display)
* WASAPI Audio Capturer (Loopback, Microphone, Line-In, What U Hear, ...)

## Current Support Generators
### Current Support Generators
* Windows Imaging Components Image Generator (BMP, PNG, JPEG, TIFF)
* Windows Imaging Components Video Generator (GIF)
* Wave Audio Generator (WAV)

## Will Supports
### Will Support Capturers
* DirectShow Device Capturer (WebCam, TV Receive Card, ...) for Windows N/KN
* Media Foundation Device Capturer (WebCam, ...)
* Custom Screen Maker (Watermark, Overlay Camera, ...)
* Multiple Audio Mixer (What U Hear + Microphone + ...)

### Will Support Generators
* Matroska Video (H.264) Generator (MKV)
* Matroska Audio (AAC) Generator (MKA)
* MPEG-4 Video (H.264) Generator (MP4, M4V)
* MPEG-4 Audio (AAC) Generator (M4A)
* MPEG-1 Layer-3 Audio Generator (MP3)
* Opus Audio Generator (OPUS)

## Licenses
* DaramCam Core - MIT License
* DXGIManager - MIT License, Not my Original source (https://github.com/pgurenko/DXGICaptureSample)
* DaramCam Core - MIT License.
* DXGIManager - MIT License, Not my Original source, code from [DXGI Capture Sample Repository](https://github.com/pgurenko/DXGICaptureSample).
* WASAPI Audio Capturer - Some source code from [Matthew van Eerde's Blog Repository](https://github.com/mvaneerde/blog/tree/master/loopback-capture).
* WIC Video Generator - Some source code from [PiXCL Automation Technologies's WIC and Animated GIF Files](http://pixcl.com/WIC-and-Animated-GIF-Files.htm).

0 comments on commit 608d9f5

Please sign in to comment.