Commit afc391b7 authored by michaelni's avatar michaelni

beos/mov/adpcm patch by François Revol <revol at free dot fr>

* Some BeOS fixes:
- errno stuff
- nanosleep() replacement
- added a doc/README.beos

* mov reader still has problems with most videos (skips many chunks),
- It should now read .mov files with zlib-compressed moov headers (aka cmov)
- added SVQ1 support.
- removed mapping 'raw ' and 'yuv2' to h263, was my mistake.
- added IMA4 support. (tested)
- fixed frame rate (it reported 0 fps or something before)
- extended file probing ('wide' and 'free' atoms)
- improved .mov/.mp4 detection (or so I think)

* adpcm
* added zlib support, with header file and lib check


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@780 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3f56e399
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
#include <Errors.h> #include <Errors.h>
// mmu_man: this is needed for http.c (defined errno)
#include <errno.h>
#ifdef ENOENT #ifdef ENOENT
#undef ENOENT #undef ENOENT
#endif #endif
......
...@@ -43,6 +43,7 @@ gprof="no" ...@@ -43,6 +43,7 @@ gprof="no"
v4l="yes" v4l="yes"
audio_oss="yes" audio_oss="yes"
network="yes" network="yes"
zlib="yes"
mp3lame="no" mp3lame="no"
a52="yes" a52="yes"
a52bin="no" a52bin="no"
...@@ -123,6 +124,8 @@ for opt do ...@@ -123,6 +124,8 @@ for opt do
;; ;;
--disable-network) network="no" --disable-network) network="no"
;; ;;
--disable-zlib) zlib="no"
;;
--disable-a52) a52="no" --disable-a52) a52="no"
;; ;;
--enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs" --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
...@@ -195,6 +198,25 @@ EOF ...@@ -195,6 +198,25 @@ EOF
$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
fi fi
if test "$zlib" = "yes"; then
# check for zlib - mmu_man
cat > $TMPC << EOF
#include <zlib.h>
int main ( void ) {
if (zlibVersion() != ZLIB_VERSION)
puts("zlib version differs !!!");
return 1;
return 0;
}
EOF
$cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no"
# $TMPO 2> /dev/null > /dev/null || zlib="no"
# XXX: more tests needed - runtime test
fi
if test "$zlib" = "yes"; then
extralibs="$extralibs -lz"
fi
_restrict= _restrict=
for restrict_keyword in restrict __restrict__ __restrict; do for restrict_keyword in restrict __restrict__ __restrict; do
echo "void foo(char * $restrict_keyword p);" > $TMPC echo "void foo(char * $restrict_keyword p);" > $TMPC
...@@ -233,6 +255,7 @@ echo " --disable-mmx disable mmx usage" ...@@ -233,6 +255,7 @@ echo " --disable-mmx disable mmx usage"
echo " --disable-audio-oss disable OSS audio support [default=no]" echo " --disable-audio-oss disable OSS audio support [default=no]"
echo " --disable-v4l disable video4linux grabbing [default=no]" echo " --disable-v4l disable video4linux grabbing [default=no]"
echo " --disable-network disable network support [default=no]" echo " --disable-network disable network support [default=no]"
echo " --disable-zlib disable zlib [default=no]"
echo " --disable-simple_idct disable simple IDCT routines [default=no]" echo " --disable-simple_idct disable simple IDCT routines [default=no]"
echo " --enable-gprof enable profiling with gprof [$gprof]" echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-mpegaudio-hp faster (but less accurate)" echo " --disable-mpegaudio-hp faster (but less accurate)"
...@@ -250,6 +273,7 @@ echo "CPU $cpu" ...@@ -250,6 +273,7 @@ echo "CPU $cpu"
echo "Big Endian $bigendian" echo "Big Endian $bigendian"
echo "MMX enabled $mmx" echo "MMX enabled $mmx"
echo "gprof enabled $gprof" echo "gprof enabled $gprof"
echo "zlib enabled $zlib"
echo "mp3lame enabled $mp3lame" echo "mp3lame enabled $mp3lame"
echo "a52 support $a52" echo "a52 support $a52"
echo "a52 dlopened $a52bin" echo "a52 dlopened $a52bin"
...@@ -339,6 +363,11 @@ if test "$network" = "yes" ; then ...@@ -339,6 +363,11 @@ if test "$network" = "yes" ; then
echo "CONFIG_NETWORK=yes" >> config.mak echo "CONFIG_NETWORK=yes" >> config.mak
fi fi
if test "$zlib" = "yes" ; then
echo "#define CONFIG_ZLIB 1" >> $TMPH
echo "CONFIG_ZLIB=yes" >> config.mak
fi
if test "$mp3lame" = "yes" ; then if test "$mp3lame" = "yes" ; then
echo "#define CONFIG_MP3LAME 1" >> $TMPH echo "#define CONFIG_MP3LAME 1" >> $TMPH
echo "CONFIG_MP3LAME=yes" >> config.mak echo "CONFIG_MP3LAME=yes" >> config.mak
......
Compilation on BeOS:
--------------------
François Revol - revol@free.fr - July 2002
The configure script should guess the configuration itself.
Networking support is currently not finished.
errno issues fixed by Andrew Bachmann.
Old stuff:
François Revol - revol@free.fr - April 2002
The configure script should guess the configuration itself,
however I still didn't tested building on net_server version of BeOS.
ffserver is broken (needs poll() implementation).
There is still issues with errno codes, which are negative in BeOs, and
that ffmpeg negates when returning. This ends up turning errors into
valid results, then crashes.
(To be fixed)
This diff is collapsed.
...@@ -27,6 +27,8 @@ CodecTag codec_wav_tags[] = { ...@@ -27,6 +27,8 @@ CodecTag codec_wav_tags[] = {
{ CODEC_ID_PCM_U8, 0x01 }, /* must come after s16le in this list */ { CODEC_ID_PCM_U8, 0x01 }, /* must come after s16le in this list */
{ CODEC_ID_PCM_ALAW, 0x06 }, { CODEC_ID_PCM_ALAW, 0x06 },
{ CODEC_ID_PCM_MULAW, 0x07 }, { CODEC_ID_PCM_MULAW, 0x07 },
{ CODEC_ID_ADPCM_MS, 0x02 },
{ CODEC_ID_ADPCM_IMA_WAV, 0x11 },
{ 0, 0 }, { 0, 0 },
}; };
...@@ -56,6 +58,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) ...@@ -56,6 +58,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME) { if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME) {
blkalign = 1; blkalign = 1;
//blkalign = 144 * enc->bit_rate/enc->sample_rate; //blkalign = 144 * enc->bit_rate/enc->sample_rate;
} else if (enc->block_align != 0) { /* specified by the codec */
blkalign = enc->block_align;
} else } else
blkalign = enc->channels*bps >> 3; blkalign = enc->channels*bps >> 3;
if (enc->codec_id == CODEC_ID_PCM_U8 || if (enc->codec_id == CODEC_ID_PCM_U8 ||
...@@ -205,6 +209,7 @@ static int wav_read_header(AVFormatContext *s, ...@@ -205,6 +209,7 @@ static int wav_read_header(AVFormatContext *s,
unsigned int tag; unsigned int tag;
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
unsigned int id, channels, rate, bit_rate, extra_size, bps; unsigned int id, channels, rate, bit_rate, extra_size, bps;
unsigned int blkalign;
AVStream *st; AVStream *st;
/* check RIFF header */ /* check RIFF header */
...@@ -225,7 +230,7 @@ static int wav_read_header(AVFormatContext *s, ...@@ -225,7 +230,7 @@ static int wav_read_header(AVFormatContext *s,
channels = get_le16(pb); channels = get_le16(pb);
rate = get_le32(pb); rate = get_le32(pb);
bit_rate = get_le32(pb) * 8; bit_rate = get_le32(pb) * 8;
get_le16(pb); /* block align */ blkalign = get_le16(pb); /* block align */
bps = get_le16(pb); /* bits per sample */ bps = get_le16(pb); /* bits per sample */
if (size >= 18) { if (size >= 18) {
/* wav_extra_size */ /* wav_extra_size */
...@@ -248,6 +253,7 @@ static int wav_read_header(AVFormatContext *s, ...@@ -248,6 +253,7 @@ static int wav_read_header(AVFormatContext *s,
st->codec.codec_id = wav_codec_get_id(id, bps); st->codec.codec_id = wav_codec_get_id(id, bps);
st->codec.channels = channels; st->codec.channels = channels;
st->codec.sample_rate = rate; st->codec.sample_rate = rate;
st->codec.block_align = blkalign;
return 0; return 0;
} }
......
...@@ -15,7 +15,7 @@ OBJS= common.o utils.o mem.o allcodecs.o \ ...@@ -15,7 +15,7 @@ OBJS= common.o utils.o mem.o allcodecs.o \
mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \ mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
motion_est.o imgconvert.o imgresample.o msmpeg4.o \ motion_est.o imgconvert.o imgresample.o msmpeg4.o \
mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \ mpeg12.o h263dec.o svq1.o rv10.o mpegaudiodec.o pcm.o simple_idct.o \
ratecontrol.o ratecontrol.o adpcm.o
ASM_OBJS= ASM_OBJS=
# currently using liba52 for ac3 decoding # currently using liba52 for ac3 decoding
......
This diff is collapsed.
...@@ -89,6 +89,11 @@ PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8); ...@@ -89,6 +89,11 @@ PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw); PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw); PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
/* adpcm codecs */
PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
#undef PCM_CODEC #undef PCM_CODEC
} }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406 #define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6" #define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 4617 #define LIBAVCODEC_BUILD 4618
#define LIBAVCODEC_BUILD_STR "4617" #define LIBAVCODEC_BUILD_STR "4618"
enum CodecID { enum CodecID {
CODEC_ID_NONE, CODEC_ID_NONE,
...@@ -37,6 +37,11 @@ enum CodecID { ...@@ -37,6 +37,11 @@ enum CodecID {
CODEC_ID_PCM_U8, CODEC_ID_PCM_U8,
CODEC_ID_PCM_MULAW, CODEC_ID_PCM_MULAW,
CODEC_ID_PCM_ALAW, CODEC_ID_PCM_ALAW,
/* various adpcm codecs */
CODEC_ID_ADPCM_IMA_QT,
CODEC_ID_ADPCM_IMA_WAV,
CODEC_ID_ADPCM_MS,
}; };
#define CODEC_ID_MSMPEG4 CODEC_ID_MSMPEG4V3 #define CODEC_ID_MSMPEG4 CODEC_ID_MSMPEG4V3
...@@ -263,6 +268,7 @@ typedef struct AVCodecContext { ...@@ -263,6 +268,7 @@ typedef struct AVCodecContext {
int has_b_frames; // is 1 if the decoded stream contains b frames int has_b_frames; // is 1 if the decoded stream contains b frames
int dr_uvstride; int dr_uvstride;
int dr_ip_buffer_count; int dr_ip_buffer_count;
int block_align; /* currently only for adpcm codec in wav/avi */
//FIXME this should be reordered after kabis API is finished ... //FIXME this should be reordered after kabis API is finished ...
/* /*
...@@ -286,7 +292,7 @@ typedef struct AVCodecContext { ...@@ -286,7 +292,7 @@ typedef struct AVCodecContext {
ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5, ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5,
ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12; ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12;
unsigned int unsigned int
ui_res0,ui_res1,ui_res2; ui_res0,ui_res1;
unsigned short int unsigned short int
us_res0,us_res1,us_res2,us_res3,us_res4,us_res5, us_res0,us_res1,us_res2,us_res3,us_res4,us_res5,
us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12; us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12;
...@@ -376,6 +382,12 @@ PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8); ...@@ -376,6 +382,12 @@ PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw); PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw); PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
/* adpcm codecs */
PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
#undef PCM_CODEC #undef PCM_CODEC
/* dummy raw video codec */ /* dummy raw video codec */
......
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