Skip to content

Instantly share code, notes, and snippets.

Avatar

Ji Fang jifang

  • Visbit
  • Sunnyvale, CA
View GitHub Profile
@jifang
jifang / ffmpeg-hevc-bsf.patch
Last active Jan 30, 2020
Trim down the ffmpeg library
View ffmpeg-hevc-bsf.patch
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 2b20067211..f6ef244063 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -83,6 +83,7 @@ static int packet_alloc(AVBufferRef **buf, int size)
return 0;
}
+#if 0
int av_new_packet(AVPacket *pkt, int size)
View libcurlpp-0.8.1-multiplex.patch
diff --git a/src/curlpp/Multi.cpp b/src/curlpp/Multi.cpp
index 58b05aa..e3ecca2 100644
--- a/src/curlpp/Multi.cpp
+++ b/src/curlpp/Multi.cpp
@@ -31,6 +31,7 @@ curlpp::Multi::Multi()
{
mMultiHandle = curl_multi_init();
runtimeAssert("Error when trying to curl_multi_init() a handle", mMultiHandle != NULL);
+ curl_multi_setopt(mMultiHandle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
}
@jifang
jifang / libev-4.19-ndk20b.patch
Created Dec 9, 2019
Patch for compiling libev-4.19 with NDK r20b
View libev-4.19-ndk20b.patch
--- libev-4.19.orig/ev_select.c 2019-12-09 15:00:08.000000000 -0500
+++ libev-4.19/ev_select.c 2019-12-09 14:49:46.000000000 -0500
@@ -47,7 +47,7 @@
#endif
#if defined(__ANDROID__) || defined(ANDROID)
-typedef int fd_mask;
+//typedef int fd_mask; // Android NDK r20b typedef fd_mask to unsigned long
#endif
View gist:e9f8849973bc962bf622e1ad90dde8b4
--- libev-4.19.orig/ev_select.c 2019-12-09 15:00:08.000000000 -0500
+++ libev-4.19/ev_select.c 2019-12-09 14:49:46.000000000 -0500
@@ -47,7 +47,7 @@
#endif
#if defined(__ANDROID__) || defined(ANDROID)
-typedef int fd_mask;
+//typedef int fd_mask; // Android NDK r20b typedef fd_mask to unsigned long
#endif
@jifang
jifang / ExampleInstrumentedTest.java
Last active Apr 17, 2018
Android test for creating files in multiple threads
View ExampleInstrumentedTest.java
package com.example.jifang.testio;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import org.junit.Test;
import org.junit.runner.RunWith;
View gist:9df9991e5f8e7f1d979c73a453f7ad67
03-06 14:07:52.072 13736-13794/co.visbit.myapplication D/Http2: >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
03-06 14:07:52.073 13736-13794/co.visbit.myapplication D/Http2: >> 0x00000000 6 SETTINGS
03-06 14:07:52.073 13736-13794/co.visbit.myapplication D/Http2: >> 0x00000000 4 WINDOW_UPDATE
03-06 14:07:52.075 13736-13818/co.visbit.myapplication D/Http2: << 0x00000000 18 SETTINGS
03-06 14:07:52.077 13736-13818/co.visbit.myapplication D/Http2: << 0x00000000 4 WINDOW_UPDATE
03-06 14:07:52.081 13736-13794/co.visbit.myapplication D/Http2: >> 0x00000003 26 HEADERS END_STREAM|END_HEADERS
03-06 14:07:52.083 13736-13820/co.visbit.myapplication D/Http2: >> 0x00000000 0 SETTINGS ACK
03-06 14:07:52.092 13736-13818/co.visbit.myapplication D/Http2: << 0x00000000 0 SETTINGS ACK
03-06 14:07:52.135 13736-13818/co.visbit.myapplication D/Http2: << 0x00000003 123 HEADERS END_HEADERS
03-06 14:07:52.136 13736-13818/co.visbit.myapplication D/Http2: <<
View gist:7e3109bd31f888349e1a98ebd84d2e38
03-05 14:39:22.779 5979-5995/? V/VB_Test: [1] downloading:1
03-05 14:39:22.779 5979-5995/? V/VB_Test: Download:https://10.0.0.186/files/1
03-05 14:39:22.976 5979-5995/? V/VB_Network: Sending request https://10.0.0.186/files/1 on Connection{10.0.0.186:443, proxy=DIRECT hostAddress=/10.0.0.186:443 cipherSuite=TLS_RSA_WITH_AES_128_CBC_SHA protocol=h2}
User-Agent:
Host: 10.0.0.186
Connection: Keep-Alive
Accept-Encoding: gzip
03-05 14:39:23.024 5979-5995/? V/VB_Network: Received response for https://10.0.0.186/files/1 (h2) in 48.9ms
server: nginx/1.13.10
date: Mon, 05 Mar 2018 22:39:23 GMT
View gist:5a8a0e6dc4bf19273e815c56b7b9385f
This file has been truncated, but you can view the full file.
2018/03/05 14:38:48 [notice] 92168#0: using the "kqueue" event method
2018/03/05 14:38:48 [notice] 92168#0: start worker processes
2018/03/05 14:38:48 [debug] 92168#0: channel 10:11
2018/03/05 14:38:48 [notice] 92168#0: start worker process 92282
2018/03/05 14:38:48 [debug] 92168#0: pass channel s:2 pid:92282 fd:10 to s:0 pid:92169 fd:3
2018/03/05 14:38:48 [debug] 92168#0: pass channel s:2 pid:92282 fd:10 to s:1 pid:92274 fd:4
2018/03/05 14:38:48 [debug] 92282#0: add cleanup: 00007FD4B002E310
2018/03/05 14:38:48 [debug] 92282#0: malloc: 00007FD4AF51B670:8
2018/03/05 14:38:48 [debug] 92282#0: malloc: 00007FD4B1801600:16384