Skip to content

Instantly share code, notes, and snippets.

View yashi's full-sized avatar

Yasushi SHOJI yashi

View GitHub Profile
#include <SDL.h>
int main()
{
int ret;
SDL_Window *w1, *w2;
Uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
int i, j;
ret = SDL_Init(SDL_INIT_VIDEO);
#include <SDL.h>
int main()
{
int ret;
SDL_Window *w;
SDL_Event e;
int done = 0;
ret = SDL_Init(SDL_INIT_VIDEO);
@yashi
yashi / gist:759ace2a249e75d2ca18
Created November 11, 2014 06:04
Appending GstBuffers
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gstreamer-1.0) a.c" -*- */
#include <gst/gst.h>
void dump_buf(GstBuffer *buf)
{
gsize max;
gsize bufsize;
gsize offset;
bufsize = gst_buffer_get_sizes(buf, &offset, &max);
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gio-2.0) transfer-full-out.c" -*- */
#include <gio/gio.h>
#include <stdio.h>
int main()
{
GFile *file;
char *buf;
gsize len;
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gio-2.0) transfer-full-in.c" -*- */
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
void *buf;
gsize len;
GBytes *bytes;
#+Title: test for unordered list
#+OPTIONS: author:nil creator:nil timestamp:nil
* lists
- element 1
- element 2
- else
diff --git a/ceu2rtp.c b/ceu2rtp.c
index 17c43d5..18efc86 100644
--- a/ceu2rtp.c
+++ b/ceu2rtp.c
@@ -50,7 +50,7 @@ enum {
#define DEFAULT_FRAME_RATE_RESOLUTION (30)
#define DEFAULT_FRAME_RATE_TICK (1)
#define DEFAULT_MAX_GOP_LENGTH (30)
-#define DEFAULT_B_PIC_MODE (3)
+#define DEFAULT_B_PIC_MODE GST_ACMH264ENC_B_PIC_MODE_0_B_PIC
@yashi
yashi / gist:2430822
Created April 20, 2012 18:16
define SIZEOF_ST_INDEX_T
diff --git a/src/st.c b/src/st.c
index c4bbc70..49ef31b 100644
--- a/src/st.c
+++ b/src/st.c
@@ -963,6 +963,8 @@ strhash(st_data_t arg)
#define MURMUR 2
#endif
+#define SIZEOF_ST_INDEX_T __WORDSIZE
+
@yashi
yashi / gist:2433311
Created April 21, 2012 02:21
mruby ritevm instruction format
/* instructions OP:A:B:C = 7:9:9:7 (32 bits) */
/* OP:A:Bx = 7:9:16 */
/* OP:Ax = 7:25 */
enum {
OP_NOP=0,/* */
OP_MOVE,/* A B R(A) := R(B) */
OP_LOADL,/* A Bx R(A) := Lit(Bx) */
OP_LOADI,/* A sBx R(A) := sBx */
OP_LOADSYM,/* A Bx R(A) := Sym(Bx) */
OP_LOADNIL,/* A R(A) := nil */
OP_LOADSELF,/* A R(A) := self */
OP_LOADT,/* A R(A) := true */
OP_LOADF,/* A R(A) := false */