Commit 71f0ea69 authored by Laurent Aimar's avatar Laurent Aimar

* ffmpeg : add a new fourcc, ( 3IV2 you shoudln't be able to decode it

but sometimes it's in fact MPEG-4, thx titer ).

 * mp4 : add capability to read mov with mp3 track. But it seems that
mad doesn't like too much fragmented data packets, and thus breaks the
audio.( since with '--codec dummy' I'm able to read resulting audio file
without any problem :)
parent e42c8d0f
......@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.8 2002/07/23 17:19:02 fenrir Exp $
* $Id: ffmpeg.h,v 1.9 2002/07/23 22:42:20 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -86,6 +86,8 @@ typedef struct bitmapinfoheader_s
/* ?? */
#define FOURCC_3IV1 VLC_FOURCC('3','I','V','1')
#define FOURCC_3IV2 VLC_FOURCC('3','I','V','2')
/* H263 and H263i */
#define FOURCC_H263 VLC_FOURCC('H','2','6','3')
#define FOURCC_h263 VLC_FOURCC('h','2','6','3')
......@@ -164,6 +166,8 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
case FOURCC_DX50:
case FOURCC_mp4v:
case FOURCC_4:
case FOURCC_3IV2:
i_codec = CODEC_ID_MPEG4;
psz_name = "MPEG-4";
break;
......
......@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.5 2002/07/23 17:19:02 fenrir Exp $
* $Id: libmp4.c,v 1.6 2002/07/23 22:42:20 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -1312,60 +1312,6 @@ int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 );
}
#if 0
int MP4_ReadBox_sample_mp4v( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
MP4_READBOX_ENTER( MP4_Box_data_sample_mp4v_t );
for( i = 0; i < 6 ; i++ )
{
MP4_GET1BYTE( p_box->data.p_sample_mp4v->i_reserved1[i] );
}
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_data_reference_index );
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_predefined1 );
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_reserved2 );
for( i = 0; i < 3 ; i++ )
{
MP4_GET4BYTES( p_box->data.p_sample_mp4v->i_predefined2[i] );
}
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_width );
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_height );
MP4_GET4BYTES( p_box->data.p_sample_mp4v->i_horizresolution );
MP4_GET4BYTES( p_box->data.p_sample_mp4v->i_vertresolution );
MP4_GET4BYTES( p_box->data.p_sample_mp4v->i_reserved3 );
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_predefined3 );
/* This is a pascal string, padded to 32 bytes */
memcpy( &p_box->data.p_sample_mp4v->i_compressorname, p_peek+1, 31 );
p_box->data.p_sample_mp4v->i_compressorname[*p_peek] = 0;
p_peek += 32; i_read -= 32;
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_depth );
MP4_GET2BYTES( p_box->data.p_sample_mp4v->i_predefined4 );
MP4_SeekStream( p_stream, p_box->i_pos + MP4_BOX_HEADERSIZE( p_box ) + 78);
MP4_ReadBoxContainerRaw( p_stream, p_box ); /* esds */
#ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"mp4v\" in stsd %dx%d depth %d compressor %s",
p_box->data.p_sample_mp4v->i_width,
p_box->data.p_sample_mp4v->i_height,
p_box->data.p_sample_mp4v->i_depth,
p_box->data.p_sample_mp4v->i_compressorname );
#endif
MP4_READBOX_EXIT( 1 );
}
#endif
int MP4_ReadBox_stsd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
......@@ -1996,6 +1942,7 @@ static struct
/* for codecs */
{ FOURCC_soun, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC__mp3, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ms55, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_mp4a, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_vide, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
......@@ -2005,6 +1952,7 @@ static struct
{ FOURCC_h263, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_cvid, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_3IV1, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_3IV2, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_mjpa, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_mjpb, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_mjqt, NULL, NULL }, /* found in mjpa/b */
......
......@@ -2,7 +2,7 @@
* libmp4.h : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libmp4.h,v 1.5 2002/07/23 17:19:02 fenrir Exp $
* $Id: libmp4.h,v 1.6 2002/07/23 22:42:20 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -95,7 +95,9 @@
#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
#define FOURCC__mp3 VLC_FOURCC( '.', 'm', 'p', '3' )
#define FOURCC_ms55 VLC_FOURCC( 'm', 's', 0x0, 0x55 )
#define FOURCC_3IV1 VLC_FOURCC( '3', 'I', 'V', '1' )
#define FOURCC_3IV2 VLC_FOURCC( '3', 'I', 'V', '2' )
#define FOURCC_h263 VLC_FOURCC( 'h', '2', '6', '3' )
#define FOURCC_DIVX VLC_FOURCC( 'D', 'I', 'V', 'X' )
#define FOURCC_cvid VLC_FOURCC( 'c', 'v', 'i', 'd' )
......
......@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.6 2002/07/23 17:19:02 fenrir Exp $
* $Id: mp4.c,v 1.7 2002/07/23 22:42:20 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -790,12 +790,6 @@ static void MP4_StartDecoder( input_thread_t *p_input,
return;
}
if( !p_sample->data.p_data )
{
printf( "\nAhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh %.4s\n",
&p_sample->i_type );
return;
}
vlc_mutex_lock( &p_input->stream.stream_lock );
p_demux_track->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
......@@ -811,7 +805,18 @@ static void MP4_StartDecoder( input_thread_t *p_input,
p_demux_track->p_es->i_stream_id = p_demux_track->i_track_ID;
/* It's a little ugly but .. there are special cases */
switch( p_sample->i_type )
{
case( VLC_FOURCC( '.', 'm', 'p', '3' ) ):
case( VLC_FOURCC( 'm', 's', 0x00, 0x55 ) ):
p_demux_track->p_es->i_fourcc = VLC_FOURCC( 'm', 'p', 'g', 'a' );
break;
default:
p_demux_track->p_es->i_fourcc = p_sample->i_type;
break;
}
p_demux_track->p_es->i_cat = p_demux_track->i_cat;
i_decoder_specific_info_len = 0;
......
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