Update: use PowerShell script PythonEmbed4Win.ps1.
The instructions in this gist have some subtle problems and this gist will not be updated.
The instructions in this gist have some subtle problems and this gist will not be updated.
| #pragma once | |
| #include <thread> | |
| #include <google/protobuf/message.h> | |
| #include <grpcpp/grpcpp.h> | |
| #include <grpcpp/alarm.h> | |
| #include <logger.h> |
| // Windows | |
| // g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan-1 | |
| // Linux | |
| // g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan | |
| // https://vulkan-tutorial.com/ | |
| #include <iostream> | |
| using namespace std; | |
| #include <SDL2/SDL.h> |
| #include "screengrab.h" | |
| void capture() | |
| { | |
| CComPtr<ID3D11Device> pDevice; | |
| CComPtr<IDXGIOutputDuplication> pDeskDupl; | |
| //(...)create devices and duplication interface etc here.. | |
| DXGI_OUTDUPL_DESC OutputDuplDesc; |
| // public domain | |
| // | |
| // algorithm adopted from: | |
| // https://dspguru.com/dsp/tricks/fixed-point-atan2-with-self-normalization/ | |
| // | |
| // when ran without arguments, it simply calculates the maximum error between | |
| // the functions below and atan2f | |
| // | |
| // it tests all (x,y) values from -100.00 to +100.00 | |
| // |
| #include <string.h> | |
| #include <gst/gst.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| // v4l2src ! tee name=t t. ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 t. ! videoconvert ! autovideosink | |
| static GMainLoop *loop; | |
| static GstElement *pipeline, *src, *tee, *encoder, *muxer, *filesink, *videoconvert, *videosink, *queue_record, *queue_display; |
| #include <tuple> | |
| #include <type_traits> | |
| #include <cassert> | |
| template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int); | |
| template <class, class...> std::false_type test_is_braces_constructible(...); | |
| template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0)); | |
| struct any_type { | |
| template<class T> |
| #include <stdio.h> | |
| #include <windows.h> | |
| #include <gdiplus.h> | |
| #include <time.h> | |
| int GetEncoderClsid(const WCHAR* format, CLSID* pClsid) { | |
| using namespace Gdiplus; | |
| UINT num = 0; | |
| UINT size = 0; |
| #include <iostream> | |
| // This is a rewrite and analysis of the technique in this article: | |
| // http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html | |
| // ------- Framework ------- | |
| // The little library required to work this magic | |
| // Generate a static data member of type Tag::type in which to store | |
| // the address of a private member. It is crucial that Tag does not |