Skip to content

Instantly share code, notes, and snippets.

@rcolinray
rcolinray / gl_ffmpeg.cpp
Created November 19, 2013 20:54
OpenGL-FFMpeg integration
// Use OpenGL 3.0+, but don't use GLU
#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
extern "C" {
@roxlu
roxlu / H264_Decoder.cpp
Created March 3, 2014 16:57
LibAV parser and decoder example with openGL (YUV420 -> RGB shader).
#include "H264_Decoder.h"
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user)
:codec(NULL)
,codec_context(NULL)
,parser(NULL)
,fp(NULL)
,frame(0)
,cb_frame(frameCallback)
,cb_user(user)
@awwsmm
awwsmm / regex_MicrosoftCSV.md
Last active August 2, 2023 03:36
Regex for parsing Microsoft-style CSV data

Parse Microsoft-style CSV data with regex

Background

CSV (comma-separated values) files organise their data by separating them with newlines and commas. If a desired piece of data, say a string of text, itself contains a comma, then this string must be surrounded by double quotes:

5,7,8 -- three values

"5,7",8 -- two values

@damianh
damianh / CookieMessageHandler.cs
Created April 28, 2018 11:43
HttpMessageHandler for dealing with cookies in requests.
public class CookieMessageHandler : DelegatingHandler
{
private readonly CookieContainer _cookies = new CookieContainer();
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("Cookie", _cookies.GetCookieHeader(request.RequestUri));
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
@RomiTT
RomiTT / RGB_DEFAULT.hlsl
Last active January 11, 2024 12:38
YUV to RGB HLSL Shaders - DirectX 11
//-----------------------------------------------------------
// YUV TO RGB BT.601 For SD TV
//-----------------------------------------------------------
cbuffer PS_CONSTANT_BUFFER : register(b0)
{
float Opacity;
float ignoreA;
float ignoreB;
float ignoreC;