{
result r = E_SUCCESS;
r = __pListenerList->Add(&listener);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
}
{
result r = E_SUCCESS;
r = __pListenerList->Remove(&listener);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = NotifyOtherRemoved();
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
}
}
result
+_CameraCoordinator::NotifyOtherRemoved(void)
+{
+ result r = E_SUCCESS;
+ _ICameraCoordinatorListener* pListener = null;
+ SysLog(NID_MEDIA, "Enter");
+
+ std::unique_ptr <IEnumeratorT <_ICameraCoordinatorListener*> > pEnum (__pListenerList->GetEnumeratorN());
+ SysTryReturn(NID_MEDIA, pEnum.get() != null, GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ r = pEnum->GetCurrent(pListener);
+ SysTryReturn(NID_MEDIA, pListener != null && r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
+ "[E_SYSTEM] A system error has been occurred. The listener is not proper");
+
+ r = pListener->OnCameraCoordinatorOtherRemoved();
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ return r;
+}
+
+result
_CameraCoordinator::StartMmPreview(void)
{
result r = E_SUCCESS;
*/
result NotifyModeChanged(_CameraMode mode);
+
+ /**
+ * Notifies the other _ICameraCoordinatorListener is removed
+ *
+ * @return An error code
+ * @param[in] mode camera mode
+ * @remarks This mtehod calls _ICameraCoordinatorListener::::OnCameraCoordinatorOtherRemoved().
+ * This method will call every _ICameraCoordinatorListener which are registered to _CameraCoordinator.
+ */
+ result NotifyOtherRemoved(void);
+
/**
* Start the preview.
*
return r;
}
+result
+_CameraImpl::OnCameraCoordinatorOtherRemoved(void)
+{
+ result r = E_SUCCESS;
+ SysLog(NID_MEDIA, "Enter.");
+ return r;
+}
+
void
_CameraImpl::StateChangedCb(camera_state_e previous, camera_state_e current, bool byPolicy, void *pUserData)
{
result OnCameraCoordinatorModeChanged(_CameraMode mode);
/**
+ * Called when the other module is removed
+ *
+ * @return An error code
+ */
+ result OnCameraCoordinatorOtherRemoved(void);
+
+ /**
* Function definition for start capture.
*
* @return This function returns 0 on success, else on failure.
*/
virtual result OnCameraCoordinatorModeChanged(_CameraMode mode) = 0;
+ /**
+ * Called when the other module is removed
+ *
+ * @return An error code
+ */
+ virtual result OnCameraCoordinatorOtherRemoved(void) = 0;
+
};
}}// Tizen::Media
}
if (__pCoordinator != null)
{
- if (__pVideoSourceAdapter != null)
+ if (__pVideoSourceAdapter.get() != null)
{
if (__pVideoSourceAdapter->GetUserPreviewFormat() != __pCoordinator->GetCameraSourceFormat())
{
SysTryReturn(NID_MEDIA, state == RECORDER_STATE_OPENED || state == RECORDER_STATE_PAUSED
, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] VideoRecorder is in an invalid state:%d", state);
+ SysTryReturn(NID_MEDIA, __pVideoSourceAdapter.get() != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. The source is deleted.");
if (__pVideoSourceAdapter->HasRecordingResolutionRestriction())
{
SysTryReturn(NID_MEDIA, __recordingResolution == __pVideoSourceAdapter->GetSourceResolution()
SysTryReturn(NID_MEDIA, pList.get() != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Getting the supported list was failed.\n");
SysTryReturn(NID_MEDIA, pList->Contains(resolution), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE]. resolution is out of range. This resolution(%d,%d) is not supported in the device.\n", resolution.width, resolution.height);
+ SysTryReturn(NID_MEDIA, __pVideoSourceAdapter.get() != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. The source is deleted.");
if ( __pVideoSourceAdapter->HasRecordingResolutionRestriction())
{
Dimension sourceResolution = __pVideoSourceAdapter->GetSourceResolution();
return r;
}
+result
+_VideoRecorderImpl::OnCameraCoordinatorOtherRemoved(void)
+{
+ result r = E_SUCCESS;
+ SysLog(NID_MEDIA, "Enter.");
+ __pVideoSourceAdapter.reset(null);
+ return r;
+}
+
void
_VideoRecorderImpl::StateChangedCb(recorder_state_e previous, recorder_state_e current, bool byPolicy, void* pUserData)
{
// Preview resolution
if (reload & _RELOAD_RECORD_RESOLUTION)
{
+ SysTryReturn(NID_MEDIA, __pVideoSourceAdapter.get() != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. The source is deleted.");
__recordingResolution = __pVideoSourceAdapter->GetSourceResolution();
}
result OnCameraCoordinatorModeChanged(_CameraMode mode);
/**
+ * Called when the other module is removed
+ *
+ * @return An error code
+ */
+ result OnCameraCoordinatorOtherRemoved(void);
+
+ /**
* Sets the state.
*
* @param[in] state new _VideoRecorder's state