#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "glib.h"
#include "tbm_bufmgr.h"
#include "tbm_surface.h"
int ret = PLAYER_ERROR_NONE;
int sock_fd = -1;
+ int pid = getpid();
mm_player_api_e api = MM_PLAYER_API_CREATE;
mmsvc_api_client_e client = MMSVC_PLAYER;
ret = PLAYER_ERROR_INVALID_OPERATION;
goto ErrorExit;
}
- player_msg_send1_async(api, (intptr_t)player, sock_fd, INT, client);
+ player_msg_send2_async(api, (intptr_t)player, sock_fd, INT, client, INT, pid);
pc = g_new0(player_cli_s, 1);
if (pc == NULL) {
/* external handle cast */
#define EXT_HANDLE(h) ((h)->remote_handle)
+int player_sound_register(player_h player, int pid);
+
/**
* @brief Called when the video sink bin is crated.
* @since_tizen 3.0
}while(0)
/**
+ * @brief Create and send message. Does not wait server result.
+ * @remarks Does NOT guarantee thread safe.
+ * @param[in] api The enum of module API.
+ * @param[in] player The server side handle of media player.
+ * @param[in] fd socket fd
+ * @param[in] type The enum of parameter type. Muse be one of thease(INT, INT64, POINTER, DOUBLE, STRING, ARRAY)
+ * @param[in] param the name of param is key, must be local variable. never be pointer.
+ */
+#define player_msg_send2_async(api, player, fd, type1, param1, type2, param2) \
+ do{ \
+ char *__sndMsg__; \
+ int __len__; \
+ type1 __value1__ = (type1)param1; \
+ type2 __value2__ = (type2)param2; \
+ __sndMsg__ = mmsvc_core_msg_json_factory_new(api, PARAM_HANDLE, player, \
+ MUSED_TYPE_##type1, #param1, __value1__, \
+ MUSED_TYPE_##type2, #param2, __value2__, \
+ 0); \
+ __len__ = mmsvc_core_ipc_send_msg(fd, __sndMsg__); \
+ mmsvc_core_msg_json_factory_free(__sndMsg__); \
+ if (__len__ <= 0) { \
+ LOGE("sending message failed"); \
+ return PLAYER_ERROR_INVALID_OPERATION; \
+ } \
+ }while(0)
+
+
+/**
* @brief Create and send message for callback. Does not wait server result.
* @remarks Does NOT guarantee thread safe.
* @param[in] api The enum of module API.
data_thread_info_t *thread_i;
static guint stream_id = 0;
char stream_path[STREAM_PATH_LENGTH];
+ int pid;
ret = player_create(&player);
LOGD("handle : %p, client : %p", player, client);
+ player_msg_get(pid, mmsvc_core_client_get_msg(client));
+
+ if(ret == PLAYER_ERROR_NONE)
+ ret = player_sound_register(player, pid);
+ else
+ player_msg_return(api, ret, client);
+
if(ret == PLAYER_ERROR_NONE) {
thread_i = g_new(data_thread_info_t, 1);
thread_i->running = 1;
prepare_data_t *prepare_data;
player_msg_get_type(handle, mmsvc_core_client_get_msg(client), POINTER);
+
player = (player_h) handle;
prepare_data = g_new(prepare_data_t, 1);