Skip to content

Instantly share code, notes, and snippets.

View chichunchen's full-sized avatar

Chi-Chun, Chen chichunchen

  • HPE/Cray
  • Minnesota
View GitHub Profile
@chichunchen
chichunchen / simple-gst-play.c
Last active July 25, 2018 21:10
Simple gst-play example.
#include <gst/gst.h>
#include <stdlib.h>
typedef struct
{
gchar **uris;
guint num_uris;
gint cur_idx;
GstElement *playbin;
#include <gst/gst.h>
#include <stdlib.h>
#include <string.h>
#define SEEK_DEFAULT_POS -1
/* Structure to contain all our information, so we can pass it around */
typedef struct _CustomData {
GstElement *playbin; /* Our one and only element */
gboolean playing; /* Are we in the PLAYING state? */
#include <stdio.h>
#include <gst/gst.h>
#define BUF_LEN 1000
char buf[BUF_LEN];
char *path;
char *name;
int video_segment_cnt = 1;
char *get_uri_from_id(int n);
#include <gst/gst.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Structure to contain all our information, so we can pass it around */
typedef struct _CustomData {
GstElement *playbin; /* Our one and only element */
gboolean playing; /* Are we in the PLAYING state? */
gboolean terminate; /* Should we terminate execution? */
@chichunchen
chichunchen / client.cpp
Created June 20, 2018 01:12 — forked from SteveRuben/client.cpp
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
@chichunchen
chichunchen / ffmpeg-cheatsheet.md
Created June 18, 2018 21:30 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@chichunchen
chichunchen / ffmpeg-cheatsheet.md
Created June 18, 2018 21:30 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
set number
set shiftwidth=4
set tabstop=4
:syntax on
set autoindent
set smartindent
" highlight matching braces
set showmatch
set scrolloff=6
@chichunchen
chichunchen / A_results.txt
Created May 16, 2018 17:03 — forked from leifwalsh/A_results.txt
mcs lock: userspace c++11 implementation of http://lwn.net/Articles/590243/. seems to be awful---far worse than normal spinlock---with nthreads > ncpus
# clang version 3.4 (tags/RELEASE_34/final)
# Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
spinlock 1: 3925ms
spinlock 2: 25665ms
spinlock 3: 27722ms
spinlock 4: 42727ms
std::mutex 1: 5526ms
std::mutex 2: 17672ms
std::mutex 3: 31038ms
std::mutex 4: 36890ms
@chichunchen
chichunchen / dfa.ml
Created October 9, 2017 19:34
dfa in ocaml
type state = int;;
type 'a dfa = {
current_state : state;
transition_function : (state * 'a * state) list;
final_states : state list;
};;
type decision = Accept | Reject;;
let a_b_even_dfa : char dfa = (* input symbols are characters *)
{ current_state = 0;