Commit ac44871c authored by Gildas Bazin's avatar Gildas Bazin Committed by Diego Biurrun

WinCE cross-compilation support

patch by Gildas Bazin < gbazin **@** altern **.** org >

Originally committed as revision 4881 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 0e6c947d
...@@ -26,6 +26,7 @@ echo " --enable-libgsm enable GSM support via libgsm [default=no]" ...@@ -26,6 +26,7 @@ echo " --enable-libgsm enable GSM support via libgsm [default=no]"
echo " --enable-xvid enable XviD support via xvidcore [default=no]" echo " --enable-xvid enable XviD support via xvidcore [default=no]"
echo " --enable-x264 enable H.264 encoding via x264 [default=no]" echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
echo " --enable-mingw32 enable MinGW native/cross Windows compile" echo " --enable-mingw32 enable MinGW native/cross Windows compile"
echo " --enable-mingwce enable MinGW native/cross WinCE compile"
echo " --enable-a52 enable GPLed A52 support [default=no]" echo " --enable-a52 enable GPLed A52 support [default=no]"
echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
echo " --enable-dts enable GPLed DTS support [default=no]" echo " --enable-dts enable GPLed DTS support [default=no]"
...@@ -202,6 +203,7 @@ a52bin="no" ...@@ -202,6 +203,7 @@ a52bin="no"
dts="no" dts="no"
pp="no" pp="no"
mingw32="no" mingw32="no"
mingwce="no"
cygwin="no" cygwin="no"
os2="no" os2="no"
lshared="no" lshared="no"
...@@ -545,6 +547,8 @@ for opt do ...@@ -545,6 +547,8 @@ for opt do
;; ;;
--enable-mingw32) mingw32="yes" --enable-mingw32) mingw32="yes"
;; ;;
--enable-mingwce) mingwce="yes"
;;
--enable-shared) lshared="yes" --enable-shared) lshared="yes"
;; ;;
--disable-debug) debug="no" --disable-debug) debug="no"
...@@ -864,7 +868,7 @@ EOF ...@@ -864,7 +868,7 @@ EOF
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no" $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
fi fi
if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
v4l="no" v4l="no"
bktr="no" bktr="no"
audio_oss="no" audio_oss="no"
...@@ -872,6 +876,9 @@ if test "$mingw32" = "yes" ; then ...@@ -872,6 +876,9 @@ if test "$mingw32" = "yes" ; then
dc1394="no" dc1394="no"
ffserver="no" ffserver="no"
network="no" network="no"
if test "$mingw32" = "yes"; then
protocols="no"
fi
SLIBPREF="" SLIBPREF=""
SLIBSUF=".dll" SLIBSUF=".dll"
EXESUF=".exe" EXESUF=".exe"
...@@ -1685,6 +1692,16 @@ if test "$mingw32" = "yes" ; then ...@@ -1685,6 +1692,16 @@ if test "$mingw32" = "yes" ; then
echo "#endif" >> $TMPH echo "#endif" >> $TMPH
fi fi
if test "$mingwce" = "yes" ; then
echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak
echo "#define CONFIG_WINCE 1" >> $TMPH
echo "CONFIG_WINCE=yes" >> config.mak
echo "#ifndef __MINGW32__" >> $TMPH
echo "#define __MINGW32__ 1" >> $TMPH
echo "#endif" >> $TMPH
fi
if test "$os2" = "yes" ; then if test "$os2" = "yes" ; then
echo "#define CONFIG_OS2 1" >> $TMPH echo "#define CONFIG_OS2 1" >> $TMPH
echo "CONFIG_OS2=yes" >> config.mak echo "CONFIG_OS2=yes" >> config.mak
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "avformat.h" #include "avformat.h"
#ifdef CONFIG_WIN32 #if defined(CONFIG_WIN32) && !defined(CONFIG_WINCE)
#include <sys/types.h> #include <sys/types.h>
#include <sys/timeb.h> #include <sys/timeb.h>
#elif defined(CONFIG_OS2) #elif defined(CONFIG_OS2)
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
*/ */
int64_t av_gettime(void) int64_t av_gettime(void)
{ {
#ifdef CONFIG_WIN32 #if defined(CONFIG_WINCE)
return timeGetTime() * int64_t_C(1000);
#elif defined(CONFIG_WIN32)
struct timeb tb; struct timeb tb;
_ftime(&tb); _ftime(&tb);
return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000); return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
...@@ -47,6 +49,7 @@ int64_t av_gettime(void) ...@@ -47,6 +49,7 @@ int64_t av_gettime(void)
#endif #endif
} }
#if !defined(CONFIG_WINCE)
#if !defined(HAVE_LOCALTIME_R) #if !defined(HAVE_LOCALTIME_R)
struct tm *localtime_r(const time_t *t, struct tm *tp) struct tm *localtime_r(const time_t *t, struct tm *tp)
{ {
...@@ -59,3 +62,4 @@ struct tm *localtime_r(const time_t *t, struct tm *tp) ...@@ -59,3 +62,4 @@ struct tm *localtime_r(const time_t *t, struct tm *tp)
return tp; return tp;
} }
#endif /* !defined(HAVE_LOCALTIME_R) */ #endif /* !defined(HAVE_LOCALTIME_R) */
#endif /* !defined(CONFIG_WINCE) */
...@@ -2739,6 +2739,7 @@ int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg) ...@@ -2739,6 +2739,7 @@ int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg)
* S+[.m...] * S+[.m...]
* @endcode * @endcode
*/ */
#ifndef CONFIG_WINCE
int64_t parse_date(const char *datestr, int duration) int64_t parse_date(const char *datestr, int duration)
{ {
const char *p; const char *p;
...@@ -2846,6 +2847,7 @@ int64_t parse_date(const char *datestr, int duration) ...@@ -2846,6 +2847,7 @@ int64_t parse_date(const char *datestr, int duration)
} }
return negative ? -t : t; return negative ? -t : t;
} }
#endif /* CONFIG_WINCE */
/** /**
* Attempts to find a specific tag in a URL. * Attempts to find a specific tag in a URL.
......
...@@ -200,6 +200,11 @@ static inline float floorf(float f) { ...@@ -200,6 +200,11 @@ static inline float floorf(float f) {
# define snprintf _snprintf # define snprintf _snprintf
# define vsnprintf _vsnprintf # define vsnprintf _vsnprintf
# ifdef CONFIG_WINCE
# define perror(a)
# endif
# endif # endif
/* CONFIG_WIN32 end */ /* CONFIG_WIN32 end */
...@@ -281,6 +286,9 @@ inline void dprintf(const char* fmt,...) {} ...@@ -281,6 +286,9 @@ inline void dprintf(const char* fmt,...) {}
# endif # endif
# endif /* !CONFIG_WIN32 */ # endif /* !CONFIG_WIN32 */
# ifdef CONFIG_WINCE
# define abort()
# endif
# define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0) # define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
......
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