Skip to content

Instantly share code, notes, and snippets.

View jusonqiu's full-sized avatar
😄
I may be slow to respond.

jusonqiu

😄
I may be slow to respond.
  • Tencent
  • ShenZhen
View GitHub Profile
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@jusonqiu
jusonqiu / m2mjpeg_adpcm.c
Last active March 30, 2020 09:18
FFMPEG把普通视频解码成yuv同时编成mjpeg, 把音频解码成pcm并调整参数。 初始化编码器和解码器 配置编码器 编码与解码 调整帧率.
/******************************************************************************
* Copyright (C) 2015 All rights reserved.
*
* File: m2mjpeg_adpcm.c
* Author: Zhaosheng Qiu <[email protected]>
* Time: 2015/06/29
* Descriptions:
*
******************************************************************************/
#include <stdio.h>
@jusonqiu
jusonqiu / simplest_ffmpeg_streamer.c
Created October 9, 2015 03:42
* This example stream local media files to streaming media ,server (Use RTMP as example),It's the simplest FFmpeg streamer. source from [雷霄骅](http://blog.csdn.net/leixiaohua1020)
#include <stdio.h>
#include <libavformat/avformat.h>
#include <libavutil/mathematics.h>
#include <libavutil/time.h>
int main(int argc, char* argv[])
{
AVOutputFormat *ofmt = NULL;
//输入对应一个AVFormatContext,输出对应一个AVFormatContext
//(Input AVFormatContext and Output AVFormatContext)
@jusonqiu
jusonqiu / makewave.c
Last active March 30, 2020 09:18
Create 44Byte Header Wave File
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* M_PI is declared in math.h */
#define PI M_PI
typedef unsigned int UI;
cat $1 | hexdump -v -e '7/1 "0x%02X, " 1/1 " 0x%02X,\n"'
#include <stdio.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <string.h>
#define KEY_LENGTH 2048
#define PUB_EXP 3
#define PRINT_KEYS
#define WRITE_TO_FILE
@jusonqiu
jusonqiu / yuv2rgb.c
Last active December 5, 2023 06:38
Convert YUV to RGB
/* convert a YUV set to a rgb set - thanks to MartinS and
http://www.efg2.com/lab/Graphics/Colors/YUV.htm */
static void yuvtorgb(int Y, int U, int V, u8 *rgb)
{
int r, g, b;
static short L1[256], L2[256], L3[256], L4[256], L5[256];
static int initialised;
if (!initialised) {
int i;
#include <stdio.h>
#define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"
@jusonqiu
jusonqiu / android-status-bar.kt
Created June 5, 2019 09:24
设置android status bar 沉浸式
private fun setTranslucentStatus() {
// 5.0以上系统状态栏透明
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//设置沉浸状态
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
//设置UI渗入,StatusBar ICON 颜色
var options = SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or SYSTEM_UI_FLAG_LAYOUT_STABLE
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
options = options or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR //dark icon
@jusonqiu
jusonqiu / For Mac 4.2.6 unlimited trial.md
Created November 12, 2019 01:58 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6 ,it's works , this is the way which makes Always in evaluation mode 。

  1. go to the dir : /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare
  4. insert BCompare the content :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@