win32: use _WIN32 not WIN32

parent a3ef55cd
......@@ -25,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys/stat.h>
#include <fcntl.h>
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
# ifndef R_OK
# ifndef R_OK
# define R_OK 0x2
# endif
# ifndef W_OK
......@@ -51,13 +51,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define close _close
# define access _access
# define lseek _lseek
#else /*WIN32*/
#else /*_WIN32*/
# ifndef O_BINARY
# define O_BINARY 0
# endif
#endif /*!WIN32*/
#endif /*!_WIN32*/
#ifdef swap16
#else
......@@ -72,7 +72,7 @@ static MS2_INLINE uint16_t swap16(uint16_t a)
#else
static MS2_INLINE uint32_t swap32(uint32_t a)
{
return ((a & 0xFF) << 24) | ((a & 0xFF00) << 8) |
return ((a & 0xFF) << 24) | ((a & 0xFF00) << 8) |
((a & 0xFF0000) >> 8) | ((a & 0xFF000000) >> 24);
}
#endif
......@@ -120,7 +120,7 @@ typedef struct _wave_header_t
data_t data_chunk;
} wave_header_t;
#ifndef WIN32
#ifndef _WIN32
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_ALAW 0x0006
......@@ -133,7 +133,7 @@ typedef struct _wave_header_t
#define wave_header_get_channel(header) le_uint16((header)->format_chunk.channel)
#define wave_header_get_bpsmpl(header) \
le_uint16((header)->format_chunk.blockalign)
int ms_read_wav_header_from_fd(wave_header_t *header,int fd);
#endif
......@@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/msticker.h"
#ifdef WIN32
#ifdef _WIN32
#include <malloc.h> /* for alloca */
#endif
......@@ -143,7 +143,7 @@ WaveInCallback (HWAVEIN waveindev, UINT uMsg, DWORD dwInstance, DWORD dwParam1,
{
case MM_WOM_DONE:
wHdr = (WAVEHDR *) dwParam1;
/* A waveform-audio data block has been played and
/* A waveform-audio data block has been played and
can now be freed. */
ms_message("WaveInCallback : MM_WOM_DONE");
waveInUnprepareHeader (waveindev, (LPWAVEHDR) wHdr, sizeof (WAVEHDR));
......@@ -232,7 +232,7 @@ static int winsnd_open(WinSndData *device, int devnumber, int bits,int stereo, i
device->wfx.nChannels = channel;
device->wfx.nSamplesPerSec = rate; /* 8000; */
device->wfx.wBitsPerSample = bits;
dwFlag = CALLBACK_FUNCTION;
if (devnumber != WAVE_MAPPER)
......@@ -303,7 +303,7 @@ static int winsnd_open(WinSndData *device, int devnumber, int bits,int stereo, i
{
memset (&(device->waveouthdr[i]), 0, sizeof (device->waveouthdr[i]));
device->waveouthdr[i].lpData = device->waveoutbuffer[i];
/* BUG: on ne connait pas la taille des frames a recevoir...
/* BUG: on ne connait pas la taille des frames a recevoir...
on utilise enc_frame_per_packet au lien de dec_frame_per_packet */
device->waveouthdr[i].dwBufferLength = device->rate/8000 * WINSND_BUFLEN;
......@@ -353,7 +353,7 @@ static int winsnd_open(WinSndData *device, int devnumber, int bits,int stereo, i
device->waveinhdr[i].dwBufferLength = device->rate/8000 * WINSND_BUFLEN;
device->waveinhdr[i].dwFlags = 0;
device->waveinhdr[i].dwUser = i;
mr = waveInPrepareHeader (device->waveindev, &(device->waveinhdr[i]),
mr = waveInPrepareHeader (device->waveindev, &(device->waveinhdr[i]),
sizeof (device->waveinhdr[i]));
if (mr == MMSYSERR_NOERROR){
mr = waveInAddBuffer (device->waveindev, &(device->waveinhdr[i]),
......@@ -478,7 +478,7 @@ static void winsnd_set_source(MSSndCard *card, MSSndCardCapture source)
break;
case MS_SND_CARD_LINE:
break;
}
}
}
static void winsnd_init(MSSndCard *card){
......
......@@ -60,7 +60,7 @@ char * ortp_strdup_vprintf(const char *fmt, va_list ap)
/* Guess we need no more than 100 bytes. */
int n, size = 200;
char *p,*np;
#ifndef WIN32
#ifndef _WIN32
va_list cap;/*copy of our argument list: a va_list cannot be re-used (SIGSEGV on linux 64 bits)*/
#endif
if ((p = (char *) ortp_malloc (size)) == NULL)
......@@ -68,7 +68,7 @@ char * ortp_strdup_vprintf(const char *fmt, va_list ap)
while (1)
{
/* Try to print in the allocated space. */
#ifndef WIN32
#ifndef _WIN32
va_copy(cap,ap);
n = vsnprintf (p, size, fmt, cap);
va_end(cap);
......@@ -106,13 +106,13 @@ char *ortp_strdup_printf(const char *fmt,...){
return ret;
}
#if defined(WIN32) || defined(_WIN32_WCE)
#if defined(_WIN32) || defined(_WIN32_WCE)
#define ENDLINE "\r\n"
#else
#define ENDLINE "\n"
#endif
#if defined(WIN32) || defined(_WIN32_WCE)
#if defined(_WIN32) || defined(_WIN32_WCE)
void ortp_logv(int level, const char *fmt, va_list args)
{
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level))
......
......@@ -55,7 +55,7 @@ ORTP_PUBLIC extern unsigned int __ortp_log_mask;
#define ortp_log_level_enabled(level) (__ortp_log_mask & (level))
#if !defined(WIN32) && !defined(_WIN32_WCE)
#if !defined(_WIN32) && !defined(_WIN32_WCE)
#define ortp_logv(level,fmt,args) \
{\
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level)) \
......
......@@ -22,7 +22,7 @@
#define ORTP_PORT_H
#if !defined(WIN32) && !defined(_WIN32_WCE)
#if !defined(_WIN32) && !defined(_WIN32_WCE)
/********************************/
/* definitions for UNIX flavour */
/********************************/
......@@ -113,7 +113,7 @@ int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (*routi
#else
/*********************************/
/* definitions for WIN32 flavour */
/* definitions for _WIN32 flavour */
/*********************************/
#include <stdio.h>
......@@ -283,7 +283,7 @@ ORTP_PUBLIC void ortp_get_cur_time(ortpTimeSpec *ret);
/* portable named pipes and shared memory*/
#if !defined(_WIN32_WCE)
#ifdef WIN32
#ifdef _WIN32
typedef HANDLE ortp_pipe_t;
#define ORTP_PIPE_INVALID INVALID_HANDLE_VALUE
#else
......@@ -318,7 +318,7 @@ ORTP_PUBLIC void ortp_shm_close(void *memory);
#endif
#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC)
#if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC)
#ifdef ORTP_EXPORTS
#define VAR_DECLSPEC __declspec(dllexport)
#else
......
......@@ -19,7 +19,7 @@
*/
#if defined(WIN32) || defined(_WIN32_WCE)
#if defined(_WIN32) || defined(_WIN32_WCE)
#include "ortp-config-win32.h"
#elif HAVE_CONFIG_H
#include "ortp-config.h"
......@@ -370,7 +370,7 @@ char * WSAAPI gai_strerror(int errnum){
#endif
#ifndef WIN32
#ifndef _WIN32
#include <sys/socket.h>
#include <netdb.h>
......@@ -473,7 +473,7 @@ void ortp_shm_close(void *mem){
#endif
#elif defined(WIN32) && !defined(_WIN32_WCE)
#elif defined(_WIN32) && !defined(_WIN32_WCE)
static char *make_pipe_name(const char *name){
return ortp_strdup_printf("\\\\.\\pipe\\%s",name);
......@@ -581,16 +581,16 @@ void *ortp_shm_open(unsigned int keyid, int size, int create){
if (create){
h = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file
NULL, // default security
NULL, // default security
PAGE_READWRITE, // read/write access
0, // maximum object size (high-order DWORD)
size, // maximum object size (low-order DWORD)
0, // maximum object size (high-order DWORD)
size, // maximum object size (low-order DWORD)
name); // name of mapping object
}else{
h = OpenFileMapping(
FILE_MAP_ALL_ACCESS, // read/write access
FALSE, // do not inherit the name
name); // name of mapping object
name); // name of mapping object
}
if (h==(HANDLE)-1) {
ortp_error("Fail to open file mapping (create=%i)",create);
......@@ -598,8 +598,8 @@ void *ortp_shm_open(unsigned int keyid, int size, int create){
}
buf = (LPTSTR) MapViewOfFile(h, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
0,
0,
size);
if (buf!=NULL){
MapInfo *i=(MapInfo*)ortp_new(MapInfo,1);
......@@ -638,7 +638,7 @@ void ortp_shm_close(void *mem){
#endif
void ortp_get_cur_time(ortpTimeSpec *ret){
#if defined(_WIN32_WCE) || defined(WIN32)
#if defined(_WIN32_WCE) || defined(_WIN32)
DWORD timemillis;
# if defined(_WIN32_WCE)
timemillis=GetTickCount();
......
......@@ -71,7 +71,7 @@ typedef union{
#endif
#define ntoh24(x) hton24(x)
#if defined(WIN32) || defined(_WIN32_WCE)
#if defined(_WIN32) || defined(_WIN32_WCE)
#define is_would_block_error(errnum) (errnum==WSAEWOULDBLOCK)
#else
#define is_would_block_error(errnum) (errnum==EWOULDBLOCK || errnum==EAGAIN)
......
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static JavaVM *ms2_vm=NULL;
#ifndef WIN32
#ifndef _WIN32
#include <pthread.h>
static pthread_key_t jnienv_key;
......@@ -33,7 +33,7 @@ static pthread_key_t jnienv_key;
**/
void _android_key_cleanup(void *data){
JNIEnv* env=(JNIEnv*)pthread_getspecific(jnienv_key);
if (env != NULL) {
ms_message("Thread end, detaching jvm from current thread");
(*ms2_vm)->DetachCurrentThread(ms2_vm);
......@@ -46,7 +46,7 @@ void _android_key_cleanup(void *data){
void ms_set_jvm(JavaVM *vm){
ms2_vm=vm;
#ifndef WIN32
#ifndef _WIN32
pthread_key_create(&jnienv_key,_android_key_cleanup);
#endif
}
......@@ -60,7 +60,7 @@ JNIEnv *ms_get_jni_env(void){
if (ms2_vm==NULL){
ms_fatal("Calling ms_get_jni_env() while no jvm has been set using ms_set_jvm().");
}else{
#ifndef WIN32
#ifndef _WIN32
env=(JNIEnv*)pthread_getspecific(jnienv_key);
if (env==NULL){
if ((*ms2_vm)->AttachCurrentThread(ms2_vm,&env,NULL)!=0){
......
......@@ -73,7 +73,7 @@ int ms_display_poll_event(MSDisplay *d, MSDisplayEvent *ev);
extern MSDisplayDesc ms_sdl_display_desc;
#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(MEDIASTREAMER_STATIC)
#if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(MEDIASTREAMER_STATIC)
#if defined(MEDIASTREAMER2_EXPORTS) && defined(INVIDEOUT_C)
#define MSVAR_DECLSPEC __declspec(dllexport)
#else
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msvideopresets.h"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#if defined(_WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#ifdef MEDIASTREAMER2_INTERNAL_EXPORTS
#define MEDIASTREAMER2_INTERNAL_EXPORT __declspec(dllexport)
#define MEDIASTREAMER2_INTERNAL_VAR_EXPORT __declspec(dllexport)
......
......@@ -34,8 +34,6 @@ set(SOURCE_FILES_C
)
set(SOURCE_FILES_OBJC )
add_definitions(-DBC_CONFIG_FILE="mediastreamer-config.h")
if(ENABLE_VIDEO)
list(APPEND SOURCE_FILES_C mediastreamer2_video_stream_tester.c)
endif()
......
......@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#include <poll.h>
#else
......@@ -734,7 +734,7 @@ void setup_media_streams(MediastreamDatas* args) {
if (args->mtu) ms_factory_set_mtu(factory, args->mtu);
ms_factory_enable_statistics(factory, TRUE);
ms_factory_reset_statistics(factory);
args->ice_session=ice_session_new();
ice_session_set_remote_credentials(args->ice_session,"1234","1234567890abcdef123456");
// ICE local credentials are assigned when creating the ICE session, but force them here to simplify testing
......@@ -865,7 +865,7 @@ void setup_media_streams(MediastreamDatas* args) {
params.zid_file=args->zrtp_secrets;
audio_stream_enable_zrtp(args->audio,&params);
}
args->session=args->audio->ms.sessions.rtp_session;
}
......@@ -926,7 +926,7 @@ void setup_media_streams(MediastreamDatas* args) {
cam=ms_web_cam_manager_get_cam(ms_factory_get_web_cam_manager(factory),args->camera);
if (cam==NULL)
cam=ms_web_cam_manager_get_default_cam(ms_factory_get_web_cam_manager(factory));
if (args->infile){
iodef.input.type = MSResourceFile;
iodef.input.file = args->infile;
......@@ -976,7 +976,7 @@ void setup_media_streams(MediastreamDatas* args) {
static void mediastream_tool_iterate(MediastreamDatas* args) {
#ifndef WIN32
#ifndef _WIN32
struct pollfd pfd;
int err;
......@@ -1109,7 +1109,7 @@ void clear_mediastreams(MediastreamDatas* args) {
if (args->logfile)
fclose(args->logfile);
ms_factory_destroy(args->video->ms.factory);
}
......
......@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#else
#include <malloc.h>
......@@ -204,7 +204,7 @@ static void setup_media_streams(MediastreamDatas *args)
{
MSConnectionHelper h;
MSTickerParams params = {0};
/*create the rtp session */
ortp_init();
if (args->is_verbose) {
......@@ -344,7 +344,7 @@ static void run_non_interactive_loop(MediastreamDatas *args)
while (cond) {
int n;
for (n = 0; n < 100; ++n) {
#ifdef WIN32
#ifdef _WIN32
MSG msg;
Sleep(10);
while (PeekMessage(&msg, NULL, 0, 0, 1)) {
......
......@@ -43,7 +43,7 @@ int main(int argc, char *argv[]){
ortp_init();
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
//ms_init();
factory = ms_factory_new();
ms_factory_init_voip(factory);
ms_factory_init_plugins(factory);
......@@ -56,13 +56,13 @@ int main(int argc, char *argv[]){
for(i=0;i<1;++i){
int n;
vs=video_preview_new(factory);
/*video_preview_set_display_filter_name(vs,"MSVideoOut");*/
video_preview_set_size(vs,vsize);
video_preview_start(vs, cam);
for(n=0;n<60000 && !stopped;++n){
#ifdef WIN32
#ifdef _WIN32
MSG msg;
Sleep(100);
while (PeekMessage(&msg, NULL, 0, 0,1)){
......@@ -90,7 +90,7 @@ int main(int argc, char *argv[]){
ms_filter_link(vs->pixconv,0,vs->tee,0);
ms_filter_link(vs->tee,0,vs->output2,0);
ms_filter_link(vs->tee,1,vs->output2,1);
//ms_filter_unlink(vs->tee,0,vs->output,0);
ms_ticker_attach (vs->ms.sessions.ticker, vs->source);
......@@ -127,7 +127,7 @@ int main(int argc, char *argv[]){
ms_filter_link(vs->pixconv,0, vs->output2,0);
ms_ticker_attach (vs->ms.sessions.ticker, vs->source);
}
}
......
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