Commit 763daeec authored by Simon Morlat's avatar Simon Morlat

avoid extern variable for windows

parent ea929123
......@@ -910,6 +910,11 @@ MS2_PUBLIC void video_preview_stop(VideoPreview *stream);
*/
MS2_PUBLIC MSFilter* video_preview_stop_reuse_source(VideoPreview *stream);
/*
* Returns the web cam descriptor for the mire kind of camera.
**/
MS2_PUBLIC MSWebCamDesc *ms_mire_webcam_desc_get(void);
/**
* @}
**/
......
......@@ -152,16 +152,11 @@ static void mire_cam_init(MSWebCam *cam){
cam->name=ms_strdup("Mire (synthetic moving picture)");
}
static MSFilter *mire_create_reader(MSWebCam *obj){
return ms_filter_new_from_desc(&ms_mire_desc);
}
/*This declaration sets export attributes for windows. Test program want to use the mire webcam directly as it is not included by default in the
webcam manager*/
MS2_VAR_PUBLIC MSWebCamDesc mire_desc;
MSWebCamDesc mire_desc={
MSWebCamDesc ms_mire_webcam_desc={
"Mire",
&mire_detect,
&mire_cam_init,
......@@ -169,10 +164,14 @@ MSWebCamDesc mire_desc={
NULL
};
MSWebCamDesc *ms_mire_webcam_desc_get(void){
return &ms_mire_webcam_desc;
}
static void mire_detect(MSWebCamManager *obj){
char *debug=getenv("DEBUG");
if (debug && atoi(debug)==1){
MSWebCam *cam=ms_web_cam_new(&mire_desc);
MSWebCam *cam=ms_web_cam_new(&ms_mire_webcam_desc);
ms_web_cam_manager_add_cam(obj,cam);
}
}
......
......@@ -503,5 +503,10 @@ void video_stream_close_player(VideoStream *stream){
const char *video_stream_get_default_video_renderer(void){
return NULL;
}
MSWebCamDesc *ms_mire_webcam_desc_get(void){
return NULL;
}
#endif
......@@ -199,7 +199,7 @@ extern MSWebCamDesc ms_v4m_cam_desc;
extern MSWebCamDesc static_image_desc;
#endif
extern MSWebCamDesc mire_desc;
extern MSWebCamDesc ms_mire_webcam_desc;
#ifdef ANDROID
extern MSWebCamDesc ms_android_video_capture_desc;
#endif
......@@ -233,7 +233,7 @@ static MSWebCamDesc * ms_web_cam_descs[]={
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
&ms_v4ios_cam_desc,
#endif
&mire_desc,
&ms_mire_webcam_desc,
#if defined(HAVE_LIBAVCODEC_AVCODEC_H) || TARGET_OS_IPHONE
&static_image_desc,
#endif
......
......@@ -197,7 +197,7 @@ void start_adaptive_stream(MSFormatType type, stream_manager_t ** pmarielle, str
MediaStream *marielle_ms,*margaux_ms;
OrtpNetworkSimulatorParams params={0};
#if VIDEO_ENABLED
MSWebCam * marielle_webcam=mediastreamer2_tester_get_mir_webcam(ms_web_cam_manager_get());
MSWebCam * marielle_webcam=mediastreamer2_tester_get_mire_webcam(ms_web_cam_manager_get());
#endif
stream_manager_t *marielle=*pmarielle=stream_manager_new(type);
stream_manager_t *margaux=*pmargaux=stream_manager_new(type);
......
......@@ -53,7 +53,7 @@ extern test_suite_t neon_test_suite;
int apple_main(int argc, char *argv[]);
#endif
MSWebCam* mediastreamer2_tester_get_mir_webcam(MSWebCamManager *mgr);
MSWebCam* mediastreamer2_tester_get_mire_webcam(MSWebCamManager *mgr);
#ifdef __cplusplus
};
......
......@@ -39,18 +39,17 @@ static RtpProfile rtp_profile;
#define H264_PAYLOAD_TYPE 104
#define MP4V_PAYLOAD_TYPE 105
MSWebCam* mediastreamer2_tester_get_mir_webcam(MSWebCamManager *mgr) {
MSWebCam* mediastreamer2_tester_get_mire_webcam(MSWebCamManager *mgr) {
MSWebCam *cam;
#ifdef _MSC_VER
extern __declspec(dllimport) MSWebCamDesc mire_desc;
#else
extern MSWebCamDesc mire_desc;
#endif
cam = ms_web_cam_manager_get_cam(mgr, "Mire: Mire (synthetic moving picture)");
if (cam == NULL) {
cam=ms_web_cam_new(&mire_desc);
ms_web_cam_manager_add_cam(mgr,cam);
MSWebCamDesc *desc = ms_mire_webcam_desc_get();
if (desc){
cam=ms_web_cam_new(desc);
ms_web_cam_manager_add_cam(mgr,cam);
}
}
return cam;
......@@ -433,7 +432,7 @@ static void avpf_rpsi_count(void) {
marielle->vconf->fps=15;
marielle->vconf->vsize.height=MS_VIDEO_SIZE_CIF_H;
marielle->vconf->vsize.width=MS_VIDEO_SIZE_CIF_W;
marielle->cam = mediastreamer2_tester_get_mir_webcam(ms_web_cam_manager_get());
marielle->cam = mediastreamer2_tester_get_mire_webcam(ms_web_cam_manager_get());
margaux->vconf=ms_new0(MSVideoConfiguration,1);
......@@ -441,7 +440,7 @@ static void avpf_rpsi_count(void) {
margaux->vconf->fps=5; /*to save cpu resource*/
margaux->vconf->vsize.height=MS_VIDEO_SIZE_CIF_H;
margaux->vconf->vsize.width=MS_VIDEO_SIZE_CIF_W;
margaux->cam = mediastreamer2_tester_get_mir_webcam(ms_web_cam_manager_get());
margaux->cam = mediastreamer2_tester_get_mire_webcam(ms_web_cam_manager_get());
if (supported) {
init_video_streams(marielle, margaux, TRUE, FALSE, &params,VP8_PAYLOAD_TYPE);
......
......@@ -77,12 +77,6 @@ extern void libmswebrtc_init();
#define MEDIASTREAM_MAX_ICE_CANDIDATES 3
#ifdef _MSC_VER
extern __declspec(dllimport) MSWebCamDesc mire_desc;
#else
extern MSWebCamDesc mire_desc;
#endif
static int cond=1;
......@@ -711,7 +705,7 @@ void setup_media_streams(MediastreamDatas* args) {
rtp_profile_set_payload(&av_profile,114,args->custom_pt);
rtp_profile_set_payload(&av_profile,115,&payload_type_lpc1015);
#ifdef VIDEO_ENABLED
cam=ms_web_cam_new(&mire_desc);
cam=ms_web_cam_new(ms_mire_webcam_desc_get());
if (cam) ms_web_cam_manager_add_cam(ms_web_cam_manager_get(), cam);
cam=NULL;
......
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