#include <stdbool.h>
#include <Elementary.h>
-bool vp_play_app_launch_share_panel(Evas_Object *pWin, const char *szMediaURL, void *pUserData);
+bool vp_play_app_launch_share_panel(Evas_Object *pWin, const char *szMediaURL, app_control_h *pServiceShare, void *pUserData);
bool vp_play_app_launch_videos(Evas_Object *pWin, bool bRaise, void *pUserData);
bool vp_play_app_launch_share_panel(Evas_Object *pWin,
const char *szMediaURL,
+ app_control_h *pServiceShare,
void *pUserData)
{
if (szMediaURL == NULL) {
return FALSE;
}
- app_control_h pService = NULL;
char *szFileName = NULL;
int nRet = 0;
- nRet = app_control_create(&pService);
- if (nRet != APP_CONTROL_ERROR_NONE) {
- VideoLogError("app_control_create is fail [0x%x]", nRet);
- goto Execption;
+ if (*pServiceShare == NULL) {
+ nRet = app_control_create(pServiceShare);
+ if (nRet != APP_CONTROL_ERROR_NONE) {
+ VideoLogError("app_control_create is fail [0x%x]", nRet);
+ goto Execption;
+ }
}
- nRet = app_control_set_operation(pService, VP_SHARE_OPERATION_SINGLE);
+ nRet = app_control_set_operation(*pServiceShare, VP_SHARE_OPERATION_SINGLE);
if (nRet != APP_CONTROL_ERROR_NONE) {
VideoLogError("app_control_add_extra_data is fail [0x%x]", nRet);
goto Execption;
}
- nRet = app_control_add_extra_data(pService, "http://tizen.org/appcontrol/data/path", szMediaURL);
+ nRet = app_control_add_extra_data(*pServiceShare, "http://tizen.org/appcontrol/data/path", szMediaURL);
if (nRet != APP_CONTROL_ERROR_NONE) {
VideoLogError("app_control_add_extra_data is fail [0x%x]", nRet);
goto Execption;
VideoSecureLogInfo("file : %s", szFileName);
- nRet = app_control_set_uri(pService, szFileName);
+ nRet = app_control_set_uri(*pServiceShare, szFileName);
if (nRet != APP_CONTROL_ERROR_NONE) {
VideoLogError("app_control_add_extra_data is fail [0x%x]", nRet);
goto Execption;
}
nRet =
- app_control_send_launch_request(pService, __vp_play_ug_reply_cb,
+ app_control_send_launch_request(*pServiceShare, __vp_play_ug_reply_cb,
pUserData);
if (nRet != APP_CONTROL_ERROR_NONE) {
VideoLogError("app_control_send_launch_request is fail [0x%x]",
}
VP_FREE(szFileName);
- app_control_destroy(pService);
- pService = NULL;
-
return TRUE;
Execption:
VP_FREE(szFileName);
- if (pService) {
- app_control_destroy(pService);
- pService = NULL;
+ if (*pServiceShare) {
+ app_control_destroy(*pServiceShare);
+ *pServiceShare = NULL;
}
return FALSE;
}
#include <Elementary.h>
#include <net_connection.h>
#include <sound_manager.h>
+#include <app_control.h>
#include "vp-play-view.h"
#include "vp-play-type-define.h"
bool lockmini_hide;
bool b_lockmini_show;
+ app_control_h pServiceShare;
} PlayView;
}
#endif
+static bool _vp_play_normal_view_release_service_share(PlayView *pView)
+{
+ if(!pView)
+ return FALSE;
+
+ if (pView->pServiceShare) {
+ app_control_send_terminate_request(pView->pServiceShare);
+ app_control_destroy(pView->pServiceShare);
+ pView->pServiceShare = NULL;
+ }
+
+ return TRUE;
+}
+
+
bool vp_play_normal_view_play_start(normal_view_handle pViewHandle)
{
if (!pViewHandle) {
pNormalView);
evas_object_show(pNormalView->pPopup);
pNormalView->bIsPopupShow = TRUE;
+ _vp_play_normal_view_release_service_share(pNormalView->pPlayView);
}
}
}
if (pPlayView->bViewChange == FALSE) {
if (vp_file_exists(pNormalView->szMediaURL)) {
vp_play_config_set_preview_url_videos(pNormalView->szMediaURL);
+ } else {
+ _vp_play_normal_view_release_service_share(pNormalView->pPlayView);
}
}
vp_play_preference_set_preview_audio_track(pNormalView->nDefaultAudioTrackIndex);
//pNormalView->bManualPause = TRUE;
}
- if (vp_play_app_launch_share_panel(pPlayView->pWin, pNormalView->szMediaURL, (void *)pNormalView)) {
+ if (vp_play_app_launch_share_panel(pPlayView->pWin, pNormalView->szMediaURL, &pPlayView->pServiceShare, (void *)pNormalView)) {
pNormalView->bSharepopup = TRUE;
} else {
if (vp_file_exists((const char*)pNormalView->szMediaURL)) {
pDetailInfo->szLocation = vp_dir_get((const char*)pNormalView->szMediaURL);
+ } else {
+ _vp_play_normal_view_release_service_share(pNormalView->pPlayView);
}
pNormalView->pDetailHandle = vp_detail_page_create((void *)pPlayView->pNaviframe,__vp_normal_detail_popup_close_cb, pDetailInfo);
VideoSecureLogInfo("change == %d, %s, %s", pNormalView->nLaunchingType, pNormalView->szMediaURL, pVideoId);
if (!vp_file_exists(pNormalView->szMediaURL) || !pVideoId) {
VideoLogError("current file is deleted");
+ _vp_play_normal_view_release_service_share(pNormalView->pPlayView);
VP_FREE(pVideoId);
if (!pPlayView->pFunc) {
VideoLogError("pPlayView pFunc is NULL");