OMAP DSP 学习笔记(LINUX平台)(二)DMAI
DMAI(DaVinci Multimedia Application Interface)是DSP提供给ARM端应用程序的调用接口,DSP也是依赖于DSPLINK的。 DMAI中也提供了许多VISA (video, imaging, speech and audio)编解码的实例。DMAI提供的是一种功能的抽象,而在具体实现上,不同硬件平台,不同系统是不一个样的。另外,由于DMAI是以源代码的形式提供的,所以可以用来参考完成一些别的任务,比如设备驱动。 DMAI的优势: 1. 移植和重用:例如TI GStreamer plugin就是基于DMAI,它可以方便的移植到其他的davinci平台。 2. 软件接口一致: (1)对底层硬件加速部分抽象封装,使开发者不需要明白平台的特定实现 (2)支持所有的codec,使开发者不必明白xDM版本的细节与区别 (3)对显示的抽象(FBDEV和V4L2) (4)管理底层细节与错误处理 代码示例: {
#include
#include
#include
#include
#include
#include
#include
#include
Adec_Handle hAd;
Loader_Handle hLoader;
Buffer_Handle hOutBuf, hInBuf;
Engine_Handle hEngine;
Sound_Handle hSound;
AUDDEC_Params params = Adec_Params_DEFAULT;
AUDDEC_DynamicParams dynParams = Adec_DynamicParams_DEFAULT;
Loader_Attrs lAttrs = Loader_Attrs_DEFAULT;
Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;
Sound_Attrs sAttrs = Sound_Attrs_STEREO_DEFAULT;
CERuntime_init();
Dmai_init();
hSound = Sound_create(&sAttrs);
hEngine = Engine_open("myengine", NULL, NULL);
hAd = Adec_create(hEngine, "aacdec", ¶ms, &dynParams);
hOutBuf = Buffer_create(Adec_getOutBufSize(hAd), &bAttrs);
lAttrs.readSize = Adec_getInBufSize(hAd);
lAttrs.readBufSize = lAttrs.readSize * 2;
hLoader = Loader_create("myfile.aac", &lAttrs);
Loader_prime(hLoader, &hInBuf);
while (1) {
Adec_process(hAd, hInBuf, hOutBuf);
Sound_write(hSound, hOutBuf);
相关文档:
利用
下载的这段代码,成功实现了守护进程,原来守护进程是很简单的事情。
在main函数中执行
init_daemon();//初始化为Daemon
就可以把进程变成守护进程
#include
#include
#include
#include
#include
void
init_daemon(void
)
{
int
pid;
int
i;
if
(pid=fork()) ......
1.Linux“线程”
进程与线程之间是有区别的,不过Linux内核只提供了轻量进程的支持,未实现线程模型。Linux是一种“多进程单线程”的操作系统。Linux本身只有进程的概念,而其所谓的“线程”本质上在内核里仍然是进程。
大家知道,进程是资源分配的单位,同一进程中的多个线程共享该进程的 ......
Programming your application or library based on Qt has always had the promise that you can deploy your application on many different platforms. Development of those applications can, likewise, happen on many different platforms. QtCreator runs on Windows, Mac & Linux among others.
Qt很简单,易 ......