Commit 8c6bf3d3 authored by Sandrine Avakian's avatar Sandrine Avakian
Browse files

More cleaning / refactoring around MSFactory.

parent 483fcd85
...@@ -176,6 +176,7 @@ MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj); ...@@ -176,6 +176,7 @@ MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj);
/** /**
* Creates an audio endpoint (or virtual participant) to record the conference into a wav file. * Creates an audio endpoint (or virtual participant) to record the conference into a wav file.
* @param factory The factory used by the linphone core.
**/ **/
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(MSFactory* factory); MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(MSFactory* factory);
......
...@@ -162,7 +162,12 @@ extern "C"{ ...@@ -162,7 +162,12 @@ extern "C"{
* Returns: MSSndCardManager if successfull, NULL otherwise. * Returns: MSSndCardManager if successfull, NULL otherwise.
*/ */
MS2_PUBLIC MS2_DEPRECATED MSSndCardManager * ms_snd_card_manager_get(void); MS2_PUBLIC MS2_DEPRECATED MSSndCardManager * ms_snd_card_manager_get(void);
/**
* Retrieve a factory from a sound card object.
* @param c MSSndCard object.
* Returns: MSFactory pointer.
*/
MS2_PUBLIC MSFactory * ms_snd_card_get_factory(MSSndCard * c); MS2_PUBLIC MSFactory * ms_snd_card_get_factory(MSSndCard * c);
/** /**
...@@ -226,6 +231,13 @@ MS2_PUBLIC const MSList * ms_snd_card_manager_get_list(MSSndCardManager *m); ...@@ -226,6 +231,13 @@ MS2_PUBLIC const MSList * ms_snd_card_manager_get_list(MSSndCardManager *m);
*/ */
MS2_PUBLIC void ms_snd_card_manager_add_card(MSSndCardManager *m, MSSndCard *c); MS2_PUBLIC void ms_snd_card_manager_add_card(MSSndCardManager *m, MSSndCard *c);
/**
* Set the sound card manager of a sound card.
*
* @param m A sound card manager containing sound cards.
* @param c A sound card object.
*
*/
MS2_PUBLIC void ms_snd_card_set_manager(MSSndCardManager*m, MSSndCard *c); MS2_PUBLIC void ms_snd_card_set_manager(MSSndCardManager*m, MSSndCard *c);
/** /**
......
...@@ -99,6 +99,10 @@ extern "C"{ ...@@ -99,6 +99,10 @@ extern "C"{
*/ */
MS2_PUBLIC MS2_DEPRECATED MSWebCamManager * ms_web_cam_manager_get(void); MS2_PUBLIC MS2_DEPRECATED MSWebCamManager * ms_web_cam_manager_get(void);
/**
* Returns the factory from the webcam object.
* @param c MSWebCam used to get to the factory.
*/
MS2_PUBLIC MSFactory * ms_web_cam_get_factory(MSWebCam *c); MS2_PUBLIC MSFactory * ms_web_cam_get_factory(MSWebCam *c);
/** /**
......
...@@ -921,7 +921,7 @@ MSFilterDesc au_write_desc={ ...@@ -921,7 +921,7 @@ MSFilterDesc au_write_desc={
static MSFilter *ms_au_read_new(MSSndCard *mscard){ static MSFilter *ms_au_read_new(MSSndCard *mscard){
ms_debug("ms_au_read_new"); ms_debug("ms_au_read_new");
au_card_t* card=(au_card_t*)(mscard->data); au_card_t* card=(au_card_t*)(mscard->data);
MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_factory_get(mscard), &au_read_desc); MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_get_factory(mscard), &au_read_desc);
au_filter_read_data_t *d=ms_new0(au_filter_read_data_t,1); au_filter_read_data_t *d=ms_new0(au_filter_read_data_t,1);
qinit(&d->rq); qinit(&d->rq);
d->readTimeStamp.mSampleTime=-1; d->readTimeStamp.mSampleTime=-1;
...@@ -935,7 +935,7 @@ static MSFilter *ms_au_read_new(MSSndCard *mscard){ ...@@ -935,7 +935,7 @@ static MSFilter *ms_au_read_new(MSSndCard *mscard){
static MSFilter *ms_au_write_new(MSSndCard *mscard){ static MSFilter *ms_au_write_new(MSSndCard *mscard){
ms_debug("ms_au_write_new"); ms_debug("ms_au_write_new");
au_card_t* card=(au_card_t*)(mscard->data); au_card_t* card=(au_card_t*)(mscard->data);
MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_factory_get(mscard), &au_write_desc); MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_get_factory(mscard), &au_write_desc);
au_filter_write_data_t *d=ms_new0(au_filter_write_data_t,1); au_filter_write_data_t *d=ms_new0(au_filter_write_data_t,1);
d->bufferizer= ms_bufferizer_new(); d->bufferizer= ms_bufferizer_new();
ms_mutex_init(&d->mutex,NULL); ms_mutex_init(&d->mutex,NULL);
......
...@@ -1848,7 +1848,7 @@ MSFilterDesc winsndds_write_desc={ ...@@ -1848,7 +1848,7 @@ MSFilterDesc winsndds_write_desc={
}; };
MSFilter *ms_winsndds_read_new(MSSndCard *card){ MSFilter *ms_winsndds_read_new(MSSndCard *card){
MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_factory_get(card), &winsndds_read_desc); MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_get_factory(card), &winsndds_read_desc);
WinSndDsCard *wc=(WinSndDsCard*)card->data; WinSndDsCard *wc=(WinSndDsCard*)card->data;
WinSndDs *d=(WinSndDs*)f->data; WinSndDs *d=(WinSndDs*)f->data;
d->dev_id=wc->in_devid; d->dev_id=wc->in_devid;
...@@ -1859,7 +1859,7 @@ MSFilter *ms_winsndds_read_new(MSSndCard *card){ ...@@ -1859,7 +1859,7 @@ MSFilter *ms_winsndds_read_new(MSSndCard *card){
MSFilter *ms_winsndds_write_new(MSSndCard *card){ MSFilter *ms_winsndds_write_new(MSSndCard *card){
MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_factory_get(card), &winsndds_write_desc); MSFilter *f=ms_factory_create_filter_from_desc(ms_snd_card_get_factory(card), &winsndds_write_desc);
WinSndDsCard *wc=(WinSndDsCard*)card->data; WinSndDsCard *wc=(WinSndDsCard*)card->data;
WinSndDs *d=(WinSndDs*)f->data; WinSndDs *d=(WinSndDs*)f->data;
d->dev_id=wc->out_devid; d->dev_id=wc->out_devid;
......
...@@ -1159,7 +1159,7 @@ JNIEXPORT void JNICALL Java_org_linphone_mediastream_MediastreamerActivity_chang ...@@ -1159,7 +1159,7 @@ JNIEXPORT void JNICALL Java_org_linphone_mediastream_MediastreamerActivity_chang
char* id = (char*)malloc(15); char* id = (char*)malloc(15);
snprintf(id, 15, "Android%d", camId); snprintf(id, 15, "Android%d", camId);
ms_message("Changing camera, trying to use: '%s'\n", id); ms_message("Changing camera, trying to use: '%s'\n", id);
video_stream_change_camera(args->video, ms_web_cam_manager_get_cam(ms_factory_get_wbc_manager(args->video->ms.factory), id)); video_stream_change_camera(args->video, ms_web_cam_manager_get_cam(ms_factory_get_web_cam_manager(args->video->ms.factory), id));
#endif #endif
} }
......
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