Commit b3b99a16 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/: proper generation of pts in the video decoder + couple of bug fixes + cleanup.
   The ffmpeg video decoder can now be used to decode mpeg1/2 videos as well.
* modules/codec/libmpeg2.c: upped priority so it will be used to decode mpeg1/2 videos instead of ffmpeg.
parent 48ab4989
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library * ffmpeg.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.46 2003/07/18 19:26:22 titer Exp $ * $Id: ffmpeg.c,v 1.47 2003/08/08 17:08:32 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -433,14 +433,12 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc, ...@@ -433,14 +433,12 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
switch( i_fourcc ) switch( i_fourcc )
{ {
#if 0
/* XXX don't use it */
case FOURCC_mpgv: case FOURCC_mpgv:
i_cat = VIDEO_ES; i_cat = VIDEO_ES;
i_codec = CODEC_ID_MPEG1VIDEO; i_codec = CODEC_ID_MPEG1VIDEO;
psz_name = "MPEG-1/2 Video"; psz_name = "MPEG-1/2 Video";
break; break;
#endif
case FOURCC_DIV1: case FOURCC_DIV1:
case FOURCC_div1: case FOURCC_div1:
case FOURCC_MPG4: case FOURCC_MPG4:
...@@ -645,6 +643,3 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc, ...@@ -645,6 +643,3 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
return( VLC_FALSE ); return( VLC_FALSE );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library * ffmpeg_vdec.h: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.21 2003/07/18 19:26:22 titer Exp $ * $Id: ffmpeg.h,v 1.22 2003/08/08 17:08:32 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
\ \
AVCodecContext *p_context; \ AVCodecContext *p_context; \
AVCodec *p_codec; \ AVCodec *p_codec; \
mtime_t input_pts_previous; \
mtime_t input_pts; \
mtime_t pts; \ mtime_t pts; \
\ \
/* Private stuff for frame gathering */ \ /* Private stuff for frame gathering */ \
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.h: video decoder using ffmpeg library * video.h: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video.h,v 1.9 2003/06/17 21:07:50 gbazin Exp $ * $Id: video.h,v 1.10 2003/08/08 17:08:32 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -43,8 +43,6 @@ typedef struct vdec_thread_s ...@@ -43,8 +43,6 @@ typedef struct vdec_thread_s
int i_frame_late; /* how many decoded frames are late */ int i_frame_late; /* how many decoded frames are late */
mtime_t i_frame_late_start; mtime_t i_frame_late_start;
int i_frame_count; /* to emulate pts */
/* for direct rendering */ /* for direct rendering */
int b_direct_rendering; int b_direct_rendering;
} vdec_thread_t; } vdec_thread_t;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: libmpeg2.c,v 1.23 2003/07/13 12:15:23 massiot Exp $ * $Id: libmpeg2.c,v 1.24 2003/08/08 17:08:32 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -92,7 +92,7 @@ static picture_t *GetNewPicture( dec_thread_t *, uint8_t ** ); ...@@ -92,7 +92,7 @@ static picture_t *GetNewPicture( dec_thread_t *, uint8_t ** );
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
set_description( _("MPEG I/II video decoder (using libmpeg2)") ); set_description( _("MPEG I/II video decoder (using libmpeg2)") );
set_capability( "decoder", 40 ); set_capability( "decoder", 150 );
set_callbacks( OpenDecoder, NULL ); set_callbacks( OpenDecoder, NULL );
add_shortcut( "libmpeg2" ); add_shortcut( "libmpeg2" );
vlc_module_end(); vlc_module_end();
......
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