[Mplayer-cvslog] CVS: main/libmpdemux Makefile,1.49,1.50 demuxer.c,1.133,1.134 demuxer.h,1.55,1.56 video.c,1.32,1.33
Arpi of Ize
arpi at mplayerhq.hu
Tue Jan 28 01:12:26 CET 2003
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv32263/libmpdemux
Modified Files:
Makefile demuxer.c demuxer.h video.c
Log Message:
libgif/libungif based demuxer support for libmpdemux.
patch by Joey Parrish <joey at nicewarrior.org>
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Makefile 22 Jan 2003 23:51:04 -0000 1.49
+++ Makefile 28 Jan 2003 00:12:23 -0000 1.50
@@ -3,7 +3,7 @@
include ../config.mak
-SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c
+SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c
ifeq ($(XMMS_PLUGINS),yes)
SRCS += demux_xmms.c
endif
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- demuxer.c 23 Jan 2003 02:12:15 -0000 1.133
+++ demuxer.c 28 Jan 2003 00:12:23 -0000 1.134
@@ -133,6 +133,7 @@
extern void demux_close_pva(demuxer_t* demuxer);
extern void demux_close_smjpeg(demuxer_t* demuxer);
extern void demux_close_xmms(demuxer_t* demuxer);
+extern void demux_close_gif(demuxer_t* demuxer);
#ifdef USE_TV
#include "tv.h"
@@ -199,6 +200,10 @@
case DEMUXER_TYPE_XMMS:
demux_close_xmms(demuxer); break;
#endif
+#ifdef HAVE_GIF
+ case DEMUXER_TYPE_GIF:
+ demux_close_gif(demuxer); break;
+#endif
}
// free streams:
@@ -276,6 +281,7 @@
int demux_audio_fill_buffer(demux_stream_t *ds);
int demux_pva_fill_buffer(demuxer_t *demux);
int demux_xmms_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
+int demux_gif_fill_buffer(demuxer_t *demux);
extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
extern int demux_ogg_fill_buffer(demuxer_t *d);
@@ -325,6 +331,9 @@
case DEMUXER_TYPE_RTP: return demux_rtp_fill_buffer(demux, ds);
#endif
case DEMUXER_TYPE_SMJPEG: return demux_smjpeg_fill_buffer(demux);
+#ifdef HAVE_GIF
+ case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux);
+#endif
}
return 0;
}
@@ -549,6 +558,8 @@
extern int demux_open_smjpeg(demuxer_t* demuxer);
extern int bmp_check_file(demuxer_t *demuxer);
extern int demux_xmms_open(demuxer_t* demuxer);
+extern int gif_check_file(demuxer_t *demuxer);
+extern int demux_open_gif(demuxer_t* demuxer);
extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer);
@@ -758,6 +769,19 @@
demuxer = NULL;
}
}
+#ifdef HAVE_GIF
+//=============== Try to open as GIF file: =================
+if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_GIF){
+ demuxer=new_demuxer(stream,DEMUXER_TYPE_GIF,audio_id,video_id,dvdsub_id);
+ if(gif_check_file(demuxer)){
+ mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_Detected_XXX_FileFormat,"GIF");
+ file_format=DEMUXER_TYPE_GIF;
+ } else {
+ free_demuxer(demuxer);
+ demuxer = NULL;
+ }
+}
+#endif
//=============== Try to open as BMP file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_BMP){
demuxer=new_demuxer(stream,DEMUXER_TYPE_BMP,audio_id,video_id,dvdsub_id);
@@ -958,6 +982,12 @@
if (!demux_open_film(demuxer)) return NULL;
break;
}
+#ifdef HAVE_GIF
+ case DEMUXER_TYPE_GIF: {
+ if (!demux_open_gif(demuxer)) return NULL;
+ break;
+ }
+#endif
case DEMUXER_TYPE_BMP: {
if (!demux_open_bmp(demuxer)) return NULL;
break;
Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- demuxer.h 23 Jan 2003 02:12:15 -0000 1.55
+++ demuxer.h 28 Jan 2003 00:12:23 -0000 1.56
@@ -36,11 +36,12 @@
#define DEMUXER_TYPE_XMMS 25
#define DEMUXER_TYPE_RAWVIDEO 26
#define DEMUXER_TYPE_MPEG4_ES 27
+#define DEMUXER_TYPE_GIF 28
// This should always match the higest demuxer type number.
// Unless you want to disallow users to force the demuxer to some types
#define DEMUXER_TYPE_MIN 0
-#define DEMUXER_TYPE_MAX 27
+#define DEMUXER_TYPE_MAX 28
#define DEMUXER_TYPE_DEMUXERS (1<<16)
// A virtual demuxer type for the network code
Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- video.c 23 Jan 2003 02:12:15 -0000 1.32
+++ video.c 28 Jan 2003 00:12:23 -0000 1.33
@@ -412,6 +412,9 @@
// frame_time = 1/25.0;
}
}
+ case DEMUXER_TYPE_GIF:
+ frame_time=d_video->pts-pts1;
+ break;
}
if(demuxer->file_format==DEMUXER_TYPE_MPEG_PS ||
More information about the MPlayer-cvslog
mailing list