Commit 483fcd85 authored by Simon Morlat's avatar Simon Morlat

clean a bit around MSFactory, MSSndCardManager and MSWebCamManager

parent b2eb303a
......@@ -64,8 +64,8 @@ struct _RingStream
typedef struct _RingStream RingStream;
MS2_PUBLIC RingStream *ring_start (const char * file, int interval, MSSndCard *sndcard, MSFactory *factory);
MS2_PUBLIC RingStream *ring_start_with_cb( MSFactory *factory, const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data);
MS2_PUBLIC RingStream *ring_start(MSFactory *factory, const char * file, int interval, MSSndCard *sndcard);
MS2_PUBLIC RingStream *ring_start_with_cb(MSFactory *factory, const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data);
MS2_PUBLIC void ring_stop (RingStream * stream);
/**
......@@ -393,14 +393,15 @@ struct _AudioStream
int sample_rate;
int nchannels;
struct _VideoStream *videostream;/*the stream with which this audiostream is paired*/
MSAudioRoute audio_route;
bool_t play_dtmfs;
bool_t use_ec;
bool_t use_gc;
bool_t use_agc;
bool_t eq_active;
bool_t use_ng;/*noise gate*/
bool_t is_ec_delay_set;
MSAudioRoute audio_route;
};
/**
......@@ -410,11 +411,11 @@ typedef struct _AudioStream AudioStream;
/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
MS2_PUBLIC AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip,
int remport, int payload_type, int jitt_comp, bool_t echo_cancel, MSFactory* factory);
MS2_PUBLIC AudioStream *audio_stream_start(MSFactory* factory, RtpProfile * prof, int locport, const char *remip,
int remport, int payload_type, int jitt_comp, bool_t echo_cancel);
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(RtpProfile* prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard,
MSSndCard *captcard, bool_t echocancel, MSFactory* factory);
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(MSFactory* factory, RtpProfile* prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard,
MSSndCard *captcard, bool_t echocancel);
MS2_PUBLIC int audio_stream_start_with_files (AudioStream * stream, RtpProfile * prof,
const char *remip, int remport, int rem_rtcp_port,
......@@ -480,7 +481,7 @@ MS2_PUBLIC void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno);
* @param factory
* @return a new AudioStream.
**/
MS2_PUBLIC AudioStream *audio_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t ipv6, MSFactory* factory);
MS2_PUBLIC AudioStream *audio_stream_new(MSFactory* factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
/**
* Creates an AudioStream object listening on a RTP port for a dedicated address.
......@@ -490,7 +491,7 @@ MS2_PUBLIC AudioStream *audio_stream_new(int loc_rtp_port, int loc_rtcp_port, bo
* @param factory
* @return a new AudioStream.
**/
MS2_PUBLIC AudioStream *audio_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port, MSFactory* factory);
MS2_PUBLIC AudioStream *audio_stream_new2(MSFactory* factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
/**Creates an AudioStream object from initialized MSMediaStreamSessions.
......@@ -498,7 +499,7 @@ MS2_PUBLIC AudioStream *audio_stream_new2(const char* ip, int loc_rtp_port, int
* @param factory the MSFActory from the core object
* @return a new AudioStream
**/
MS2_PUBLIC AudioStream *audio_stream_new_with_sessions(const MSMediaStreamSessions *sessions, MSFactory* factory);
MS2_PUBLIC AudioStream *audio_stream_new_with_sessions(MSFactory* factory, const MSMediaStreamSessions *sessions);
#define AUDIO_STREAM_FEATURE_PLC (1 << 0)
#define AUDIO_STREAM_FEATURE_EC (1 << 1)
......@@ -802,22 +803,23 @@ struct _VideoStream
int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */
uint64_t last_reported_decoding_error_time;
uint64_t last_fps_check;
MediaStreamVideoStat ms_video_stat;
bool_t use_preview_window;
bool_t freeze_on_error;
bool_t display_filter_auto_rotate_enabled;
bool_t source_performs_encoding;
bool_t output_performs_decoding;
bool_t player_active;
bool_t staticimage_webcam_fps_optimization; /* if TRUE, the StaticImage webcam will ignore the fps target in order to save CPU time. Default is TRUE */
MediaStreamVideoStat ms_video_stat;
};
typedef struct _VideoStream VideoStream;
MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6, MSFactory* factory);
MS2_PUBLIC VideoStream *video_stream_new(MSFactory* factory, int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6);
/**
* Creates a VideoStream object listening on a RTP port for a dedicated address.
* @param loc_ip the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
......@@ -825,9 +827,9 @@ MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bo
* @param [in] loc_rtcp_port the local UDP port to listen for RTCP packets
* @return a new VideoStream.
**/
MS2_PUBLIC VideoStream *video_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port, MSFactory* factory);
MS2_PUBLIC VideoStream *video_stream_new2(MSFactory* factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC VideoStream *video_stream_new_with_sessions(const MSMediaStreamSessions *sessions, MSFactory* factory);
MS2_PUBLIC VideoStream *video_stream_new_with_sessions(MSFactory* factory, const MSMediaStreamSessions *sessions);
MS2_PUBLIC void video_stream_set_direction(VideoStream *vs, MediaStreamDir dir);
static MS2_INLINE void video_stream_enable_adaptive_bitrate_control(VideoStream *stream, bool_t enabled) {
media_stream_enable_adaptive_bitrate_control(&stream->ms, enabled);
......@@ -1171,7 +1173,7 @@ MS2_PUBLIC MSWebCamDesc *ms_mire_webcam_desc_get(void);
* @param[in] local_rtp_port The local port to bind the RTP socket to.
* @param[in] local_rtcp_port The local port to bind the RTCP socket to.
*/
MS2_PUBLIC RtpSession * ms_create_duplex_rtp_session(const char* local_ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC RtpSession * ms_create_duplex_rtp_session(const char* local_ip, int loc_rtp_port, int loc_rtcp_port, int mtu);
/**
* Asks the audio playback filter to route to the selected device (currently only used for blackberry)
......@@ -1208,7 +1210,7 @@ typedef struct _TextStream TextStream;
* @param factory
* @return a new TextStream.
**/
MS2_PUBLIC TextStream *text_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t ipv6, MSFactory *factory);
MS2_PUBLIC TextStream *text_stream_new(MSFactory *factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
/**
* Creates a TextStream object from initialized MSMediaStreamSessions.
......@@ -1216,7 +1218,7 @@ MS2_PUBLIC TextStream *text_stream_new(int loc_rtp_port, int loc_rtcp_port, bool
* @param factory
* @return a new TextStream
**/
MS2_PUBLIC TextStream *text_stream_new_with_sessions(const MSMediaStreamSessions *sessions, MSFactory *factory);
MS2_PUBLIC TextStream *text_stream_new_with_sessions(MSFactory *factory, const MSMediaStreamSessions *sessions);
/**
* Creates a TextStream object listening on a RTP port for a dedicated address.
......@@ -1226,7 +1228,7 @@ MS2_PUBLIC TextStream *text_stream_new_with_sessions(const MSMediaStreamSessions
* @param factory
* @return a new TextStream.
**/
MS2_PUBLIC TextStream *text_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port,MSFactory *factory);
MS2_PUBLIC TextStream *text_stream_new2(MSFactory *factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
/**
* Starts a text stream.
......@@ -1241,7 +1243,7 @@ MS2_PUBLIC TextStream *text_stream_new2(const char* ip, int loc_rtp_port, int lo
* @param[in] factory
*/
MS2_PUBLIC TextStream* text_stream_start(TextStream *stream, RtpProfile *profile, const char *rem_rtp_addr, int rem_rtp_port, const char *rem_rtcp_addr, int rem_rtcp_port,
int payload_type, MSFactory *factory);
int payload_type);
/**
* Stops the text streaming thread and free everything
......
......@@ -28,11 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "TargetConditionals.h"
#endif
#ifndef LINPHONE_DEPRECATED
#ifndef MS2_DEPRECATED
#if defined(_MSC_VER)
#define LINPHONE_DEPRECATED __declspec(deprecated)
#define MS2_DEPRECATED __declspec(deprecated)
#else
#define LINPHONE_DEPRECATED __attribute__ ((deprecated))
#define MS2_DEPRECATED __attribute__ ((deprecated))
#endif
#endif
#define MS_UNUSED(x) ((void)(x))
......@@ -348,14 +348,14 @@ MS2_PUBLIC bool_t ms_tags_list_contains_tag(const MSList *list, const char *tag)
*
* This must be called once before calling any other API.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_base_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_base_init(void);
/**
* Initialize the mediastreamer2 VoIP library.
*
* This must be called one before calling any other API.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_voip_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_voip_init(void);
/**
* Load the plugins from the default plugin directory.
......@@ -363,13 +363,13 @@ MS2_PUBLIC LINPHONE_DEPRECATED void ms_voip_init(void);
* This is just a wrapper around ms_load_plugins().
* This must be called after ms_base_init() and after ms_voip_init().
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_plugins_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_plugins_init(void);
/**
* Set the directory from where the plugins are to be loaded when calling ms_plugins_init().
* @param[in] path The path to the plugins directory.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_plugins_dir(const char *path);
MS2_PUBLIC MS2_DEPRECATED void ms_set_plugins_dir(const char *path);
/**
* Load plugins from a specific directory.
......@@ -382,26 +382,26 @@ MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_plugins_dir(const char *path);
*
* Returns: >0 if successfull, 0 if not plugins loaded, -1 otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED int ms_load_plugins(const char *directory);
MS2_PUBLIC MS2_DEPRECATED int ms_load_plugins(const char *directory);
/**
* Release resource allocated in the mediastreamer2 base library.
*
* This must be called once before closing program.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_base_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_base_exit(void);
/**
* Release resource allocated in the mediastreamer2 VoIP library.
*
* This must be called once before closing program.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_voip_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_voip_exit(void);
/**
* Unload the plugins loaded by ms_plugins_init().
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_plugins_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_plugins_exit(void);
struct _MSSndCardDesc;
......@@ -418,9 +418,9 @@ MS2_PUBLIC void ms_usleep(uint64_t usec);
* value works for both.
*
**/
MS2_PUBLIC LINPHONE_DEPRECATED int ms_get_payload_max_size(void);
MS2_PUBLIC MS2_DEPRECATED int ms_get_payload_max_size(void);
MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_payload_max_size(int size);
MS2_PUBLIC MS2_DEPRECATED void ms_set_payload_max_size(int size);
/**
* Returns the network Max Transmission Unit to reach destination_host.
......@@ -433,19 +433,19 @@ MS2_PUBLIC int ms_discover_mtu(const char *destination_host);
* Set mediastreamer default mtu, used to compute the default RTP max payload size.
* This function will call ms_set_payload_max_size(mtu-[ipv6 header size]).
**/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_mtu(int mtu);
MS2_PUBLIC MS2_DEPRECATED void ms_set_mtu(int mtu);
/**
* Get mediastreamer default mtu, used to compute the default RTP max payload size.
**/
MS2_PUBLIC int ms_get_mtu(void);
MS2_PUBLIC MS2_DEPRECATED int ms_get_mtu(void);
/**
* Declare how many cpu (cores) are available on the platform
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_cpu_count(unsigned int c);
MS2_PUBLIC MS2_DEPRECATED void ms_set_cpu_count(unsigned int c);
MS2_PUBLIC LINPHONE_DEPRECATED unsigned int ms_get_cpu_count(void);
MS2_PUBLIC MS2_DEPRECATED unsigned int ms_get_cpu_count(void);
/**
* Adds a new entry in the SoundDeviceDescription table
......
......@@ -41,7 +41,7 @@ MS2_PUBLIC MSEventQueue *ms_event_queue_new(void);
* to the event queue.
*
**/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_set_global_event_queue(MSEventQueue *q);
MS2_PUBLIC MS2_DEPRECATED void ms_set_global_event_queue(MSEventQueue *q);
/**
* Run callbacks associated to the events received.
......@@ -59,6 +59,6 @@ MS2_PUBLIC void ms_event_queue_skip(MSEventQueue *q);
/**
* Destroys an event queue.
**/
//MS2_PUBLIC LINPHONE_DEPRECATED void ms_event_queue_destroy(MSEventQueue *q);
//MS2_PUBLIC MS2_DEPRECATED void ms_event_queue_destroy(MSEventQueue *q);
MS2_PUBLIC void ms_event_queue_destroy(MSEventQueue *q);
#endif
......@@ -40,12 +40,11 @@ struct _MSFactory{
struct _MSEventQueue *evq;
int max_payload_size;
int mtu;
bool_t statistics_enabled;
bool_t voip_initd;
int ref_count;
int managers_ref;
struct _MSSndCardManager* sndcardmanager;
struct _MSWebCamManager* wbcmanager;
void (*voip_uninit_func)(struct _MSFactory*);
bool_t statistics_enabled;
bool_t voip_initd;
};
typedef struct _MSFactory MSFactory;
......@@ -54,11 +53,11 @@ typedef struct _MSFactory MSFactory;
extern "C" {
#endif
#ifndef LINPHONE_DEPRECATED
#ifndef MS2_DEPRECATED
#if defined(_MSC_VER)
#define LINPHONE_DEPRECATED __declspec(deprecated)
#define MS2_DEPRECATED __declspec(deprecated)
#else
#define LINPHONE_DEPRECATED __attribute__ ((deprecated))
#define MS2_DEPRECATED __attribute__ ((deprecated))
#endif
#endif
......@@ -67,16 +66,21 @@ extern "C" {
**/
MS2_PUBLIC MSFactory *ms_factory_new(void);
/**
* Create a mediastreamer2 factory and initialize all voip related filter, card and webcam managers.
**/
MS2_PUBLIC MSFactory* ms_factory_new_with_voip(void);
/**
* Create the fallback factory (for compatibility with applications not using MSFactory to create ms2 object)
**/
LINPHONE_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_create_fallback(void);
MS2_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_create_fallback(void);
/**
* Used by the legacy functions before MSFactory was added.
* Do not use in an application.
**/
LINPHONE_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_get_fallback(void);
MS2_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_get_fallback(void);
/**
* Destroy the factory.
......@@ -84,15 +88,15 @@ LINPHONE_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_get_fallback(void);
**/
MS2_PUBLIC void ms_factory_destroy(MSFactory *factory);
/*
* Obtain the soundcard manager.
**/
MS2_PUBLIC struct _MSSndCardManager* ms_factory_get_snd_card_manager(MSFactory *f);
/**
* Exits the factory : unset voip and destroys the factory if there is no references to it.
* Ensures it can be destroyed before destroying all objects created by the factory.
**/
MS2_PUBLIC MSFactory* ms_factory_exit(MSFactory* factory);
MS2_PUBLIC MSFactory* ms_factory_create(MSFactory* f);
MS2_PUBLIC struct _MSSndCardManager* ms_factory_get_snd_manager(MSFactory *f);
* Obtain the webcam manager.
*/
MS2_PUBLIC struct _MSWebCamManager* ms_factory_get_web_cam_manager(MSFactory* f);
MS2_PUBLIC void ms_factory_register_filter(MSFactory *factory, MSFilterDesc *desc);
......@@ -299,7 +303,9 @@ MS2_PUBLIC int ms_factory_get_payload_max_size(MSFactory *factory);
MS2_PUBLIC void ms_factory_set_payload_max_size(MSFactory *obj, int size);
MS2_PUBLIC void ms_factory_set_mtu(MSFactory *obj, int mtu);
MS2_PUBLIC void ms_factory_set_mtu(MSFactory *obj, int mtu);
MS2_PUBLIC int ms_factory_get_mtu(MSFactory *obj);
MS2_PUBLIC const struct _MSFmtDescriptor * ms_factory_get_audio_format(MSFactory *obj, const char *mime, int rate, int channels, const char *fmtp);
......
......@@ -243,7 +243,7 @@ extern "C"{
*
* @param desc a filter description.
*/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_filter_register(MSFilterDesc *desc);
MS2_PUBLIC MS2_DEPRECATED void ms_filter_register(MSFilterDesc *desc);
/**
* Retrieve capture filter that supports encoding to codec name.
......@@ -252,7 +252,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED void ms_filter_register(MSFilterDesc *desc);
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_encoding_capturer(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilterDesc * ms_filter_get_encoding_capturer(const char *mime);
/**
* Retrieve render filter that supports decoding to codec name.
......@@ -261,7 +261,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_encoding_capturer(co
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_decoding_renderer(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilterDesc * ms_filter_get_decoding_renderer(const char *mime);
/**
* Retrieve encoders according to codec name.
......@@ -275,7 +275,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_decoding_renderer(co
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_encoder(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilterDesc * ms_filter_get_encoder(const char *mime);
/**
* Retrieve decoders according to codec name.
......@@ -289,7 +289,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_encoder(const char *
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_decoder(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilterDesc * ms_filter_get_decoder(const char *mime);
/**
* Lookup a mediastreamer2 filter using its name.
......@@ -299,7 +299,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc * ms_filter_get_decoder(const char *
*
* @param filter_name The filter name.
**/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc *ms_filter_lookup_by_name(const char *filter_name);
MS2_PUBLIC MS2_DEPRECATED MSFilterDesc *ms_filter_lookup_by_name(const char *filter_name);
/**
* Returns a list of filter descriptions implementing a given interface.
......@@ -307,7 +307,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilterDesc *ms_filter_lookup_by_name(const char
* @param id a filter interface id
* @return a newly allocated MSList of #MSFilterDesc.
**/
MS2_PUBLIC LINPHONE_DEPRECATED MSList *ms_filter_lookup_by_interface(MSFilterInterfaceId id);
MS2_PUBLIC MS2_DEPRECATED MSList *ms_filter_lookup_by_interface(MSFilterInterfaceId id);
/**
* Create encoder filter according to codec name.
......@@ -321,7 +321,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSList *ms_filter_lookup_by_interface(MSFilterInt
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilter * ms_filter_create_encoder(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilter * ms_filter_create_encoder(const char *mime);
/**
* Create decoder filter according to codec name.
......@@ -335,7 +335,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilter * ms_filter_create_encoder(const char *m
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilter * ms_filter_create_decoder(const char *mime);
MS2_PUBLIC MS2_DEPRECATED MSFilter * ms_filter_create_decoder(const char *mime);
/**
* Check if a encode or decode filter exists for a codec name.
......@@ -349,7 +349,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilter * ms_filter_create_decoder(const char *m
*
* Returns: TRUE if successfull, FALSE otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED bool_t ms_filter_codec_supported(const char *mime);
MS2_PUBLIC MS2_DEPRECATED bool_t ms_filter_codec_supported(const char *mime);
/**
* Create decoder filter according to a filter's MSFilterId.
......@@ -358,7 +358,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED bool_t ms_filter_codec_supported(const char *mime
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilter *ms_filter_new(MSFilterId id);
MS2_PUBLIC MS2_DEPRECATED MSFilter *ms_filter_new(MSFilterId id);
/**
* Create decoder filter according to a filter's name.
......@@ -367,7 +367,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilter *ms_filter_new(MSFilterId id);
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilter *ms_filter_new_from_name(const char *name);
MS2_PUBLIC MS2_DEPRECATED MSFilter *ms_filter_new_from_name(const char *name);
/**
* Create decoder filter according to a filter's description.
......@@ -379,7 +379,7 @@ MS2_PUBLIC LINPHONE_DEPRECATED MSFilter *ms_filter_new_from_name(const char *nam
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC LINPHONE_DEPRECATED MSFilter *ms_filter_new_from_desc(MSFilterDesc *desc);
MS2_PUBLIC MS2_DEPRECATED MSFilter *ms_filter_new_from_desc(MSFilterDesc *desc);
/**
* Link one OUTPUT pin from a filter to an INPUT pin of another filter.
......@@ -587,26 +587,26 @@ MS2_PUBLIC int ms_connection_helper_unlink(MSConnectionHelper *h, MSFilter *f, i
* \brief Enable processing time measurements statistics for filters.
*
**/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_filter_enable_statistics(bool_t enabled);
MS2_PUBLIC MS2_DEPRECATED void ms_filter_enable_statistics(bool_t enabled);
/**
* \brief Reset processing time statistics for filters.
*
**/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_filter_reset_statistics(void);
MS2_PUBLIC MS2_DEPRECATED void ms_filter_reset_statistics(void);
/**
* \brief Retrieves statistics for running filters.
* Returns a list of MSFilterStats
**/
MS2_PUBLIC LINPHONE_DEPRECATED const MSList * ms_filter_get_statistics(void);
MS2_PUBLIC MS2_DEPRECATED const MSList * ms_filter_get_statistics(void);
/**
* \brief Logs runtime statistics for running filters.
*
**/
MS2_PUBLIC LINPHONE_DEPRECATED void ms_filter_log_statistics(void);
MS2_PUBLIC MS2_DEPRECATED void ms_filter_log_statistics(void);
......
......@@ -46,12 +46,13 @@ extern "C"{
/**
* Instanciate a media player
* @param factory a MSFactory
* @param snd_card Playback sound card
* @param video_display_name Video out
* @param window_id Pointer on the drawing window
* @return A pointer on the created MSMediaPlayer
*/
MS2_PUBLIC MSMediaPlayer *ms_media_player_new(MSSndCard *snd_card, const char *video_display_name, void *window_id);
MS2_PUBLIC MSMediaPlayer *ms_media_player_new(MSFactory *factory, MSSndCard *snd_card, const char *video_display_name, void *window_id);
/**
* Free a media player
......@@ -80,7 +81,7 @@ MS2_PUBLIC void ms_media_player_set_eof_callback(MSMediaPlayer *obj, MSMediaPlay
* @param filepath Path of the file to open
* @return TRUE if the file could be opened
*/
MS2_PUBLIC bool_t ms_media_player_open(MSMediaPlayer *obj, const char *filepath, MSFactory *factory);
MS2_PUBLIC bool_t ms_media_player_open(MSMediaPlayer *obj, const char *filepath);
/**
* Close a media file
......
......@@ -161,15 +161,15 @@ extern "C"{
*
* Returns: MSSndCardManager if successfull, NULL otherwise.
*/
MS2_PUBLIC MSSndCardManager * ms_snd_card_manager_get(MSSndCardManager* scm);
MS2_PUBLIC MS2_DEPRECATED MSSndCardManager * ms_snd_card_manager_get(void);
MS2_PUBLIC MSFactory * ms_snd_card_factory_get(MSSndCard * c);
MS2_PUBLIC MSFactory * ms_snd_card_get_factory(MSSndCard * c);
/**
* Destroy a sound card manager object.
*
* You usually do not need this function, the ms_factory_destroy() doing this job for you.
*/
MS2_PUBLIC void ms_snd_card_manager_destroy(void* sndcardmanager);
MS2_PUBLIC void ms_snd_card_manager_destroy(MSSndCardManager* sndcardmanager);
/**
* Retreive a sound card object based on its name.
......@@ -226,7 +226,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_manager(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.
......
......@@ -56,7 +56,7 @@ struct _MSWebCam;
typedef void (*MSWebCamDetectFunc)(MSWebCamManager *obj);
typedef void (*MSWebCamInitFunc)(struct _MSWebCam *obj);
typedef void (*MSWebCamUninitFunc)(struct _MSWebCam *obj);
typedef struct _MSFilter * (*MSWebCamCreateReaderFunc)(struct _MSWebCam *obj, MSFactory* factory);
typedef struct _MSFilter * (*MSWebCamCreateReaderFunc)(struct _MSWebCam *obj);
typedef bool_t (*MSWebCamEncodeToMimeType)(struct _MSWebCam *obj, const char *mime_type);
struct _MSWebCamDesc{
......@@ -97,15 +97,13 @@ extern "C"{
*
* Returns: MSWebCamManager if successfull, NULL otherwise.
*/
MS2_PUBLIC MSWebCamManager * ms_web_cam_manager_get(MSWebCamManager *scm);
MS2_PUBLIC MS2_DEPRECATED MSWebCamManager * ms_web_cam_manager_get(void);
MS2_PUBLIC MSFactory * ms_web_cam_factory_get(MSWebCam *c);
MS2_PUBLIC MSWebCamManager* ms_factory_get_wbc_manager(MSFactory* f);
MS2_PUBLIC MSFactory * ms_web_cam_get_factory(MSWebCam *c);
/**
* Destroy the webcam manager object.
*
* You usually don't need this function, ms_factory_destroy() doing the job for you.
*/
MS2_PUBLIC void ms_web_cam_manager_destroy(MSWebCamManager* scm);
......@@ -182,7 +180,7 @@ MS2_PUBLIC void ms_web_cam_manager_reload(MSWebCamManager *m);
*
* Returns: A MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC struct _MSFilter * ms_web_cam_create_reader(MSWebCam *obj, MSFactory* factory);
MS2_PUBLIC struct _MSFilter * ms_web_cam_create_reader(MSWebCam *obj);
/**
* Create a new webcam object.
......
......@@ -205,13 +205,13 @@ struct AndroidSndWriteData{
};
static MSFilter *android_snd_card_create_reader(MSSndCard *card){
MSFilter *f=ms_android_snd_read_new(ms_snd_card_factory_get(card));
MSFilter *f=ms_android_snd_read_new(ms_snd_card_get_factory(card));
(static_cast<AndroidSndReadData*>(f->data))->setCard(card);
return f;
}
static MSFilter *android_snd_card_create_writer(MSSndCard *card){
MSFilter *f=ms_android_snd_write_new(ms_snd_card_factory_get(card));
MSFilter *f=ms_android_snd_write_new(ms_snd_card_get_factory(card));
(static_cast<AndroidSndWriteData*>(f->data))->setCard((AndroidNativeSndCardData*)card->data);
return f;
}
......
......@@ -569,7 +569,7 @@ static MSFilterDesc msandroid_sound_read_desc={
MSFilter *msandroid_sound_read_new(MSSndCard *card){
ms_debug("msandroid_sound_read_new");
MSFilter *f=ms_factory_new_from_desc(ms_snd_card_factory_get(card), &msandroid_sound_read_desc);
MSFilter *f=ms_factory_new_from_desc(ms_snd_card_get_factory(card), &msandroid_sound_read_desc);
msandroid_sound_read_data *data=new msandroid_sound_read_data();
data->builtin_aec = card->capabilities & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER;
if (card->data != NULL) {
......@@ -895,7 +895,7 @@ static MSFilterDesc msandroid_sound_write_desc={
MSFilter *msandroid_sound_write_new(MSSndCard *card){
ms_debug("msandroid_sound_write_new");
MSFilter *f=ms_filter_new_from_desc(ms_snd_card_factory_get(card), &msandroid_sound_write_desc);
MSFilter *f=ms_filter_new_from_desc(ms_snd_card_get_factory(card), &msandroid_sound_write_desc);
msandroid_sound_write_data *data = new msandroid_sound_write_data();
if (card->data != NULL) {
SoundDeviceDescription *d = (SoundDeviceDescription *)card->data;
......
......@@ -251,7 +251,6 @@ static void android_snd_card_detect(MSSndCardManager *m) {
if (initOpenSLES() == 0) { // Try to dlopen libOpenSLES
ms_message("libOpenSLES correctly loaded, creating OpenSLES MS soundcard");
MSSndCard *card = android_snd_card_new();
ms_snd_card_set_manager(m,card);
ms_snd_card_manager_add_card(m, card);
} else {
ms_warning("Failed to dlopen libOpenSLES, OpenSLES MS soundcard unavailable");
......@@ -628,7 +627,7 @@ static MSFilter* ms_android_snd_read_new(MSFactory *factory) {
}
static MSFilter *android_snd_card_create_reader(MSSndCard *card) {
MSFilter *f = ms_android_snd_read_new(ms_snd_card_factory_get(card));
MSFilter *f = ms_android_snd_read_new(ms_snd_card_get_factory(card));
OpenSLESInputContext *ictx = static_cast<OpenSLESInputContext*>(f->data);
ictx->setContext((OpenSLESContext*)card->data);
return f;
......@@ -843,7 +842,7 @@ static OpenSLESOutputContext* opensles_output_context_init() {
}
static MSFilter *android_snd_card_create_writer(MSSndCard *card) {
MSFilter *f = ms_android_snd_write_new(ms_snd_card_factory_get(card));
MSFilter *f = ms_android_snd_write_new(ms_snd_card_get_factory(card));
OpenSLESOutputContext *octx = static_cast<OpenSLESOutputContext*>(f->data);
octx->setContext((OpenSLESContext*)card->data);
return f;
......
......@@ -405,7 +405,7 @@ static void video_capture_cam_init(MSWebCam *cam){
static MSFilter *video_capture_create_reader(MSWebCam *obj){
ms_message("Instanciating Android VIDEO capture MS filter");
MSFilter* lFilter = ms_factory_create_filter_from_desc(ms_web_cam_factory_get(obj), &ms_video_capture_desc);
MSFilter* lFilter = ms_factory_create_filter_from_desc(ms_web_cam_get_factory(obj), &ms_video_capture_desc);
getContext(lFilter)->webcam = obj;
return lFilter;
......
......@@ -52,8 +52,8 @@ having sound quality trouble:*/
static MSSndCard * alsa_card_new(int id, const char *pcmbasename);
static MSSndCard *alsa_card_duplicate(MSSndCard *obj);
static MSFilter * ms_alsa_read_new(const char *dev);
static MSFilter * ms_alsa_write_new(const char *dev);
static MSFilter * ms_alsa_read_new(MSFactory *factory, const char *dev);
static MSFilter * ms_alsa_write_new(MSFactory *factory, const char *dev);
struct _AlsaData{
......@@ -604,14 +604,14 @@ static void alsa_card_set_source(MSSndCard *obj,MSSndCardCapture source)
static MSFilter *alsa_card_create_reader(MSSndCard *card)
{
AlsaData *ad=(AlsaData*)card->data;
MSFilter *f=ms_alsa_read_new(ad->pcmdev);
MSFilter *f=ms_alsa_read_new(ms_snd_card_get_factory(card), ad->pcmdev);
return f;
}
static MSFilter *alsa_card_create_writer(MSSndCard *card)
{
AlsaData *ad=(AlsaData*)card->data;
MSFilter *f=ms_alsa_write_new(ad->pcmdev);
MSFilter *f=ms_alsa_write_new(ms_snd_card_get_factory(card), ad->pcmdev);
return f;
}
......@@ -1052,8 +1052,8 @@ MSFilterDesc alsa_read_desc={
.methods=alsa_read_methods
};