Commit 1ef00c88 authored by Laurent Aimar's avatar Laurent Aimar

* ffmpeg: disable direct rendering by default. I have too many files

that don't work with it (I don't see why it doesn't work :(
 * mp4: fix a bug in timestamp calculation. Replace s/u* by s/uint*_t
 * avi : remove an useless debug message.
 * src/misc/objects.c : fix stream output object allocation.
parent 2c91229a
...@@ -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.15 2002/11/10 02:47:27 fenrir Exp $ * $Id: ffmpeg.c,v 1.16 2002/11/17 06:46:55 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -98,7 +98,7 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t, int *, int *, char ** ); ...@@ -98,7 +98,7 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t, int *, int *, char ** );
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("Ffmpeg"), NULL ); add_category_hint( N_("Ffmpeg"), NULL );
#if LIBAVCODEC_BUILD >= 4615 #if LIBAVCODEC_BUILD >= 4615
add_bool( "ffmpeg-dr", 1, NULL, add_bool( "ffmpeg-dr", 0, NULL,
"direct rendering", "direct rendering",
"direct rendering" ); "direct rendering" );
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc * avi.c : AVI file Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.13 2002/11/16 22:25:07 fenrir Exp $ * $Id: avi.c,v 1.14 2002/11/17 06:46:56 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
...@@ -1108,8 +1108,6 @@ static int AVIInit( vlc_object_t * p_this ) ...@@ -1108,8 +1108,6 @@ static int AVIInit( vlc_object_t * p_this )
{ {
// already at begining of p_movi // already at begining of p_movi
} }
msg_Info( p_input, "skipping 12 bytes" );
AVI_SkipBytes( p_input, 12 ); // enter in p_movi AVI_SkipBytes( p_input, 12 ); // enter in p_movi
p_avi->i_movi_begin = p_movi->i_chunk_pos; p_avi->i_movi_begin = p_movi->i_chunk_pos;
......
This diff is collapsed.
This diff is collapsed.
...@@ -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.4 2002/09/17 11:57:38 fenrir Exp $ * $Id: mp4.c,v 1.5 2002/11/17 06:46:56 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
...@@ -73,14 +73,14 @@ static int MP4_ReadSample(); ...@@ -73,14 +73,14 @@ static int MP4_ReadSample();
static int MP4_DecodeSample(); static int MP4_DecodeSample();
#define MP4_Set4BytesLE( p, dw ) \ #define MP4_Set4BytesLE( p, dw ) \
*((u8*)p) = ( (dw)&0xff ); \ *((uint8_t*)p) = ( (dw)&0xff ); \
*((u8*)p+1) = ( ((dw)>> 8)&0xff ); \ *((uint8_t*)p+1) = ( ((dw)>> 8)&0xff ); \
*((u8*)p+2) = ( ((dw)>>16)&0xff ); \ *((uint8_t*)p+2) = ( ((dw)>>16)&0xff ); \
*((u8*)p+3) = ( ((dw)>>24)&0xff ) *((uint8_t*)p+3) = ( ((dw)>>24)&0xff )
#define MP4_Set2BytesLE( p, dw ) \ #define MP4_Set2BytesLE( p, dw ) \
*((u8*)p) = ( (dw)&0xff ); \ *((uint8_t*)p) = ( (dw)&0xff ); \
*((u8*)p+1) = ( ((dw)>> 8)&0xff ) *((uint8_t*)p+1) = ( ((dw)>> 8)&0xff )
/***************************************************************************** /*****************************************************************************
...@@ -88,19 +88,19 @@ static int MP4_DecodeSample(); ...@@ -88,19 +88,19 @@ static int MP4_DecodeSample();
*****************************************************************************/ *****************************************************************************/
static int MP4Init( vlc_object_t * p_this ) static int MP4Init( vlc_object_t * p_this )
{ {
input_thread_t *p_input = (input_thread_t *)p_this; input_thread_t *p_input = (input_thread_t *)p_this;
u8 *p_peek; uint8_t *p_peek;
u32 i_type; uint32_t i_type;
demux_sys_t *p_demux; demux_sys_t *p_demux;
MP4_Box_t *p_ftyp; MP4_Box_t *p_ftyp;
MP4_Box_t *p_mvhd; MP4_Box_t *p_mvhd;
MP4_Box_t *p_trak; MP4_Box_t *p_trak;
int i; int i;
/* I need to seek */ /* I need to seek */
if( !p_input->stream.b_seekable ) if( !p_input->stream.b_seekable )
{ {
...@@ -351,7 +351,6 @@ static int MP4Demux( input_thread_t *p_input ) ...@@ -351,7 +351,6 @@ static int MP4Demux( input_thread_t *p_input )
{ {
continue; /* no need to read something */ continue; /* no need to read something */
} }
while( MP4_GetTrackPTS( &p_demux->track[i_track] ) < while( MP4_GetTrackPTS( &p_demux->track[i_track] ) <
MP4_GetMoviePTS( p_demux ) ) MP4_GetMoviePTS( p_demux ) )
{ {
...@@ -769,13 +768,13 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -769,13 +768,13 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
as a unique type */ as a unique type */
/* TODO use also stss and stsh table for seeking */ /* TODO use also stss and stsh table for seeking */
/* FIXME use edit table */ /* FIXME use edit table */
int i_sample; int64_t i_sample;
int i_chunk; int64_t i_chunk;
int i_index; int64_t i_index;
int i_index_sample_used; int64_t i_index_sample_used;
u64 i_last_dts; int64_t i_last_dts;
p_stts = MP4_BoxGet( p_demux_track->p_stbl, "stts" ); p_stts = MP4_BoxGet( p_demux_track->p_stbl, "stts" );
p_stsz = MP4_BoxGet( p_demux_track->p_stbl, "stsz" ); /* FIXME and stz2 */ p_stsz = MP4_BoxGet( p_demux_track->p_stbl, "stsz" ); /* FIXME and stz2 */
...@@ -802,7 +801,7 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -802,7 +801,7 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
/* 2: each sample can have a different size */ /* 2: each sample can have a different size */
p_demux_track->i_sample_size = 0; p_demux_track->i_sample_size = 0;
p_demux_track->p_sample_size = p_demux_track->p_sample_size =
calloc( p_demux_track->i_sample_count, sizeof( u32 ) ); calloc( p_demux_track->i_sample_count, sizeof( uint32_t ) );
for( i_sample = 0; i_sample < p_demux_track->i_sample_count; i_sample++ ) for( i_sample = 0; i_sample < p_demux_track->i_sample_count; i_sample++ )
{ {
...@@ -819,18 +818,20 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -819,18 +818,20 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
i_last_dts = 0; i_last_dts = 0;
i_index = 0; i_index_sample_used =0; i_index = 0; i_index_sample_used =0;
/* create and init last data for each chunk */ /* create and init last data for each chunk */
for(i_chunk = 0 ; i_chunk < p_demux_track->i_chunk_count; i_chunk++ ) for(i_chunk = 0 ; i_chunk < p_demux_track->i_chunk_count; i_chunk++ )
{ {
int i_entry, i_sample_count, i; int64_t i_entry, i_sample_count, i;
/* save last dts */ /* save last dts */
p_demux_track->chunk[i_chunk].i_first_dts = i_last_dts; p_demux_track->chunk[i_chunk].i_first_dts = i_last_dts;
/* count how many entries needed for this chunk /* count how many entries needed for this chunk
for p_sample_delta_dts and p_sample_count_dts */ for p_sample_delta_dts and p_sample_count_dts */
i_entry = 0;
i_sample_count = p_demux_track->chunk[i_chunk].i_sample_count; i_sample_count = p_demux_track->chunk[i_chunk].i_sample_count;
i_entry = 0;
while( i_sample_count > 0 ) while( i_sample_count > 0 )
{ {
i_sample_count -= p_stts->data.p_stts->i_sample_count[i_index+i_entry]; i_sample_count -= p_stts->data.p_stts->i_sample_count[i_index+i_entry];
...@@ -841,24 +842,26 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -841,24 +842,26 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
} }
i_entry++; i_entry++;
} }
/* allocate them */ /* allocate them */
p_demux_track->chunk[i_chunk].p_sample_count_dts = p_demux_track->chunk[i_chunk].p_sample_count_dts =
calloc( i_entry, sizeof( u32 ) ); calloc( i_entry, sizeof( uint32_t ) );
p_demux_track->chunk[i_chunk].p_sample_delta_dts = p_demux_track->chunk[i_chunk].p_sample_delta_dts =
calloc( i_entry, sizeof( u32 ) ); calloc( i_entry, sizeof( uint32_t ) );
/* now copy */ /* now copy */
i_sample_count = p_demux_track->chunk[i_chunk].i_sample_count; i_sample_count = p_demux_track->chunk[i_chunk].i_sample_count;
for( i = 0; i < i_entry; i++ ) for( i = 0; i < i_entry; i++ )
{ {
int i_used; int64_t i_used;
int i_rest; int64_t i_rest;
i_rest = p_stts->data.p_stts->i_sample_count[i_index] - i_index_sample_used; i_rest = p_stts->data.p_stts->i_sample_count[i_index] - i_index_sample_used;
i_used = __MIN( i_rest, i_sample_count ); i_used = __MIN( i_rest, i_sample_count );
i_index_sample_used += i_used; i_index_sample_used += i_used;
i_sample_count -= i_used;
p_demux_track->chunk[i_chunk].p_sample_count_dts[i] = i_used; p_demux_track->chunk[i_chunk].p_sample_count_dts[i] = i_used;
...@@ -871,6 +874,7 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -871,6 +874,7 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
if( i_index_sample_used >= if( i_index_sample_used >=
p_stts->data.p_stts->i_sample_count[i_index] ) p_stts->data.p_stts->i_sample_count[i_index] )
{ {
i_index++; i_index++;
i_index_sample_used = 0; i_index_sample_used = 0;
} }
...@@ -879,9 +883,10 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -879,9 +883,10 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
} }
msg_Dbg( p_input, msg_Dbg( p_input,
"track[Id 0x%x] read %d samples", "track[Id 0x%x] read %d samples length:"I64Fd"s",
p_demux_track->i_track_ID, p_demux_track->i_track_ID,
p_demux_track->i_sample_count ); p_demux_track->i_sample_count,
i_last_dts / p_demux_track->i_timescale );
return( 1 ); return( 1 );
} }
...@@ -889,16 +894,16 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -889,16 +894,16 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
static void MP4_StartDecoder( input_thread_t *p_input, static void MP4_StartDecoder( input_thread_t *p_input,
track_data_mp4_t *p_demux_track ) track_data_mp4_t *p_demux_track )
{ {
MP4_Box_t *p_sample; MP4_Box_t *p_sample;
int i; int i;
int i_chunk; int i_chunk;
int i_decoder_specific_info_len; int i_decoder_specific_info_len;
u8 *p_decoder_specific_info; uint8_t *p_decoder_specific_info;
u8 *p_init; uint8_t *p_init;
MP4_Box_t *p_esds; MP4_Box_t *p_esds;
if( (!p_demux_track->b_ok )||( p_demux_track->i_cat == UNKNOWN_ES ) ) if( (!p_demux_track->b_ok )||( p_demux_track->i_cat == UNKNOWN_ES ) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.h : MP4 file input module for vlc * mp4.h : MP4 file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mp4.h,v 1.3 2002/09/17 11:57:38 fenrir Exp $ * $Id: mp4.h,v 1.4 2002/11/17 06:46:56 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
...@@ -27,28 +27,28 @@ ...@@ -27,28 +27,28 @@
*****************************************************************************/ *****************************************************************************/
typedef struct bitmapinfoheader_s typedef struct bitmapinfoheader_s
{ {
u32 i_size; /* size of header 40 + size of data follwoing this header */ uint32_t i_size; /* size of header 40 + size of data follwoing this header */
u32 i_width; uint32_t i_width;
u32 i_height; uint32_t i_height;
u16 i_planes; uint16_t i_planes;
u16 i_bitcount; uint16_t i_bitcount;
u32 i_compression; uint32_t i_compression;
u32 i_sizeimage; uint32_t i_sizeimage;
u32 i_xpelspermeter; uint32_t i_xpelspermeter;
u32 i_ypelspermeter; uint32_t i_ypelspermeter;
u32 i_clrused; uint32_t i_clrused;
u32 i_clrimportant; uint32_t i_clrimportant;
} bitmapinfoheader_t; } bitmapinfoheader_t;
typedef struct waveformatex_s typedef struct waveformatex_s
{ {
u16 i_format; uint16_t i_format;
u16 i_channels; uint16_t i_channels;
u32 i_samplepersec; uint32_t i_samplepersec;
u32 i_avgbytespersec; uint32_t i_avgbytespersec;
u16 i_blockalign; uint16_t i_blockalign;
u16 i_bitspersample; uint16_t i_bitspersample;
u16 i_size; /* This give size of data uint16_t i_size; /* This give size of data
imediatly following this header. */ imediatly following this header. */
} waveformatex_t; } waveformatex_t;
...@@ -57,18 +57,18 @@ typedef struct waveformatex_s ...@@ -57,18 +57,18 @@ typedef struct waveformatex_s
*****************************************************************************/ *****************************************************************************/
typedef struct chunk_data_mp4_s typedef struct chunk_data_mp4_s
{ {
u64 i_offset; /* absolute position of this chunk in the file */ uint64_t i_offset; /* absolute position of this chunk in the file */
u32 i_sample_description_index; /* index for SampleEntry to use */ uint32_t i_sample_description_index; /* index for SampleEntry to use */
u32 i_sample_count; /* how many samples in this chunk */ uint32_t i_sample_count; /* how many samples in this chunk */
u32 i_sample_first; /* index of the first sample in this chunk */ uint32_t i_sample_first; /* index of the first sample in this chunk */
/* now provide way to calculate pts, dts, and offset without to /* now provide way to calculate pts, dts, and offset without to
much memory and with fast acces */ much memory and with fast acces */
/* with this we can calculate dts/pts without waste memory */ /* with this we can calculate dts/pts without waste memory */
u64 i_first_dts; uint64_t i_first_dts;
u32 *p_sample_count_dts; uint32_t *p_sample_count_dts;
u32 *p_sample_delta_dts; /* dts delta */ uint32_t *p_sample_delta_dts; /* dts delta */
/* TODO if needed add pts /* TODO if needed add pts
but quickly *add* support for edts and seeking */ but quickly *add* support for edts and seeking */
...@@ -93,22 +93,22 @@ typedef struct track_data_mp4_s ...@@ -93,22 +93,22 @@ typedef struct track_data_mp4_s
int i_height; int i_height;
/* more internal data */ /* more internal data */
u64 i_timescale; /* time scale for this track only */ uint64_t i_timescale; /* time scale for this track only */
/* give the next sample to read, i_chunk is to find quickly where /* give the next sample to read, i_chunk is to find quickly where
the sample is located */ the sample is located */
u32 i_sample; /* next sample to read */ uint32_t i_sample; /* next sample to read */
u32 i_chunk; /* chunk where next sample is stored */ uint32_t i_chunk; /* chunk where next sample is stored */
/* total count of chunk and sample */ /* total count of chunk and sample */
u32 i_chunk_count; uint32_t i_chunk_count;
u32 i_sample_count; uint32_t i_sample_count;
chunk_data_mp4_t *chunk; /* always defined for each chunk */ chunk_data_mp4_t *chunk; /* always defined for each chunk */
/* sample size, p_sample_size defined only if i_sample_size == 0 /* sample size, p_sample_size defined only if i_sample_size == 0
else i_sample_size is size for all sample */ else i_sample_size is size for all sample */
u32 i_sample_size; uint32_t i_sample_size;
u32 *p_sample_size; /* XXX perhaps add file offset if take uint32_t *p_sample_size; /* XXX perhaps add file offset if take
too much time to do sumations each time*/ too much time to do sumations each time*/
es_descriptor_t *p_es; /* vlc es for this track */ es_descriptor_t *p_es; /* vlc es for this track */
...@@ -130,19 +130,19 @@ struct demux_sys_t ...@@ -130,19 +130,19 @@ struct demux_sys_t
mtime_t i_pcr; mtime_t i_pcr;
u64 i_time; /* time position of the presentation in movie timescale */ uint64_t i_time; /* time position of the presentation in movie timescale */
u64 i_timescale; /* movie time scale */ uint64_t i_timescale; /* movie time scale */
u64 i_duration; /* movie duration */ uint64_t i_duration; /* movie duration */
int i_tracks; /* number of track */ int i_tracks; /* number of track */
track_data_mp4_t *track; /* array of track */ track_data_mp4_t *track; /* array of track */
}; };
static inline u64 MP4_GetTrackPos( track_data_mp4_t *p_track ) static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
{ {
int i_sample; int i_sample;
u64 i_pos; uint64_t i_pos;
i_pos = p_track->chunk[p_track->i_chunk].i_offset; i_pos = p_track->chunk[p_track->i_chunk].i_offset;
...@@ -168,9 +168,9 @@ static inline u64 MP4_GetTrackPos( track_data_mp4_t *p_track ) ...@@ -168,9 +168,9 @@ static inline u64 MP4_GetTrackPos( track_data_mp4_t *p_track )
/* Return time in s of a track */ /* Return time in s of a track */
static inline mtime_t MP4_GetTrackPTS( track_data_mp4_t *p_track ) static inline mtime_t MP4_GetTrackPTS( track_data_mp4_t *p_track )
{ {
int i_sample; int i_sample;
int i_index; int i_index;
u64 i_dts; uint64_t i_dts;
i_sample = p_track->i_sample - p_track->chunk[p_track->i_chunk].i_sample_first; i_sample = p_track->i_sample - p_track->chunk[p_track->i_chunk].i_sample_first;
i_dts = p_track->chunk[p_track->i_chunk].i_first_dts; i_dts = p_track->chunk[p_track->i_chunk].i_first_dts;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling * objects.c: vlc_object_t handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.28 2002/11/09 16:34:53 sam Exp $ * $Id: objects.c,v 1.29 2002/11/17 06:46:56 fenrir Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "audio_output.h" #include "audio_output.h"
#include "aout_internal.h" #include "aout_internal.h"
#include "stream_output.h"
#include "vlc_playlist.h" #include "vlc_playlist.h"
#include "interface.h" #include "interface.h"
...@@ -114,6 +115,10 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type ) ...@@ -114,6 +115,10 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
i_size = sizeof(aout_instance_t); i_size = sizeof(aout_instance_t);
psz_type = "audio output"; psz_type = "audio output";
break; break;
case VLC_OBJECT_SOUT:
i_size = sizeof(sout_instance_t);
psz_type = "stream output";
break;
default: default:
i_size = i_type > 0 i_size = i_type > 0
? i_type > sizeof(vlc_object_t) ? i_type > sizeof(vlc_object_t)
......
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