add handeoffs signal for waylandsink 17/85617/4
authorNAMJEONGYOON <just.nam@samsung.com>
Fri, 26 Aug 2016 07:05:39 +0000 (16:05 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Mon, 29 Aug 2016 07:49:47 +0000 (16:49 +0900)
Change-Id: Ie7d1e4c05e5223ba887c89e5ec18463059c6d940

packaging/libmm-player.spec
src/include/mm_player.h
src/mm_player_attrs.c
src/mm_player_priv.c

index 6721aa3..d58a534 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.5.96
+Version:    0.5.97
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 2ed7cc1..90b890e 100644 (file)
 #define MM_PLAYER_DRC_MODE                                             "drc_mode"
 
 /**
- * MM_PLAYER_GAPLESS
+ * MM_PLAYER_GAPLESS_MODE
  *
  * gapless playback mode (int)
  */
 #define MM_PLAYER_GAPLESS_MODE                                 "gapless_mode"
 
+/**
+ * MM_PLAYER_ENABLE_VIDEO_DECODED_CB
+ *
+ * enable video decoded callback (int)
+ */
+#define MM_PLAYER_ENABLE_VIDEO_DECODED_CB              "enable_video_decoded_cb"
+
 #define BUFFER_MAX_PLANE_NUM (4)
 
 typedef struct {
index 3869e4d..a56b4e8 100644 (file)
@@ -211,6 +211,16 @@ __mmplayer_apply_attribute(MMHandleType handle, const char *attribute_name)
                }
        }
 
+       if (g_strrstr(attribute_name, MM_PLAYER_ENABLE_VIDEO_DECODED_CB)) {
+               if (!player->set_mode.media_packet_video_stream) {
+                       LOGE("there is no callback for media_packet");
+                       return MM_ERROR_PLAYER_INTERNAL;
+               }
+               int enable = 0;
+               mm_attrs_get_int_by_name(player->attrs, "enable_video_decoded_cb", &enable);
+               g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "signal-handoffs", enable ? TRUE : FALSE, NULL);
+       }
+
        return MM_ERROR_NONE;
 }
 
@@ -1097,6 +1107,15 @@ _mmplayer_construct_attribute(MMHandleType handle)
                        MM_ATTRS_VALID_TYPE_INT_RANGE,
                        FALSE,
                        TRUE
+               },
+               {
+                       "enable_video_decoded_cb",
+                       MM_ATTRS_TYPE_INT,
+                       MM_ATTRS_FLAG_RW,
+                       (void *) FALSE,
+                       MM_ATTRS_VALID_TYPE_INT_RANGE,
+                       FALSE,
+                       TRUE
                }
        };
 
index ec65d7f..eb80d77 100644 (file)
@@ -5291,6 +5291,26 @@ __mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDispl
                                }
                        }
                }
+               if (player->set_mode.media_packet_video_stream) {
+                       int enable = 0;
+                       mm_attrs_get_int_by_name(player->attrs, "enable_video_decoded_cb", &enable);
+                       if (enable)
+                               g_object_set(G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), "signal-handoffs", TRUE, NULL);
+
+                       MMPLAYER_SIGNAL_CONNECT(player,
+                                                                       G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+                                                                       MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
+                                                                       "handoff",
+                                                                       G_CALLBACK(__mmplayer_video_stream_decoded_render_cb),
+                                                                       (gpointer)player);
+
+                       MMPLAYER_SIGNAL_CONNECT(player,
+                                                                       G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
+                                                                       MM_PLAYER_SIGNAL_TYPE_VIDEOBIN,
+                                                                       "preroll-handoff",
+                                                                       G_CALLBACK(__mmplayer_video_stream_decoded_preroll_cb),
+                                                                       (gpointer)player);
+               }
                break;
        }
        case MM_DISPLAY_SURFACE_REMOTE: