Commit 3e6735a3 authored by Sandrine Avakian's avatar Sandrine Avakian

Setting a reference to the MSSndCardManager in MSSndCard instead of the MSFactory.

Removing ms_factory_uninit_plugins when destroying the factory since it is already called in ms_factory_destroy.
parent 5a65cee9
......@@ -131,7 +131,7 @@ typedef struct _MSSndCardDesc MSSndCardDesc;
struct _MSSndCard{
MSSndCardDesc *desc;
MSFactory* factory;
MSSndCardManager* scm;
char *name;
char *id;
unsigned int capabilities;
......@@ -224,7 +224,7 @@ 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_set_factory(MSSndCardManager*m, MSSndCard *c);
MS2_PUBLIC void ms_snd_card_set_manager(MSSndCardManager*m, MSSndCard *c);
/**
* Prepend a list of sound card object to the sound card manager's list.
......
......@@ -359,7 +359,7 @@ static void au_card_detect(MSSndCardManager * m)
if (card_capacity) {
card=ca_card_new(devname, uidname, devices[i], card_capacity);
ms_snd_card_set_factory(m, card);
ms_snd_card_set_manager(m, card);
ms_snd_card_manager_add_card(m, card);
}
......
......@@ -106,8 +106,8 @@ void ms_snd_card_manager_add_card(MSSndCardManager *m, MSSndCard *c){
m->cards=ms_list_append(m->cards,c);
}
void ms_snd_card_set_factory(MSSndCardManager*m, MSSndCard *c){
c->factory = m->factory;
void ms_snd_card_set_manager(MSSndCardManager*m, MSSndCard *c){
c->scm = m;
}
void ms_snd_card_manager_prepend_cards(MSSndCardManager *m, MSList *l) {
......@@ -153,7 +153,7 @@ MSSndCard * ms_snd_card_new(MSSndCardDesc *desc){
MSSndCard * ms_snd_card_new_with_name(MSSndCardDesc *desc,const char* name) {
MSSndCard *obj=(MSSndCard *)ms_new0(MSSndCard,1);
obj->factory = NULL;
obj->scm = NULL;
obj->desc=desc;
obj->name=name?ms_strdup(name):NULL;
obj->data=NULL;
......
......@@ -68,7 +68,6 @@ static int tester_after_all(void) {
//ms_exit();
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
rtp_profile_clear_all(&rtp_profile);
return 0;
......
......@@ -43,7 +43,6 @@ static int basic_audio_tester_before_all(void) {
static int basic_audio_tester_after_all(void) {
//ms_exit();
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
ortp_exit();
return 0;
......
......@@ -60,7 +60,7 @@ static void filter_register_tester(void) {
ms_filter_destroy(filter);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
//ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
// ms_exit();
......@@ -70,7 +70,7 @@ static void filter_register_tester(void) {
ms_filter_destroy(filter);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
// ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
BC_ASSERT_PTR_NULL(factory);
}
......@@ -164,9 +164,9 @@ static void test_filterdesc_enable_disable_base(const char* mime, const char* fi
ms_factory_init_plugins(factory);
if (is_enc)
filter = ms_factory_create_filter(factory,mime);
filter = ms_factory_create_encoder(factory,mime);
else
filter = ms_factory_create_filter(factory,mime);
filter = ms_factory_create_decoder(factory,mime);
BC_ASSERT_PTR_NOT_NULL(filter);
ms_filter_destroy(filter);
......@@ -190,7 +190,6 @@ static void test_filterdesc_enable_disable_base(const char* mime, const char* fi
ms_filter_destroy(filter);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
}
static void test_filterdesc_enable_disable(void) {
......
......@@ -32,7 +32,6 @@ static int tester_before_all(void) {
static int tester_after_all(void) {
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
return 0;
}
......@@ -87,7 +86,7 @@ static void play_file(const char *filepath, bool_t unsupported_format, bool_t se
BC_ASSERT_EQUAL(ms_media_player_get_state(file_player), MSPlayerClosed, int, "%d");
ms_media_player_set_eof_callback(file_player, eof_callback, &eof);
succeed = ms_media_player_open(file_player, filepath, snd_card->factory);
succeed = ms_media_player_open(file_player, filepath, snd_card->scm->factory);
if(unsupported_format) {
BC_ASSERT_FALSE(succeed);
BC_ASSERT_EQUAL(ms_media_player_get_state(file_player), MSPlayerClosed, int, "%d");
......@@ -131,7 +130,7 @@ static void play_file(const char *filepath, bool_t unsupported_format, bool_t se
if(play_twice) {
eof_init(&eof);
BC_ASSERT_TRUE(ms_media_player_open(file_player, filepath,snd_card->factory));
BC_ASSERT_TRUE(ms_media_player_open(file_player, filepath,snd_card->scm->factory));
BC_ASSERT_TRUE(ms_media_player_start(file_player));
wait_for_eof(&eof, 100, timeout);
ms_media_player_close(file_player);
......
......@@ -49,7 +49,6 @@ static int tester_cleanup(void) {
//ms_exit();
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
rtp_profile_clear_all(&rtp_profile);
return 0;
......
......@@ -68,7 +68,6 @@ static int tester_after_all(void) {
//ms_exit();
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
rtp_profile_clear_all(&rtp_profile);
return 0;
......
......@@ -333,7 +333,6 @@ static int uninit_bench(struct bench_config *bench)
}
ms_factory_uninit_voip(bench->factory);
ms_factory_uninit_plugins(bench->factory);
ms_factory_destroy(bench->factory);
ms_ticker_destroy(bench->ticker);
return 0;
......
......@@ -128,7 +128,6 @@ int main(int argc, char *argv[]){
ms_filter_destroy(f2);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
return 0;
}
......@@ -1111,7 +1111,6 @@ void clear_mediastreams(MediastreamDatas* args) {
fclose(args->logfile);
ms_factory_uninit_voip(args->video->ms.factory);
ms_factory_uninit_plugins(args->video->ms.factory);
ms_factory_destroy(args->video->ms.factory);
}
......
......@@ -161,7 +161,6 @@ end:
if (profile) rtp_profile_destroy(profile);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
return err;
......
......@@ -38,7 +38,6 @@ int main(int argc, char *argv[]){
printf("result: %i \n",ms_discover_mtu(argv[1]));
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
return 0;
......
......@@ -53,7 +53,6 @@ int main(int argc, char *argv[]){
ring_stop(r);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
return 0;
}
......@@ -115,7 +115,6 @@ int main(int argc, char *argv[]){
ms_filter_destroy(rec);
ms_factory_uninit_voip(factory);
ms_factory_uninit_plugins(factory);
ms_factory_destroy(factory);
//ms_base_exit();
return 0;
......
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