[0.6.192] Add API to set client PID 83/205983/1
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 13 May 2019 01:21:41 +0000 (10:21 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 13 May 2019 01:43:35 +0000 (10:43 +0900)
- Normally, this library is used in a service daemon.
  So far, player handle could not know the application's
  PID over the daemon's client/server interface. It is now
  supported by this API.

Change-Id: I28b059edc757a0de6a6533218b1512335090ce9b
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/libmm-player.spec
src/include/mm_player.h
src/include/mm_player_priv.h
src/mm_player.c
src/mm_player_priv.c

index 3a939a8..0ba5d39 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.191
+Version:    0.6.192
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index a0d8f91..fa05d78 100644 (file)
@@ -1501,6 +1501,19 @@ int mm_player_do_video_capture(MMHandleType player);
 int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
 
 /**
+ * This function set the application PID.
+ *
+ * @param      player          [in]    Handle of player
+ * @param      pid                     [in]    application PID
+ *
+ * @return     This function returns zero on success, or negative value with error code.
+ *
+ * @pre                Player state should be MM_PLAYER_STATE_NULL.
+ * @remark     None
+ */
+int mm_player_set_client_pid(MMHandleType player, int pid);
+
+/**
        @}
  */
 
index 2ff24d9..82bfc47 100644 (file)
@@ -786,6 +786,8 @@ typedef struct {
        /* build audio offload */
        gboolean build_audio_offload;
        guint audio_device_cb_id;
+
+       int client_pid;
 } mmplayer_t;
 
 typedef struct {
@@ -891,6 +893,7 @@ int _mmplayer_gst_element_add_bucket_to_bin(GstBin *bin, GList *element_bucket);
 int _mmplayer_gst_element_link_bucket(GList *element_bucket);
 void _mmplayer_typefind_have_type(GstElement *tf, guint probability, GstCaps *caps, gpointer data);
 int _mmplayer_parse_profile(const char *uri, void *param, mmplayer_parse_profile_t *data);
+int _mmplayer_set_client_pid(MMHandleType hplayer, int pid);
 
 #ifdef __cplusplus
        }
index e5ca355..1692628 100644 (file)
@@ -1232,3 +1232,18 @@ int mm_player_get_video_roi_area(MMHandleType player, double *scale_x, double *s
 
        return result;
 }
+
+int mm_player_set_client_pid(MMHandleType player, int pid)
+{
+       int result = MM_ERROR_NONE;
+
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+       MMPLAYER_CMD_LOCK(player);
+
+       result = _mmplayer_set_client_pid(player, pid);
+
+       MMPLAYER_CMD_UNLOCK(player);
+
+       return result;
+}
\ No newline at end of file
index ccdef1b..7c9f0c0 100644 (file)
@@ -8750,6 +8750,24 @@ _mmplayer_get_video_roi_area(MMHandleType hplayer, double *scale_x, double *scal
        return ret;
 }
 
+int
+_mmplayer_set_client_pid(MMHandleType hplayer, int pid)
+{
+       mmplayer_t* player = (mmplayer_t*)hplayer;
+
+       MMPLAYER_FENTER();
+
+       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
+
+       player->client_pid = pid;
+
+       LOGD("client pid[%d] %p", pid, player);
+
+       MMPLAYER_FLEAVE();
+
+       return MM_ERROR_NONE;
+}
+
 static gboolean
 __mmplayer_update_duration_value(mmplayer_t *player)
 {