ADD_DEFINITIONS("-DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
ADD_CUSTOM_COMMAND(
- DEPENDS clean
+ DEPENDS clean
COMMENT "distribution clean"
COMMAND find
- ARGS .
+ ARGS .
-not -name config.cmake -and \(
-name tester.c -or
-name Testing -or
+%bcond_with wayland
+%bcond_with x
+
Name: capi-media-player
Summary: A Media Player library in Tizen Native API
Version: 0.1.1
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(evas)
+%if %{with x}
BuildRequires: pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires: pkgconfig(ecore-wayland)
+%endif
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with wayland}
+ -DWAYLAND_SUPPORT=On \
+%else
+ -DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+ -DX11_SUPPORT=On
+%else
+ -DX11_SUPPORT=Off
+%endif
make %{?jobs:-j%jobs}
INCLUDE_DIRECTORIES(../include)
link_directories(${CMAKE_SOURCE_DIR}/../)
+IF(X11_SUPPORT)
+ SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+ SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED mm-player appcore-efl elementary ecore evas ecore-x capi-media-sound-manager)
+pkg_check_modules(${fw_test} REQUIRED mm-player appcore-efl elementary ecore evas capi-media-sound-manager ${WIN_PKG})
+
+
FOREACH(flag ${${fw_test}_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
aux_source_directory(. sources)
FOREACH(src ${sources})
GET_FILENAME_COMPONENT(src_name ${src} NAME_WE)
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <player.h>
#include <pthread.h>
#include <glib.h>
#include <dlfcn.h>
#include <appcore-efl.h>
#include <Elementary.h>
+
+#ifdef HAVE_X11
#include <Ecore_X.h>
+#endif
+#ifdef HAVE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
+
#define PACKAGE "player_test"
#define MAX_STRING_LEN 2048
Evas_Object *win;
Evas_Object *layout_main; /* layout widget based on EDJ */
+ #ifdef HAVE_X11
Ecore_X_Window xid;
+ #elif HAVE_WAYLAND
+ unsigned int xid;
+ #endif
/* add more variables here */
};
elm_win_title_set(eo, name);
elm_win_borderless_set(eo, EINA_TRUE);
evas_object_smart_callback_add(eo, "delete,request",win_del, NULL);
- ecore_x_window_size_get(ecore_x_window_root_first_get(),&w, &h);
+ #ifdef HAVE_X11
+ Ecore_X_Window xwin;
+ xwin = elm_win_xwindow_get(eo);
+ if (xwin != 0)
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+ else {
+ #endif
+ #ifdef HAVE_WAYLAND
+ Ecore_Wl_Window *wlwin;
+ wlwin = elm_win_wl_window_get(eo);
+ if (wlwin != NULL)
+ ecore_wl_screen_size_get(&w, &h);
+ #endif
+ #ifdef HAVE_X11
+ }
+ #endif
evas_object_resize(eo, w, h);
}
win = create_win(PACKAGE);
if (win == NULL)
return -1;
- ad->win = win;
- evas_object_show(win);
+ ad->win = win;
+ evas_object_show(win);
return 0;
}
player_set_subtitle_path(g_player,g_subtitle_uri);
player_set_subtitle_updated_cb(g_player, subtitle_updated_cb, (void*)g_player);
}
+ #ifdef HAVE_X11
player_set_display(g_player,PLAYER_DISPLAY_TYPE_X11,GET_DISPLAY(ad.xid));
+ #elif HAVE_WAYLAND
+ player_set_display(g_player,PLAYER_DISPLAY_TYPE_EVAS,GET_DISPLAY(ad.xid));
+ #endif
+
+
player_set_buffering_cb(g_player, buffering_cb, (void*)g_player);
player_set_completed_cb(g_player, completed_cb, (void*)g_player);
player_set_uri(g_player, g_uri);
-
+
if ( async )
{
ret = player_prepare_async(g_player, prepared_cb, (void*) g_player);