Android 4.4KitKat Audioflinger Process Analysis

Source: Internet
Author: User

Audioflinger (AF) is a service with specific code in AV\MEDIA\MEDIASERVER\MAIN_MEDIASERVER.CPP:

intMainintargcChar**argv)    {Signal (sigpipe, sig_ign); CharValue[property_value_max]; BOOLDolog = (Property_get ("ro.test_harness", Value,"0") >0) && (atoi (value) = =1);    pid_t Childpid; //Fixme The advantage of making the process containing Media.log service the parent process of//the process that contains all of the other real services, was that it allows us to collect more//detailed information such as signal numbers, stop and continue, resource usage, etc. //But it's also more complex. Consider replacing this by independent processes, and using//binder on death notification instead.    if(Dolog && (childpid = fork ())! =0) {        //Media.log Service//Prctl (Pr_set_name, (unsigned long) "Media.log", 0, 0, 0); //Unfortunately PS ignores pr_set_name for the main thread, so use this ugly hackstrcpy (argv[0],"Media.log"); SP<ProcessState>proc (processstate::self ());        Medialogservice::instantiate (); Processstate::self ()-Startthreadpool (); ...
       sp<ProcessState> proc (processstate::self ());        SP<IServiceManager> sm = Defaultservicemanager ();        Alogi ("servicemanager:%p", SM.get());        Audioflinger::instantiate ();        Mediaplayerservice::instantiate ();        Cameraservice::instantiate ();        Audiopolicyservice::instantiate ();        Registerextensions ();        Processstate::self (),Startthreadpool ();        Ipcthreadstate::self (),Jointhreadpool ();    }

Android 4.4KitKat Audioflinger Process Analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.