#include "e_video_internal.h"
#include <tizen-extension-server-protocol.h>
-typedef struct _E_Video E_Video;
+typedef struct _E_Video_Object E_Video_Object;
-struct _E_Video
+struct _E_Video_Object
{
- struct wl_resource *video_object;
+ struct wl_resource *resource;
E_Client *ec;
struct
{
- Ecore_Event_Handler *ec_visibility;
- Ecore_Event_Handler *ec_remove;
- } event_handler;
+ Ecore_Event_Handler *visibility_change;
+ Ecore_Event_Handler *remove;
+ } client_event_handler;
};
-static Eina_List *video_list = NULL;
+static Eina_List *_vo_list = NULL;
-static void _e_video_set(E_Video *video, E_Client *ec);
-static void _e_video_destroy(E_Video *video);
+static void _e_comp_wl_video_object_setup(E_Video_Object *vo, E_Client *ec);
+static void _e_comp_wl_video_object_destroy(E_Video_Object *vo);
static int
-_e_video_get_prop_id(E_Video *video, const char *name)
+_e_comp_wl_video_object_prop_id_get(E_Video_Object *vo, const char *name)
{
const tdm_prop *props;
int i, count = 0;
- e_client_video_available_properties_get(video->ec, &props, &count);
+ e_client_video_available_properties_get(vo->ec, &props, &count);
for (i = 0; i < count; i++)
{
if (!strncmp(name, props[i].name, TDM_NAME_LEN))
{
- VDB("check property(%s)", video->ec, name);
+ VDB("check property(%s)", vo->ec, name);
return props[i].id;
}
}
}
static Eina_Bool
-_e_comp_wl_video_cb_ec_remove(void *data, int type, void *event)
+_e_comp_wl_video_object_ec_cb_remove(void *data, int type, void *event)
{
E_Event_Client *ev = event;
E_Client *ec;
- E_Video *video;
+ E_Video_Object *vo;
EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
EINA_SAFETY_ON_NULL_RETURN_VAL(ev->ec, ECORE_CALLBACK_PASS_ON);
ec = ev->ec;
- video = data;
- if (video->ec != ec) return ECORE_CALLBACK_PASS_ON;
+ vo = data;
+ if (vo->ec != ec) return ECORE_CALLBACK_PASS_ON;
if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
- video_list = eina_list_remove(video_list, video);
+ _vo_list = eina_list_remove(_vo_list, vo);
- _e_video_destroy(video);
+ _e_comp_wl_video_object_destroy(vo);
return ECORE_CALLBACK_PASS_ON;
}
-static E_Video *
-_e_video_create(struct wl_resource *video_object, struct wl_resource *surface)
+static E_Video_Object *
+_e_comp_wl_video_object_create(struct wl_resource *resource, struct wl_resource *surface)
{
- E_Video *video;
+ E_Video_Object *vo;
E_Client *ec;
ec = wl_resource_get_user_data(surface);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), NULL);
- video = calloc(1, sizeof *video);
- EINA_SAFETY_ON_NULL_RETURN_VAL(video, NULL);
+ vo = calloc(1, sizeof *vo);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(vo, NULL);
- video->video_object = video_object;
+ vo->resource = resource;
VIN("create.", ec);
- video_list = eina_list_append(video_list, video);
+ _vo_list = eina_list_append(_vo_list, vo);
- _e_video_set(video, ec);
+ _e_comp_wl_video_object_setup(vo, ec);
- video->event_handler.ec_remove =
+ vo->client_event_handler.remove =
ecore_event_handler_add(E_EVENT_CLIENT_REMOVE,
- _e_comp_wl_video_cb_ec_remove, video);
+ _e_comp_wl_video_object_ec_cb_remove, vo);
- return video;
+ return vo;
}
static void
-_e_video_set(E_Video *video, E_Client *ec)
+_e_comp_wl_video_object_setup(E_Video_Object *vo, E_Client *ec)
{
Eina_Bool res;
int minw = -1, minh = -1, maxw = -1, maxh = -1;
int i, count = 0;
const tdm_prop *props;
- video->ec = ec;
+ vo->ec = ec;
- EINA_SAFETY_ON_NULL_RETURN(video->ec->zone);
+ EINA_SAFETY_ON_NULL_RETURN(vo->ec->zone);
e_client_video_set(ec);
res = e_zone_video_available_size_get(ec->zone, &minw, &minh, &maxw, &maxh, &align);
if (res)
{
- tizen_video_object_send_size(video->video_object,
+ tizen_video_object_send_size(vo->resource,
minw, minh, maxw, maxh, align);
- /* VIN("align width: output(%d) pp(%d) video(%d)",
- video->output_align, video->pp_align, video->video_align); */
+ /* VIN("align width: output(%d) pp(%d) vo(%d)",
+ vo->output_align, vo->pp_align, vo->video_align); */
}
else
VER("Failed to get video available size", ec);
continue;
}
- tizen_video_object_send_attribute(video->video_object, props[i].name, value.u32);
+ tizen_video_object_send_attribute(vo->resource, props[i].name, value.u32);
}
}
static void
-_e_video_destroy(E_Video *video)
+_e_comp_wl_video_object_destroy(E_Video_Object *vo)
{
- if (!video)
+ if (!vo)
return;
- VIN("destroy", video->ec);
+ VIN("destroy", vo->ec);
- wl_resource_set_destructor(video->video_object, NULL);
+ wl_resource_set_destructor(vo->resource, NULL);
- E_FREE_FUNC(video->event_handler.ec_visibility, ecore_event_handler_del);
- E_FREE_FUNC(video->event_handler.ec_remove, ecore_event_handler_del);
+ E_FREE_FUNC(vo->client_event_handler.visibility_change, ecore_event_handler_del);
+ E_FREE_FUNC(vo->client_event_handler.remove, ecore_event_handler_del);
- e_client_video_unset(video->ec);
+ e_client_video_unset(vo->ec);
- free(video);
+ free(vo);
}
static void
-_e_comp_wl_video_object_destroy(struct wl_resource *resource)
+_e_comp_wl_video_object_resource_destroy(struct wl_resource *resource)
{
- E_Video *video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ E_Video_Object *vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- video_list = eina_list_remove(video_list, video);
+ _vo_list = eina_list_remove(_vo_list, vo);
- _e_video_destroy(video);
+ _e_comp_wl_video_object_destroy(vo);
}
static void
-_e_comp_wl_video_object_cb_destroy(struct wl_client *client, struct wl_resource *resource)
+_e_comp_wl_video_object_handle_destroy(struct wl_client *client, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
static void
-_e_comp_wl_video_object_cb_set_attribute(struct wl_client *client,
+_e_comp_wl_video_object_handle_attribute_set(struct wl_client *client,
struct wl_resource *resource,
const char *name,
int32_t value)
{
- E_Video *video;
+ E_Video_Object *vo;
tdm_value v;
int id;
- video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- if (!video->ec)
+ if (!vo->ec)
return;
VIN("Client(%s):PID(%d) Attribute:%s, Value:%d",
- video->ec, e_client_util_name_get(video->ec) ?: "No Name",
- video->ec->netwm.pid, name, value);
+ vo->ec, e_client_util_name_get(vo->ec) ?: "No Name",
+ vo->ec->netwm.pid, name, value);
// check available property & count
- id = _e_video_get_prop_id(video, name);
+ id = _e_comp_wl_video_object_prop_id_get(vo, name);
if(id < 0)
{
- VIN("no available property", video->ec);
+ VIN("no available property", vo->ec);
return;
}
v.u32 = value;
- e_client_video_property_set(video->ec, id, v, EINA_FALSE);
+ e_client_video_property_set(vo->ec, id, v, EINA_FALSE);
}
static Eina_Bool
-_e_comp_wl_video_cb_visibility_change(void *data, int type, void *event)
+_e_comp_wl_video_object_ec_cb_visibility_change(void *data, int type, void *event)
{
- E_Video *video;
+ E_Video_Object *vo;
E_Client *ec;
E_Event_Client *ev;
ev = event;
- video = data;
- if (video->ec != ev->ec)
+ vo = data;
+ if (vo->ec != ev->ec)
return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
}
static void
-_e_comp_wl_video_object_cb_follow_topmost_visibility(struct wl_client *client,
+_e_comp_wl_video_object_handle_topmost_visibility_follow(struct wl_client *client,
struct wl_resource *resource)
{
- E_Video *video;
+ E_Video_Object *vo;
- video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- if(!video->ec)
+ if(!vo->ec)
return;
- VIN("set follow_topmost_visibility", video->ec);
+ VIN("set follow_topmost_visibility", vo->ec);
- e_client_video_topmost_visibility_follow(video->ec);
+ e_client_video_topmost_visibility_follow(vo->ec);
- if (!video->event_handler.ec_visibility)
+ if (!vo->client_event_handler.visibility_change)
{
- video->event_handler.ec_visibility =
+ vo->client_event_handler.visibility_change =
ecore_event_handler_add(E_EVENT_CLIENT_VISIBILITY_CHANGE,
- (Ecore_Event_Handler_Cb)_e_comp_wl_video_cb_visibility_change,
- video);
+ (Ecore_Event_Handler_Cb)_e_comp_wl_video_object_ec_cb_visibility_change,
+ vo);
}
}
static void
-_e_comp_wl_video_object_cb_unfollow_topmost_visibility(struct wl_client *client,
+_e_comp_wl_video_object_handle_topmost_visibility_unfollow(struct wl_client *client,
struct wl_resource *resource)
{
- E_Video *video;
+ E_Video_Object *vo;
- video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- if(!video->ec)
+ if(!vo->ec)
return;
- VIN("set unfollow_topmost_visibility", video->ec);
+ VIN("set unfollow_topmost_visibility", vo->ec);
- e_client_video_topmost_visibility_unfollow(video->ec);
- E_FREE_FUNC(video->event_handler.ec_visibility, ecore_event_handler_del);
+ e_client_video_topmost_visibility_unfollow(vo->ec);
+ E_FREE_FUNC(vo->client_event_handler.visibility_change, ecore_event_handler_del);
}
static void
-_e_comp_wl_video_object_cb_allowed_attribute(struct wl_client *client,
+_e_comp_wl_video_object_handle_attribute_allowed(struct wl_client *client,
struct wl_resource *resource)
{
- E_Video *video;
+ E_Video_Object *vo;
- video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- if(!video->ec)
+ if(!vo->ec)
return;
- VIN("set allowed_attribute", video->ec);
- e_client_video_property_allow(video->ec);
+ VIN("set allowed_attribute", vo->ec);
+ e_client_video_property_allow(vo->ec);
}
static void
-_e_comp_wl_video_object_cb_disallowed_attribute(struct wl_client *client,
+_e_comp_wl_video_object_handle_attribute_disallowed(struct wl_client *client,
struct wl_resource *resource)
{
- E_Video *video;
+ E_Video_Object *vo;
- video = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(video);
+ vo = wl_resource_get_user_data(resource);
+ EINA_SAFETY_ON_NULL_RETURN(vo);
- if(!video->ec)
+ if(!vo->ec)
return;
- VIN("set disallowed_attribute", video->ec);
- e_client_video_property_disallow(video->ec);
+ VIN("set disallowed_attribute", vo->ec);
+ e_client_video_property_disallow(vo->ec);
}
-static const struct tizen_video_object_interface _e_comp_wl_video_object_interface =
+static const struct tizen_video_object_interface _e_comp_wl_video_object_implementation =
{
- _e_comp_wl_video_object_cb_destroy,
- _e_comp_wl_video_object_cb_set_attribute,
- _e_comp_wl_video_object_cb_follow_topmost_visibility,
- _e_comp_wl_video_object_cb_unfollow_topmost_visibility,
- _e_comp_wl_video_object_cb_allowed_attribute,
- _e_comp_wl_video_object_cb_disallowed_attribute,
+ _e_comp_wl_video_object_handle_destroy,
+ _e_comp_wl_video_object_handle_attribute_set,
+ _e_comp_wl_video_object_handle_topmost_visibility_follow,
+ _e_comp_wl_video_object_handle_topmost_visibility_unfollow,
+ _e_comp_wl_video_object_handle_attribute_allowed,
+ _e_comp_wl_video_object_handle_attribute_disallowed,
};
static void
-_e_comp_wl_video_cb_get_object(struct wl_client *client,
+_e_comp_wl_video_handle_object_get(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface)
{
- E_Video *video;
+ E_Video_Object *vo;
int version = wl_resource_get_version(resource);
struct wl_resource *res;
return;
}
- if (!(video = _e_video_create(res, surface)))
+ if (!(vo = _e_comp_wl_video_object_create(res, surface)))
{
wl_resource_destroy(res);
wl_client_post_no_memory(client);
return;
}
- wl_resource_set_implementation(res, &_e_comp_wl_video_object_interface,
- video, _e_comp_wl_video_object_destroy);
+ wl_resource_set_implementation(res, &_e_comp_wl_video_object_implementation,
+ vo, _e_comp_wl_video_object_resource_destroy);
}
static void
-_e_comp_wl_video_cb_get_viewport(struct wl_client *client,
+_e_comp_wl_video_handle_viewport_get(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface)
}
static void
-_e_comp_wl_video_cb_destroy(struct wl_client *client, struct wl_resource *resource)
+_e_comp_wl_video_handle_destroy(struct wl_client *client, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
-static const struct tizen_video_interface _e_comp_wl_video_interface =
+static const struct tizen_video_interface _e_comp_wl_video_implementation =
{
- _e_comp_wl_video_cb_get_object,
- _e_comp_wl_video_cb_get_viewport,
- _e_comp_wl_video_cb_destroy,
+ _e_comp_wl_video_handle_object_get,
+ _e_comp_wl_video_handle_viewport_get,
+ _e_comp_wl_video_handle_destroy,
};
static void
-_e_comp_wl_video_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+_e_comp_wl_tizen_video_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
struct wl_resource *res;
const uint32_t *formats = NULL;
return;
}
- wl_resource_set_implementation(res, &_e_comp_wl_video_interface, NULL, NULL);
+ wl_resource_set_implementation(res, &_e_comp_wl_video_implementation, NULL, NULL);
e_comp_screen_available_video_formats_get(&formats, &count);
for (i = 0; i < count; i++)
}
static void
-_e_comp_wl_vbuf_print(void *data, const char *log_path)
+_e_comp_wl_video_info_cb_vbuf_print(void *data, const char *log_path)
{
e_comp_wl_video_buffer_list_print(log_path);
}
static void
-_e_comp_wl_video_to_primary(void *data, const char *log_path)
+_e_comp_wl_video_info_cb_video_to_primary(void *data, const char *log_path)
{
Eina_Bool flag;
}
static void
-_e_comp_wl_video_punch(void *data, const char *log_path)
+_e_comp_wl_video_info_cb_video_punch(void *data, const char *log_path)
{
Eina_Bool flag;
if (!e_comp_wl->wl.disp) return 0;
if (e_comp->wl_comp_data->video.global) return 1;
- e_info_server_hook_set("vbuf", _e_comp_wl_vbuf_print, NULL);
- e_info_server_hook_set("video-to-primary", _e_comp_wl_video_to_primary, NULL);
- e_info_server_hook_set("video-punch", _e_comp_wl_video_punch, NULL);
+ e_info_server_hook_set("vbuf", _e_comp_wl_video_info_cb_vbuf_print, NULL);
+ e_info_server_hook_set("video-to-primary", _e_comp_wl_video_info_cb_video_to_primary, NULL);
+ e_info_server_hook_set("video-punch", _e_comp_wl_video_info_cb_video_punch, NULL);
/* try to add tizen_video to wayland globals */
e_comp->wl_comp_data->video.global =
- wl_global_create(e_comp_wl->wl.disp, &tizen_video_interface, 1, NULL, _e_comp_wl_video_cb_bind);
+ wl_global_create(e_comp_wl->wl.disp, &tizen_video_interface, 1, NULL, _e_comp_wl_tizen_video_bind);
if (!e_comp->wl_comp_data->video.global)
{
e_comp->wl_comp_data->available_hw_accel.scaler = EINA_FALSE;
E_FREE_FUNC(e_comp->wl_comp_data->video.global, wl_global_destroy);
- E_FREE_LIST(video_list, _e_video_destroy);
+ E_FREE_LIST(_vo_list, _e_comp_wl_video_object_destroy);
e_info_server_hook_set("vbuf", NULL, NULL);
e_info_server_hook_set("video-to-primary", NULL, NULL);