Commit 0de4fbf2 authored by David Idmansour's avatar David Idmansour

recorder now use capture device as default audio device & recorder_open now...

recorder now use capture device as default audio device & recorder_open now needs device orientation
parent 994699bb
...@@ -611,7 +611,7 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphonePlayer); ...@@ -611,7 +611,7 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphonePlayer);
struct _LinphoneRecorder{ struct _LinphoneRecorder{
belle_sip_object_t base; belle_sip_object_t base;
void *user_data; void *user_data;
int (*open)(LinphoneRecorder* recorder, const char *filename); int (*open)(LinphoneRecorder* recorder, const char *filename, int device_orientation);
int (*start)(LinphoneRecorder* recorder); int (*start)(LinphoneRecorder* recorder);
int (*pause)(LinphoneRecorder* recorder); int (*pause)(LinphoneRecorder* recorder);
MSRecorderState (*get_state)(LinphoneRecorder* recorder); MSRecorderState (*get_state)(LinphoneRecorder* recorder);
......
...@@ -37,7 +37,7 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneRecorder, belle_sip_object_t, ...@@ -37,7 +37,7 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneRecorder, belle_sip_object_t,
FALSE FALSE
); );
static int _recorder_open(LinphoneRecorder *obj, const char *filename); static int _recorder_open(LinphoneRecorder *obj, const char *filename, int device_orientation);
static int _recorder_start(LinphoneRecorder *obj); static int _recorder_start(LinphoneRecorder *obj);
static int _recorder_pause(LinphoneRecorder *obj); static int _recorder_pause(LinphoneRecorder *obj);
static MSRecorderState _recorder_get_state(LinphoneRecorder *obj); static MSRecorderState _recorder_get_state(LinphoneRecorder *obj);
...@@ -51,7 +51,7 @@ LinphoneRecorder *linphone_core_create_recorder(LinphoneCore *lc, const char *so ...@@ -51,7 +51,7 @@ LinphoneRecorder *linphone_core_create_recorder(LinphoneCore *lc, const char *so
MSSndCardManager *snd_card_manager = ms_factory_get_snd_card_manager(lc->factory); MSSndCardManager *snd_card_manager = ms_factory_get_snd_card_manager(lc->factory);
MSWebCam *web_cam; MSWebCam *web_cam;
MSWebCamManager *web_cam_manager = ms_factory_get_web_cam_manager(lc->factory); MSWebCamManager *web_cam_manager = ms_factory_get_web_cam_manager(lc->factory);
if (sound_card_name == NULL) sound_card_name = linphone_core_get_ringer_device(lc); if (sound_card_name == NULL) sound_card_name = linphone_core_get_capture_device(lc);
snd_card = ms_snd_card_manager_get_card(snd_card_manager, sound_card_name); snd_card = ms_snd_card_manager_get_card(snd_card_manager, sound_card_name);
if (web_cam_name == NULL) web_cam_name = linphone_core_get_video_device(lc); if (web_cam_name == NULL) web_cam_name = linphone_core_get_video_device(lc);
web_cam = ms_web_cam_manager_get_cam(web_cam_manager, web_cam_name); web_cam = ms_web_cam_manager_get_cam(web_cam_manager, web_cam_name);
...@@ -71,8 +71,8 @@ bool_t linphone_recorder_matroska_supported(void) { ...@@ -71,8 +71,8 @@ bool_t linphone_recorder_matroska_supported(void) {
return ms_media_recorder_matroska_supported(); return ms_media_recorder_matroska_supported();
} }
static int _recorder_open(LinphoneRecorder *obj, const char *filename) { static int _recorder_open(LinphoneRecorder *obj, const char *filename, int device_orientation) {
return ms_media_recorder_open((MSMediaRecorder *)obj->impl, filename) ? 0 : -1; return ms_media_recorder_open((MSMediaRecorder *)obj->impl, filename, device_orientation) ? 0 : -1;
} }
static int _recorder_start(LinphoneRecorder *obj) { static int _recorder_start(LinphoneRecorder *obj) {
...@@ -122,8 +122,8 @@ void linphone_recorder_set_user_data(LinphoneRecorder *recorder, void *ud) { ...@@ -122,8 +122,8 @@ void linphone_recorder_set_user_data(LinphoneRecorder *recorder, void *ud) {
recorder->user_data = ud; recorder->user_data = ud;
} }
LinphoneStatus linphone_recorder_open(LinphoneRecorder *obj, const char *filename){ LinphoneStatus linphone_recorder_open(LinphoneRecorder *obj, const char *filename, int device_orientation){
return obj->open(obj,filename); return obj->open(obj,filename,device_orientation);
} }
LinphoneStatus linphone_recorder_start(LinphoneRecorder *obj){ LinphoneStatus linphone_recorder_start(LinphoneRecorder *obj){
......
...@@ -67,7 +67,7 @@ LINPHONE_PUBLIC void linphone_recorder_set_user_data(LinphoneRecorder *recorder, ...@@ -67,7 +67,7 @@ LINPHONE_PUBLIC void linphone_recorder_set_user_data(LinphoneRecorder *recorder,
* @param[in] obj #LinphoneRecorder object * @param[in] obj #LinphoneRecorder object
* @param[in] filename The path to the file to open * @param[in] filename The path to the file to open
*/ */
LINPHONE_PUBLIC LinphoneStatus linphone_recorder_open(LinphoneRecorder *obj, const char *filename); LINPHONE_PUBLIC LinphoneStatus linphone_recorder_open(LinphoneRecorder *obj, const char *filename, int device_orientation);
/** /**
* Start playing a file that has been opened with linphone_recorder_open(). * Start playing a file that has been opened with linphone_recorder_open().
......
...@@ -42,7 +42,7 @@ static void record_file(const char *filename, bool_t supported_format, const cha ...@@ -42,7 +42,7 @@ static void record_file(const char *filename, bool_t supported_format, const cha
BC_ASSERT_PTR_NOT_NULL(recorder); BC_ASSERT_PTR_NOT_NULL(recorder);
if(recorder == NULL) goto fail; if(recorder == NULL) goto fail;
res = linphone_recorder_open(recorder, filename); res = linphone_recorder_open(recorder, filename, linphone_core_get_device_rotation(lc_manager->lc));
BC_ASSERT_EQUAL(res, 0, int, "%d"); BC_ASSERT_EQUAL(res, 0, int, "%d");
if(res == -1) goto fail; if(res == -1) goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment