Commit be0f3d85 authored by Laurent Aimar's avatar Laurent Aimar

* all: with mpeg4 video I changed the way that some initialisation data

are passed (more logical).
parent d387c508
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c: video decoder using ffmpeg library * video.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.12 2002/12/10 10:22:04 fenrir Exp $ * $Id: video.c,v 1.13 2002/12/14 18:57:34 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -362,11 +362,13 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec ) ...@@ -362,11 +362,13 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
switch( p_vdec->i_codec_id ) switch( p_vdec->i_codec_id )
{ {
case( CODEC_ID_MPEG4 ): case( CODEC_ID_MPEG4 ):
#if 0
avcodec_decode_video( p_vdec->p_context, p_vdec->p_ff_pic, avcodec_decode_video( p_vdec->p_context, p_vdec->p_ff_pic,
&b_gotpicture, &b_gotpicture,
(void *)&p_vdec->p_format[1], (void *)&p_vdec->p_format[1],
p_vdec->p_format->biSize p_vdec->p_format->biSize
- sizeof(BITMAPINFOHEADER) ); - sizeof(BITMAPINFOHEADER) );
#endif
break; break;
default: default:
if( p_vdec->p_fifo->i_fourcc == FOURCC_MP4S || if( p_vdec->p_fifo->i_fourcc == FOURCC_MP4S ||
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc * mp4.c : MP4 file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.9 2002/12/06 16:34:06 sam Exp $ * $Id: mp4.c,v 1.10 2002/12/14 18:57:34 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -906,6 +906,7 @@ static void MP4_StartDecoder( input_thread_t *p_input, ...@@ -906,6 +906,7 @@ static void MP4_StartDecoder( input_thread_t *p_input,
unsigned int i_decoder_specific_info_len; unsigned int i_decoder_specific_info_len;
uint8_t * p_decoder_specific_info; uint8_t * p_decoder_specific_info;
pes_packet_t *p_pes_init;
uint8_t *p_init; uint8_t *p_init;
BITMAPINFOHEADER *p_bih; BITMAPINFOHEADER *p_bih;
...@@ -975,6 +976,7 @@ static void MP4_StartDecoder( input_thread_t *p_input, ...@@ -975,6 +976,7 @@ static void MP4_StartDecoder( input_thread_t *p_input,
i_decoder_specific_info_len = 0; i_decoder_specific_info_len = 0;
p_decoder_specific_info = NULL; p_decoder_specific_info = NULL;
p_pes_init = NULL;
/* now see if esds is present and if so create a data packet /* now see if esds is present and if so create a data packet
with decoder_specific_info */ with decoder_specific_info */
...@@ -1083,9 +1085,34 @@ static void MP4_StartDecoder( input_thread_t *p_input, ...@@ -1083,9 +1085,34 @@ static void MP4_StartDecoder( input_thread_t *p_input,
if( i_decoder_specific_info_len ) if( i_decoder_specific_info_len )
{ {
data_packet_t *p_data;
memcpy( p_init + sizeof( BITMAPINFOHEADER ), memcpy( p_init + sizeof( BITMAPINFOHEADER ),
p_decoder_specific_info, p_decoder_specific_info,
i_decoder_specific_info_len); i_decoder_specific_info_len);
/* If stream is mpeg4 video we send specific_info,
as it's needed to decode it (vol) */
switch( p_demux_track->p_es->i_fourcc )
{
case VLC_FOURCC( 'm','p','4','v' ):
case VLC_FOURCC( 'D','I','V','X' ):
case VLC_FOURCC( 'd','i','v','x' ):
p_pes_init = input_NewPES( p_input->p_method_data );
p_data = input_NewPacket( p_input->p_method_data,
i_decoder_specific_info_len);
memcpy( p_data->p_payload_start,
p_decoder_specific_info,
i_decoder_specific_info_len );
p_pes_init->i_dts = p_pes_init->i_pts = 0;
p_pes_init->p_first = p_pes_init->p_last = p_data;
p_pes_init->i_nb_data = 1;
p_pes_init->i_pes_size = i_decoder_specific_info_len;
break;
default:
break;
}
} }
break; break;
...@@ -1109,6 +1136,7 @@ static void MP4_StartDecoder( input_thread_t *p_input, ...@@ -1109,6 +1136,7 @@ static void MP4_StartDecoder( input_thread_t *p_input,
p_decoder_specific_info, p_decoder_specific_info,
i_decoder_specific_info_len); i_decoder_specific_info_len);
} }
break; break;
default: default:
...@@ -1121,6 +1149,10 @@ static void MP4_StartDecoder( input_thread_t *p_input, ...@@ -1121,6 +1149,10 @@ static void MP4_StartDecoder( input_thread_t *p_input,
input_SelectES( p_input, p_demux_track->p_es ); input_SelectES( p_input, p_demux_track->p_es );
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
if( p_pes_init != NULL )
{
input_DecodePES( p_demux_track->p_es->p_decoder_fifo, p_pes_init );
}
p_demux_track->b_ok = 1; p_demux_track->b_ok = 1;
p_demux_track->b_selected = 1; p_demux_track->b_selected = 1;
} }
......
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