4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * This file defines IPC protocol
25 * @file media-server-ipc.h
26 * @author Haejeong Kim(backto.kim@samsung.com)
30 #ifndef _MEDIA_SERVER_IPC_H_
31 #define _MEDIA_SERVER_IPC_H_
33 #define MS_TIMEOUT_SEC_3 3 /**< Response from Server time out */
34 #define MS_TIMEOUT_SEC_10 10 /**< Response from Server time out */
35 #define MS_TIMEOUT_SEC_20 20 /**< Response from Media server time out */
37 #ifdef _USE_UDS_SOCKET_
39 MS_DB_BATCH_UPDATE_PORT = 0, /**< Media DB batch update */
40 MS_SCAN_DAEMON_PORT, /**< Port of communication between scanner and server */
41 MS_SCAN_COMM_PORT, /**< Port of communication between scanner and server */
42 MS_SCANNER_PORT, /**< Directory Scanner */
43 MS_DB_UPDATE_PORT, /**< Media DB Update */
44 MS_THUMB_CREATOR_PORT, /**< Create thumbnail */
45 MS_THUMB_COMM_PORT, /**< Port of communication between creator and server */
46 MS_THUMB_DAEMON_PORT, /**< Port of Thumbnail server */
50 #define MS_SCANNER_PORT 1001 /**< Directory Scanner */
51 #define MS_DB_UPDATE_PORT 1002 /**< Media DB Update */
52 #define MS_THUMB_CREATOR_PORT 1003 /**< Create thumbnail */
53 #define MS_THUMB_DAEMON_PORT 1004 /**< Port of Thumbnail server */
54 #define MS_THUMB_COMM_PORT 1005 /**< Port of communication between creator and server */
55 #define MS_DB_BATCH_UPDATE_PORT 1006 /**< Media DB batch update */
56 #define MS_SCAN_DAEMON_PORT 1007 /**< Port of communication between scanner and server */
57 #define MS_SCAN_COMM_PORT 1008 /**< Port of communication between scanner and server */
60 #ifdef _USE_UDS_SOCKET_TCP_
62 MS_DB_BATCH_UPDATE_TCP_PORT = 0, /**< Media DB batch update */
63 MS_THUMB_CREATOR_TCP_PORT, /**< Create thumbnail */
68 #define MAX_MSG_SIZE 4096
71 MS_MSG_DB_UPDATE = 0, /**< Media DB Update */
72 MS_MSG_DB_UPDATE_BATCH_START, /**< Start of media DB update batch */
73 MS_MSG_DB_UPDATE_BATCH, /**< Perform of media DB update batch */
74 MS_MSG_DB_UPDATE_BATCH_END, /**< End of media DB update batch */
75 MS_MSG_DIRECTORY_SCANNING, /**< Non recursive Directory Scan and Media DB Update*/
76 MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE,/**< Recursive Directory Scan and Media DB Update*/
77 MS_MSG_BURSTSHOT_INSERT,
78 MS_MSG_BULK_INSERT, /**< Request bulk insert */
80 MS_MSG_STORAGE_PARTIAL,
81 MS_MSG_STORAGE_INVALID,
82 MS_MSG_THUMB_SERVER_READY, /**< Ready from thumbnail server */
83 MS_MSG_THUMB_EXTRACT_ALL_DONE, /**< Done of all-thumbnail extracting */
84 MS_MSG_SCANNER_READY, /**< Ready from media scanner */
85 MS_MSG_SCANNER_RESULT, /**< Result of directory scanning */
86 MS_MSG_SCANNER_BULK_RESULT, /**< Request bulk insert */
87 MS_MSG_MAX /**< Invalid msg type */
92 ms_msg_type_e msg_type;
95 size_t msg_size; /*this is size of message below and this does not include the terminationg null byte ('\0'). */
96 char msg[MAX_MSG_SIZE];
105 MS_MEDIA_THUMB_LARGE,
106 MS_MEDIA_THUMB_SMALL,
110 ms_msg_type_e msg_type;
111 } ms_thumb_server_msg;
113 typedef struct _thumbMsg{
123 int origin_path_size;
125 char org_path[MAX_MSG_SIZE];
126 char dst_path[MAX_MSG_SIZE];
130 #endif /*_MEDIA_SERVER_IPC_H_*/