Skip to content

Instantly share code, notes, and snippets.

Avatar

Roger Pack rdp

View GitHub Profile
View cdio.diff
diff --git a/cross_compile_ffmpeg.sh b/cross_compile_ffmpeg.sh
index 1231d6c..f59244d 100755
--- a/cross_compile_ffmpeg.sh
+++ b/cross_compile_ffmpeg.sh
@@ -805,6 +805,10 @@ build_libtiff() {
sed -i.bak 's/-ltiff.*$/-ltiff -llzma -ljpeg -lz/' $PKG_CONFIG_PATH/libtiff-4.pc # static deps
}
+build_libcdio() {
+ generic_download_and_make_and_install http://git.savannah.gnu.org/cgit/libcdio.git/snapshot/libcdio-release-2.1.0.tar.gz
View windows_screen_capture_bmp.cpp
// compile this like g++ go2.c -lgdi32 [if you're using mingw]
#include <windows.h>
#include <stdio.h>
// Helper function to retrieve current position of file pointer:
inline int GetFilePointer(HANDLE FileHandle){
return SetFilePointer(FileHandle, 0, 0, FILE_CURRENT);
}
//---------------------------------------------------------------------------
View send_ctrl_c.c
// attribution: http://stackoverflow.com/a/15281070/32453
// you can compile this with gcc [mingw or mingw-w64] and probably other compilers as well
#include <stdlib.h> // NULL
#include <stdbool.h> // false
#include <windows.h> // AttachConsole, CTRL_C_EVENT, etc.
#include <stdio.h> // printf
#include <strsafe.h>
void logLastError()
@rdp
rdp / Temp.java
Last active Jul 12, 2020
Not use all RAM for larger select queries postgres (example code)
View Temp.java
import java.sql.*;
/**
* Example code for showing how to use raw postgres cursors to read chunked
* from the psql source converted to java
* <p>
* To run the demo:
* $ psql
* CREATE TABLE DOCUMENT_TEMPLATE(
View find_html5_video.js
// attempt to fidn the first <video ... tag on the page:
function findFirstVideoTag() {
var all = document.getElementsByTagName("video");
if (all.length > 0)
return all[0];
else {
// iframes
var i, frames;
frames = document.getElementsByTagName("iframe");
View ffmpeg_vbi_cc.diff
diff --git a/configure b/configure
index 080d93a129..86bdb73dc7 100755
--- a/configure
+++ b/configure
@@ -2681,6 +2681,9 @@ bink_decoder_select="blockdsp hpeldsp"
binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
+ccaption_raw_608_decoder_select="ccaption_decoder"
clearvideo_decoder_select="idctdsp"
View me.diff
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index d7f5bd7..afd8cef 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -716,9 +716,9 @@ dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum,
if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, &device_filter, &device_unique_name)) < 0)
return r;
ctx->device_filter[devtype] = device_filter;
+ ctx->device_unique_name[devtype] = device_unique_name;
if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, NULL)) < 0)
View ffmpeg crash
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index d7f5bd7..afd8cef 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -716,9 +716,9 @@ dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum,
if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, &device_filter, &device_unique_name)) < 0)
return r;
ctx->device_filter[devtype] = device_filter;
+ ctx->device_unique_name[devtype] = device_unique_name;
if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, NULL)) < 0)
@rdp
rdp / crc32er.rb
Last active Mar 24, 2020
crc32c for ruby
View crc32er.rb
require 'digest/crc32c' # gem install digest-crc
p 'syntax: something to get digested! [output it with trailing 4 byte digest, in ruby string syntax]'
checksum = Digest::CRC32c.checksum(ARGV[0])
p checksum
out = ARGV[0].dup.bytes # assume it starts ascii :|
for n in [24, 16, 8, 0]
next_byte = (checksum >> n & 0xff)
out << next_byte
p "x%x" % next_byte
end
View gist:810398
// enum.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cstdio>
#include <cstring>
#include <windows.h>
#include <comcat.h>
You can’t perform that action at this time.