Commit 5313bf3a authored by Simon Morlat's avatar Simon Morlat

Merge remote-tracking branch 'private/dev_recorder'

Conflicts:
	include/mediastreamer2/msfilter.h
	src/voip/videostream.c
	tester/mediastreamer2_adaptive_tester.c
parents 84ce0753 eb8206cc
......@@ -35,6 +35,7 @@ Compilation and installation
- libvpx
- libopus
- x11 with libxv-dev on linux
- libmastroska2 from https://github.com/Matroska-Org/foundation-source
- theora
* For Linux, MacOS or mingw
......@@ -61,6 +62,15 @@ Use the *linphone* mailing list for question about mediastreamer2.
Subscribe here:
https://savannah.nongnu.org/mail/?group=linphone
Notes about third parties compilation
-------------------------------------
* libmatroska2:
- get the source with
$ git clone git://git.linphone.org/libmatroska-c.git
- compilation:
$ make -f Makefile
$ make -f Makefile install
......@@ -578,7 +578,7 @@ AC_ARG_ENABLE(matroska,
no) matroska=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-matroska) ;;
esac],
[matroska=false]
[matroska=guess]
)
AC_ARG_WITH(ebml,
[AS_HELP_STRING([--with-ebml],[Sets the installation prefix of ebml library (v2) [default=/usr]])],
......@@ -591,14 +591,13 @@ AC_ARG_WITH(matroska,
[ matroskadir=/usr ]
)
if test x$matroska == xtrue; then
if test x$matroska != xfalse ; then
build_matroska=yes
if test x"$ebmldir" != xno ; then
test x"$ebmldir" = xyes && ebmldir=/usr
MS_CHECK_DEP([ebml library],[EBML],[$ebmldir/include],
[$ebmldir/lib],[ebml/ebml.h],[ebml2],[EBML_ElementRender])
if test "$ebml_found" == "no" ; then
MS_CHECK_DEP([ebml library],[EBML],[${ebmldir}/include],
[${ebmldir}/lib],[ebml/ebml.h],[ebml2],[EBML_ElementRender])
if test "$matroska$EBML_found" = "trueno" ; then
build_matroska=no
AC_MSG_ERROR([Could not locate ebml headers or library.])
fi
......@@ -607,10 +606,9 @@ else
fi
if test x"$matroskadir" != xno ; then
test x"$matroskadir" = xyes && matroskadir=/usr
MS_CHECK_DEP([matroska library],[MATROSKA],[$matroskadir/include],
[$matroskadir/lib],[matroska/matroska.h],[matroska2],[MATROSKA_BlockReleaseData],[-lebml2])
if test "$matroska_found" == "no" ; then
MS_CHECK_DEP([matroska library],[MATROSKA],[${matroskadir}/include}],
[${matroskadir}/lib],[matroska/matroska.h],[matroska2],[MATROSKA_BlockReleaseData],[-lebml2])
if test "$matroska$MATROSKA_found" = "trueno" ; then
build_matroska=no
AC_MSG_ERROR([Could not locate matroska headers or library.])
fi
......
......@@ -39,7 +39,9 @@ mediastreamer2_include_HEADERS= ice.h \
videostarter.h \
bits_rw.h \
x11_helper.h \
flowcontrol.h
flowcontrol.h \
formats.h \
msfactory.h
EXTRA_DIST=$(mediastreamer2_include_HEADERS)
......@@ -142,7 +142,8 @@ typedef enum MSFilterId{
MS_OPUS_DEC_ID,
MS_QSA_READ_ID,
MS_QSA_WRITE_ID,
MS_MKV_WRITER_ID
MS_MKV_RECORDER_ID,
MS_MKV_PLAYER_ID
} MSFilterId;
......
/*
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{
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);
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).
**/
......@@ -123,11 +116,14 @@ typedef enum _MSStreamState{
MSStreamStarted
}MSStreamState;
#define AudioStreamType MSAudio
#define VideoStreamType MSVideo
/**
* Base struct for both AudioStream and VideoStream structure.
**/
struct _MediaStream {
StreamType type;
MSFormatType type;
MSStreamState state;
MSMediaStreamSessions sessions;
OrtpEvQueue *evq;
......@@ -290,6 +286,12 @@ struct _AudioStream
MSFilter *recv_tee;
MSFilter *recorder_mixer;
MSFilter *recorder;
struct {
MSFilter *resampler;
MSFilter *encoder;
MSFilter *recorder;
MSFilter *video_input;
}av_recorder;
char *recorder_file;
EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/
uint32_t features;
......@@ -533,6 +535,7 @@ static MS2_INLINE int audio_stream_set_dscp(AudioStream *stream, int dscp) {
return media_stream_set_dscp(&stream->ms, dscp);
}
/**
* @}
**/
......@@ -564,6 +567,8 @@ struct _VideoStream
MSFilter *tee2;
MSFilter *jpegwriter;
MSFilter *output2;
MSFilter *tee3;
MSFilter *itcsink;
MSVideoSize sent_vsize;
int corner; /*for selfview*/
VideoStreamRenderCallback rendercb;
......@@ -576,12 +581,13 @@ struct _VideoStream
VideoStreamDir dir;
MSWebCam *cam;
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 freeze_on_error;
bool_t display_filter_auto_rotate_enabled;
bool_t source_performs_encoding;
bool_t output_performs_decoding;
uint64_t last_reported_decoding_error_time;
};
typedef struct _VideoStream VideoStream;
......@@ -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);
/**
* 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.
**/
......
/*
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.
#ifndef msfilter_h
#define msfilter_h
#include "mscommon.h"
#include "msqueue.h"
#include "allfilters.h"
#include "mediastreamer2/mscommon.h"
#include "mediastreamer2/msqueue.h"
#include "mediastreamer2/allfilters.h"
#include "mediastreamer2/formats.h"
/**
* @file msfilter.h
......@@ -177,7 +178,8 @@ struct _MSFilter{
ms_mutex_t lock;
MSQueue **inputs; /**<Table of input 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.*/
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*/
......@@ -443,6 +445,15 @@ MS2_PUBLIC bool_t ms_filter_has_method(MSFilter *f, unsigned int 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.
* This callback is called from the filter's MSTicker, unless a global event queue
......@@ -455,7 +466,7 @@ MS2_PUBLIC bool_t ms_filter_implements_interface(MSFilter *f, MSFilterInterfaceI
* @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.
......@@ -594,6 +605,8 @@ MS2_PUBLIC const MSList * ms_filter_get_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,
the method index (_cnt_) and the argument size */
/* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/
......@@ -661,8 +674,30 @@ the method index (_cnt_) and the argument size */
/**Filters can return their latency in milliseconds (if known) using this method:*/
#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_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int)
#define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int)
......@@ -682,8 +717,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_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*)
/** @} */
......@@ -717,8 +750,8 @@ MS2_PUBLIC void ms_filter_postpone_task(MSFilter *f, MSFilterFunc taskfunc);
}
#endif
#include "msinterfaces.h"
#include "mediastreamer2/msinterfaces.h"
#include "mediastreamer2/msfactory.h"
/* used by awk script in Makefile.am to generate alldescs.c */
#define MS_FILTER_DESC_EXPORT(desc)
......
......@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef msinterfaces_h
#define msinterfaces_h
#include "mediastreamer2/mscodecutils.h"
typedef struct _MSVideoCodecSLI MSVideoCodecSLI;
struct _MSVideoCodecSLI {
......@@ -163,7 +165,8 @@ typedef enum _MSRecorderState MSRecorderState;
#define MS_RECORDER_GET_STATE \
MS_FILTER_METHOD(MSFilterRecorderInterface,5,MSRecorderState)
#define MS_RECORDER_NEEDS_FIR \
MS_FILTER_EVENT_NO_ARG(MSFilterRecorderInterface,0)
/** Interface definitions for echo cancellers */
......@@ -229,6 +232,9 @@ typedef enum _MSRecorderState MSRecorderState;
#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.
**/
......
......@@ -126,11 +126,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#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{
int x,y,w,h;
......
......@@ -40,6 +40,7 @@ libmediastreamer_base_la_SOURCES= base/mscommon.c \
base/msticker.c \
base/eventqueue.c \
base/mssndcard.c \
base/msfactory.c \
otherfilters/tee.c \
otherfilters/join.c \
base/mswebcam.c \
......@@ -80,7 +81,6 @@ if MS2_FILTERS
libmediastreamer_voip_la_SOURCES+= audiofilters/alaw.c \
audiofilters/ulaw.c \
audiofilters/dtmfgen.c \
audiofilters/msconf.c \
audiofilters/g711.c audiofilters/g711.h \
audiofilters/msvolume.c \
utils/dsptools.c \
......
......@@ -262,7 +262,7 @@ static void *loadSymbol(void *handle, const char *symbol, int *error){
#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);
if (handle==NULL){
android_version=21;
......@@ -282,7 +282,7 @@ extern "C" void libmsandroiddisplaybad_init(void){
error=1;
}
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.");
}
}else ms_message("Could not load either "LIBSURFACE22_SO " or "LIBSURFACE21_SO);
......
......@@ -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)*/
void *handle=NULL;
handle=dlopen("libjnigraphics.so",RTLD_LAZY);
......@@ -220,7 +220,7 @@ bool_t libmsandroiddisplay_init(void){
|| sym_AndroidBitmap_unlockPixels==NULL){
ms_warning("AndroidBitmap not available.");
}else{
ms_filter_register(&ms_android_display_desc);
ms_factory_register_filter(factory,&ms_android_display_desc);
ms_message("MSAndroidDisplay registered.");
return TRUE;
}
......
......@@ -174,7 +174,7 @@ MSFilterDesc ms_android_opengl_display_desc={
.methods=methods
};
void libmsandroidopengldisplay_init(void){
ms_filter_register(&ms_android_opengl_display_desc);
void libmsandroidopengldisplay_init(MSFactory *factory){
ms_factory_register_filter(factory,&ms_android_opengl_display_desc);
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[] = {
{ MS_FILTER_GET_SAMPLE_RATE, ms_opus_dec_get_sample_rate },
{ MS_FILTER_ADD_FMTP, ms_opus_dec_add_fmtp },
{ MS_FILTER_SET_RTP_PAYLOAD_PICKER, ms_opus_set_rtp_picker },
{ MS_DECODER_HAVE_PLC, ms_opus_dec_have_plc },
{ MS_AUDIO_DECODER_SET_RTP_PAYLOAD_PICKER, ms_opus_set_rtp_picker },
{ MS_AUDIO_DECODER_HAVE_PLC, ms_opus_dec_have_plc },
{ MS_FILTER_SET_NCHANNELS, ms_opus_dec_set_nchannels },
{ 0, NULL }
};
......
......@@ -157,14 +157,16 @@ MSEventQueue *ms_event_queue_new(){
}
void ms_event_queue_destroy(MSEventQueue *q){
/*compatibility code*/
if (q==ms_factory_get_event_queue(ms_factory_get_fallback())){
ms_factory_set_event_queue(ms_factory_get_fallback(),NULL);
}
ms_mutex_destroy(&q->mutex);
ms_free(q);
}
static MSEventQueue *ms_global_event_queue=NULL;
void ms_set_global_event_queue(MSEventQueue *q){
ms_global_event_queue=q;
ms_factory_set_event_queue(ms_factory_get_fallback(),q);
}
void ms_event_queue_skip(MSEventQueue *q){
......@@ -234,12 +236,12 @@ void ms_filter_set_notify_callback(MSFilter *f, MSFilterNotifyFunc fn, void *ud)
void ms_filter_notify(MSFilter *f, unsigned int id, void *arg){
if (f->notify_callbacks!=NULL){
if (ms_global_event_queue==NULL){
if (f->factory->evq==NULL){
/* synchronous notification */
ms_filter_invoke_callbacks(&f,id,arg,Both);
}else{
ms_filter_invoke_callbacks(&f,id,arg,OnlySynchronous);
write_event(ms_global_event_queue,f,id,arg);
write_event(f->factory->evq,f,id,arg);
}
}