[v0.6.10] clean up the code which is related to evas display 14/95414/1
authorNAMJEONGYOON <just.nam@samsung.com>
Thu, 3 Nov 2016 07:10:31 +0000 (16:10 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Thu, 3 Nov 2016 07:10:52 +0000 (16:10 +0900)
Change-Id: I6d96ef882b77673217102d2f7375361a88c14990

packaging/libmm-player.spec
src/mm_player_priv.c

index a55d7157ad810886686fe5d44fff5cfd37ac745f..db00eb709a5d51ee71d5d0e6cc081079751d060a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.9
+Version:    0.6.10
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 45866579ed59396ac12a1e61cda153d5e63f288e..51d318f2e6c38d26a9faa986a88b83a031ff2c28 100644 (file)
@@ -3661,9 +3661,9 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
        }
 
        /*
-         * xvimagesink only    (A)
-         * custom_convert - no xv(e.g. memsink, evasimagesink  (B)
-         * videoflip - avsysmemsink(C)
+         * waylandsink (A)
+         * custom_convert - none (B)
+         * videoflip - none (C)
          */
        if (player->set_mode.video_zc) {
                if (player->pipeline->videobin[MMPLAYER_V_CONV].gst) // B
@@ -3677,8 +3677,7 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
                mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
                LOGD("check display surface type attribute: %d", surface_type);
 
-               if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY) ||
-                       (surface_type == MM_DISPLAY_SURFACE_EVAS && !strcmp(player->ini.videosink_element_evas, "evaspixmapsink")))
+               if (surface_type == MM_DISPLAY_SURFACE_OVERLAY)
                        rotation_type = ROTATION_USING_SINK;
                else
                        rotation_type = ROTATION_USING_FLIP; //C
@@ -3688,7 +3687,7 @@ __mmplayer_get_property_value_for_rotation(mm_player_t* player, int rotation_ang
 
        /* get property value for setting */
        switch (rotation_type) {
-       case ROTATION_USING_SINK: // xvimagesink, pixmap
+       case ROTATION_USING_SINK: // waylandsink
                {
                        switch (dest_angle) {
                        case 0:
@@ -3950,94 +3949,6 @@ __mmplayer_update_wayland_videosink_video_param(mm_player_t* player, char *param
        return MM_ERROR_NONE;
 }
 
-int
-__mmplayer_update_evas_videosink_video_param(mm_player_t* player)
-{
-       MMHandleType attrs = 0;
-       void *object = NULL;
-       int scaling = 0;
-       gboolean visible = TRUE;
-       int display_method = 0;
-       int org_angle = 0; // current supported angle values are 0, 90, 180, 270
-       int user_angle = 0;
-       int rotation_value = 0;
-       MMPLAYER_FENTER();
-
-       /* check video sinkbin is created */
-       if (MM_ERROR_NONE != __mmplayer_video_param_check_video_sink_bin(player))
-               return MM_ERROR_PLAYER_NOT_INITIALIZED;
-
-       attrs = MMPLAYER_GET_ATTRS(player);
-       MMPLAYER_RETURN_VAL_IF_FAIL(attrs, MM_ERROR_PLAYER_INTERNAL);
-
-       __mmplayer_get_video_angle(player, &user_angle, &org_angle);
-
-       /* common case if using evas surface */
-       mm_attrs_get_data_by_name(attrs, "display_overlay", &object);
-       mm_attrs_get_int_by_name(attrs, "display_visible", &visible);
-       mm_attrs_get_int_by_name(attrs, "display_evas_do_scaling", &scaling);
-       mm_attrs_get_int_by_name(attrs, "display_method", &display_method);
-
-       /* if evasimagesink */
-       if (!strcmp(player->ini.videosink_element_evas, "evasimagesink")) {
-               if (object) {
-                       /* if it is evasimagesink, we are not supporting rotation */
-                       if (user_angle != 0) {
-                               mm_attrs_set_int_by_name(attrs, "display_rotation", MM_DISPLAY_ROTATION_NONE);
-                               if (mmf_attrs_commit(attrs)) /* return -1 if error */
-                                       LOGE("failed to commit\n");
-                               LOGW("unsupported feature");
-                               return MM_ERROR_NOT_SUPPORT_API;
-                       }
-                       __mmplayer_get_property_value_for_rotation(player, org_angle+user_angle, &rotation_value);
-                       g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst,
-                                       "evas-object", object,
-                                       "visible", visible,
-                                       "display-geometry-method", display_method,
-                                       "rotate", rotation_value,
-                                       NULL);
-                       LOGD("set video param : method %d", display_method);
-                       LOGD("set video param : evas-object %x, visible %d", object, visible);
-                       LOGD("set video param : evas-object %x, rotate %d", object, rotation_value);
-               } else {
-                       LOGE("no evas object");
-                       return MM_ERROR_PLAYER_INTERNAL;
-               }
-
-
-               /* if evasimagesink using converter */
-               if (player->set_mode.video_zc && player->pipeline->videobin[MMPLAYER_V_CONV].gst) {
-                       int width = 0;
-                       int height = 0;
-                       int no_scaling = !scaling;
-
-                       mm_attrs_get_int_by_name(attrs, "display_width", &width);
-                       mm_attrs_get_int_by_name(attrs, "display_height", &height);
-
-                       /* NOTE: fimcconvert does not manage index of src buffer from upstream src-plugin, decoder gives frame information in output buffer with no ordering */
-                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "src-rand-idx", TRUE, NULL);
-                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-buffer-num", 5, NULL);
-
-                       if (no_scaling) {
-                               /* no-scaling order to fimcconvert, original width, height size of media src will be passed to sink plugin */
-                               g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst,
-                                               "dst-width", 0, /* setting 0, output video width will be media src's width */
-                                               "dst-height", 0, /* setting 0, output video height will be media src's height */
-                                               NULL);
-                       } else {
-                               /* scaling order to fimcconvert */
-                               if (width)
-                                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-width", width, NULL);
-                               if (height)
-                                       g_object_set(player->pipeline->videobin[MMPLAYER_V_CONV].gst, "dst-height", height, NULL);
-                               LOGD("set video param : video frame scaling down to width(%d) height(%d)", width, height);
-                       }
-                       LOGD("set video param : display_evas_do_scaling %d", scaling);
-               }
-       }
-       return MM_ERROR_NONE;
-}
-
 int
 _mmplayer_update_video_param(mm_player_t* player, char *param_name) // @
 {
@@ -4071,23 +3982,6 @@ _mmplayer_update_video_param(mm_player_t* player, char *param_name) // @
                                return ret;
                }
                break;
-       case MM_DISPLAY_SURFACE_EVAS:
-               {
-                       ret = __mmplayer_update_evas_videosink_video_param(player);
-                       if (ret != MM_ERROR_NONE)
-                               return ret;
-               }
-               break;
-       case MM_DISPLAY_SURFACE_NULL:
-               {
-                       /* do nothing */
-               }
-               break;
-       case MM_DISPLAY_SURFACE_REMOTE:
-               {
-                       /* do nothing */
-               }
-               break;
        }
 
        MMPLAYER_FLEAVE();
@@ -5208,13 +5102,9 @@ __mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket)
        mm_attrs_get_int_by_name(player->attrs, "display_surface_type", (int *)&surface_type);
 
        if (player->set_mode.video_zc) {
-               /* ST12 or SN12 , if player use omx, evasimagesink doesn't use videoconvert */
-               if ((surface_type == MM_DISPLAY_SURFACE_EVAS) && (!strcmp(player->ini.videosink_element_evas, "evasimagesink")))
-                       video_csc = player->ini.videoconverter_element;
-               else
-                       video_csc = ""; /* Videosinks don't use videoconvert except evasimagesink which use  normal video formats */
+               video_csc = ""; /* videosinks don't use videoconvert normally */
        } else {
-               /* sw codec, if player use libav,  waylandsink need videoconvert  to render shm wl-buffer which support RGB only */
+               /* sw codec, if player use libav, waylandsink need videoconvert to render shm wl-buffer which support RGB only */
                if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY) && (!strncmp(player->ini.videosink_element_overlay, "waylandsink", strlen(player->ini.videosink_element_overlay))))
                        video_csc = "videoconvert";
        }
@@ -5256,9 +5146,6 @@ ERROR:
 /**
   * VIDEO PIPELINE
   * - video overlay surface(arm/x86) : waylandsink
-  * - evas surface (arm) : evaspixmapsink
-  *                         fimcconvert !evasimagesink
-  * - evas surface (x86) : videoconvertor !videoflip !evasimagesink
   */
 static int
 __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDisplaySurfaceType surface_type)
@@ -5311,12 +5198,6 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                else
                        goto ERROR;
                break;
-       case MM_DISPLAY_SURFACE_EVAS:
-               if (strlen(player->ini.videosink_element_evas) > 0)
-                       videosink_element = player->ini.videosink_element_evas;
-               else
-                       goto ERROR;
-               break;
        case MM_DISPLAY_SURFACE_NULL:
                if (strlen(player->ini.videosink_element_fake) > 0)
                        videosink_element = player->ini.videosink_element_fake;
@@ -5636,8 +5517,6 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
 
                switch (surface_type) {
                case MM_DISPLAY_SURFACE_OVERLAY:
-               case MM_DISPLAY_SURFACE_EVAS:
-               case MM_DISPLAY_SURFACE_GL:
                case MM_DISPLAY_SURFACE_NULL:
                case MM_DISPLAY_SURFACE_REMOTE:
                        if (__mmplayer_gst_create_plain_text_elements(player) != MM_ERROR_NONE) {
@@ -11700,15 +11579,9 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                __mmplayer_update_content_type_info(player);
        }
 
-       /* To support evasimagesink, omx is excluded temporarily*/
        mm_attrs_get_int_by_name(player->attrs,
                                "display_surface_type", &surface_type);
        LOGD("check display surface type attribute: %d", surface_type);
-       if (surface_type == MM_DISPLAY_SURFACE_EVAS && strstr(factory_name, "omx")) {
-               LOGW("skipping [%s] for supporting evasimagesink temporarily.\n", factory_name);
-               result = GST_AUTOPLUG_SELECT_SKIP;
-               goto DONE;
-       }
 
        /* filtering exclude keyword */
        for (idx = 0; player->ini.exclude_element_keyword[idx][0] != '\0'; idx++) {
@@ -13636,7 +13509,7 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
        if (player->attrs) {
                mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &prev_display_surface_type);
                mm_attrs_get_data_by_name(player->attrs, "display_overlay", &prev_display_overlay);
-               LOGD("[0: Video surface, 1: EVAS surface] previous surface type(%d), new surface type(%d)", prev_display_surface_type, surface_type);
+               LOGD("[0: Video surface, 4: EVAS surface] previous surface type(%d), new surface type(%d)", prev_display_surface_type, surface_type);
                if (prev_display_surface_type == surface_type) {
                        LOGD("incoming display surface type is same as previous one, do nothing..");
                        MMPLAYER_FLEAVE();
@@ -13672,9 +13545,6 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
                        return MM_ERROR_PLAYER_INVALID_STATE;
                }
 
-               /* get a current videosink name */
-               cur_videosink_name = GST_ELEMENT_NAME(player->pipeline->videobin[MMPLAYER_V_SINK].gst);
-
                /* surface change */
                for (i = 0 ; i < num_of_dec ; i++) {
                        if (player->pipeline->mainbin &&
@@ -13684,7 +13554,7 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
 
                                klass = gst_element_factory_get_metadata(decfactory, GST_ELEMENT_METADATA_KLASS);
                                if ((g_strrstr(klass, "Codec/Decoder/Video"))) {
-                                       if (!strncmp(cur_videosink_name, "x", 1) && (surface_type == MM_DISPLAY_SURFACE_EVAS)) {
+                                       if ((prev_display_surface_type == MM_DISPLAY_SURFACE_OVERLAY) && (surface_type == MM_DISPLAY_SURFACE_REMOTE)) {
                                                ret = __mmplayer_do_change_videosink(player, MMPLAYER_M_DEC1+i, player->ini.videosink_element_evas, surface_type, display_overlay);
                                                if (ret) {
                                                        goto ERROR_CASE;
@@ -13693,7 +13563,7 @@ int _mmplayer_change_videosink(MMHandleType handle, MMDisplaySurfaceType surface
                                                        MMPLAYER_FLEAVE();
                                                        return MM_ERROR_NONE;
                                                }
-                                       } else if (!strncmp(cur_videosink_name, "evas", 4) && (surface_type == MM_DISPLAY_SURFACE_OVERLAY)) {
+                                       } else if ((prev_display_surface_type == MM_DISPLAY_SURFACE_REMOTE) && (surface_type == MM_DISPLAY_SURFACE_OVERLAY)) {
                                                ret = __mmplayer_do_change_videosink(player, MMPLAYER_M_DEC1+i, player->ini.videosink_element_overlay, surface_type, display_overlay);
                                                if (ret) {
                                                        goto ERROR_CASE;
@@ -13828,10 +13698,6 @@ __mmplayer_do_change_videosink(mm_player_t* player, const int dec_index, const c
                        LOGD("save attributes related to video display surface : id = %d", *(int*)display_overlay);
                        mm_attrs_set_data_by_name(player->attrs, "display_overlay", display_overlay, sizeof(display_overlay));
                        break;
-               case MM_DISPLAY_SURFACE_EVAS:
-                       LOGD("save attributes related to display surface to EVAS : evas image object = %x", display_overlay);
-                       mm_attrs_set_data_by_name(player->attrs, "display_overlay", display_overlay, sizeof(void*));
-                       break;
                default:
                        LOGE("invalid type(%d) for changing display surface", surface_type);
                        MMPLAYER_FLEAVE();