return ESPP_CLIENT_ERROR_NONE;
}
+int espp_client_set_display_surface_id(espp_h espp, espp_display_type_e type, unsigned int surface_id, int x, int y, int w, int h)
+{
+ espp_s *_espp = (espp_s *)espp;
+ g_autoptr(GMutexLocker) locker = NULL;
+
+ RET_VAL_IF(!espp, ESPP_CLIENT_ERROR_INVALID_PARAMETER, "espp is NULL");
+
+ locker = g_mutex_locker_new(&_espp->mutex);
+
+ if (espp_service_client_socket_request_set_display_surface_id(_espp, type, surface_id, x, y, w, h) != 0)
+ return ESPP_CLIENT_ERROR_INVALID_OPERATION;
+
+ LOG_INFO("espp[%p] type[%d] surface_id[%u]", espp, type, surface_id);
+
+ return ESPP_CLIENT_ERROR_NONE;
+}
} espp_video_mime_type_e;
/**
+ * @brief Enumerations for the display type
+ */
+typedef enum {
+ ESPP_DISPLAY_TYPE_NONE, /**< None */
+ ESPP_DISPLAY_TYPE_OVERLAY, /**< Overlay */
+ ESPP_DISPLAY_TYPE_EVAS, /**< Evas */
+ ESPP_DISPLAY_TYPE_MIXER, /**< Mixer */
+} espp_display_type_e;
+
+/**
* @brief Audio stream information structure
*/
typedef struct {
*/
int espp_client_set_video_stream_info(espp_h espp, espp_video_stream_info_s *info);
+/**
+ * @brief Sets the video display surface id.
+ * @param[in] espp ESPP service client handle
+ * @param[in] type The display type
+ * @param[in] surface_id Resource id of window
+ * @param[in] x The x coordinate of window
+ * @param[in] y The y coordinate of window
+ * @param[in] w The width of window
+ * @param[in] h The height of window
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #ESPP_CLIENT_ERROR_NONE Successful
+ * @retval #ESPP_CLIENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ESPP_CLIENT_ERROR_INVALID_OPERATION Invalid operation
+ */
+int espp_client_set_display_surface_id(espp_h espp, espp_display_type_e type, unsigned int surface_id, int x, int y, int w, int h);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
int espp_service_client_socket_request_prepare_async(espp_s *espp);
int espp_service_client_socket_request_set_audio_stream_info(espp_s *espp, espp_audio_stream_info_s *info);
int espp_service_client_socket_request_set_video_stream_info(espp_s *espp, espp_video_stream_info_s *info);
+int espp_service_client_socket_request_set_display_surface_id(espp_s *espp, espp_display_type_e type, unsigned int surface_id, int x, int y, int w, int h);
int espp_service_client_socket_request_set_callback(espp_s *espp, espp_service_event_e type, void *callback, void *user_data);
/* event handler */
return 0;
}
+int espp_service_client_socket_request_set_display_surface_id(espp_s *espp, espp_display_type_e type, unsigned int surface_id, int x, int y, int w, int h)
+{
+ espp_service_data_from_client_s data;
+ espp_service_data_from_server_s result;
+
+ ASSERT(espp);
+ RET_VAL_IF(espp->fd == -1, -1, "fd is -1");
+
+ FILL_SOCKET_MSG_REQUEST(data, ESPP_SERVICE_REQUEST_SET_DISPLAY_SURFACE_ID);
+ FILL_SOCKET_MSG_PARAMS(data, ESPP_SERVICE_REQUEST_SET_DISPLAY_SURFACE_ID,
+ "type", type, "surface_id", surface_id,
+ "x", x, "y", y, "w", w, "h", h);
+ if (send_data(espp->fd, &data, &result) != 0)
+ return -1;
+
+ RET_VAL_IF_SERVER_RESULT_ERROR(result, -1);
+
+ LOG_DEBUG("espp[%p], fd[%d]", espp, espp->fd);
+
+ return 0;
+}
+
int espp_service_client_socket_request_set_callback(espp_s *espp, espp_service_event_e type, void *callback, void *user_data)
{
espp_service_data_from_client_s data;
[ESPP_SERVICE_REQUEST_PREPARE_ASYNC] = { "PrepareAsync", NULL },
[ESPP_SERVICE_REQUEST_SET_AUDIO_STREAM_INFO] = { "SetAudioStreamInfo", "suiuuu" },
[ESPP_SERVICE_REQUEST_SET_VIDEO_STREAM_INFO] = { "SetVideoStreamInfo", "suiuuuuuu" },
+ [ESPP_SERVICE_REQUEST_SET_DISPLAY_SURFACE_ID] = { "SetDisplaySurfaceId", "iuiiii" },
[ESPP_SERVICE_REQUEST_SET_CALLBACK] = { "SetCallback", "i" },
};
ESPP_SERVICE_REQUEST_PREPARE_ASYNC,
ESPP_SERVICE_REQUEST_SET_AUDIO_STREAM_INFO,
ESPP_SERVICE_REQUEST_SET_VIDEO_STREAM_INFO,
+ ESPP_SERVICE_REQUEST_SET_DISPLAY_SURFACE_ID,
ESPP_SERVICE_REQUEST_SET_CALLBACK,
} espp_service_request_e;
#include "espp_service_priv.h"
#include <esplusplayer_capi.h>
+#include <esplusplayer_internal.h>
typedef int (*set_cb_func) (esplusplayer_handle handle, void *callback, void *user_data);
typedef void (*func_handler) (handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result);
result->ret = 0;
}
+static void __handle_set_display_surface_id(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
+{
+ int ret;
+ esplusplayer_display_type type;
+ unsigned int surface_id;
+ int x, y, w, h;
+
+ ASSERT(hdata);
+ ASSERT(data);
+ ASSERT(result);
+ ASSERT(hdata->svc);
+ ASSERT(hdata->fd >= 0);
+
+ result->ret = -1;
+
+ RET_IF(!g_hash_table_lookup(hdata->svc->fd_table, hdata->key), "failed to g_hash_table_lookup(), key[%s]", hdata->key);
+
+ ret = espp_service_msg_parse_params(data->params, data->request,
+ &type, &surface_id, &x, &y, &w, &h);
+ if (ret != 0)
+ return;
+
+ ret = esplusplayer_set_surface_display((esplusplayer_handle)hdata->espp, type, surface_id, x, y, w, h);
+ RET_IF(ret != ESPLUSPLAYER_ERROR_TYPE_NONE, "failed to esplusplayer_set_surface_display(), ESPP[%p], surface_id[%u]", hdata->espp, surface_id);
+
+ LOG_INFO("fd[%d], ESPP[%p]: esplusplayer_set_surface_display() success, surface_id[%u]", hdata->fd, hdata->espp, surface_id);
+
+ result->ret = 0;
+}
+
static void __ready_to_prepare_cb(const int type, void *user_data)
{
handler_userdata_s *hdata = (handler_userdata_s *)user_data;
[ESPP_SERVICE_REQUEST_PREPARE_ASYNC] = __handle_prepare_async,
[ESPP_SERVICE_REQUEST_SET_AUDIO_STREAM_INFO] = __handle_set_audio_stream_info,
[ESPP_SERVICE_REQUEST_SET_VIDEO_STREAM_INFO] = __handle_set_video_stream_info,
+ [ESPP_SERVICE_REQUEST_SET_DISPLAY_SURFACE_ID] = __handle_set_display_surface_id,
[ESPP_SERVICE_REQUEST_SET_CALLBACK] = __handle_set_callback,
};