Tizen applications need to have information about media.
The information are:
- where media are located (ex: /home/ , /usr/share/ ... )
- what kind of media (ex: picture, movie, music, ...)
- Where thumbnails are located
The capi-content-media-content provides the API to get and set information about media into a database.
In Tizen 2.x, all information is stored in the same place and in a unique database.
In case of multi-user architecture in Tizen 3 , the media will be located in different directories and information stored in several databases.
The migration to Multi-user will be achieved in 3 phases
- Phase 1 : one database per user, sharing media is not possible
- Phase 2 : phase 1 plus thumbnail management and secure communication between CAPI and media-server
- Phase 3 : phase 2 plus a global database is created to share media between users, adding security
Requests for getting information from database are done by CAPI.
Requests for adding media ( moving, scanning, ... ) are sent by CAPI to media-server.
The Media-server forwards the scan requests from CAPI to media-scanner.
The database is created at the startup of media-server in /usr/dbspace/.media.db
The service media-server, media-scanner and media-thumbnail are launched by root
- Unix sockets are used to communicate between CAPI and media-server.
- user UID is used to identify in which database is the information stored.
- A database is created for the user at the first connection with the label smack "User". Security/Multi_user_policy#Home_directories_of_users
- The directory content of a user is scan at boot. This directory ($USER/content) is provided by the package tizen-platform-conf with variable TZ_USER_CONTENT see Tizen-platform-config
- A scan can only be done in user home directory.
- The information is stored in user database ($USER/.applications/dbspace/.media.db). The path of the database is provided by the package tizen-platform-conf with variable TZ_USER_DB
- A User can read information in his/her own database.
- A User asks to media-server to write into his/her own database.
Jira bug corresponding to the phase 1: TC-1482
- The thumbnail server can handle formats: JPEG, PNG, BMP and GIF.
- A User can only read the thumbnail picture. Path of thumbnail is in the database.
- Thumbnails are stored in home user directory in $USER/data with smack label "User".
- Secure socket to communicate between CAPI and media-server. see Security/Cynara/ApplicationCredentials#Unix_domain_sockets
- Add cgroup profile to reduce CPU load of media-server process.
The architecture needs to be defined.
The main purpose of phase 3 will be to share media between users and add security.
- A global database to share the media.
- A new secure user to launch services media-server, media-scanner and media-thumbnail. see Security/Multi user policy#Service_daemons