Commit c580962d authored by Simon Morlat's avatar Simon Morlat

work in progress

parent ebc30daf
...@@ -39,7 +39,9 @@ mediastreamer2_include_HEADERS= ice.h \ ...@@ -39,7 +39,9 @@ mediastreamer2_include_HEADERS= ice.h \
videostarter.h \ videostarter.h \
bits_rw.h \ bits_rw.h \
x11_helper.h \ x11_helper.h \
flowcontrol.h flowcontrol.h \
formats.h \
msfactory.h
EXTRA_DIST=$(mediastreamer2_include_HEADERS) EXTRA_DIST=$(mediastreamer2_include_HEADERS)
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2014 Belledonne Communications SARL http://www.belledonne-communications.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef msformats_h
#define msformats_h
#ifdef __cplusplus
extern "C"{
#endif
/**
* Simple enum to indicate whether a format is audio or video.
**/
typedef enum _MSFormatType{
MSAudio,
MSVideo
}MSFormatType;
/**
* to string from enum.
**/
MS2_PUBLIC const char* ms_format_type_to_string(MSFormatType type);
/* those structs are part of the ABI: don't change their size otherwise binary plugins will be broken*/
typedef struct MSVideoSize{
int width,height;
} MSVideoSize;
/**
* Structure describing fully a media format.
**/
struct _MSFmtDescriptor{
MSFormatType type; /**<format type, audio or video*/
char *encoding; /**<the name of the encoding: for example pcmu, H264, opus*/
int nchannels; /**<number of channels, relevant for audio only*/
int rate; /**<Samplerate for audio, clockrate for video*/
char *fmtp; /**<fmtp*/
MSVideoSize vsize; /**<video size*/
char *text; /**<do not use directly, use ms_fmt_descriptor_to_string() instead*/
};
typedef struct _MSFmtDescriptor MSFmtDescriptor;
MS2_PUBLIC const char *ms_fmt_descriptor_to_string(const MSFmtDescriptor *orig);
#ifdef __cplusplus
}
#endif
#endif
...@@ -88,13 +88,6 @@ typedef struct _MSCryptoSuiteNameParams{ ...@@ -88,13 +88,6 @@ typedef struct _MSCryptoSuiteNameParams{
MS2_PUBLIC MSCryptoSuite ms_crypto_suite_build_from_name_params(const MSCryptoSuiteNameParams *nameparams); MS2_PUBLIC MSCryptoSuite ms_crypto_suite_build_from_name_params(const MSCryptoSuiteNameParams *nameparams);
MS2_PUBLIC int ms_crypto_suite_to_name_params(MSCryptoSuite cs, MSCryptoSuiteNameParams *nameparams); MS2_PUBLIC int ms_crypto_suite_to_name_params(MSCryptoSuite cs, MSCryptoSuiteNameParams *nameparams);
typedef enum StreamType {
AudioStreamType,
VideoStreamType
} StreamType;
MS2_PUBLIC const char* ms_stream_type_to_string(StreamType);
/** /**
* The MediaStream is an object describing a stream (one of AudioStream or VideoStream). * The MediaStream is an object describing a stream (one of AudioStream or VideoStream).
**/ **/
...@@ -123,11 +116,14 @@ typedef enum _MSStreamState{ ...@@ -123,11 +116,14 @@ typedef enum _MSStreamState{
MSStreamStarted MSStreamStarted
}MSStreamState; }MSStreamState;
#define AudioStreamType MSAudio
#define VideoStreamType MSVideo
/** /**
* Base struct for both AudioStream and VideoStream structure. * Base struct for both AudioStream and VideoStream structure.
**/ **/
struct _MediaStream { struct _MediaStream {
StreamType type; MSFormatType type;
MSStreamState state; MSStreamState state;
MSMediaStreamSessions sessions; MSMediaStreamSessions sessions;
OrtpEvQueue *evq; OrtpEvQueue *evq;
...@@ -290,6 +286,12 @@ struct _AudioStream ...@@ -290,6 +286,12 @@ struct _AudioStream
MSFilter *recv_tee; MSFilter *recv_tee;
MSFilter *recorder_mixer; MSFilter *recorder_mixer;
MSFilter *recorder; MSFilter *recorder;
struct {
MSFilter *resampler;
MSFilter *encoder;
MSFilter *recorder;
MSFilter *video_input;
}av_recorder;
char *recorder_file; char *recorder_file;
EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/ EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/
uint32_t features; uint32_t features;
...@@ -533,6 +535,7 @@ static inline int audio_stream_set_dscp(AudioStream *stream, int dscp) { ...@@ -533,6 +535,7 @@ static inline int audio_stream_set_dscp(AudioStream *stream, int dscp) {
return media_stream_set_dscp(&stream->ms, dscp); return media_stream_set_dscp(&stream->ms, dscp);
} }
/** /**
* @} * @}
**/ **/
...@@ -564,6 +567,8 @@ struct _VideoStream ...@@ -564,6 +567,8 @@ struct _VideoStream
MSFilter *tee2; MSFilter *tee2;
MSFilter *jpegwriter; MSFilter *jpegwriter;
MSFilter *output2; MSFilter *output2;
MSFilter *tee3;
MSFilter *itcsink;
MSVideoSize sent_vsize; MSVideoSize sent_vsize;
int corner; /*for selfview*/ int corner; /*for selfview*/
VideoStreamRenderCallback rendercb; VideoStreamRenderCallback rendercb;
...@@ -576,12 +581,13 @@ struct _VideoStream ...@@ -576,12 +581,13 @@ struct _VideoStream
VideoStreamDir dir; VideoStreamDir dir;
MSWebCam *cam; MSWebCam *cam;
int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */ int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */
uint64_t last_reported_decoding_error_time;
bool_t use_preview_window; bool_t use_preview_window;
bool_t freeze_on_error; bool_t freeze_on_error;
bool_t display_filter_auto_rotate_enabled; bool_t display_filter_auto_rotate_enabled;
bool_t source_performs_encoding; bool_t source_performs_encoding;
bool_t output_performs_decoding; bool_t output_performs_decoding;
uint64_t last_reported_decoding_error_time;
}; };
typedef struct _VideoStream VideoStream; typedef struct _VideoStream VideoStream;
...@@ -713,6 +719,19 @@ MS2_PUBLIC bool_t video_stream_is_decoding_error_to_be_reported(VideoStream *str ...@@ -713,6 +719,19 @@ MS2_PUBLIC bool_t video_stream_is_decoding_error_to_be_reported(VideoStream *str
*/ */
MS2_PUBLIC void video_stream_decoding_error_reported(VideoStream *stream); MS2_PUBLIC void video_stream_decoding_error_reported(VideoStream *stream);
/**
* Link the audio stream with an existing video stream.
* This is necessary to enable recording of audio & video into a multimedia file.
*/
MS2_PUBLIC void audio_stream_link_video(AudioStream *stream, VideoStream *video);
/**
* Unlink the audio stream from the video stream.
* This must be done if the video stream is about to be stopped.
**/
MS2_PUBLIC void audio_stream_unlink_video(AudioStream *stream, VideoStream *video);
/** /**
* Small API to display a local preview window. * Small API to display a local preview window.
**/ **/
......
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef msfactory_h
#define msfactory_h
/*do not use these fields directly*/
struct _MSFactory{
MSList *desc_list;
MSList *stats_list;
#ifdef WIN32
MSList *ms_plugins_loaded_list;
#endif
MSList *formats;
char *plugins_dir;
int cpu_count;
struct _MSEventQueue *evq;
int max_payload_size;
int mtu;
bool_t statistics_enabled;
bool_t voip_initd;
};
typedef struct _MSFactory MSFactory;
/**
* Create a mediastreamer2 factory. This is the root object that will create everything else from mediastreamer2.
**/
MS2_PUBLIC MSFactory *ms_factory_new(void);
/**
* Used by the legacy functions before MSFactory was added.
* Do not use in an application.
**/
MS2_PUBLIC MSFactory *ms_factory_get_fallback(void);
/**
* Destroy the factory.
* This should be done after destroying all objects created by the factory.
**/
MS2_PUBLIC void ms_factory_destroy(MSFactory *factory);
MS2_PUBLIC void ms_factory_register_filter(MSFactory *factory, MSFilterDesc *desc);
/**
* Retrieve capture filter that supports encoding to codec name.
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_factory_get_encoding_capturer(MSFactory *factory, const char *mime);
/**
* Retrieve render filter that supports decoding to codec name.
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_factory_get_decoding_renderer(MSFactory *factory, const char *mime);
/**
* Retrieve encoders according to codec name.
*
* Internal supported codecs:
* PCMU, PCMA, speex, gsm
* Existing Public plugins:
* iLBC
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_factory_get_encoder(MSFactory *factory, const char *mime);
/**
* Retrieve decoders according to codec name.
*
* Internal supported codecs:
* PCMU, PCMA, speex, gsm
* Existing Public plugins:
* iLBC
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_factory_get_decoder(MSFactory *factory, const char *mime);
/**
* Lookup a mediastreamer2 filter using its name.
* If found, the descriptor (MSFilterDesc) is returned.
* This descriptor can be used to instanciate the filter using ms_filter_new_from_desc()
* This function can be useful to query the presence of a filter loaded as a plugin, for example.
*
* @param filter_name The filter name.
**/
MS2_PUBLIC MSFilterDesc *ms_factory_lookup_filter_by_name(MSFactory *factory, const char *filter_name);
/**
* Lookup a mediastreamer2 filter using its id.
* If found, the descriptor (MSFilterDesc) is returned.
* This descriptor can be used to instanciate the filter using ms_filter_new_from_desc()
* This function can be useful to query the presence of a filter loaded as a plugin, for example.
*
* @param id The filter id.
**/
MS2_PUBLIC MSFilterDesc* ms_factory_lookup_filter_by_id( MSFactory* factory, MSFilterId id);
/**
* Returns a list of filter descriptions implementing a given interface.
* The list itself must be freed by the caller of this function, but not the MSFilterDesc pointed by the list elements.
* @param id a filter interface id
* @returns a newly allocated MSList of #MSFilterDesc.
**/
MSList *ms_factory_lookup_filter_by_interface(MSFactory *factory, MSFilterInterfaceId id);
/**
* Create encoder filter according to codec name.
*
* Internal supported codecs:
* PCMU, PCMA, speex, gsm
* Existing Public plugins:
* iLBC
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilter * ms_factory_create_encoder(MSFactory *factory, const char *mime);
/**
* Create decoder filter according to codec name.
*
* Internal supported codecs:
* PCMU, PCMA, speex, gsm
* Existing Public plugins:
* iLBC
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilter * ms_factory_create_decoder(MSFactory *factory, const char *mime);
/**
* Check if a encode or decode filter exists for a codec name.
*
* Internal supported codecs:
* PCMU, PCMA, speex, gsm
* Existing Public plugins:
* iLBC
*
* @param mime A string indicating the codec.
*
* Returns: TRUE if successfull, FALSE otherwise.
*/
MS2_PUBLIC bool_t ms_factory_codec_supported(MSFactory *factory, const char *mime);
/**
* Create decoder filter according to a filter's MSFilterId.
*
* @param id A MSFilterId identifier for the filter.
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilter *ms_factory_create_filter(MSFactory *factory, MSFilterId id);
/**
* Create decoder filter according to a filter's name.
*
* @param name A name for the filter.
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilter *ms_factory_create_filter_from_name(MSFactory *factory, const char *name);
/**
* Create decoder filter according to a filter's description.
*
* The primary use is to create your own filter's in your
* application and avoid registration inside mediastreamer2.
*
* @param desc A MSFilterDesc for the filter.
*
* Returns: a MSFilter if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilter *ms_factory_create_filter_from_desc(MSFactory *factory, MSFilterDesc *desc);
MS2_PUBLIC void ms_factory_enable_statistics(MSFactory* obj, bool_t enabled);
MS2_PUBLIC const MSList * ms_factory_get_statistics(MSFactory* obj);
MS2_PUBLIC void ms_factory_reset_statistics(MSFactory *obj);
MS2_PUBLIC void ms_factory_log_statistics(MSFactory *obj);
MS2_PUBLIC unsigned int ms_factory_get_cpu_count(MSFactory *obj);
MS2_PUBLIC void ms_factory_set_cpu_count(MSFactory *obj, unsigned int c);
MS2_PUBLIC void ms_factory_init_plugins(MSFactory *obj);
MS2_PUBLIC void ms_factory_set_plugins_dir(MSFactory *obj, const char *path);
MS2_PUBLIC void ms_factory_uninit_plugins(MSFactory *obj);
MS2_PUBLIC void ms_factory_init_voip(MSFactory *obj);
MS2_PUBLIC void ms_factory_uninit_voip(MSFactory *obj);
MS2_PUBLIC struct _MSEventQueue * ms_factory_get_event_queue(MSFactory *obj);
MS2_PUBLIC void ms_factory_set_event_queue(MSFactory *obj,struct _MSEventQueue *q);
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 const struct _MSFmtDescriptor * ms_factory_get_audio_format(MSFactory *obj, const char *mime, int rate, int channels, const char *fmtp);
MS2_PUBLIC const struct _MSFmtDescriptor * ms_factory_get_video_format(MSFactory *obj, const char *mime, const MSVideoSize *size, const char *fmtp);
#endif
...@@ -20,9 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -20,9 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef msfilter_h #ifndef msfilter_h
#define msfilter_h #define msfilter_h
#include "mscommon.h" #include "mediastreamer2/mscommon.h"
#include "msqueue.h" #include "mediastreamer2/msqueue.h"
#include "allfilters.h" #include "mediastreamer2/allfilters.h"
#include "mediastreamer2/formats.h"
/** /**
* @file msfilter.h * @file msfilter.h
...@@ -177,7 +178,8 @@ struct _MSFilter{ ...@@ -177,7 +178,8 @@ struct _MSFilter{
ms_mutex_t lock; ms_mutex_t lock;
MSQueue **inputs; /**<Table of input queues.*/ MSQueue **inputs; /**<Table of input queues.*/
MSQueue **outputs;/**<Table of output queues */ MSQueue **outputs;/**<Table of output queues */
void *padding[2]; /**Unused - to be reused later when new protected fields have to added*/ struct _MSFactory *factory;/**<the factory that created this filter*/
void *padding; /**Unused - to be reused later when new protected fields have to added*/
void *data; /**< Pointer used by the filter for internal state and computations.*/ void *data; /**< Pointer used by the filter for internal state and computations.*/
struct _MSTicker *ticker; /**<Pointer to the ticker object. It is not NULL when being called process()*/ struct _MSTicker *ticker; /**<Pointer to the ticker object. It is not NULL when being called process()*/
/*private attributes, they can be moved and changed at any time*/ /*private attributes, they can be moved and changed at any time*/
...@@ -441,7 +443,16 @@ MS2_PUBLIC bool_t ms_filter_has_method(MSFilter *f, unsigned int id); ...@@ -441,7 +443,16 @@ MS2_PUBLIC bool_t ms_filter_has_method(MSFilter *f, unsigned int id);
* *
* Returns TRUE if interface is implemented, FALSE, otherwise. * Returns TRUE if interface is implemented, FALSE, otherwise.
**/ **/
bool_t ms_filter_implements_interface(MSFilter *f, MSFilterInterfaceId id); MS2_PUBLIC bool_t ms_filter_implements_interface(MSFilter *f, MSFilterInterfaceId id);
/**
* Returns whether a filter implements a given interface, based on the filter's descriptor.
* @param f a MSFilter object
* @param id an interface id.
*
* Returns TRUE if interface is implemented, FALSE, otherwise.
**/
MS2_PUBLIC bool_t ms_filter_desc_implements_interface(MSFilterDesc *desc, MSFilterInterfaceId id);
/** /**
* Set a callback on filter's to be informed of private filter's event. * Set a callback on filter's to be informed of private filter's event.
...@@ -455,7 +466,7 @@ bool_t ms_filter_implements_interface(MSFilter *f, MSFilterInterfaceId id); ...@@ -455,7 +466,7 @@ bool_t ms_filter_implements_interface(MSFilter *f, MSFilterInterfaceId id);
* @deprecated use ms_filter_add_notify_callback() * @deprecated use ms_filter_add_notify_callback()
* *
*/ */
//MS2_PUBLIC void ms_filter_set_notify_callback(MSFilter *f, MSFilterNotifyFunc fn, void *userdata);
/** /**
* Set a callback on filter's to be informed of private filter's event. * Set a callback on filter's to be informed of private filter's event.
...@@ -587,6 +598,8 @@ MS2_PUBLIC const MSList * ms_filter_get_statistics(void); ...@@ -587,6 +598,8 @@ MS2_PUBLIC const MSList * ms_filter_get_statistics(void);
MS2_PUBLIC void ms_filter_log_statistics(void); MS2_PUBLIC void ms_filter_log_statistics(void);
/* I define the id taking the lower bits of the address of the MSFilterDesc object, /* I define the id taking the lower bits of the address of the MSFilterDesc object,
the method index (_cnt_) and the argument size */ the method index (_cnt_) and the argument size */
/* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/ /* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/
...@@ -654,8 +667,30 @@ the method index (_cnt_) and the argument size */ ...@@ -654,8 +667,30 @@ the method index (_cnt_) and the argument size */
/**Filters can return their latency in milliseconds (if known) using this method:*/ /**Filters can return their latency in milliseconds (if known) using this method:*/
#define MS_FILTER_GET_LATENCY MS_FILTER_BASE_METHOD(11,int) #define MS_FILTER_GET_LATENCY MS_FILTER_BASE_METHOD(11,int)
typedef struct _MSPinFormat{
int pin;
const MSFmtDescriptor *fmt;
}MSPinFormat;
/* more specific methods: to be moved into implementation specific header files*/ /**
* Obtain the format of a filter on a given input
*/
#define MS_FILTER_GET_INPUT_FMT MS_FILTER_BASE_METHOD(30,MSPinFormat)
/**
* Set the format of a filter on a given input
*/
#define MS_FILTER_SET_INPUT_FMT MS_FILTER_BASE_METHOD(31,MSPinFormat)
/**
* Obtain the format of a filter on a given output
*/
#define MS_FILTER_GET_OUTPUT_FMT MS_FILTER_BASE_METHOD(32,MSPinFormat)
/**
* Set the format of a filter on a given output
*/
#define MS_FILTER_SET_OUTPUT_FMT MS_FILTER_BASE_METHOD(33,MSPinFormat)
/* DEPRECATED specific methods: to be moved into implementation specific header files - DO NOT USE IN NEW CODE*/
#define MS_FILTER_SET_FILTERLENGTH MS_FILTER_BASE_METHOD(12,int) #define MS_FILTER_SET_FILTERLENGTH MS_FILTER_BASE_METHOD(12,int)
#define MS_FILTER_SET_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int) #define MS_FILTER_SET_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int)
#define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int) #define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int)
...@@ -675,8 +710,6 @@ the method index (_cnt_) and the argument size */ ...@@ -675,8 +710,6 @@ the method index (_cnt_) and the argument size */
#define MS_FILTER_SET_RTP_PAYLOAD_PICKER MS_FILTER_BASE_METHOD(27,void*) #define MS_FILTER_SET_RTP_PAYLOAD_PICKER MS_FILTER_BASE_METHOD(27,void*)
#define MS_FILTER_SET_OUTPUT_NCHANNELS MS_FILTER_BASE_METHOD(28,int) #define MS_FILTER_SET_OUTPUT_NCHANNELS MS_FILTER_BASE_METHOD(28,int)
#define MS_CONF_SPEEX_PREPROCESS_MIC MS_FILTER_EVENT(MS_CONF_ID, 1, void*)
#define MS_CONF_CHANNEL_VOLUME MS_FILTER_EVENT(MS_CONF_ID, 3, void*)
/** @} */ /** @} */
...@@ -710,8 +743,8 @@ MS2_PUBLIC void ms_filter_postpone_task(MSFilter *f, MSFilterFunc taskfunc); ...@@ -710,8 +743,8 @@ MS2_PUBLIC void ms_filter_postpone_task(MSFilter *f, MSFilterFunc taskfunc);
} }
#endif #endif
#include "msinterfaces.h" #include "mediastreamer2/msinterfaces.h"
#include "mediastreamer2/msfactory.h"
/* used by awk script in Makefile.am to generate alldescs.c */ /* used by awk script in Makefile.am to generate alldescs.c */
#define MS_FILTER_DESC_EXPORT(desc) #define MS_FILTER_DESC_EXPORT(desc)
......
...@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef msinterfaces_h #ifndef msinterfaces_h
#define msinterfaces_h #define msinterfaces_h
#include "mediastreamer2/mscodecutils.h"
typedef struct _MSVideoCodecSLI MSVideoCodecSLI; typedef struct _MSVideoCodecSLI MSVideoCodecSLI;
struct _MSVideoCodecSLI { struct _MSVideoCodecSLI {
...@@ -229,6 +231,9 @@ typedef enum _MSRecorderState MSRecorderState; ...@@ -229,6 +231,9 @@ typedef enum _MSRecorderState MSRecorderState;
#define MS_DECODER_HAVE_PLC MS_AUDIO_DECODER_HAVE_PLC /*for backward compatibility*/ #define MS_DECODER_HAVE_PLC MS_AUDIO_DECODER_HAVE_PLC /*for backward compatibility*/
#define MS_AUDIO_DECODER_SET_RTP_PAYLOAD_PICKER \
MS_FILTER_METHOD(MSFilterAudioDecoderInterface,1,MSRtpPayloadPickerContext*)
/** /**
* Interface definition for video encoders. * Interface definition for video encoders.
**/ **/
......
...@@ -126,11 +126,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -126,11 +126,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_VIDEO_SIZE_UXGA_H 1200 #define MS_VIDEO_SIZE_UXGA_H 1200
/* those structs are part of the ABI: don't change their size otherwise binary plugins will be broken*/
typedef struct MSVideoSize{
int width,height;
} MSVideoSize;
typedef struct MSRect{ typedef struct MSRect{
int x,y,w,h; int x,y,w,h;
......
...@@ -41,6 +41,7 @@ libmediastreamer_base_la_SOURCES= base/mscommon.c \ ...@@ -41,6 +41,7 @@ libmediastreamer_base_la_SOURCES= base/mscommon.c \
base/msticker.c \ base/msticker.c \
base/eventqueue.c \ base/eventqueue.c \
base/mssndcard.c \ base/mssndcard.c \
base/msfactory.c \
otherfilters/tee.c \ otherfilters/tee.c \
otherfilters/join.c \ otherfilters/join.c \
base/mswebcam.c \ base/mswebcam.c \
...@@ -81,7 +82,6 @@ if MS2_FILTERS ...@@ -81,7 +82,6 @@ if MS2_FILTERS
libmediastreamer_voip_la_SOURCES+= audiofilters/alaw.c \ libmediastreamer_voip_la_SOURCES+= audiofilters/alaw.c \
audiofilters/ulaw.c \ audiofilters/ulaw.c \
audiofilters/dtmfgen.c \ audiofilters/dtmfgen.c \
audiofilters/msconf.c \
audiofilters/g711.c audiofilters/g711.h \ audiofilters/g711.c audiofilters/g711.h \
audiofilters/msvolume.c \ audiofilters/msvolume.c \
utils/dsptools.c \ utils/dsptools.c \
......
...@@ -262,7 +262,7 @@ static void *loadSymbol(void *handle, const char *symbol, int *error){ ...@@ -262,7 +262,7 @@ static void *loadSymbol(void *handle, const char *symbol, int *error){
#define LIBSURFACE21_SO "libui.so" #define LIBSURFACE21_SO "libui.so"
extern "C" void libmsandroiddisplaybad_init(void){ extern "C" void libmsandroiddisplaybad_init(MSFactory *factory){
void *handle=dlopen(LIBSURFACE22_SO,RTLD_LAZY); void *handle=dlopen(LIBSURFACE22_SO,RTLD_LAZY);
if (handle==NULL){ if (handle==NULL){
android_version=21; android_version=21;
...@@ -282,7 +282,7 @@ extern "C" void libmsandroiddisplaybad_init(void){ ...@@ -282,7 +282,7 @@ extern "C" void libmsandroiddisplaybad_init(void){
error=1; error=1;
} }
if (error==0){ if (error==0){
ms_filter_register(&ms_android_display_bad_desc); ms_factory_register_filter(factory,&ms_android_display_bad_desc);
ms_message("Android display filter (the bad one) loaded."); ms_message("Android display filter (the bad one) loaded.");
} }
}else ms_message("Could not load either "LIBSURFACE22_SO " or "LIBSURFACE21_SO); }else ms_message("Could not load either "LIBSURFACE22_SO " or "LIBSURFACE21_SO);
......
...@@ -207,7 +207,7 @@ MSFilterDesc ms_android_display_desc={ ...@@ -207,7 +207,7 @@ MSFilterDesc ms_android_display_desc={
}; };
bool_t libmsandroiddisplay_init(void){ bool_t libmsandroiddisplay_init(MSFactory *factory){
/*See if we can use AndroidBitmap_* symbols (only since android 2.2 normally)*/ /*See if we can use AndroidBitmap_* symbols (only since android 2.2 normally)*/
void *handle=NULL; void *handle=NULL;
handle=dlopen("libjnigraphics.so",RTLD_LAZY); handle=dlopen("libjnigraphics.so",RTLD_LAZY);
...@@ -220,7 +220,7 @@ bool_t libmsandroiddisplay_init(void){ ...@@ -220,7 +220,7 @@ bool_t libmsandroiddisplay_init(void){
|| sym_AndroidBitmap_unlockPixels==NULL){ || sym_AndroidBitmap_unlockPixels==NULL){
ms_warning("AndroidBitmap not available."); ms_warning("AndroidBitmap not available.");
}else{ }else{
ms_filter_register(&ms_android_display_desc); ms_factory_register_filter(factory,&ms_android_display_desc);
ms_message("MSAndroidDisplay registered."); ms_message("MSAndroidDisplay registered.");
return TRUE; return TRUE;
} }
......
...@@ -174,7 +174,7 @@ MSFilterDesc ms_android_opengl_display_desc={ ...@@ -174,7 +174,7 @@ MSFilterDesc ms_android_opengl_display_desc={
.methods=methods .methods=methods
}; };
void libmsandroidopengldisplay_init(void){ void libmsandroidopengldisplay_init(MSFactory *factory){
ms_filter_register(&ms_android_opengl_display_desc); ms_factory_register_filter(factory,&ms_android_opengl_display_desc);
ms_message("MSAndroidDisplay (OpenGL ES2) registered (id=%d).", MS_ANDROID_DISPLAY_ID); ms_message("MSAndroidDisplay (OpenGL ES2) registered (id=%d).", MS_ANDROID_DISPLAY_ID);
} }
This diff is collapsed.
...@@ -791,7 +791,8 @@ static MSFilterMethod ms_opus_dec_methods[] = { ...@@ -791,7 +791,8 @@ static MSFilterMethod ms_opus_dec_methods[] = {