modified player for evas 23/60223/3
authorNAMJEONGYOON <just.nam@samsung.com>
Wed, 24 Feb 2016 07:42:43 +0000 (16:42 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Fri, 26 Feb 2016 08:27:13 +0000 (17:27 +0900)
Change-Id: I758e3e2699c88c70e7f485c391da47f031037fd7

src/include/mm_player_priv.h
src/mm_player_capture.c
src/mm_player_priv.c

index 07f8b1f..de46b9f 100644 (file)
@@ -602,7 +602,7 @@ typedef struct {
        /* missing plugin during autoplugging */
        MissingCodec not_supported_codec;
 
-       /*unlinked audio/video mime type */
+       /* unlinked audio/video mime type */
        gchar *unlinked_video_mime;
        gchar *unlinked_audio_mime;
        gchar *unlinked_demuxer_mime;
@@ -726,7 +726,7 @@ typedef struct {
        /* subtitle stream caps parsed by demuxer or set by external demuxer */
        GstCaps* s_stream_caps;
 
-       /*es player using feed-data callback or calling app_src_push_buffer directly*/
+       /* es player using feed-data callback or calling app_src_push_buffer directly*/
        gboolean es_player_push_mode;
 
        /* tmb buffer manager for s/w codec tmb_bo */
index e91d13e..217210c 100644 (file)
@@ -123,12 +123,19 @@ _mmplayer_do_video_capture(MMHandleType hplayer)
                LOGW("capturing... we can't do any more");
                return MM_ERROR_PLAYER_INVALID_STATE;
        }
+       gint surface_type = 0;
+       mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &surface_type);
 
        /* check if video pipeline is linked or not */
        if (!player->pipeline->videobin)
        {
-               LOGW("not ready to capture");
-               return MM_ERROR_PLAYER_INVALID_STATE;
+               if (surface_type == MM_DISPLAY_SURFACE_REMOTE && player->video_fakesink)
+                       LOGD("it is evas surface type.");
+               else
+               {
+                       LOGW("not ready to capture");
+                       return MM_ERROR_PLAYER_INVALID_STATE;
+               }
        }
 
        /* check if drm file */
@@ -138,7 +145,10 @@ _mmplayer_do_video_capture(MMHandleType hplayer)
                return MM_ERROR_PLAYER_DRM_OUTPUT_PROTECTION;
        }
 
-       pad = gst_element_get_static_pad(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "sink" );
+       if (player->pipeline->videobin)
+               pad = gst_element_get_static_pad(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "sink" );
+       else // evas surface
+               pad = gst_element_get_static_pad (player->video_fakesink, "sink");
 
        if (player->state != MM_PLAYER_STATE_PLAYING)
        {
@@ -148,7 +158,10 @@ _mmplayer_do_video_capture(MMHandleType hplayer)
 
                        gst_element_get_state(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, NULL, NULL, 5 * GST_SECOND); //5 seconds
 
-                       g_object_get(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "last-sample", &sample, NULL);
+                       if (player->pipeline->videobin)
+                               g_object_get(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "last-sample", &sample, NULL);
+                       else // evas surface
+                               g_object_get(player->video_fakesink, "last-sample", &sample, NULL);
 
                        if (sample)
                        {
index cefaa51..77e1a68 100644 (file)
@@ -2237,7 +2237,7 @@ __mmplayer_gst_rtp_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
                gint stype = 0;
                mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
 
-               if (stype == MM_DISPLAY_SURFACE_NULL)
+               if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
                {
                        if (player->v_stream_caps)
                        {
@@ -2602,7 +2602,7 @@ __mmplayer_gst_decode_pad_added (GstElement *elem, GstPad *pad, gpointer data)
                mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required, and not support multiple track */
-               if (stype == MM_DISPLAY_SURFACE_NULL)
+               if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
                {
                        LOGD ("no video sink by null surface or multiple track");
                        gchar *caps_str = gst_caps_to_string(caps);
@@ -3617,7 +3617,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        mm_attrs_get_int_by_name(player->attrs, "display_surface_client_type", &surface_client_type);
                        LOGD("display_surface_type : server(%d), client(%d)\n", surface_type, surface_client_type);
 
-                       if (surface_type == MM_DISPLAY_SURFACE_NULL)
+                       if (surface_type == MM_DISPLAY_SURFACE_NULL || surface_type == MM_DISPLAY_SURFACE_REMOTE)
                        {
                                LOGD("not make videobin because it dose not want\n");
                                goto ERROR;
@@ -4360,6 +4360,11 @@ _mmplayer_update_video_param(mm_player_t* player) // @
                        /* do nothing */
                }
                break;
+               case MM_DISPLAY_SURFACE_REMOTE:
+               {
+                       /* do nothing */
+               }
+               break;
        }
 
        MMPLAYER_FLEAVE();
@@ -5476,6 +5481,12 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                                else
                                        goto ERROR;
                                break;
+                       case MM_DISPLAY_SURFACE_REMOTE:
+                               if (strlen(player->ini.videosink_element_fake) > 0)
+                                       videosink_element = player->ini.videosink_element_fake;
+                               else
+                                       goto ERROR;
+                               break;
                        default:
                                LOGE("unidentified surface type");
                                goto ERROR;
@@ -5501,6 +5512,10 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                                }
                                break;
             }
+                       case MM_DISPLAY_SURFACE_REMOTE:
+                       {
+                               break;
+                       }
                        default:
                                break;
                }
@@ -5763,6 +5778,7 @@ static int __mmplayer_gst_create_text_pipeline(mm_player_t* player)
                        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)
                                {
                                        LOGE("failed to make plain text elements\n");
@@ -12550,7 +12566,7 @@ GstCaps* caps, GstElementFactory* factory, gpointer data)
                mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required */
-               if (stype == MM_DISPLAY_SURFACE_NULL)
+               if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
                {
                        if (player->set_mode.media_packet_video_stream == FALSE
                                && !player->video_stream_cb)
@@ -13870,7 +13886,7 @@ static void __mmplayer_add_new_pad(GstElement *element, GstPad *pad, gpointer da
                mm_attrs_get_int_by_name (player->attrs, "display_surface_type", &stype);
 
                /* don't make video because of not required */
-               if (stype == MM_DISPLAY_SURFACE_NULL)
+               if (stype == MM_DISPLAY_SURFACE_NULL || stype == MM_DISPLAY_SURFACE_REMOTE)
                {
                        LOGD("no video because it's not required");
                        return;