SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(dependents "dlog glib-2.0 libtbm mused legacy-capi-media-player mm-common")
+SET(dependents "dlog glib-2.0 libtbm mused legacy-capi-media-player mm-common tizen-extension-client evas")
INCLUDE(FindPkgConfig)
pkg_check_modules(${fw_name} REQUIRED ${dependents})
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(dependents "dlog elementary evas libtbm mm-common mm-playerclient capi-base-common capi-media-tool eom")
+SET(dependents "dlog elementary evas libtbm mm-common mm-playerclient capi-base-common capi-media-tool eom tizen-extension-client")
SET(pc_dependents "libtbm capi-media-tool capi-base-common capi-media-sound-manager legacy-capi-media-player")
INCLUDE(FindPkgConfig)
static void __prepare_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
{
- char caps[MUSE_MSG_MAX_LENGTH] = {0, };
_player_event_e ev = _PLAYER_EVENT_TYPE_PREPARE;
- if (player_msg_get_string(caps, recvMsg))
- if (strlen(caps) > 0)
- mm_player_mused_realize(cb_info->local_handle, caps);
-
((player_prepared_cb)cb_info->user_cb[ev])(cb_info->user_data[ev]);
set_null_user_cb(cb_info, ev);
}
}
-static void __video_bin_created_cb_handler(callback_cb_info_s *cb_info, char *recvMsg)
-{
- char caps[MUSE_MSG_MAX_LENGTH] = {0, };
- if (player_msg_get_string(caps, recvMsg))
- if (strlen(caps) > 0)
- mm_player_mused_realize(cb_info->local_handle, caps);
-}
-
-static void dummy_user_callback()
-{
-}
-
static void (*_user_callbacks[_PLAYER_EVENT_TYPE_NUM])(callback_cb_info_s *cb_info, char *recvMsg) = {
__prepare_cb_handler, /*_PLAYER_EVENT_TYPE_PREPARE*/
__complete_cb_handler, /*_PLAYER_EVENT_TYPE_COMPLETE*/
__media_stream_audio_seek_cb_handler, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK*/
NULL, /*_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED*/
__video_stream_changed_cb_handler, /*_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED*/
- __video_bin_created_cb_handler, /*_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED*/
};
static void _player_event_job_function(_player_cb_data *data)
ret = wait_for_cb_return(api, pc->cb_info, &ret_buf, CALLBACK_TIME_OUT);
if (ret == PLAYER_ERROR_NONE) {
intptr_t module_addr;
- char stream_path[MUSE_MSG_MAX_LENGTH] = {0, };
*player = (player_h)pc;
if (player_msg_get_type(module_addr, ret_buf, POINTER)) {
pc->cb_info->data_fd = muse_core_client_new_data_ch();
muse_core_send_client_addr(module_addr, pc->cb_info->data_fd);
LOGD("Data channel fd %d, muse module addr %p", pc->cb_info->data_fd, module_addr);
}
-
- if (mm_player_mused_create(&INT_HANDLE(pc)) != MM_ERROR_NONE) {
- LOGE("create failure");
- ret = PLAYER_ERROR_INVALID_OPERATION;
- goto ErrorExit;
- }
- mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), TRUE);
- SERVER_TIMEOUT(pc) += CALLBACK_TIME_OUT;
- if (player_msg_get_string(stream_path, ret_buf)) {
- LOGD("shmsrc stream path : %s", stream_path);
- if (mm_player_set_shm_stream_path(INT_HANDLE(pc), stream_path)
- != MM_ERROR_NONE)
- goto ErrorExit;
- }
} else
goto ErrorExit;
player_msg_send(api, pc, ret_buf, ret);
- if(mm_player_mused_unset_evas_object_cb(INT_HANDLE(pc)) != MM_ERROR_NONE)
+ if(player_unset_evas_object_cb(player) != MM_ERROR_NONE)
LOGW("fail to unset evas object callback");
if (CALLBACK_INFO(pc)) {
- if (mm_player_mused_destroy(INT_HANDLE(pc)) != MM_ERROR_NONE)
- ret = PLAYER_ERROR_INVALID_OPERATION;
-
_player_event_queue_destroy(CALLBACK_INFO(pc));
tbm_bufmgr_deinit(TBM_BUFMGR(pc));
muse_player_api_e api = MUSE_PLAYER_API_PREPARE_ASYNC;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- int is_streaming = 0;
LOGD("ENTER");
}
player_msg_send(api, pc, ret_buf, ret);
- if (ret == PLAYER_ERROR_NONE) {
- player_msg_get(is_streaming, ret_buf);
- IS_STREAMING_CONTENT(pc) = is_streaming;
- mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), is_streaming);
- }
-
g_free(ret_buf);
return ret;
}
muse_player_api_e api = MUSE_PLAYER_API_PREPARE;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- char caps[MUSE_MSG_MAX_LENGTH] = {0, };
- int is_streaming = 0;
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
- if (CALLBACK_INFO(pc))
- mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_visible", 1, NULL);
-
- if (ret == PLAYER_ERROR_NONE) {
- player_msg_get(is_streaming, ret_buf);
- IS_STREAMING_CONTENT(pc) = is_streaming;
- mm_player_get_state_timeout(INT_HANDLE(pc), &SERVER_TIMEOUT(pc), is_streaming);
- player_msg_get_string(caps, ret_buf);
- if (strlen(caps) > 0 && mm_player_mused_realize(INT_HANDLE(pc), caps) != MM_ERROR_NONE)
- ret = PLAYER_ERROR_INVALID_OPERATION;
- }
-
g_free(ret_buf);
return ret;
}
if (!CALLBACK_INFO(pc))
return PLAYER_ERROR_INVALID_STATE;
- mm_player_mused_pre_unrealize(INT_HANDLE(pc));
-
player_msg_send(api, pc, ret_buf, ret);
if (ret == PLAYER_ERROR_NONE) {
set_null_user_cb_lock(pc->cb_info, _PLAYER_EVENT_TYPE_SEEK);
_player_deinit_memory_buffer(pc);
}
- if (mm_player_mused_unrealize(INT_HANDLE(pc)) != MM_ERROR_NONE)
- ret = PLAYER_ERROR_INVALID_OPERATION;
-
g_free(ret_buf);
return ret;
}
Evas_Object *obj = NULL;
const char *object_type = NULL;
#ifdef HAVE_WAYLAND
- void *set_handle = NULL;
- void *set_wl_display = NULL;
- Ecore_Wl_Window *wl_window = NULL;
wl_win_msg_type wl_win;
char *wl_win_msg = (char *)&wl_win;
- MMPlayerPipelineType mmPipelineType = MM_PLAYER_PIPELINE_CLIENT;
+ unsigned int parent_id;
+ struct wl_surface *wl_surface;
+ struct wl_display *wl_display;
+ Ecore_Wl_Window *wl_window = NULL;
#else
unsigned int xhandle = 0;
#endif
wl_win.type = type;
evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y, &wl_win.wl_window_width, &wl_win.wl_window_height);
- if(mm_player_mused_set_evas_object_cb(INT_HANDLE(pc), obj) != MM_ERROR_NONE)
+
+ if(player_set_evas_object_cb(player, obj) != MM_ERROR_NONE){
LOGW("fail to set evas object callback");
+ }
wl_window = elm_win_wl_window_get(obj);
- set_handle = (void *)ecore_wl_window_surface_get(wl_window);
+ wl_surface = (struct wl_surface *) ecore_wl_window_surface_get(wl_window);
/* get wl_display */
- set_wl_display = (void *)ecore_wl_display_get();
-
- LOGI("xid %d, surface_id %d, surface %p(%d), win_id %d",
- elm_win_xwindow_get(obj),
- ecore_wl_window_surface_id_get(wl_window),
- ecore_wl_window_surface_get(wl_window),
- *(int *)ecore_wl_window_surface_get(wl_window),
- ecore_wl_window_id_get(wl_window));
+ wl_display = (struct wl_display *) ecore_wl_display_get();
+
+ if (!pc->wlclient) {
+ ret = _wlclient_create(&pc->wlclient);
+ if ( ret != MM_ERROR_NONE) {
+ LOGE("Wayland client create failure");
+ return ret;
+ }
+ }
+ if (wl_surface && wl_display){
+ LOGD ("surface = %p, wl_display = %p", wl_surface, wl_display);
+ parent_id = _wlclient_get_wl_window_parent_id (pc->wlclient, wl_surface, wl_display);
+ LOGD ("parent_id = %d", parent_id);
+ wl_win.parent_id = parent_id;
+ LOGD ("wl_win.parent_id = %d", wl_win.parent_id);
+ }
+ if (pc->wlclient) {
+ g_free(pc->wlclient);
+ pc->wlclient = NULL;
+ }
#else
/* x window overlay surface */
LOGI("overlay surface type");
evas_object_geometry_get(obj, &wl_win.wl_window_x, &wl_win.wl_window_y,
&wl_win.wl_window_width, &wl_win.wl_window_height);
- set_handle = display;
}
#endif
else
return PLAYER_ERROR_INVALID_PARAMETER;
}
#ifdef HAVE_WAYLAND
- else {
+ else { /* PLAYER_DISPLAY_TYPE_NONE */
LOGI("Wayland surface type is NONE");
wl_win.type = type;
wl_win.wl_window_x = 0;
wl_win.wl_window_height = 0;
}
player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
-
- if (CALLBACK_INFO(pc)) {
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "display_surface_type", type,
- "pipeline_type", mmPipelineType,
- "wl_display", set_wl_display,
- sizeof(void *),
- "display_overlay", set_handle,
- sizeof(display), (char *)NULL);
- if (ret != MM_ERROR_NONE)
- LOGE("Failed to display surface change :%d", ret);
-
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL,
- "wl_window_render_x", wl_win.wl_window_x,
- "wl_window_render_y", wl_win.wl_window_y,
- "wl_window_render_width", wl_win.wl_window_width,
- "wl_window_render_height", wl_win.wl_window_height,
- (char *)NULL);
-
- if (ret != MM_ERROR_NONE)
- LOGE("Failed to set wl_window render rectangle :%d", ret);
- }
#else
player_msg_send2(api, pc, ret_buf, ret, INT, type, INT, xhandle);
#endif
char *ret_buf = NULL;
LOGD("ENTER");
-
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_method", mode, NULL);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
-
player_msg_send1(api, pc, ret_buf, ret, INT, mode);
g_free(ret_buf);
return ret;
char *ret_buf = NULL;
LOGD("ENTER");
-
- ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_rotation", rotation, NULL);
- if (ret != MM_ERROR_NONE)
- return __player_convert_error_code(ret, (char *)__FUNCTION__);
-
player_msg_send1(api, pc, ret_buf, ret, INT, rotation);
g_free(ret_buf);
return ret;
{
PLAYER_INSTANCE_CHECK(player);
int ret = PLAYER_ERROR_NONE;
+#if 0
player_cli_s *pc = (player_cli_s *)player;
int value = 0;
LOGD("ENTER");
-
if (visible == TRUE)
value = 1;
ret = mm_player_set_attribute(INT_HANDLE(pc), NULL, "display_visible", value, NULL);
if (ret != MM_ERROR_NONE)
return __player_convert_error_code(ret, (char *)__FUNCTION__);
+#endif
return ret;
}
muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH;
player_cli_s *pc = (player_cli_s *)player;
char *ret_buf = NULL;
- int type = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
LOGD("ENTER");
player_msg_send1(api, pc, ret_buf, ret, STRING, path);
- if (ret == PLAYER_ERROR_NONE) {
- pc->cb_info->user_cb[type] = dummy_user_callback;
- pc->cb_info->user_data[type] = NULL;
- }
g_free(ret_buf);
return ret;
}
#include <muse_core_ipc.h>
#include <mm_error.h>
#include <dlog.h>
+#include <Evas.h>
#include "player2_private.h"
#include "player_msg_private.h"
#include "player_internal.h"
g_free(ret_buf);
return ret;
}
+
+static void __evas_resize_cb (void *data, Evas *e, Evas_Object *eo, void *event_info)
+{
+
+ player_cli_s *pc = (player_cli_s *)data;
+ wl_win_msg_type wl_win;
+ char *wl_win_msg = (char *)&wl_win;
+ char *ret_buf = NULL;
+ muse_player_api_e api = MUSE_PLAYER_API_RESIZE_VIDEO_RENDER_RECT;
+ int ret = PLAYER_ERROR_NONE;
+ LOGD("ret =%d",ret);
+
+ evas_object_geometry_get(eo, &wl_win.wl_window_x, &wl_win.wl_window_y, &wl_win.wl_window_width, &wl_win.wl_window_height);
+ LOGD("get window rectangle: x(%d) y(%d) width(%d) height(%d)",
+ wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
+
+ wl_win.type = 0; /*init but not use */
+ wl_win.parent_id = 0; /*init but not use */
+
+ player_msg_send_array(api, pc, ret_buf, ret, wl_win_msg, sizeof(wl_win_msg_type), sizeof(char));
+
+ g_free(ret_buf);
+ return;
+
+}
+
+static void __evas_del_cb (void *data, Evas *e, Evas_Object *eo, void *event_info)
+{
+
+ player_cli_s *pc = (player_cli_s *)data;
+
+ evas_object_event_callback_del (eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
+ evas_object_event_callback_del (eo, EVAS_CALLBACK_DEL, __evas_del_cb);
+
+ LOGD("evas callback del %p", eo);
+ pc->have_evas_callback = FALSE;
+
+ return;
+}
+
+int player_set_evas_object_cb(player_h player, Evas_Object * eo)
+{
+
+ PLAYER_INSTANCE_CHECK(player);
+ return_val_if_fail(eo != NULL, MM_ERROR_INVALID_ARGUMENT);
+
+ player_cli_s *pc = (player_cli_s *)player;
+
+ if(pc->have_evas_callback && pc->eo == eo) {
+ LOGW("evas object had callback already %p", pc->eo);
+ return MM_ERROR_UNKNOWN;
+ }
+ pc->eo = eo;
+ evas_object_event_callback_add (eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb, player);
+ evas_object_event_callback_add (eo, EVAS_CALLBACK_DEL, __evas_del_cb, player);
+ LOGD("evas callback add %p", pc->eo);
+ pc->have_evas_callback = TRUE;
+
+ return MM_ERROR_NONE;
+}
+
+int player_unset_evas_object_cb(player_h player)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ player_cli_s *pc = (player_cli_s *)player;
+ return_val_if_fail(pc->eo != NULL, MM_ERROR_INVALID_ARGUMENT);
+
+ evas_object_event_callback_del (pc->eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
+ evas_object_event_callback_del (pc->eo, EVAS_CALLBACK_DEL, __evas_del_cb);
+ LOGD("evas callback del %p", pc->eo);
+ pc->eo = NULL;
+ pc->have_evas_callback = FALSE;
+
+ return MM_ERROR_NONE;
+}
--- /dev/null
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <glib.h>
+#include <string.h>
+#include <dlog.h>
+#include <mm_error.h>
+#include <wayland-client.h>
+#include <tizen-extension-client-protocol.h>
+
+#include "player2_wayland.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "TIZEN_N_PLAYER"
+
+
+
+#define goto_if_fail(expr,label) \
+{ \
+ if (!(expr)) { \
+ debug_error(" failed [%s]\n", #expr); \
+ goto label; \
+ } \
+}
+
+void handle_resource_id(void *data, struct tizen_resource *tizen_resource, uint32_t id)
+{
+ unsigned int *parent_id = data;
+
+ *parent_id = id;
+
+ LOGD("[CLIENT] got parent_id(%d) from server\n", id);
+}
+
+static const struct tizen_resource_listener tz_resource_listener =
+{
+ handle_resource_id,
+};
+
+static void
+handle_global(void *data, struct wl_registry *registry,
+ uint32_t name, const char *interface, uint32_t version)
+{
+ return_if_fail (data != NULL);
+ wl_client *wlclient = data;
+
+ if (strcmp(interface, "tizen_surface") == 0)
+ {
+ LOGD("binding tizen_surface");
+ wlclient->tz_surface = wl_registry_bind(registry, name, &tizen_surface_interface, version);
+ return_if_fail (wlclient->tz_surface != NULL);
+ }
+}
+
+static const struct wl_registry_listener registry_listener =
+{
+ handle_global,
+};
+
+int _wlclient_create (wl_client ** wlclient)
+{
+ wl_client *ptr = NULL;
+
+ ptr = g_malloc0 (sizeof (wl_client));
+ if (!ptr) {
+ LOGE ("Cannot allocate memory for wlclient\n");
+ goto ERROR;
+ } else {
+ *wlclient = ptr;
+ LOGD ("Success create wlclient(%p)", *wlclient);
+ }
+ return MM_ERROR_NONE;
+
+ERROR:
+ *wlclient = NULL;
+ return MM_ERROR_PLAYER_NO_FREE_SPACE;
+}
+
+
+int _wlclient_get_wl_window_parent_id (wl_client * wlclient, struct wl_surface *surface, struct wl_display *display)
+{
+ goto_if_fail (wlclient != NULL, failed);
+ goto_if_fail (surface != NULL, failed);
+ goto_if_fail (display != NULL, failed);
+
+ unsigned int parent_id = 0;
+
+ wlclient->display = display;
+ goto_if_fail (wlclient->display != NULL, failed);
+
+ wlclient->registry = wl_display_get_registry(wlclient->display);
+ goto_if_fail (wlclient->registry != NULL, failed);
+
+ wl_registry_add_listener(wlclient->registry, ®istry_listener, wlclient);
+ wl_display_dispatch(wlclient->display);
+ wl_display_roundtrip(wlclient->display);
+
+ /* check global objects */
+ goto_if_fail (wlclient->tz_surface != NULL, failed);
+
+ /* Get parent_id which is unique in a entire systemw. */
+ wlclient->tz_resource = tizen_surface_get_tizen_resource(wlclient->tz_surface, surface);
+ goto_if_fail (wlclient->tz_resource != NULL, failed);
+
+ tizen_resource_add_listener(wlclient->tz_resource, &tz_resource_listener, &parent_id);
+ wl_display_roundtrip(wlclient->display);
+ goto_if_fail (parent_id > 0, failed);
+
+ _wlclient_finalize(wlclient);
+
+ return parent_id;
+
+failed:
+ LOGE ("Failed to get parent_id");
+
+ return 0;
+}
+
+void _wlclient_finalize (wl_client * wlclient)
+{
+ LOGD ("start finalize wlclient");
+ return_if_fail (wlclient != NULL)
+
+ if (wlclient->tz_surface)
+ tizen_surface_destroy(wlclient->tz_surface);
+
+ if (wlclient->tz_resource)
+ tizen_resource_destroy(wlclient->tz_resource);
+
+ /* destroy registry */
+ if (wlclient->registry)
+ wl_registry_destroy(wlclient->registry);
+ return;
+}
+
#ifndef __TIZEN_MEDIA_PLAYER_2_PRIVATE_H__
#define __TIZEN_MEDIA_PLAYER_2_PRIVATE_H__
#include <tbm_bufmgr.h>
+#include <Evas.h>
#include "player.h"
#include "mm_types.h"
#include "muse_core.h"
#include "muse_core_ipc.h"
-
+#include "player2_wayland.h"
#ifdef __cplusplus
extern "C" {
#endif
MUSE_PLAYER_API_GET_DISPLAY_ROTATION,
MUSE_PLAYER_API_SET_DISPLAY_VISIBLE,
MUSE_PLAYER_API_IS_DISPLAY_VISIBLE,
+ MUSE_PLAYER_API_RESIZE_VIDEO_RENDER_RECT,
MUSE_PLAYER_API_GET_CONTENT_INFO,
MUSE_PLAYER_API_GET_CODEC_INFO,
MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO,
callback_cb_info_s *cb_info;
player_data_s *head;
server_info_s server;
+ wl_client *wlclient;
+ Evas_Object * eo;
+ gboolean have_evas_callback;
} player_cli_s;
/* Internal handle */
int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out);
int player_sound_register(player_h player, int pid);
int player_is_streaming(player_h player, bool *is_streaming);
-
-/**
- * @brief Called when the video sink bin is crated.
- * @since_tizen 3.0
- * @param[out] caps video sink current caps
- * @param[out ] user_data The user data passed from the callback registration function
- * @see player_set_vidoe_bin_created_cb()
- * @see player_unset_vidoe_bin_created_cb()
- */
-typedef void (*player_video_bin_created_cb)(const char *caps, void *user_data);
-
-/**
- * @brief Registers a callback function to be invoked when video sink bin is created.
- * @since_tizen 3.0
- * @param[in] player The handle to the media player
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @post player_video_bin_created_cb() will be invoked.
- * @see player_unset_vidoe_bin_created_cb()
- */
-int player_set_video_bin_created_cb(player_h player, player_video_bin_created_cb callback, void *user_data);
-
-/**
- * @brief Unregisters a callback function to be invoked when video sink bin is created.
- * @since_tizen 3.0
- * @param[in] player The handle to the media player
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @post player_video_bin_created_cb() will be invoked.
- * @see player_unset_vidoe_bin_created_cb()
- */
-int player_unset_video_bin_created_cb(player_h player);
-
+int player_set_evas_object_cb(player_h player, Evas_Object * eo);
+int player_unset_evas_object_cb(player_h player);
#ifdef __cplusplus
}
--- /dev/null
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+#ifndef __TIZEN_MEDIA_PLAYER_2_WLCLIENT_H__
+#define __TIZEN_MEDIA_PLAYER_2_WLCLIENT_H__
+#include <stdio.h>
+#include <tbm_bufmgr.h>
+#include <tizen-extension-client-protocol.h>
+#include <wayland-client.h>
+#include "mm_types.h"
+#include "mm_debug.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct
+{
+ struct wl_display *display;
+ struct wl_registry *registry;
+ struct tizen_surface *tz_surface;
+ struct tizen_resource *tz_resource;
+} wl_client;
+int _wlclient_create (wl_client ** wlclient);
+int _wlclient_get_wl_window_parent_id (wl_client * wlclient, struct wl_surface *surface, struct wl_display *display);
+void _wlclient_finalize (wl_client * wlclient);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_MEDIA_PLAYER_2_WLCLIENT_H__ */
typedef struct {
int type;
- intptr_t surface;
+ unsigned int parent_id;
int wl_window_x;
int wl_window_y;
int wl_window_width;
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(capi-media-sound-manager)
BuildRequires: pkgconfig(legacy-capi-media-player)
+BuildRequires: pkgconfig(tizen-extension-client)
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
* define for lagacy API for mused
*/
#ifdef HAVE_WAYLAND
-extern int player_set_display_wl_for_mused(player_h player, player_display_type_e type, intptr_t surface, int x, int y, int w, int h);
+extern int player_set_display_wl_for_mused(player_h player, player_display_type_e type, int parent_id, int x, int y, int w, int h);
+extern int player_resize_video_render_rect(player_h player, int x, int y, int w, int h);
#else
extern int player_set_display_for_mused(player_h player, player_display_type_e type, unsigned int xhandle);
#endif
_set_media_stream_audio_seek_cb, /*_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK*/
NULL, /*_PLAYER_EVENT_TYPE_AUDIO_STREAM_CHANGED*/
_set_video_stream_changed_cb, /*_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED*/
- NULL, /*_PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED*/
};
static int player_disp_set_callback(muse_module_h module)
#ifdef HAVE_WAYLAND
player_msg_get_array(wl_win_msg, muse_core_client_get_msg(module));
- ret = player_set_display_wl_for_mused((player_h)handle, wl_win.type, wl_win.surface, wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
+ ret = player_set_display_wl_for_mused((player_h)handle, wl_win.type, wl_win.parent_id, wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
#else
player_msg_get(type, muse_core_client_get_msg(module));
player_msg_get(xhandle, muse_core_client_get_msg(module));
return ret;
}
+#ifdef HAVE_WAYLAND
+static int player_disp_resize_video_render_rect(muse_module_h module)
+{
+ int ret = -1;
+ intptr_t handle;
+ muse_player_api_e api = MUSE_PLAYER_API_RESIZE_VIDEO_RENDER_RECT;
+
+ wl_win_msg_type wl_win;
+ char *wl_win_msg = (char *)&wl_win;
+ handle = muse_core_ipc_get_handle(module);
+
+ player_msg_get_array(wl_win_msg, muse_core_client_get_msg(module));
+
+ ret = player_resize_video_render_rect((player_h)handle, wl_win.wl_window_x, wl_win.wl_window_y, wl_win.wl_window_width, wl_win.wl_window_height);
+ player_msg_return(api, ret, module);
+
+ return ret;
+
+}
+#endif
static int player_disp_get_content_info(muse_module_h module)
{
int ret = -1;
return ret;
}
-static void _video_bin_created_cb(const char *caps, void *user_data)
-{
- muse_module_h module = (muse_module_h)user_data;
- muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
- _player_event_e ev = _PLAYER_EVENT_TYPE_VIDEO_BIN_CREATED;
-
- LOGD("Enter");
-
- player_msg_event1(api, ev, module, STRING, caps);
-}
-
static int player_disp_set_progressive_download_path(muse_module_h module)
{
int ret = -1;
player_msg_get_string(path, muse_core_client_get_msg(module));
ret = player_set_progressive_download_path((player_h)handle, path);
- if (ret == PLAYER_ERROR_NONE)
- player_set_video_bin_created_cb((player_h)handle, _video_bin_created_cb, module);
-
player_msg_return(api, ret, module);
return ret;
player_disp_get_display_rotation, /* MUSE_PLAYER_API_GET_DISPLAY_ROTATION */
player_disp_set_display_visible, /* MUSE_PLAYER_API_SET_DISPLAY_VISIBLE */
player_disp_is_display_visible, /* MUSE_PLAYER_API_IS_DISPLAY_VISIBLE */
+ player_disp_resize_video_render_rect, /* MUSE_PLAYER_API_RESIZE_VIDEO_RENDER_RECT */
player_disp_get_content_info, /* MUSE_PLAYER_API_GET_CONTENT_INFO */
player_disp_get_codec_info, /* MUSE_PLAYER_API_GET_CODEC_INFO */
player_disp_get_audio_stream_info, /* MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO */