From: Doyoun Kang Date: Wed, 4 Nov 2020 11:54:54 +0000 (+0900) Subject: Revert "video: Rename functions and variables more detail." X-Git-Tag: submit/tizen/20201105.050753~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F246848%2F1;p=platform%2Fupstream%2Fenlightenment.git Revert "video: Rename functions and variables more detail." This reverts commit 76563ffde2c4b5bf0be317b40145a1e47f43890f. Change-Id: Idd6661c970e9ff0c205e3987490bdb1f7c389e84 --- diff --git a/src/bin/video/e_comp_wl_video.c b/src/bin/video/e_comp_wl_video.c index b3b0cb56e8..15c7be5106 100644 --- a/src/bin/video/e_comp_wl_video.c +++ b/src/bin/video/e_comp_wl_video.c @@ -6,36 +6,36 @@ #include "e_video_internal.h" #include -typedef struct _E_Video_Object E_Video_Object; +typedef struct _E_Video E_Video; -struct _E_Video_Object +struct _E_Video { - struct wl_resource *resource; + struct wl_resource *video_object; E_Client *ec; struct { - Ecore_Event_Handler *visibility_change; - Ecore_Event_Handler *remove; - } client_event_handler; + Ecore_Event_Handler *ec_visibility; + Ecore_Event_Handler *ec_remove; + } event_handler; }; -static Eina_List *_vo_list = NULL; +static Eina_List *video_list = NULL; -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 void _e_video_set(E_Video *video, E_Client *ec); +static void _e_video_destroy(E_Video *video); static int -_e_comp_wl_video_object_prop_id_get(E_Video_Object *vo, const char *name) +_e_video_get_prop_id(E_Video *video, const char *name) { const tdm_prop *props; int i, count = 0; - e_client_video_available_properties_get(vo->ec, &props, &count); + e_client_video_available_properties_get(video->ec, &props, &count); for (i = 0; i < count; i++) { if (!strncmp(name, props[i].name, TDM_NAME_LEN)) { - VDB("check property(%s)", vo->ec, name); + VDB("check property(%s)", video->ec, name); return props[i].id; } } @@ -44,57 +44,57 @@ _e_comp_wl_video_object_prop_id_get(E_Video_Object *vo, const char *name) } static Eina_Bool -_e_comp_wl_video_object_ec_cb_remove(void *data, int type, void *event) +_e_comp_wl_video_cb_ec_remove(void *data, int type, void *event) { E_Event_Client *ev = event; E_Client *ec; - E_Video_Object *vo; + E_Video *video; 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; - vo = data; - if (vo->ec != ec) return ECORE_CALLBACK_PASS_ON; + video = data; + if (video->ec != ec) return ECORE_CALLBACK_PASS_ON; if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON; - _vo_list = eina_list_remove(_vo_list, vo); + video_list = eina_list_remove(video_list, video); - _e_comp_wl_video_object_destroy(vo); + _e_video_destroy(video); return ECORE_CALLBACK_PASS_ON; } -static E_Video_Object * -_e_comp_wl_video_object_create(struct wl_resource *resource, struct wl_resource *surface) +static E_Video * +_e_video_create(struct wl_resource *video_object, struct wl_resource *surface) { - E_Video_Object *vo; + E_Video *video; 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); - vo = calloc(1, sizeof *vo); - EINA_SAFETY_ON_NULL_RETURN_VAL(vo, NULL); + video = calloc(1, sizeof *video); + EINA_SAFETY_ON_NULL_RETURN_VAL(video, NULL); - vo->resource = resource; + video->video_object = video_object; VIN("create.", ec); - _vo_list = eina_list_append(_vo_list, vo); + video_list = eina_list_append(video_list, video); - _e_comp_wl_video_object_setup(vo, ec); + _e_video_set(video, ec); - vo->client_event_handler.remove = + video->event_handler.ec_remove = ecore_event_handler_add(E_EVENT_CLIENT_REMOVE, - _e_comp_wl_video_object_ec_cb_remove, vo); + _e_comp_wl_video_cb_ec_remove, video); - return vo; + return video; } static void -_e_comp_wl_video_object_setup(E_Video_Object *vo, E_Client *ec) +_e_video_set(E_Video *video, E_Client *ec) { Eina_Bool res; int minw = -1, minh = -1, maxw = -1, maxh = -1; @@ -102,19 +102,19 @@ _e_comp_wl_video_object_setup(E_Video_Object *vo, E_Client *ec) int i, count = 0; const tdm_prop *props; - vo->ec = ec; + video->ec = ec; - EINA_SAFETY_ON_NULL_RETURN(vo->ec->zone); + EINA_SAFETY_ON_NULL_RETURN(video->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(vo->resource, + tizen_video_object_send_size(video->video_object, minw, minh, maxw, maxh, align); - /* VIN("align width: output(%d) pp(%d) vo(%d)", - vo->output_align, vo->pp_align, vo->video_align); */ + /* VIN("align width: output(%d) pp(%d) video(%d)", + video->output_align, video->pp_align, video->video_align); */ } else VER("Failed to get video available size", ec); @@ -131,87 +131,87 @@ _e_comp_wl_video_object_setup(E_Video_Object *vo, E_Client *ec) continue; } - tizen_video_object_send_attribute(vo->resource, props[i].name, value.u32); + tizen_video_object_send_attribute(video->video_object, props[i].name, value.u32); } } static void -_e_comp_wl_video_object_destroy(E_Video_Object *vo) +_e_video_destroy(E_Video *video) { - if (!vo) + if (!video) return; - VIN("destroy", vo->ec); + VIN("destroy", video->ec); - wl_resource_set_destructor(vo->resource, NULL); + wl_resource_set_destructor(video->video_object, NULL); - 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_FREE_FUNC(video->event_handler.ec_visibility, ecore_event_handler_del); + E_FREE_FUNC(video->event_handler.ec_remove, ecore_event_handler_del); - e_client_video_unset(vo->ec); + e_client_video_unset(video->ec); - free(vo); + free(video); } static void -_e_comp_wl_video_object_resource_destroy(struct wl_resource *resource) +_e_comp_wl_video_object_destroy(struct wl_resource *resource) { - E_Video_Object *vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + E_Video *video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - _vo_list = eina_list_remove(_vo_list, vo); + video_list = eina_list_remove(video_list, video); - _e_comp_wl_video_object_destroy(vo); + _e_video_destroy(video); } static void -_e_comp_wl_video_object_handle_destroy(struct wl_client *client, struct wl_resource *resource) +_e_comp_wl_video_object_cb_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void -_e_comp_wl_video_object_handle_attribute_set(struct wl_client *client, +_e_comp_wl_video_object_cb_set_attribute(struct wl_client *client, struct wl_resource *resource, const char *name, int32_t value) { - E_Video_Object *vo; + E_Video *video; tdm_value v; int id; - vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - if (!vo->ec) + if (!video->ec) return; VIN("Client(%s):PID(%d) Attribute:%s, Value:%d", - vo->ec, e_client_util_name_get(vo->ec) ?: "No Name", - vo->ec->netwm.pid, name, value); + video->ec, e_client_util_name_get(video->ec) ?: "No Name", + video->ec->netwm.pid, name, value); // check available property & count - id = _e_comp_wl_video_object_prop_id_get(vo, name); + id = _e_video_get_prop_id(video, name); if(id < 0) { - VIN("no available property", vo->ec); + VIN("no available property", video->ec); return; } v.u32 = value; - e_client_video_property_set(vo->ec, id, v, EINA_FALSE); + e_client_video_property_set(video->ec, id, v, EINA_FALSE); } static Eina_Bool -_e_comp_wl_video_object_ec_cb_visibility_change(void *data, int type, void *event) +_e_comp_wl_video_cb_visibility_change(void *data, int type, void *event) { - E_Video_Object *vo; + E_Video *video; E_Client *ec; E_Event_Client *ev; ev = event; - vo = data; - if (vo->ec != ev->ec) + video = data; + if (video->ec != ev->ec) return ECORE_CALLBACK_PASS_ON; ec = ev->ec; @@ -230,97 +230,97 @@ _e_comp_wl_video_object_ec_cb_visibility_change(void *data, int type, void *even } static void -_e_comp_wl_video_object_handle_topmost_visibility_follow(struct wl_client *client, +_e_comp_wl_video_object_cb_follow_topmost_visibility(struct wl_client *client, struct wl_resource *resource) { - E_Video_Object *vo; + E_Video *video; - vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - if(!vo->ec) + if(!video->ec) return; - VIN("set follow_topmost_visibility", vo->ec); + VIN("set follow_topmost_visibility", video->ec); - e_client_video_topmost_visibility_follow(vo->ec); + e_client_video_topmost_visibility_follow(video->ec); - if (!vo->client_event_handler.visibility_change) + if (!video->event_handler.ec_visibility) { - vo->client_event_handler.visibility_change = + video->event_handler.ec_visibility = ecore_event_handler_add(E_EVENT_CLIENT_VISIBILITY_CHANGE, - (Ecore_Event_Handler_Cb)_e_comp_wl_video_object_ec_cb_visibility_change, - vo); + (Ecore_Event_Handler_Cb)_e_comp_wl_video_cb_visibility_change, + video); } } static void -_e_comp_wl_video_object_handle_topmost_visibility_unfollow(struct wl_client *client, +_e_comp_wl_video_object_cb_unfollow_topmost_visibility(struct wl_client *client, struct wl_resource *resource) { - E_Video_Object *vo; + E_Video *video; - vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - if(!vo->ec) + if(!video->ec) return; - VIN("set unfollow_topmost_visibility", vo->ec); + VIN("set unfollow_topmost_visibility", video->ec); - e_client_video_topmost_visibility_unfollow(vo->ec); - E_FREE_FUNC(vo->client_event_handler.visibility_change, ecore_event_handler_del); + e_client_video_topmost_visibility_unfollow(video->ec); + E_FREE_FUNC(video->event_handler.ec_visibility, ecore_event_handler_del); } static void -_e_comp_wl_video_object_handle_attribute_allowed(struct wl_client *client, +_e_comp_wl_video_object_cb_allowed_attribute(struct wl_client *client, struct wl_resource *resource) { - E_Video_Object *vo; + E_Video *video; - vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - if(!vo->ec) + if(!video->ec) return; - VIN("set allowed_attribute", vo->ec); - e_client_video_property_allow(vo->ec); + VIN("set allowed_attribute", video->ec); + e_client_video_property_allow(video->ec); } static void -_e_comp_wl_video_object_handle_attribute_disallowed(struct wl_client *client, +_e_comp_wl_video_object_cb_disallowed_attribute(struct wl_client *client, struct wl_resource *resource) { - E_Video_Object *vo; + E_Video *video; - vo = wl_resource_get_user_data(resource); - EINA_SAFETY_ON_NULL_RETURN(vo); + video = wl_resource_get_user_data(resource); + EINA_SAFETY_ON_NULL_RETURN(video); - if(!vo->ec) + if(!video->ec) return; - VIN("set disallowed_attribute", vo->ec); - e_client_video_property_disallow(vo->ec); + VIN("set disallowed_attribute", video->ec); + e_client_video_property_disallow(video->ec); } -static const struct tizen_video_object_interface _e_comp_wl_video_object_implementation = +static const struct tizen_video_object_interface _e_comp_wl_video_object_interface = { - _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, + _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, }; static void -_e_comp_wl_video_handle_object_get(struct wl_client *client, +_e_comp_wl_video_cb_get_object(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface) { - E_Video_Object *vo; + E_Video *video; int version = wl_resource_get_version(resource); struct wl_resource *res; @@ -331,19 +331,19 @@ _e_comp_wl_video_handle_object_get(struct wl_client *client, return; } - if (!(vo = _e_comp_wl_video_object_create(res, surface))) + if (!(video = _e_video_create(res, surface))) { wl_resource_destroy(res); wl_client_post_no_memory(client); return; } - wl_resource_set_implementation(res, &_e_comp_wl_video_object_implementation, - vo, _e_comp_wl_video_object_resource_destroy); + wl_resource_set_implementation(res, &_e_comp_wl_video_object_interface, + video, _e_comp_wl_video_object_destroy); } static void -_e_comp_wl_video_handle_viewport_get(struct wl_client *client, +_e_comp_wl_video_cb_get_viewport(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface) @@ -371,20 +371,20 @@ _e_comp_wl_video_handle_viewport_get(struct wl_client *client, } static void -_e_comp_wl_video_handle_destroy(struct wl_client *client, struct wl_resource *resource) +_e_comp_wl_video_cb_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } -static const struct tizen_video_interface _e_comp_wl_video_implementation = +static const struct tizen_video_interface _e_comp_wl_video_interface = { - _e_comp_wl_video_handle_object_get, - _e_comp_wl_video_handle_viewport_get, - _e_comp_wl_video_handle_destroy, + _e_comp_wl_video_cb_get_object, + _e_comp_wl_video_cb_get_viewport, + _e_comp_wl_video_cb_destroy, }; static void -_e_comp_wl_tizen_video_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) +_e_comp_wl_video_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *res; const uint32_t *formats = NULL; @@ -397,7 +397,7 @@ _e_comp_wl_tizen_video_bind(struct wl_client *client, void *data, uint32_t versi return; } - wl_resource_set_implementation(res, &_e_comp_wl_video_implementation, NULL, NULL); + wl_resource_set_implementation(res, &_e_comp_wl_video_interface, NULL, NULL); e_comp_screen_available_video_formats_get(&formats, &count); for (i = 0; i < count; i++) @@ -405,13 +405,13 @@ _e_comp_wl_tizen_video_bind(struct wl_client *client, void *data, uint32_t versi } static void -_e_comp_wl_video_info_cb_vbuf_print(void *data, const char *log_path) +_e_comp_wl_vbuf_print(void *data, const char *log_path) { e_comp_wl_video_buffer_list_print(log_path); } static void -_e_comp_wl_video_info_cb_video_to_primary(void *data, const char *log_path) +_e_comp_wl_video_to_primary(void *data, const char *log_path) { Eina_Bool flag; @@ -420,7 +420,7 @@ _e_comp_wl_video_info_cb_video_to_primary(void *data, const char *log_path) } static void -_e_comp_wl_video_info_cb_video_punch(void *data, const char *log_path) +_e_comp_wl_video_punch(void *data, const char *log_path) { Eina_Bool flag; @@ -441,13 +441,13 @@ e_comp_wl_video_init(void) 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_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); + 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); /* 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_tizen_video_bind); + wl_global_create(e_comp_wl->wl.disp, &tizen_video_interface, 1, NULL, _e_comp_wl_video_cb_bind); if (!e_comp->wl_comp_data->video.global) { @@ -465,7 +465,7 @@ e_comp_wl_video_shutdown(void) 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(_vo_list, _e_comp_wl_video_object_destroy); + E_FREE_LIST(video_list, _e_video_destroy); e_info_server_hook_set("vbuf", NULL, NULL); e_info_server_hook_set("video-to-primary", NULL, NULL);