Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Claudio Costa streamer45

🏠
Working from home
  • Italy
View GitHub Profile
@streamer45
streamer45 / hw.py
Created Dec 27, 2012
Python HelloWorld for Krad!
View hw.py
#!/usr/bin/env python
# Hello Krad World Video in Python
from time import sleep
from kradradio_client import Kradradio
# Station name
station_name = "hellokrad"
station = Kradradio(station_name)
# Video resolution and frame rate
@streamer45
streamer45 / hw.py
Created Dec 27, 2012
HelloWorld for Krad in Python!
View hw.py
#!/usr/bin/env python
# Hello Krad World Video in Python
from time import sleep
from kradradio_client import Kradradio
# Station name
station_name = "hellokrad"
station = Kradradio(station_name)
# Video resolution and frame rate
View krad_radio_client.py
from time import sleep
import shlex
import subprocess
KRAD = "krad_radio"
class Kradradio:
def __init__(self, sysname):
self.sysname = sysname
def cmd(self, cmd):
View gist:4390833
from time import sleep
import shlex
import subprocess
KRAD = "krad_radio"
class Kradradio:
def __init__(self, sysname):
self.sysname = sysname
def cmd(self, cmd):
View gist:4390846
from time import sleep
import shlex
import subprocess
KRAD = "krad_radio"
class Kradradio:
def __init__(self, sysname):
self.sysname = sysname
def cmd(self, cmd):
View meta_gen.h
#define KR_INFO_TYPES_COUNT 11
#define KR_MAX_DYNAMIC_MEMBERS 128
typedef struct kr_info kr_info;
typedef struct kr_meta_info kr_meta_info;
typedef struct kr_meta_info_member kr_meta_info_member;
typedef enum {
KR_JACK_INFO,
KR_JACK_PATH_INFO,
View json_handler.c
#include "json_handler.h"
#define N_TOKENS 128
#define MAX_BUFFER 65536
static uint32_t key_to_value(json_handler *jshandler, const char *value, uint32_t len) {
uint32_t i;
jsmntok_t *tok;
uint32_t length;
@streamer45
streamer45 / gist:7154164
Last active Dec 26, 2015
codegen func and proto
View gist:7154164
[streamer45@archlinux gen]$ ./codegen ../../../lib/krad_transponder/ "" "info" ebml/func
int kr_adapter_info_to_ebml(char *out, kr_adapter_info *st, int max) {
if ((out == NULL) || (st == NULL) || (max < 1)) {
return -1;
}
/* FIXME */
return 0;
}
@streamer45
streamer45 / gist:7158670
Created Oct 25, 2013
codegen madness lol
View gist:7158670
[streamer45@archlinux gen]$ ./codegen ../../../lib/krad_transponder/ "" "info" enum
enum {
KR_ADAPTER_INFO,
KR_ADAPTER_PATH_INFO
};
[streamer45@archlinux gen]$ ./codegen ../../../lib/krad_compositor/ "" "info" enum
enum {
KR_SPRITE_INFO,
KR_TEXT_INFO,
KR_VECTOR_INFO,
View gist:7166336
out.c:58:30: error: declaration of ‘to_ebml_func’ as array of functions
const kr_info_to_ebml_func to_ebml_func[4] = { kr_sprite_info_to_ebml, kr_text_info_to_ebml, kr_vector_info_to_ebml, kr_compositor_path_info_to_ebml};