diff options
author | SeokHoon Lee <andy.shlee@samsung.com> | 2017-09-08 15:31:33 +0900 |
---|---|---|
committer | SeokHoon Lee <andy.shlee@samsung.com> | 2017-09-08 15:33:10 +0900 |
commit | 452c7f33a67c0fc8a43d0cd98aa8fb4470e9451d (patch) | |
tree | 40ba95d47546fb5d908485703441cb8a2e425466 | |
parent | 91dd2aa5a3f5e4e8fdea71feb9521f43168deb3f (diff) | |
download | mediastreamrecorder-452c7f33a67c0fc8a43d0cd98aa8fb4470e9451d.tar.gz mediastreamrecorder-452c7f33a67c0fc8a43d0cd98aa8fb4470e9451d.tar.bz2 mediastreamrecorder-452c7f33a67c0fc8a43d0cd98aa8fb4470e9451d.zip |
Add state check in cancel
- Cancel api should works in recording or paused state
- remove audio io depandency
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I3ce4a6ab0f5b9e9a4bbf80156faa9d48a919a5f5
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | packaging/capi-media-streamrecorder.spec | 3 | ||||
-rw-r--r-- | src/streamrecorder_private.c | 12 |
3 files changed, 15 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 195f9c8..cdf2b4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,8 @@ SET(service "media") SET(submodule "streamrecorder") # for package file -SET(dependents "dlog mm-streamrecorder capi-media-audio-io capi-media-tool") -SET(pc_dependents "capi-base-common capi-media-audio-io capi-media-tool") +SET(dependents "dlog mm-streamrecorder capi-media-tool") +SET(pc_dependents "capi-base-common capi-media-tool") SET(fw_name "${project_prefix}-${service}-${submodule}") diff --git a/packaging/capi-media-streamrecorder.spec b/packaging/capi-media-streamrecorder.spec index a4b50b3..88e17e4 100644 --- a/packaging/capi-media-streamrecorder.spec +++ b/packaging/capi-media-streamrecorder.spec @@ -1,6 +1,6 @@ Name: capi-media-streamrecorder Summary: A Streamrecorder library in Tizen Native API -Version: 0.0.14 +Version: 0.0.15 Release: 0 Group: Multimedia/Other License: Apache-2.0 @@ -10,7 +10,6 @@ BuildRequires: pkgconfig(dlog) Buildrequires: pkgconfig(mm-streamrecorder) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(capi-media-tool) -BuildRequires: pkgconfig(capi-media-audio-io) BuildRequires: pkgconfig(libtbm) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig diff --git a/src/streamrecorder_private.c b/src/streamrecorder_private.c index 6f7cc7b..54444fc 100644 --- a/src/streamrecorder_private.c +++ b/src/streamrecorder_private.c @@ -391,13 +391,25 @@ int _streamrecorder_commit(streamrecorder_h recorder) int _streamrecorder_cancel(streamrecorder_h recorder) { + int ret = MM_ERROR_NONE; streamrecorder_s *handle = (streamrecorder_s *)recorder; + streamrecorder_state_e state = STREAMRECORDER_STATE_NONE; if (recorder == NULL) { LOGE("NULL pointer handle"); return STREAMRECORDER_ERROR_INVALID_PARAMETER; } + ret = streamrecorder_get_state(recorder, &state); + if (ret != MM_ERROR_NONE) { + return __convert_streamrecorder_error_code(__func__, ret); + } + + if (!(state == STREAMRECORDER_STATE_RECORDING || state == STREAMRECORDER_STATE_PAUSED)) { + LOGE("STREAMRECORDER_ERROR_INVALID_STATE (state:%d)", state); + return STREAMRECORDER_ERROR_INVALID_STATE; + } + return __convert_streamrecorder_error_code(__func__, mm_streamrecorder_cancel(handle->mm_handle)); } |