* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.76 2001/02/06 17:17:04 massiot Exp $
+ * $Id: vpar_headers.c,v 1.83 2001/05/01 04:18:18 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include "defs.h"
#include <stdlib.h> /* free() */
+#include <string.h> /* memcpy(), memset() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
-#include "plugins.h"
#include "intf_msg.h"
#include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h"
+#include "main.h" /* XXX REMOVE THIS */
+
/*
* Local prototypes
*/
break;
default:
+ break;
}
}
p_vpar->pi_default_intra_quant );
}
- if( GetBits( &p_vpar->bit_stream, 1 ) ) /* load_non_intra_quantizer_matrix */
+ if( GetBits(&p_vpar->bit_stream, 1) ) /* load_non_intra_quantizer_matrix */
{
LoadMatrix( p_vpar, &p_vpar->sequence.nonintra_quant );
}
p_vpar->sequence.i_chroma_format = GetBits( &p_vpar->bit_stream, 2 );
p_vpar->sequence.i_width |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
p_vpar->sequence.i_height |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
- /* bit_rate_extension, marker_bit, vbv_buffer_size_extension, low_delay */
+ /* bit_rate_extension, marker_bit, vbv_buffer_size_extension,
+ * low_delay */
RemoveBits( &p_vpar->bit_stream, 22 );
/* frame_rate_extension_n */
i_dummy = GetBits( &p_vpar->bit_stream, 2 );
/* Extension and User data */
ExtensionAndUserData( p_vpar );
+
+ /* XXX: The vout request and fifo opening will eventually be here */
+ if( p_main->p_vout == NULL )
+ {
+ intf_Msg( "vpar: no vout present, spawning one" );
+ p_main->p_vout = p_vpar->p_vout = vout_CreateThread( NULL );
+ }
}
/*****************************************************************************
int i_mb;
#endif
+ /* Recover in case of stream discontinuity. */
+ if( p_vpar->sequence.b_expect_discontinuity )
+ {
+ ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+ ReferenceUpdate( p_vpar, I_CODING_TYPE, NULL );
+ if( p_vpar->picture.p_picture != NULL )
+ {
+#ifdef VDEC_SMP
+ int i_mb;
+
+ for( i_mb = 0; p_vpar->picture.pp_mb[i_mb] != NULL; i_mb++ )
+ {
+ vpar_DestroyMacroblock( &p_vpar->vfifo,
+ p_vpar->picture.pp_mb[i_mb] );
+ }
+#endif
+ vout_DestroyPicture( p_vpar->p_vout, p_vpar->picture.p_picture );
+ }
+ p_vpar->sequence.b_expect_discontinuity = 0;
+ }
+
+ /* Parse the picture header. */
RemoveBits( &p_vpar->bit_stream, 10 ); /* temporal_reference */
p_vpar->picture.i_coding_type = GetBits( &p_vpar->bit_stream, 3 );
RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */
p_vpar->picture.i_current_structure = 0;
- intf_ErrMsg("vpar error: odd number of field pictures.");
+ intf_WarnMsg( 2, "Odd number of field pictures." );
}
/* Do we have the reference pictures ? */
{
/* This is a new frame. Get a structure from the video_output. */
while( ( P_picture = vout_CreatePicture( p_vpar->p_vout,
- 99+p_vpar->sequence.i_chroma_format, /*XXX??*/
+ /* XXX */ 99+p_vpar->sequence.i_chroma_format,
p_vpar->sequence.i_width,
p_vpar->sequence.i_height ) )
== NULL )
#ifdef VDEC_SMP
/* Link referenced pictures for the decoder
- * They are unlinked in vpar_ReleaseMacroblock() & vpar_DestroyMacroblock() */
+ * They are unlinked in vpar_ReleaseMacroblock() &
+ * vpar_DestroyMacroblock() */
if( p_vpar->picture.i_coding_type == P_CODING_TYPE ||
p_vpar->picture.i_coding_type == B_CODING_TYPE )
{
CopyrightExtension( p_vpar );
break;
default:
+ break;
}
break;