summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2004-02-01 06:00:56 +0000
committerMike Melanson <mike@multimedia.cx>2004-02-01 06:00:56 +0000
commitcb377b4bec363a1e5ed17d212e8a67586b0f0516 (patch)
tree685e7cd21274ddad420c8b4302bac786bce91774
parente6c2e80993f3fc8656e6a3c4f97a37c418e95cff (diff)
downloadxine-lib-cb377b4bec363a1e5ed17d212e8a67586b0f0516.tar.gz
xine-lib-cb377b4bec363a1e5ed17d212e8a67586b0f0516.tar.bz2
add support for BGR24 and RGB24 video coming from ffmpeg; activate the
following ffmpeg video decoders: Duck TM1, FLIC, SMC, 8BPS, VMD Video, ZLIB, MSZH, ASV1, ASV2, VCR1; activate the following ffmpeg audio decoders: Xan DPCM, VMD audio, MACE 3:1, MACE 6:1 CVS patchset: 6092 CVS date: 2004/02/01 06:00:56
-rw-r--r--src/libffmpeg/audio_decoder.c12
-rw-r--r--src/libffmpeg/video_decoder.c74
-rw-r--r--src/libffmpeg/xine_decoder.c14
3 files changed, 95 insertions, 5 deletions
diff --git a/src/libffmpeg/audio_decoder.c b/src/libffmpeg/audio_decoder.c
index 9c6cef048..fc1b2dac1 100644
--- a/src/libffmpeg/audio_decoder.c
+++ b/src/libffmpeg/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.1 2004/01/31 01:19:17 jstembridge Exp $
+ * $Id: audio_decoder.c,v 1.2 2004/02/01 06:00:56 tmmm Exp $
*
* xine audio decoder plugin using ffmpeg
*
@@ -93,7 +93,11 @@ static const ff_codec_t ff_audio_lookup[] = {
{BUF_AUDIO_MULAW, CODEC_ID_PCM_MULAW, "mu-law logarithmic PCM (ffmpeg)"},
{BUF_AUDIO_ALAW, CODEC_ID_PCM_ALAW, "A-law logarithmic PCM (ffmpeg)"},
{BUF_AUDIO_ROQ, CODEC_ID_ROQ_DPCM, "RoQ DPCM (ffmpeg)"},
- {BUF_AUDIO_INTERPLAY, CODEC_ID_INTERPLAY_DPCM, "Interplay DPCM (ffmpeg)"} };
+ {BUF_AUDIO_INTERPLAY, CODEC_ID_INTERPLAY_DPCM, "Interplay DPCM (ffmpeg)"},
+ {BUF_AUDIO_MAC3, CODEC_ID_MACE3, "MACE 3:1 (ffmpeg)"},
+ {BUF_AUDIO_MAC6, CODEC_ID_MACE6, "MACE 6:1 (ffmpeg)"},
+ {BUF_AUDIO_XAN_DPCM, CODEC_ID_XAN_DPCM, "Origin Xan DPCM (ffmpeg)"},
+ {BUF_AUDIO_VMD, CODEC_ID_VMDAUDIO, "Sierra VMD Audio (ffmpeg)"} };
static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
@@ -359,6 +363,10 @@ static uint32_t supported_audio_types[] = {
BUF_AUDIO_INTERPLAY,
BUF_AUDIO_VQA_IMA,
BUF_AUDIO_4X_ADPCM,
+ BUF_AUDIO_MAC3,
+ BUF_AUDIO_MAC6,
+ BUF_AUDIO_XAN_DPCM,
+ BUF_AUDIO_VMD,
/* BUF_AUDIO_MPEG, */
0
};
diff --git a/src/libffmpeg/video_decoder.c b/src/libffmpeg/video_decoder.c
index 42f272138..d1fdaae92 100644
--- a/src/libffmpeg/video_decoder.c
+++ b/src/libffmpeg/video_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_decoder.c,v 1.2 2004/01/31 17:10:08 jstembridge Exp $
+ * $Id: video_decoder.c,v 1.3 2004/02/01 06:00:56 tmmm Exp $
*
* xine video decoder plugin using ffmpeg
*
@@ -236,6 +236,8 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) {
if((this->context->pix_fmt == PIX_FMT_RGBA32) ||
(this->context->pix_fmt == PIX_FMT_RGB565) ||
(this->context->pix_fmt == PIX_FMT_RGB555) ||
+ (this->context->pix_fmt == PIX_FMT_BGR24) ||
+ (this->context->pix_fmt == PIX_FMT_RGB24) ||
(this->context->pix_fmt == PIX_FMT_PAL8)) {
this->output_format = XINE_IMGFMT_YUY2;
init_yuv_planes(&this->yuv, this->context->width, this->context->height);
@@ -599,6 +601,54 @@ static void ff_convert_frame(ff_video_decoder_t *this, vo_frame_t *img) {
yuv444_to_yuy2(&this->yuv, img->base[0], img->pitches[0]);
+ } else if (this->context->pix_fmt == PIX_FMT_BGR24) {
+
+ int x, plane_ptr = 0;
+ uint8_t *src;
+
+ for(y = 0; y < this->context->height; y++) {
+ src = sy;
+ for(x = 0; x < this->context->width; x++) {
+ uint8_t r, g, b;
+
+ b = *src++;
+ g = *src++;
+ r = *src++;
+
+ this->yuv.y[plane_ptr] = COMPUTE_Y(r, g, b);
+ this->yuv.u[plane_ptr] = COMPUTE_U(r, g, b);
+ this->yuv.v[plane_ptr] = COMPUTE_V(r, g, b);
+ plane_ptr++;
+ }
+ sy += this->av_frame->linesize[0];
+ }
+
+ yuv444_to_yuy2(&this->yuv, img->base[0], img->pitches[0]);
+
+ } else if (this->context->pix_fmt == PIX_FMT_RGB24) {
+
+ int x, plane_ptr = 0;
+ uint8_t *src;
+
+ for(y = 0; y < this->context->height; y++) {
+ src = sy;
+ for(x = 0; x < this->context->width; x++) {
+ uint8_t r, g, b;
+
+ r = *src++;
+ g = *src++;
+ b = *src++;
+
+ this->yuv.y[plane_ptr] = COMPUTE_Y(r, g, b);
+ this->yuv.u[plane_ptr] = COMPUTE_U(r, g, b);
+ this->yuv.v[plane_ptr] = COMPUTE_V(r, g, b);
+ plane_ptr++;
+ }
+ sy += this->av_frame->linesize[0];
+ }
+
+ yuv444_to_yuy2(&this->yuv, img->base[0], img->pitches[0]);
+
} else if (this->context->pix_fmt == PIX_FMT_PAL8) {
int x, plane_ptr = 0;
@@ -723,7 +773,17 @@ static const ff_codec_t ff_video_lookup[] = {
{BUF_VIDEO_IDCIN, CODEC_ID_IDCIN, "Id Software CIN (ffmpeg)"},
{BUF_VIDEO_WC3, CODEC_ID_XAN_WC3, "Xan (ffmpeg)"},
{BUF_VIDEO_VQA, CODEC_ID_WS_VQA, "Westwood Studios VQA (ffmpeg)"},
- {BUF_VIDEO_INTERPLAY, CODEC_ID_INTERPLAY_VIDEO, "Interplay MVE (ffmpeg)"} };
+ {BUF_VIDEO_INTERPLAY, CODEC_ID_INTERPLAY_VIDEO, "Interplay MVE (ffmpeg)"},
+ {BUF_VIDEO_FLI, CODEC_ID_FLIC, "FLIC Video (ffmpeg)"},
+ {BUF_VIDEO_8BPS, CODEC_ID_8BPS, "Planar RGB (ffmpeg)"},
+ {BUF_VIDEO_SMC, CODEC_ID_SMC, "Apple Quicktime Graphics/SMC (ffmpeg)"},
+ {BUF_VIDEO_DUCKTM1, CODEC_ID_TRUEMOTION1,"Duck TrueMotion v1 (ffmpeg)"},
+ {BUF_VIDEO_VMD, CODEC_ID_VMDVIDEO, "Sierra VMD Video (ffmpeg)"},
+ {BUF_VIDEO_ZLIB, CODEC_ID_ZLIB, "ZLIB Video (ffmpeg)"},
+ {BUF_VIDEO_MSZH, CODEC_ID_MSZH, "MSZH Video (ffmpeg)"},
+ {BUF_VIDEO_ASV1, CODEC_ID_ASV1, "ASV v1 Video (ffmpeg)"},
+ {BUF_VIDEO_ASV2, CODEC_ID_ASV2, "ASV v2 Video (ffmpeg)"},
+ {BUF_VIDEO_ATIVCR1, CODEC_ID_VCR1, "ATI VCR-1 (ffmpeg)"} };
static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
ff_video_decoder_t *this = (ff_video_decoder_t *) this_gen;
@@ -1176,6 +1236,16 @@ static uint32_t supported_video_types[] = {
BUF_VIDEO_WC3,
BUF_VIDEO_VQA,
BUF_VIDEO_INTERPLAY,
+ BUF_VIDEO_FLI,
+ BUF_VIDEO_8BPS,
+ BUF_VIDEO_SMC,
+ BUF_VIDEO_VMD,
+ BUF_VIDEO_DUCKTM1,
+ BUF_VIDEO_ZLIB,
+ BUF_VIDEO_MSZH,
+ BUF_VIDEO_ASV1,
+ BUF_VIDEO_ASV2,
+ BUF_VIDEO_ATIVCR1,
0
};
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c
index bc006a959..64c3243b7 100644
--- a/src/libffmpeg/xine_decoder.c
+++ b/src/libffmpeg/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.154 2004/01/31 01:19:17 jstembridge Exp $
+ * $Id: xine_decoder.c,v 1.155 2004/02/01 06:00:56 tmmm Exp $
*
* xine decoder plugin using ffmpeg
*
@@ -97,6 +97,18 @@ void avcodec_register_all(void)
register_avcodec(&xan_wc3_decoder);
register_avcodec(&vqa_decoder);
register_avcodec(&interplay_video_decoder);
+ register_avcodec(&flic_decoder);
+ register_avcodec(&smc_decoder);
+ register_avcodec(&eightbps_decoder);
+ register_avcodec(&vmdvideo_decoder);
+ register_avcodec(&vmdaudio_decoder);
+ register_avcodec(&truemotion1_decoder);
+ register_avcodec(&mszh_decoder);
+ register_avcodec(&zlib_decoder);
+ register_avcodec(&xan_dpcm_decoder);
+ register_avcodec(&asv1_decoder);
+ register_avcodec(&asv2_decoder);
+ register_avcodec(&vcr1_decoder);
}
void init_once_routine(void) {