summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_asf.c100
-rw-r--r--src/demuxers/demux_avi.c97
-rw-r--r--src/demuxers/demux_qt.c39
-rw-r--r--src/xine-engine/Makefile.am2
-rw-r--r--src/xine-engine/buffer.h7
5 files changed, 31 insertions, 214 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index b215a772b..0ec0e1acb 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.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: demux_asf.c,v 1.6 2001/11/06 21:46:05 miguelfreitas Exp $
+ * $Id: demux_asf.c,v 1.7 2001/11/07 18:26:36 miguelfreitas Exp $
*
* demultiplexer for asf streams
*
@@ -363,98 +363,10 @@ static void asf_send_video_header (demux_asf_t *this, int stream_id) {
buf_element_t *buf;
BITMAPINFOHEADER *bih = (BITMAPINFOHEADER *) this->bih;
-
- switch (str2ulong((void*)&bih->biCompression)) {
-
- case mmioFOURCC('M', 'P', '4', '3'):
- case mmioFOURCC('m', 'p', '4', '3'):
- case mmioFOURCC('D', 'I', 'V', '3'):
- case mmioFOURCC('d', 'i', 'v', '3'):
- case mmioFOURCC('D', 'I', 'V', '4'):
- case mmioFOURCC('d', 'i', 'v', '4'):
- case mmioFOURCC('D', 'I', 'V', '5'):
- case mmioFOURCC('d', 'i', 'v', '5'):
- case mmioFOURCC('D', 'I', 'V', '6'):
- case mmioFOURCC('d', 'i', 'v', '6'):
- /* Video in Microsoft MPEG-4 format v3 */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_MSMPEG4_V3;
- break;
-
- case mmioFOURCC('M', 'P', 'G', '4'):
- case mmioFOURCC('m', 'p', 'g', '4'):
- case mmioFOURCC('M', 'P', '4', '1'):
- case mmioFOURCC('m', 'p', '4', '1'):
- case mmioFOURCC('M', 'P', '4', '2'):
- case mmioFOURCC('m', 'p', '4', '2'):
- case mmioFOURCC('D', 'I', 'V', '2'):
- case mmioFOURCC('d', 'i', 'v', '2'):
- /* Video in Microsoft MPEG-4 format v1/v2 */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_MSMPEG4_V12;
- break;
-
- case mmioFOURCC('D', 'I', 'V', 'X'):
- case mmioFOURCC('d', 'i', 'v', 'x'):
- case mmioFOURCC('D', 'i', 'v', 'x'):
- case mmioFOURCC('D', 'i', 'v', 'X'):
- /* Video in mpeg4 (opendivx) format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_MPEG4;
- break;
-
- case mmioFOURCC('d', 'm', 'b', '1'):
- case mmioFOURCC('M', 'J', 'P', 'G'):
- /* Video in motion jpeg format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_MJPEG;
- break;
-
- case mmioFOURCC('I', 'V', '5', '0'):
- case mmioFOURCC('i', 'v', '5', '0'):
- /* Video in Indeo Video 5.0 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_IV50;
- break;
-
- case mmioFOURCC('I', 'V', '4', '1'):
- case mmioFOURCC('i', 'v', '4', '1'):
- /* Video in Indeo Video 4.1 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_IV41;
- break;
- case mmioFOURCC('I', 'V', '3', '2'):
- case mmioFOURCC('i', 'v', '3', '2'):
- /* Video in Indeo Video 3.2 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_IV32;
- break;
-
- case mmioFOURCC('I', 'V', '3', '1'):
- case mmioFOURCC('i', 'v', '3', '1'):
- /* Video in Indeo Video 3.1 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_IV31;
- break;
+ this->streams[this->num_streams].buf_type =
+ fourcc_to_buf_video((void*)&bih->biCompression);
- case mmioFOURCC('c', 'v', 'i', 'd'):
- /* Video in Cinepak format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_CINEPAK;
- break;
- case mmioFOURCC('V', 'C', 'R', '1'):
- /* Video in ATI VCR1 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_ATIVCR1;
- break;
- case mmioFOURCC('V', 'C', 'R', '2'):
- /* Video in ATI VCR2 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_ATIVCR2;
- break;
- case mmioFOURCC('I', '2', '6', '3'):
- case mmioFOURCC('i', '2', '6', '3'):
- /* Video in I263 format */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_I263;
- break;
- case mmioFOURCC('W','M','V','1'):
- /* Windows Media Video 7 */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_WMV7;
- break;
- case mmioFOURCC('W','M','V','2'):
- /* Windows Media Video 8 */
- this->streams[this->num_streams].buf_type = BUF_VIDEO_WMV8;
- break;
- default:
+ if( !this->streams[this->num_streams].buf_type ) {
printf ("demux_asf: unknown video format %.4s\n",
(char*)&bih->biCompression);
@@ -467,7 +379,11 @@ static void asf_send_video_header (demux_asf_t *this, int stream_id) {
this->streams[this->num_streams].stream_id = stream_id;
this->streams[this->num_streams].frag_offset = 0;
+ /*
printf ("demux_asf: video format : %.4s\n", (char*)&bih->biCompression);
+ */
+ printf ("demux_asf: video format : %s\n",
+ buf_video_name(this->streams[this->num_streams].buf_type));
buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
buf->content = buf->mem;
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index b3e8c9996..a144b7344 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.48 2001/10/30 09:42:26 guenter Exp $
+ * $Id: demux_avi.c,v 1.49 2001/11/07 18:26:36 miguelfreitas Exp $
*
* demultiplexer for avi streams
*
@@ -984,97 +984,9 @@ static void demux_avi_start (demux_plugin_t *this_gen,
memcpy (buf->content, &this->avi->bih, sizeof (this->avi->bih));
buf->size = sizeof (this->avi->bih);
- switch (str2ulong((void*)&this->avi->bih.biCompression)) {
-
- case mmioFOURCC('M', 'P', '4', '3'):
- case mmioFOURCC('m', 'p', '4', '3'):
- case mmioFOURCC('D', 'I', 'V', '3'):
- case mmioFOURCC('d', 'i', 'v', '3'):
- case mmioFOURCC('D', 'I', 'V', '4'):
- case mmioFOURCC('d', 'i', 'v', '4'):
- case mmioFOURCC('D', 'I', 'V', '5'):
- case mmioFOURCC('d', 'i', 'v', '5'):
- case mmioFOURCC('D', 'I', 'V', '6'):
- case mmioFOURCC('d', 'i', 'v', '6'):
- /* Video in Microsoft MPEG-4 format v3 */
- this->avi->video_type = BUF_VIDEO_MSMPEG4_V3;
- break;
-
- case mmioFOURCC('M', 'P', 'G', '4'):
- case mmioFOURCC('m', 'p', 'g', '4'):
- case mmioFOURCC('M', 'P', '4', '1'):
- case mmioFOURCC('m', 'p', '4', '1'):
- case mmioFOURCC('M', 'P', '4', '2'):
- case mmioFOURCC('m', 'p', '4', '2'):
- case mmioFOURCC('D', 'I', 'V', '2'):
- case mmioFOURCC('d', 'i', 'v', '2'):
- /* Video in Microsoft MPEG-4 format v1/v2 */
- this->avi->video_type = BUF_VIDEO_MSMPEG4_V12;
- break;
-
- case mmioFOURCC('D', 'I', 'V', 'X'):
- case mmioFOURCC('d', 'i', 'v', 'x'):
- case mmioFOURCC('D', 'i', 'v', 'x'):
- case mmioFOURCC('D', 'i', 'v', 'X'):
- /* Video in mpeg4 (opendivx) format */
- this->avi->video_type = BUF_VIDEO_MPEG4;
- break;
-
- case mmioFOURCC('d', 'm', 'b', '1'):
- case mmioFOURCC('M', 'J', 'P', 'G'):
- /* Video in motion jpeg format */
- this->avi->video_type = BUF_VIDEO_MJPEG;
- break;
-
- case mmioFOURCC('I', 'V', '5', '0'):
- case mmioFOURCC('i', 'v', '5', '0'):
- /* Video in Indeo Video 5.0 format */
- this->avi->video_type = BUF_VIDEO_IV50;
- break;
-
- case mmioFOURCC('I', 'V', '4', '1'):
- case mmioFOURCC('i', 'v', '4', '1'):
- /* Video in Indeo Video 4.1 format */
- this->avi->video_type = BUF_VIDEO_IV41;
- break;
- case mmioFOURCC('I', 'V', '3', '2'):
- case mmioFOURCC('i', 'v', '3', '2'):
- /* Video in Indeo Video 3.2 format */
- this->avi->video_type = BUF_VIDEO_IV32;
- break;
-
- case mmioFOURCC('I', 'V', '3', '1'):
- case mmioFOURCC('i', 'v', '3', '1'):
- /* Video in Indeo Video 3.1 format */
- this->avi->video_type = BUF_VIDEO_IV31;
- break;
-
- case mmioFOURCC('c', 'v', 'i', 'd'):
- /* Video in Cinepak format */
- this->avi->video_type = BUF_VIDEO_CINEPAK;
- break;
- case mmioFOURCC('V', 'C', 'R', '1'):
- /* Video in ATI VCR1 format */
- this->avi->video_type = BUF_VIDEO_ATIVCR1;
- break;
- case mmioFOURCC('V', 'C', 'R', '2'):
- /* Video in ATI VCR2 format */
- this->avi->video_type = BUF_VIDEO_ATIVCR2;
- break;
- case mmioFOURCC('I', '2', '6', '3'):
- case mmioFOURCC('i', '2', '6', '3'):
- /* Video in I263 format */
- this->avi->video_type = BUF_VIDEO_I263;
- break;
- case mmioFOURCC('W','M','V','1'):
- /* Windows Media Video 7 */
- this->avi->video_type = BUF_VIDEO_WMV7;
- break;
- case mmioFOURCC('W','M','V','2'):
- /* Windows Media Video 8 */
- this->avi->video_type = BUF_VIDEO_WMV8;
- break;
- default:
+ this->avi->video_type = fourcc_to_buf_video((void*)&this->avi->bih.biCompression);
+
+ if ( !this->avi->video_type ) {
printf ("demux_avi: unknown avi format %.4s\n",
(char*)&this->avi->bih.biCompression);
@@ -1082,6 +994,7 @@ static void demux_avi_start (demux_plugin_t *this_gen,
return;
}
buf->type = this->avi->video_type;
+ printf ("demux_avi: video codec >%s<\n",buf_video_name(buf->type));
this->video_fifo->put (this->video_fifo, buf);
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 8e5b3fe78..a28edafef 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.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: demux_qt.c,v 1.9 2001/10/25 00:47:00 miguelfreitas Exp $
+ * $Id: demux_qt.c,v 1.10 2001/11/07 18:26:36 miguelfreitas Exp $
*
* demultiplexer for quicktime streams, based on:
*
@@ -4148,36 +4148,19 @@ static int demux_qt_detect_compressors (demux_qt_t *this) {
this->video_step = 90000.0 / quicktime_frame_rate (this->qt, 0);
- if (!strncasecmp (video, "cvid", 4)) {
- this->video_type = BUF_VIDEO_CINEPAK;
-
+ this->video_type = fourcc_to_buf_video( video );
+
+ if (this->video_type == BUF_VIDEO_CINEPAK) {
this->bih.biCompression=mmioFOURCC('c', 'v', 'i', 'd');
-
- } else if (!strncasecmp (video, "jpeg", 4))
- this->video_type = BUF_VIDEO_JPEG;
- else if (!strncasecmp (video, "3IV1", 4))
- this->video_type = BUF_VIDEO_MSMPEG4_V3;
- else if (!strncasecmp (video, "raw ", 4))
- this->video_type = BUF_VIDEO_RGB;
- else if (!strncasecmp (video, "yuv2", 4))
- this->video_type = BUF_VIDEO_YUY2;
- else if (!strncasecmp (video, "mpeg", 4))
- this->video_type = BUF_VIDEO_MPEG;
- else if (!strncasecmp (video, "mjpa", 4))
- this->video_type = BUF_VIDEO_MJPEG;
- else if (!strncasecmp (video, "mjpb", 4))
- this->video_type = BUF_VIDEO_MJPEG;
- else if (!strncasecmp (video, "svq1", 4))
- this->video_type = BUF_VIDEO_SORENSON;
- else if (!strncasecmp (video, "svqi", 4))
- this->video_type = BUF_VIDEO_SORENSON;
- else {
- printf ("demux_qt: unknown video codec >%s<\n",
- video);
+ }
+
+ if (!this->video_type ) {
+ printf ("demux_qt: unknown video codec >%s<\n",video);
return 0;
}
-
-
+
+ printf ("demux_qt: video codec >%s<\n",buf_video_name(this->video_type));
+
audio = quicktime_audio_compressor (this->qt, 0);
this->wavex.nChannels = quicktime_track_channels (this->qt, 0);
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am
index d91dfd54b..ad67530f2 100644
--- a/src/xine-engine/Makefile.am
+++ b/src/xine-engine/Makefile.am
@@ -8,7 +8,7 @@ CFLAGS = @GLOBAL_CFLAGS@ @THREAD_CFLAGS@
lib_LTLIBRARIES = libxine.la
libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \
- load_plugins.c video_decoder.c \
+ load_plugins.c video_decoder.c buffer_types.c \
audio_decoder.c video_out.c audio_out.c resample.c events.c lrb.c
libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) -lm
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index dd47d1c74..edee1c32c 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -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: buffer.h,v 1.20 2001/11/06 21:46:05 miguelfreitas Exp $
+ * $Id: buffer.h,v 1.21 2001/11/07 18:26:36 miguelfreitas Exp $
*
*
* contents:
@@ -192,6 +192,11 @@ struct fifo_buffer_s
fifo_buffer_t *fifo_buffer_new (int num_buffers, uint32_t buf_size);
+
+/* provide BUF_VIDEO_xxx given the fourcc */
+uint32_t fourcc_to_buf_video( void * fourcc );
+char * buf_video_name( uint32_t buf_type );
+
#ifdef __cplusplus
}
#endif