Name: espp-service
Summary: ESPP service package which contains client lib. and daemon binary
-Version: 0.3.17
+Version: 0.3.18
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
USER_SRCS = ./src/daemon/*.c ./src/common/*.c
# User Defines
-USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.16"
+USER_DEFS = USE_DLOG USE_SERVICE_APP ESPP_SERVICE_VERSION="0.3.18"
# User Includes
USER_INC_DIRS = ./src/daemon ./src/common ./inc ./inc/esplusplayer_capi
return ESPP_CLIENT_ERROR_NONE;
}
+int espp_client_set_display_rotation(espp_h espp, espp_display_rotation_angle_e angle)
+{
+ 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_rotation(_espp, angle) != 0)
+ return ESPP_CLIENT_ERROR_INVALID_OPERATION;
+
+ LOG_INFO("espp[%p] angle[%d]", espp, angle);
+
+ return ESPP_CLIENT_ERROR_NONE;
+}
+
int espp_client_set_audio_mute(espp_h espp, bool mute)
{
espp_s *_espp = (espp_s *)espp;
ESPP_DISPLAY_MODE_DST_ROI, /**< Destination RoI */
} espp_display_mode_e;
+/**
+ * @brief Enumerations for the display rotation angle
+ */
+typedef enum {
+ ESPP_DISPLAY_ROTATION_ANGLE_0, /**< Rotation angle 0 */
+ ESPP_DISPLAY_ROTATION_ANGLE_90, /**< Rotation angle 90 */
+ ESPP_DISPLAY_ROTATION_ANGLE_180, /**< Rotation angle 180 */
+ ESPP_DISPLAY_ROTATION_ANGLE_270, /**< Rotation angle 270 */
+} espp_display_rotation_angle_e;
+
/**
* @brief Enumerations for decoded video buffer type
*/
* @see espp_client_set_display_mode()
* @see espp_client_set_display_roi()
* @see espp_client_set_display_visible()
+ * @see espp_client_set_display_rotation()
*/
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);
* @see espp_client_open()
* @see espp_client_set_display_surface_id()
* @see espp_client_set_display_roi()
+ * @see espp_client_set_display_rotation()
*/
int espp_client_set_display_mode(espp_h espp, espp_display_mode_e mode);
* @pre #ESPP_DISPLAY_MODE_DST_ROI must be set by espp_client_set_display_mode() before calling this function.
* @see espp_client_set_display_surface_id()
* @see espp_client_set_display_mode()
+ * @see espp_client_set_display_rotation()
*/
int espp_client_set_display_roi(espp_h espp, int x, int y, int w, int h);
*/
int espp_client_set_display_visible(espp_h espp, bool visible);
+/**
+ * @brief Set the rotate angle of the video display.
+ * @param[in] espp ESPP service client handle
+ * @param[in] angle The rotation angle of the display
+ * @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
+ * @see espp_client_set_display_surface_id()
+ * @see espp_client_set_display_mode()
+ * @see espp_client_set_display_roi()
+ */
+int espp_client_set_display_rotation(espp_h espp, espp_display_rotation_angle_e angle);
+
/**
* @brief Sets mute of the audio stream.
* @param[in] espp ESPP service client handle
int espp_service_client_socket_request_set_display_mode(espp_s *espp, espp_display_mode_e mode);
int espp_service_client_socket_request_set_display_roi(espp_s *espp, int x, int y, int w, int h);
int espp_service_client_socket_request_set_display_visible(espp_s *espp, bool visible);
+int espp_service_client_socket_request_set_display_rotation(espp_s *espp, espp_display_rotation_angle_e angle);
int espp_service_client_socket_request_set_audio_mute(espp_s *espp, bool mute);
int espp_service_client_socket_request_set_audio_volume(espp_s *espp, int volume);
int espp_service_client_socket_request_get_audio_volume(espp_s *espp, int *volume);
return 0;
}
+int espp_service_client_socket_request_set_display_rotation(espp_s *espp, espp_display_rotation_angle_e angle)
+{
+ 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_ROTATION);
+ FILL_SOCKET_MSG_PARAMS(data, ESPP_SERVICE_REQUEST_SET_DISPLAY_ROTATION, "angle", angle);
+ 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_audio_mute(espp_s *espp, bool mute)
{
espp_service_data_from_client_s data;
[ESPP_SERVICE_REQUEST_SET_DISPLAY_MODE] = { "SetDisplayMode", "i" },
[ESPP_SERVICE_REQUEST_SET_DISPLAY_ROI] = { "SetDisplayRoi", "iiii" },
[ESPP_SERVICE_REQUEST_SET_DISPLAY_VISIBLE] = { "SetDisplayVisible", "b" },
+ [ESPP_SERVICE_REQUEST_SET_DISPLAY_ROTATION] = { "SetDisplayRotation", "i" },
[ESPP_SERVICE_REQUEST_SET_AUDIO_MUTE] = { "SetAudioMute", "b" },
[ESPP_SERVICE_REQUEST_SET_AUDIO_VOLUME] = { "SetAudioVolume", "i" },
[ESPP_SERVICE_REQUEST_GET_AUDIO_VOLUME] = { "GetAudioVolume", NULL },
ESPP_SERVICE_REQUEST_SET_DISPLAY_MODE,
ESPP_SERVICE_REQUEST_SET_DISPLAY_ROI,
ESPP_SERVICE_REQUEST_SET_DISPLAY_VISIBLE,
+ ESPP_SERVICE_REQUEST_SET_DISPLAY_ROTATION,
ESPP_SERVICE_REQUEST_SET_AUDIO_MUTE,
ESPP_SERVICE_REQUEST_SET_AUDIO_VOLUME,
ESPP_SERVICE_REQUEST_GET_AUDIO_VOLUME,
result->ret = 0;
}
+static void __handle_set_display_rotation(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
+{
+ int ret;
+ esplusplayer_display_rotation_type type;
+
+ 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);
+ if (ret != 0)
+ return;
+
+ ret = esplusplayer_set_display_rotation((esplusplayer_handle)hdata->espp, type);
+ RET_IF(ret != ESPLUSPLAYER_ERROR_TYPE_NONE, "failed to esplusplayer_set_display_rotation(), ESPP[%p], type[%d]",
+ hdata->espp, type);
+
+ LOG_INFO("fd[%d], ESPP[%p]: esplusplayer_set_display_rotation() success, type[%d]",
+ hdata->fd, hdata->espp, type);
+
+ result->ret = 0;
+}
+
static void __handle_set_audio_mute(handler_userdata_s *hdata, espp_service_data_from_client_s *data, espp_service_data_from_server_s *result)
{
int ret;
[ESPP_SERVICE_REQUEST_SET_DISPLAY_MODE] = __handle_set_display_mode,
[ESPP_SERVICE_REQUEST_SET_DISPLAY_ROI] = __handle_set_display_roi,
[ESPP_SERVICE_REQUEST_SET_DISPLAY_VISIBLE] = __handle_set_display_visible,
+ [ESPP_SERVICE_REQUEST_SET_DISPLAY_ROTATION] = __handle_set_display_rotation,
[ESPP_SERVICE_REQUEST_SET_AUDIO_MUTE] = __handle_set_audio_mute,
[ESPP_SERVICE_REQUEST_SET_AUDIO_VOLUME] = __handle_set_audio_volume,
[ESPP_SERVICE_REQUEST_GET_AUDIO_VOLUME] = __handle_get_audio_volume,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="7.0" package="com.samsung.tizen.espp-service" version="0.3.16">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="7.0" package="com.samsung.tizen.espp-service" version="0.3.18">
<profile name="mobile"/>
<description>espp-service</description>
<service-application appid="com.samsung.tizen.espp-service" auto-restart="false" exec="espp-service" multiple="false" nodisplay="false" on-boot="false" taskmanage="false" type="capp">