原创 C++ 文件操作封裝成class

//#include "md5.h" #include <iostream> #include <malloc.h> #include <memory.h> #include <sys/time.h> #include <stdi

原创 Linux kill 進程後 ,fd 是否被釋放,是否會調用 release ?

kill 進程後怎麼驗證 fd 確實被釋放了? 打開 APP,使用 lsof 命令 確定我們被使用的APP 確實被打開了 xxxxxx:/ # lsof | grep video10 lsof | grep video10 c

原创 MTK camera plugin 算法中 mutex 鎖導致camerahalserver AEE_AED

1.線程調試mutex問題分析 1.打印線程號、進程號、線程名字 #include <sys/syscall.h> #include <sys/prctl.h> int tid = syscall(SYS_gettid); in

原创 android YV12 地址偏移 與 line_stride 對齊

1.buffer地址偏移 以分辨率 1280*720 格式爲YV12 爲例,Y起始地址爲0x100000000 ,且是連續 y_addr = 0x100000000; cb_addr = y_addr + 1280×72

原创 wait_event_interruptible 等到條件並被wakeup執行時,再次執行 wake_up_interruptible 會發生什麼

wait_event_interruptible souece code #define __wait_event_interruptible(wq, condition, ret) \ do { \ DE

原创 爲自己的驅動寫Kconfig 和 Makefile

寫 android 驅動 的基本功就是把自己driver如何在kernel 中編譯,下面將以led驅動爲例 1.定義使用的deconfig 代碼路徑: kernel/arch/arm64/configs/xxxxx_defconf

原创 kernel 雙向循環鏈表代碼移植到 userspace 以及 Linux 線程同步的總結

list.h // This list structure implementation is adapted from the list implementation // on the Linux kernel. // Ori

原创 linux kernel container_of 的使用,結構體成員數組的形式

#include <stdio.h> #ifdef offsetof #undef offsetof #endif #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->M

原创 camera死亡通知

https://android.googlesource.com/platform/frameworks/av/+/refs/tags/android-9.0.0_r55/services/camera/libcameraserv

原创 android camera debug

adb shell dumpsys media.camera > camera.dump dump 的摘取部分信息如下 == Service global info: == Number of camera devices

原创 qcom v4l2 實現分析

1.queue buf 過程 Qcom HAL code int32_t mm_stream_qbuf(mm_stream_t *my_obj, mm_camera_buf_def_t *buf) { int32_t r

原创 camera進程通信分析

1.AIDL 用於 APP 和 cameraservice 端交互的 https://android.googlesource.com/platform/frameworks/av/+/refs/tags/android-9.0.

原创 Linux 常用調試命令彙總

top -H -O CPU 查看線程運行在相應的CPU上 top -H -O CPU [?25l[0m[H[J[s[999C[999B[6n[uTasks: 907 total, 2 running, 901 sleeping

原创 kernel 中 對 mutex 使用了memset 導致了 mutex_lock_nested 中出現了kernel panic

假設定義了一個結構體 struct mutex_lock { struct mutex lock; } struct mutex_lock mutex_lock_t; 在 mutex_init(&mute

原创 C++ thread 封裝成 class

#include <pthread.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> /* public protected