When destroying the camerasrc plugin instance there was incorrectly called
close() on fd_3aa0c and fd_3aa0 which was not initially set to an invalid
value and value of those fields was 0 at that time. This resulted to closing
stdin stream of the camera application, leading to errors when sending message
from the muse daemon like:
E/MUSED_CAMERA( 1332): muse_camera_dispatcher.c: __camera_dispatcher_send_msg(73)
> sending message[{ "api": 0, "api_class": 0, "ret": 0, "get_type": 5,
"get_index": -1, "handle": -
219114416 }] failed. errno 25
Finally starting camera application was failing with en error:
D/TIZEN_N_CAMERA( 1273): camera.c: camera_create(2425) > cb info : 42
...
E/TIZEN_N_CAMERA( 1273): camera.c: _camera_client_wait_for_cb_return(529) > api 0 was TIMED OUT!
E/TIZEN_N_CAMERA( 1273): camera.c: _camera_client_wait_for_cb_return(542) > api 0 : error 0xffffffda
D/TIZEN_N_CAMERA( 1273): camera.c: _camera_client_callback_destroy(2167) > msg_recv thread[0xaad46b50] destroy
Fix this by initializing all camerasrc_handle_t::fd_* members to an invalid
value so there is no attempts to close an incorrect file descriptor.
Change-Id: I7bbce271f4b5eb535ce632e23390fea8298b7a3b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>