Commit 36b7d8ef authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/theora.c, configure.ac.in, modules/codec/Modules.am: new
   theora codec plugin.
   This plugin is based on the experimental theora codec from the Xiph.Org
   foundation (http://www.theora.org/). Because the theora bitstream
   specifications are likely to change in the near future, this plugin won't
   be compiled by default. If you want to test/develop theora with vlc, you'll
   need to configure it with --enable-theora and also make sure you've got a
   fresh libogg from cvs.

* modules/demux/ogg.c: modified to handle theora and tarkin bitstreams.

* modules/codec/tarkin.c: fixed a few typos.
parent 22f2fa61
...@@ -1109,8 +1109,11 @@ AC_ARG_ENABLE(ogg, ...@@ -1109,8 +1109,11 @@ AC_ARG_ENABLE(ogg,
if test "x${enable_ogg}" != "xno" if test "x${enable_ogg}" != "xno"
then then
AC_CHECK_HEADERS(ogg/ogg.h, [ AC_CHECK_HEADERS(ogg/ogg.h, [
PLUGINS="${PLUGINS} ogg" AC_CHECK_LIB( ogg, oggpack_read, [
LDFLAGS_ogg="${LDFLAGS_ogg} -logg" PLUGINS="${PLUGINS} ogg"
LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
AC_CHECK_LIB( ogg, oggpackB_read, [
CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])])
],[]) ],[])
fi fi
...@@ -1497,6 +1500,7 @@ then ...@@ -1497,6 +1500,7 @@ then
BUILTINS="${BUILTINS} tarkin" BUILTINS="${BUILTINS} tarkin"
CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}" CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg" LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg"
AC_MSG_RESULT(yes)
else else
dnl The given tarkin tree wasn't built dnl The given tarkin tree wasn't built
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
...@@ -1506,6 +1510,23 @@ then ...@@ -1506,6 +1510,23 @@ then
fi fi
fi fi
dnl
dnl theora decoder plugin
dnl
AC_ARG_ENABLE(theora,
[ --enable-theora experimental theora codec (default disabled)])
if test "x${enable_theora}" = "xyes"
then
AC_CHECK_HEADERS(theora/theora.h, [
AC_CHECK_LIB(theora, theora_granule_time, [
BUILTINS="${BUILTINS} theora"
LDFLAGS_theora="${LDFLAGS_theora} -logg -ltheora" ],[
AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
You also need to check that you have a libogg posterior to the 1.0 release.])],
[-logg])
])
fi
dnl dnl
dnl Video plugins dnl Video plugins
dnl dnl
......
...@@ -3,5 +3,6 @@ SOURCES_lpcm = modules/codec/lpcm.c ...@@ -3,5 +3,6 @@ SOURCES_lpcm = modules/codec/lpcm.c
SOURCES_araw = modules/codec/araw.c SOURCES_araw = modules/codec/araw.c
SOURCES_vorbis = modules/codec/vorbis.c SOURCES_vorbis = modules/codec/vorbis.c
SOURCES_tarkin = modules/codec/tarkin.c SOURCES_tarkin = modules/codec/tarkin.c
SOURCES_theora = modules/codec/theora.c
SOURCES_dv = modules/codec/dv.c SOURCES_dv = modules/codec/dv.c
SOURCES_xvid = modules/codec/xvid.c SOURCES_xvid = modules/codec/xvid.c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* tarkin.c: tarkin decoder module making use of libtarkin. * tarkin.c: tarkin decoder module making use of libtarkin.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: tarkin.c,v 1.1 2002/11/18 13:28:09 gbazin Exp $ * $Id: tarkin.c,v 1.2 2002/11/20 14:09:57 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <tarkin.h> #include <tarkin.h>
/***************************************************************************** /*****************************************************************************
* dec_thread_t : vorbis decoder thread descriptor * dec_thread_t : tarkin decoder thread descriptor
*****************************************************************************/ *****************************************************************************/
typedef struct dec_thread_t typedef struct dec_thread_t
{ {
...@@ -59,10 +59,8 @@ typedef struct dec_thread_t ...@@ -59,10 +59,8 @@ typedef struct dec_thread_t
*/ */
TarkinStream *tarkin_stream; TarkinStream *tarkin_stream;
TarkinInfo ti; /* struct that stores all the static tarkin bitstream TarkinInfo ti; /* tarkin bitstream settings */
settings */ TarkinComment tc; /* tarkin bitstream user comments */
TarkinComment tc; /* struct that stores all the bitstream user
* comments */
TarkinTime tarkdate; TarkinTime tarkdate;
/* /*
...@@ -97,6 +95,7 @@ vlc_module_begin(); ...@@ -97,6 +95,7 @@ vlc_module_begin();
set_description( _("Tarkin decoder module") ); set_description( _("Tarkin decoder module") );
set_capability( "decoder", 100 ); set_capability( "decoder", 100 );
set_callbacks( OpenDecoder, NULL ); set_callbacks( OpenDecoder, NULL );
add_shortcut( "tarkin" );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
...@@ -149,7 +148,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo ) ...@@ -149,7 +148,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
if( tarkin_synthesis_headerin( &p_dec->ti, &p_dec->tc, &oggpacket ) < 0 ) if( tarkin_synthesis_headerin( &p_dec->ti, &p_dec->tc, &oggpacket ) < 0 )
{ {
msg_Err( p_dec->p_fifo, "This bitstream does not contain Tarkin " msg_Err( p_dec->p_fifo, "This bitstream does not contain Tarkin "
"vido data"); "video data");
goto error; goto error;
} }
...@@ -177,13 +176,13 @@ static int RunDecoder( decoder_fifo_t *p_fifo ) ...@@ -177,13 +176,13 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
/* Initialize the tarkin decoder */ /* Initialize the tarkin decoder */
tarkin_synthesis_init( p_dec->tarkin_stream, &p_dec->ti ); tarkin_synthesis_init( p_dec->tarkin_stream, &p_dec->ti );
/* vorbis decoder thread's main loop */ /* tarkin decoder thread's main loop */
while( (!p_dec->p_fifo->b_die) && (!p_dec->p_fifo->b_error) ) while( (!p_dec->p_fifo->b_die) && (!p_dec->p_fifo->b_error) )
{ {
DecodePacket( p_dec ); DecodePacket( p_dec );
} }
/* If b_error is set, the vorbis decoder thread enters the error loop */ /* If b_error is set, the tarkin decoder thread enters the error loop */
if( p_dec->p_fifo->b_error ) if( p_dec->p_fifo->b_error )
{ {
DecoderError( p_dec->p_fifo ); DecoderError( p_dec->p_fifo );
...@@ -229,29 +228,29 @@ static void DecodePacket( dec_thread_t *p_dec ) ...@@ -229,29 +228,29 @@ static void DecodePacket( dec_thread_t *p_dec )
tarkin_synthesis_packetin( p_dec->tarkin_stream, &oggpacket ); tarkin_synthesis_packetin( p_dec->tarkin_stream, &oggpacket );
while( tarkin_synthesis_frameout( p_dec->tarkin_stream, while( tarkin_synthesis_frameout( p_dec->tarkin_stream,
&rgb, 0, &p_dec->tarkdate ) == 0 ) &rgb, 0, &p_dec->tarkdate ) == 0 )
{ {
i_width = p_dec->tarkin_stream->layer->desc.width; i_width = p_dec->tarkin_stream->layer->desc.width;
i_height = p_dec->tarkin_stream->layer->desc.height; i_height = p_dec->tarkin_stream->layer->desc.height;
switch( p_dec->tarkin_stream->layer->desc.format ) switch( p_dec->tarkin_stream->layer->desc.format )
{ {
case TARKIN_RGB24: case TARKIN_RGB24:
i_chroma = VLC_FOURCC('R','V','2','4'); i_chroma = VLC_FOURCC('R','V','2','4');
break; break;
case TARKIN_RGB32: case TARKIN_RGB32:
i_chroma = VLC_FOURCC('R','V','3','2'); i_chroma = VLC_FOURCC('R','V','3','2');
break; break;
case TARKIN_RGBA: case TARKIN_RGBA:
i_chroma = VLC_FOURCC('R','G','B','A'); i_chroma = VLC_FOURCC('R','G','B','A');
break; break;
default: default:
i_chroma = VLC_FOURCC('Y','V','1','2'); i_chroma = VLC_FOURCC('Y','V','1','2');
break; break;
} }
i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height; i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height;
p_dec->p_vout = tarkin_SpawnVout( p_dec, i_width, i_height, p_dec->p_vout = tarkin_SpawnVout( p_dec, i_width, i_height,
i_aspect, i_chroma ); i_aspect, i_chroma );
/* Get a new picture */ /* Get a new picture */
while( !(p_pic = vout_CreatePicture( p_dec->p_vout, 0, 0, 0 ) ) ) while( !(p_pic = vout_CreatePicture( p_dec->p_vout, 0, 0, 0 ) ) )
...@@ -314,13 +313,13 @@ static void CloseDecoder( dec_thread_t * p_dec ) ...@@ -314,13 +313,13 @@ static void CloseDecoder( dec_thread_t * p_dec )
input_DeletePES( p_dec->p_fifo->p_packets_mgt, p_dec->p_pes ); input_DeletePES( p_dec->p_fifo->p_packets_mgt, p_dec->p_pes );
if( p_dec->p_vout ) if( p_dec->p_vout )
{ {
vlc_object_detach( p_dec->p_vout ); vlc_object_detach( p_dec->p_vout );
vout_DestroyThread( p_dec->p_vout ); vout_DestroyThread( p_dec->p_vout );
} }
if( p_dec->tarkin_stream ) if( p_dec->tarkin_stream )
tarkin_stream_destroy( p_dec->tarkin_stream ); tarkin_stream_destroy( p_dec->tarkin_stream );
free( p_dec ); free( p_dec );
} }
...@@ -392,22 +391,22 @@ static vout_thread_t *tarkin_SpawnVout( dec_thread_t *p_dec, ...@@ -392,22 +391,22 @@ static vout_thread_t *tarkin_SpawnVout( dec_thread_t *p_dec,
* picture_t structure. * picture_t structure.
*****************************************************************************/ *****************************************************************************/
static void tarkin_CopyPicture( dec_thread_t *p_dec, picture_t *p_pic, static void tarkin_CopyPicture( dec_thread_t *p_dec, picture_t *p_pic,
uint8_t *p_src ) uint8_t *p_src )
{ {
int i_plane, i_line, i_width, i_dst_stride; int i_plane, i_line, i_width, i_dst_stride;
u8 *p_dst; u8 *p_dst;
for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ ) for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
{ {
p_dst = p_pic->p[i_plane].p_pixels; p_dst = p_pic->p[i_plane].p_pixels;
i_width = p_pic->p[i_plane].i_visible_pitch; i_width = p_pic->p[i_plane].i_visible_pitch;
i_dst_stride = p_pic->p[i_plane].i_pitch; i_dst_stride = p_pic->p[i_plane].i_pitch;
for( i_line = 0; i_line < p_pic->p[i_plane].i_lines; i_line++ ) for( i_line = 0; i_line < p_pic->p[i_plane].i_lines; i_line++ )
{ {
p_dec->p_fifo->p_vlc->pf_memcpy( p_dst, p_src, i_width ); p_dec->p_fifo->p_vlc->pf_memcpy( p_dst, p_src, i_width );
p_src += i_width; p_src += i_width;
p_dst += i_dst_stride; p_dst += i_dst_stride;
} }
} }
} }
This diff is collapsed.
This diff is collapsed.
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