Remove unused codes 29/307529/1 accepted/tizen/unified/20240313.133525 accepted/tizen/unified/20240313.135013 accepted/tizen/unified/x/20240314.073242
authorJiyong <jiyong.min@samsung.com>
Tue, 12 Mar 2024 00:12:09 +0000 (09:12 +0900)
committerJiyong <jiyong.min@samsung.com>
Tue, 12 Mar 2024 00:12:09 +0000 (09:12 +0900)
Change-Id: I3ec6840dafb808932244c58ca33c1b1603e50f67

packaging/capi-media-controller.spec
svc/include/media_controller_socket.h
svc/media_controller_socket.c
svc/media_controller_svc.c

index 40a16543f4f3aa00c8db34f9dbd0f92885168f01..72455ef22e0bc852a6488a2db5aca8a232f0e32d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-controller
 Summary:    A media controller library in Tizen Native API
-Version:    0.2.44
+Version:    0.2.45
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index da5b009fa70f4e01911ab3af24b38e491aeeed77..d9f4f000183da3bfcb0cfb91a4e10bb07be5b84a 100755 (executable)
 extern "C" {
 #endif /* __cplusplus */
 
-#define SERVER_IP                      "127.0.0.1"
 #define MC_TIMEOUT_SEC_5                                       5               /* Response from daemon time out */
 #define MAX_MSG_SIZE                           10 * 1024               /* Maximum of message to daemon */
-#define MC_SOCK_NOT_ALLOCATE           -1
 #define MC_SOCK_ACTIVATION_PATH                "/run/.mediacontroller.sock"            /* tzplatform_mkpath(TZ_SYS_RUN, ".media_controller.sock") */
 #define MC_IPC_PATH                                    "/run/.mediacontroller-comm.sock"       /* tzplatform_mkpath(TZ_SYS_RUN, ".media_controller-comm.sock") */
-#define MC_SERVER_DISCONNECTION_MSG            "Disonnect"
-
-typedef enum {
-       MC_DB_UPDATE_PORT,              /**< Media Controller DB Update */
-       MC_PORT_MAX,
-} mc_msg_port_type_e;
 
 typedef enum {
        MC_MSG_DB_UPDATE,               /**< Media Controller DB Update */
@@ -65,9 +57,7 @@ typedef struct {
 } mc_comm_msg_s;
 
 int mc_ipc_create_client_socket(int timeout_sec, int *sock_fd);
-int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd);
-int mc_ipc_send_msg_to_client_tcp(int sockfd, mc_comm_msg_s *send_msg, struct sockaddr_un *client_addr);
-int mc_ipc_receive_message_tcp(int client_sock, mc_comm_msg_s *recv_msg);
+int mc_ipc_create_server_socket(int *sock_fd);
 int mc_ipc_accept_client_tcp(int serv_sock, int* client_sock);
 
 #ifdef __cplusplus
index 63bd6637b2f17224b5f0316b8bc3def1c00a9891..885e101ad1e97f52454935a738276c1bae31e76b 100644 (file)
@@ -48,7 +48,7 @@ int mc_ipc_create_client_socket(int timeout_sec, int *sock_fd)
        return MEDIA_CONTROLLER_ERROR_NONE;
 }
 
-int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd)
+int mc_ipc_create_server_socket(int *sock_fd)
 {
        int i = 0;
        bool bind_success = false;
@@ -104,40 +104,6 @@ int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd)
 
 }
 
-int mc_ipc_send_msg_to_client_tcp(int sockfd, mc_comm_msg_s *send_msg, struct sockaddr_un *client_addr)
-{
-       int ret = MEDIA_CONTROLLER_ERROR_NONE;
-
-       if (write(sockfd, send_msg, sizeof(*(send_msg))) != sizeof(*(send_msg))) {
-               mc_stderror("sendto failed");
-               ret = MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
-       } else {
-               mc_debug("sent result [%d]", send_msg->result);
-               mc_debug("result message [%s]", send_msg->msg);
-       }
-
-       return ret;
-}
-
-int mc_ipc_receive_message_tcp(int client_sock, mc_comm_msg_s *recv_msg)
-{
-       int recv_msg_size = 0;
-
-       if ((recv_msg_size = read(client_sock, recv_msg, sizeof(mc_comm_msg_s))) < 0) {
-               if (errno == EWOULDBLOCK) {
-                       mc_error("Timeout. Can't try any more");
-                       return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
-               } else {
-                       mc_stderror("recv failed");
-                       return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
-               }
-       }
-
-       mc_secure_debug("receive msg from [%d(%d)] %d, %s", recv_msg->pid, recv_msg->uid, recv_msg->msg_type, recv_msg->msg);
-
-       return MEDIA_CONTROLLER_ERROR_NONE;
-}
-
 int mc_ipc_accept_client_tcp(int serv_sock, int *client_sock)
 {
        int sockfd = -1;
index c48831dafe9c7063eb613abd37907336cfd56362..bdce47135ba57c032b5b5fe12891195449750fd5 100644 (file)
@@ -614,7 +614,7 @@ static gboolean __mc_read_service_request_tcp_socket(GIOChannel *src, GIOConditi
        req->client_sock = client_sock;
        msg = mc_cynara_receive_untrusted_message(req->client_sock, req->req_msg, &creds);
        if (msg != MEDIA_CONTROLLER_ERROR_NONE) {
-               mc_error("mc_ipc_receive_message_tcp failed [%d]", msg);
+               mc_error("mc_cynara_receive_untrusted_message failed [%d]", msg);
                goto ERROR;
        }
 
@@ -737,7 +737,7 @@ gpointer mc_svc_thread(gpointer data)
        }
 
        /* Create TCP Socket*/
-       ret = mc_ipc_create_server_socket(MC_DB_UPDATE_PORT, &sockfd);
+       ret = mc_ipc_create_server_socket(&sockfd);
        if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
                mc_error("Failed to create socket");
                return NULL;