Skip to main content

菜鸟学习系列---Android Service Manager的实现

Submitted by chengqm on Tue, 05/10/2011 - 01:50

Android系统Binder机制的总管是Service Manager,所有的Server(System Server)都需要向他注册,服务使用者需要向其查询相应的服务。

1. 代码位置
Android中Service Manager的源码,其源码位于:
frameworks\base\cmds\servicemanager\service_manager.c

而且他是一个main函数,说明他自己就是一个进程,系统启动的时候在init.rc中被调用。

service servicemanager /system/bin/servicemanager
user system
critical
onrestart restart zygote
onrestart restart media
2. 代码分析
int main(int argc, char **argv)
{
struct binder_state *bs;
void *svcmgr = BINDER_SERVICE_MANAGER;

Fix the bugs for "Notice: Undefined index: required in field_multiple_value_form() " in Drupal 7

Submitted by linuxmobile on Sun, 05/08/2011 - 02:42

If just for fix. pls. follow these steps:

1. Click on Structure > Content types.

2. Click on manage fields for either "page" or "story".

3. Create a new field. Label -> "test", Name -> field_"test", Field -> "Long text and summary", Widget -> "Text area with a summary"

4. Hit save. Now go to an existing story/page or create a story/page.

5. At this step the errors disappeared for me. Go back to the field you just created and delete it.

Gstreamer & OpenMax

Submitted by countryfish on Mon, 11/01/2010 - 05:59

1. Gstreamer plugin的简要介绍

关于Gstreamer plugin的基础知识,推荐大家阅读http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/pwg.pdf中I/II两章。下面是一个关于基本概念的摘要

1) element, 是Gstreamer中一个具有某些功能,暴露相关接口的基本自治单元。比如一个Audio decoder,可以封装成一个element。

2) plugin, 除核心功能外,Gstreamer大部分功能都有plugin提供。一个或若干个element可以封装成一个plugin。Gstreamer在需要相关element时,装载对应plugin。

3)pad,是element之间交互数据的接口。分为source pad(产生数据或者输出数据)和sink pad(接受数据)两种

4) caps of pad,pad能力,也就是pad能够接受的数据属性,如audio,video等

YUV与RGB

Submitted by chengqm on Fri, 08/20/2010 - 05:48

RGB和YUV都是色彩空间,用于表示颜色,两者可以相互转化。 YUV(亦称YCrCb)是被欧洲电视系统所采用的一种颜色编码方法(属于PAL)。YUV主要用于优化彩色视频信号的传输,使其向后兼容老式黑白电视。与R GB视频信号传输相比,它最大的优点在于只需占用极少的带宽(RGB要求三个独立的视频信号同时传输)。
     中"Y"表示明亮度(Lumina nce或Luma),也就是灰阶值;是个基带信号。而"U"和"V"表示的则是色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素的颜色。U和V不是基带信号,它俩是被正交调制了的。
     "亮度"是通过RGB输入信号来创建的,方法是将RGB信号的特定部分叠加到一起。"色度"则定义了颜色的两个方面-色调与饱和度,分别用Cr和CB来表 示。其中,Cr反映了RGB输入信号红色部分与RGB信号亮度值之间的差异。而CB反映的是RGB输入信号蓝色部分与RGB信号亮度值之同的差异。。通过 运算,YUV三分量可以还原出R(红),G(绿),B(兰)。
一、和rgb之间换算公式的差异
yuv<-->rgb
Y'= 0.299*R' + 0.587*G' + 0.114*B'

About BogoMips

Submitted by chengqm on Thu, 08/19/2010 - 03:47

1.  What are BogoMips

How to add a new system service

Submitted by linuxmobile on Wed, 08/18/2010 - 07:15

The user id of system can add any service they want

The user id of phone can only add radio related system service

The user id of media can only add media related system service.

you can check frameworks/base/cmds/servicemanager/service_manager.c for details.

you can check the uid of your apk from  android:sharedUserId of the AndroidManifest.xml.

Power management design philosphy(From Matthew Garrett)

Submitted by chengqm on Wed, 08/11/2010 - 02:53

Power management design philosphy
One of the traditional problems with power management has been balancing power savings against reduced functionality. The two traditional approaches to this have been to have sane defaults or to let the user tweak them, with a hybrid approach being to have sane defaults and an "advanced" box that lets users set their own parameters.

Both of these options suck.

How to modify ramdisk.img

Submitted by linuxmobile on Tue, 08/10/2010 - 08:54

android源码编译后得到system.img,ramdisk.img,userdata.img映像文件。其中, ramdisk.img是emulator的文件系统,system.img包括了主要的包、库等文件,userdata.img包括了一些用户数 据,emulator加载这3个映像文件后,会把 system和 userdata分别加载到 ramdisk文件系统中的system和 userdata目录下。因此,我们可以把ramdisk.img里的所有文件复制出来,system.img和userdata.img分别解压到 ramdisk文件系统中的system和 userdata目录下。

Here is the steps to modify ramdisk.img:

推荐一部书--- Linux内核设计与实现(第3版)

Submitted by chengqm on Sun, 08/01/2010 - 06:38

本站提供的下载地址:http://www.linuxmobiledevices.com/download/Linux Kernel Development 3rd Edition.pdf
相信大家对linux内核设计与实现(第2版)应该不会陌生吧. 最近又出了一个第三版,这个第三版内容是针对linux-2.6.34版本来描述的.

Pages

Premium Drupal Themes by Adaptivethemes