- 博客(42)
- 资源 (1)
- 收藏
- 关注
原创 分页机制的理解
关于对分页/分段机制的理解,将本来小范围的地址扩展到更大的范围。例:假如我有10个标签,那就只能粘到10个盒子上,用来表示10个的样品。 如果我想用这10个标签表示更多的样品,那就得想办法了。比如,我们使用2个标签作为箱号,余下的8个表示样品,那样就可以出现下面的情况:
2015-06-26 11:44:53 436
原创 module_param_array
对module_param_array(name,type,num,perm)产生疑问,尤其对num参数的作用产生疑问,搜索得到结果如下。static int param_array[]= {0,0,0,0};static int param_array_nr;module_param_array(param_array , int ,¶m_array_nr ,
2015-06-25 10:49:38 775
原创 Implementing MP3 player in C
Implementing MP3 player in CSurprised by the lack of English-written articles about MP3 decoding in C,I thought that I should put down a couple of words about that.First of all, there are many w
2015-06-24 11:13:43 784
原创 mp3 file format
MP3文件大体分为三部分:TAG_V2(ID3V2),音频数据,TAG_V1(ID3V1),其中ID3V2是ID3V1的补充,并不是所有的MP3都有ID3V2补充,即是不是所有的MP3文件都有ID3V2。如果MP3文件存在ID3V2,则一定在文件的头部,ID3V2结构分为头部(header)和若干标签帧,其中头部长度为10字节,10个字节的结构如表1:
2015-06-24 10:57:22 408
原创 gpio matrix keypad linux driver
Linuxkernel & device driver programmingCross-Referenced Linuxand Device DriverCode[ source navigation ] [diffmarkup] [ identifiersearch ] [ freetextsearch ] [ files
2015-06-24 10:11:05 2329
原创 ALSA howto
ALSA Tutorial 1 - InitializationThis tutorial assumes that you are familiar with the C++ programming language and the Linux operating system.The Advanced Linux Sound Architecture (ALSA) is the sta
2015-06-19 10:25:25 457
原创 内存池
二,实现 1,内存池的相关信息结构体点击(此处)折叠或打开struct pool_head { void **free_list; struct list_head list; /* list of all known pools */ in
2015-06-18 17:46:00 416
原创 线程池实例
1.线程池基本原理 在传统服务器结构中, 常是 有一个总的 监听线程监听有没有新的用户连接服务器, 每当有一个新的 用户进入, 服务器就开启一个新的线程用户处理这 个用户的数据包。这个线程只服务于这个用户 , 当 用户与服务器端关闭连接以后, 服务器端销毁这个线程。然而频繁地开辟与销毁线程极大地占用了系统的资源。而且在大量用户的情况下, 系统为了开辟和销毁线程将浪费大量的时间和资源。线程
2015-06-18 17:36:53 436
原创 简单Linux C线程池
大多数的网络服务器,包括Web服务器都具有一个特点,就是单位时间内必须处理数目巨大的连接请求,但是处理时间却是比较短的。在传统的多线程服务器模型中是这样实现的:一旦有个请求到达,就创建一个新的线程,由该线程执行任务,任务执行完毕之后,线程就退出。这就是"即时创建,即时销毁"的策略。尽管与创建进程相比,创建线程的时间已经大大的缩短,但是如果提交给线程的任务是执行时间较短,而且执行次数非常频繁,那么服
2015-06-18 17:22:57 331
原创 可重入函数与不可重入函数
可重入函数与不可重入函数(转)转自:http://www.cppblog.com/franksunny/archive/2007/08/03/29269.html主要用于多任务环境中,一个可重入的函数简单来说就是可以被中断的函数,也就是说,可以在这个函数执行的任何时刻中断它,转入OS调度下去执行另外一段代码,而返回控制时不会出现什么错误;而不可重入的函数由于使用了一些系统资源,比如
2015-06-18 16:59:58 324
原创 the difference between pcm and wav
WAV是一种容器,可以包含未经编码的PCM音频流,也可以包含经过编码的MP3音频流。如同:WAV是一个书包,PCM是书,MP3是文具盒。呵呵,比较形象的打比方!
2015-06-17 17:08:06 326
原创 分析一下github中项目的软件启动画面的实现
引用这个老外的一些资源了呀。。。。。。。。。。。。。。。。。看到了,很简单,就是一帧帧的png图片。下面是他的代码,就是开启一个定时器,每隔一段时间刷新出一帧新的图片,当所有图片显示完成后,启动界面结束。感觉还不如整个gif图片呢。其实这倒无所谓,反正动画(电影)也就是一帧帧的图像组成的。#ifndef LOADSPLASH_H#defi
2015-06-17 16:51:48 739
原创 qt 创建异形窗体
我们可以看到QPixmap::mask()函数返回图片中Alpha值不为0有区域,就是异形。QSplashScreen::setMask()就是设置掩码区域。所以实际的显示效果就是只显示出Alpha值不为0的区域,其他的透明效果。
2015-06-17 16:12:28 1444
原创 capture-send-play
#include errno.h> #include string.h> #include unistd.h> #include stdio.h> #include stdlib.h> #include netdb.h> #include fcntl.
2015-06-17 15:44:16 574
原创 Creating a Ring Buffer
Creating a Ring BufferThis is an example of a ring buffer class in C++. A ring buffer is one of the basic building blocks of any audio engine.Since audio streams tend to be far too large t
2015-06-17 15:32:37 341
原创 About a full duplex ALSA application
The tutorials on the web don't talk too much about how to write an effect processor using ALSA. They do talk about recording program, and a playback program, but the combination is a kind of heresy. O
2015-06-17 15:21:31 903
原创 How to Properly Write Received UDP Audio Data to ALSA with C++
I have 2 Raspberry Pis and 1 of them transmits UDP frames of Audio data to the other Raspberry Pi. The UDP Packets received are 160 Bytes each. The transmitting Raspberry Pi is sending 8KHz 8-bit Mono
2015-06-17 15:10:22 511
原创 An example of how to streaming audio over network using Qt
//client.#include "mainwindow.h"#include int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();} MainWindo
2015-06-17 14:54:37 1336
原创 Audio Streaming mit UDP in C
Audio Streaming mit UDP in CAutor: Andre AdrianVersion 27.Dez.2007ZusammenfassungTCP Server und Client werden für Internet Relay Chat oder Remote Shell benutzt. Für Audio- und Video-Stream
2015-06-17 14:41:38 590
原创 Example Program: Event-Driven Simulation
11.3 Example Program: Event-Driven SimulationAn extended example will now illustrate one of the more common uses of a priority_queues, which is to support the construction of a simulation model. A
2015-06-16 11:23:44 531
原创 Qt事件分发
最近在想Qt事件产生后,放入到系统的事件队列中,等待事件分发器向外分发,但是Qt是如何得知该事件要分发给谁呢?下面是网友的一些回答:一个事件发生之后,Qt怎么知道该发给哪个QObject的event()函数呢?我看了一下文档里关于QApplication::sendEvent()函数的说明,一个sendEvent()函数只能连接一对event-receiver。所以
2015-06-10 17:14:03 968
原创 Threads, Events and QObjects
Threads, Events and QObjects多线程程序架构线程1 线程2 线程3(输入消息队列) (输入消息队列) (输入消息队列) ================================== 全局消息队列
2015-06-10 16:42:18 568
原创 event-based framework 分析
分析一下基于事件的程序架构,程序中所有的对象之间的通信都是通过事件总线,当一个对象需要执行一个动作时,他向事件总线发射一个事件,然后事件总线根据之前注册的事件与事件处理函数,找到事件对应的事件处理函数并调用它。这个是比较简单的同步模式,没有应用多线程,是老外写的一个demo。不过从分析来看,老外写程序不是简单的面向过程的实现功能,而是像盖大楼一样,有房间,有楼梯,有电梯,有结构。
2015-06-10 15:44:48 474
原创 A lightweight synchronous event framework for C++11
A lightweight synchronous event framework for C++11OverviewLike many other event frameworks, this project allows you to reduce inter-class dependencies and decouple your C++11 code by leveraging s
2015-06-10 13:58:43 517
转载 When a QThread isn't a thread...
When a QThread isn't a thread...The thread that doesn't thread...Lets say you have some background work you need to get done. The work is pretty time intensive, so you don't want to block the ma
2015-06-10 10:22:07 439
转载 "How to use QThread in the right way (Part 1)"
A short historyLong long ago, subclass QThread and reimplement its run() function is the only recommended way of using QThread. This is rather intuitive and easy to used. But when SLOTS and Qt event
2015-06-10 10:17:49 579
原创 message dispatch
{HOMELINUXCODEHOBBYLIFE}Skynet之消息队列 - 消息的存储与分发2014/09/08 20:07按我的理解,消息队列是Skynet的核心,Skynet就是围绕着消息队列来工作的。这个消息队列分为两部分:全局队列和服务队列。每个服务都有一个自己的服务队列,服务队列被全局队列引用。主进程通过多个线程来不断的从全局队列中取出服务队列,然后分发服务队
2015-06-08 17:08:15 700
原创 ffmpeg compile summary
shell.albert@yantai:~/temporary/ffmpeg-2.6.3> ./configure --enable-static --enable-libmp3lame --enable-gpl --enable-libx264--extra-cflags=-I/home/shell.albert/libx264/include
2015-06-05 17:28:19 3261
原创 ffmpeg tutorial3
## An ffmpeg and SDL TutorialPage 1 2 3 4 5 6 7 End Prev Home Next  _place_holder;Text version## Tutorial 03: Playing SoundCode: tutorial03.c### AudioSo now we want to play sound. SDL
2015-06-05 16:07:01 453
原创 ffmpeg tutorial2
## An ffmpeg and SDL TutorialPage 1 2 3 4 5 6 7 End Prev Home Next  _place_holder;Text version## Tutorial 02: Outputting to the ScreenCode: tutorial02.c### SDL and VideoTo draw to the
2015-06-05 15:52:20 349
原创 ffmpeg tutorial1
## An ffmpeg and SDL TutorialPage 1 2 3 4 5 6 7 End Prev Home Next  _place_holder;Text version## Tutorial 01: Making ScreencapsCode: tutorial01.c### OverviewMovie files have a few basi
2015-06-05 15:32:13 625
翻译 alsa record example.c
/* A Minimal Capture Program This program opens an audio interface for capture, configures it for stereo, 16 bit, 44.1kHz, interleaved conventional read/write access. Then its reads a chunk
2015-06-04 13:35:05 1259
原创 ALSA record wave has noise
I need to capture audio data for my project,so I use ALSA library. At the start,I make a experiment at the laptop,I found the captured audio data has much noise.But the noise is little with other prof
2015-06-04 13:18:17 435
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人