#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_osd.h>
-#include "vlc_bits.h"
+#include <vlc_bits.h>
/*****************************************************************************
* Module descriptor.
"calls 1\n" \
"packet assembly info 2\n" )
-vlc_module_begin();
- set_description( N_("Philips OGT (SVCD subtitle) decoder") );
- set_shortname( N_("SVCD subtitles") );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_SCODEC );
- set_capability( "decoder", 50 );
- set_callbacks( DecoderOpen, DecoderClose );
+vlc_module_begin ()
+ set_description( N_("Philips OGT (SVCD subtitle) decoder") )
+ set_shortname( N_("SVCD subtitles") )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_SCODEC )
+ set_capability( "decoder", 50 )
+ set_callbacks( DecoderOpen, DecoderClose )
add_integer ( MODULE_STRING "-debug", 0, NULL,
- DEBUG_TEXT, DEBUG_LONGTEXT, true );
+ DEBUG_TEXT, DEBUG_LONGTEXT, true )
- add_submodule();
- set_description( N_("Philips OGT (SVCD subtitle) packetizer") );
- set_capability( "packetizer", 50 );
- set_callbacks( PacketizerOpen, DecoderClose );
-vlc_module_end();
+ add_submodule ()
+ set_description( N_("Philips OGT (SVCD subtitle) packetizer") )
+ set_capability( "packetizer", 50 )
+ set_callbacks( PacketizerOpen, DecoderClose )
+vlc_module_end ()
/*****************************************************************************
* Local prototypes
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'o','g','t',' ' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_OGT )
return VLC_EGENERIC;
- }
p_dec->p_sys = p_sys = calloc( 1, sizeof( decoder_sys_t ) );
if( p_sys == NULL )
return VLC_ENOMEM;
- p_sys->i_debug = config_GetInt( p_this, MODULE_STRING "-debug" );
+ p_sys->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" );
- p_sys->i_image = -1;
+ p_sys->i_image = -1;
p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
p_sys->p_spu = NULL;
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'o','g','t',' ' ) );
+ es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_OGT );
p_dec->pf_decode_sub = Decode;
p_dec->pf_packetize = Packetize;
p_sys->i_image_length = p_sys->i_spu_size - p_sys->i_image_offset;
p_sys->metadata_length = p_sys->i_image_offset;
- if (p_sys && p_sys->i_debug & DECODE_DBG_PACKET)
+ if( p_sys->i_debug & DECODE_DBG_PACKET )
{
msg_Dbg( p_dec, "x-start: %d, y-start: %d, width: %d, height %d, "
"spu size: %zu, duration: %"PRIu64" (d:%zu p:%"PRIu16")",
p_sys->i_width, p_sys->i_height,
p_sys->i_spu_size, p_sys->i_duration,
p_sys->i_image_length, p_sys->i_image_offset);
-
+
for( i = 0; i < 4; i++ )
{
msg_Dbg( p_dec, "palette[%d]= T: %2x, Y: %2x, u: %2x, v: %2x", i,
int i;
/* Allocate the subpicture internal data. */
- p_spu = p_dec->pf_spu_buffer_new( p_dec );
+ p_spu = decoder_NewSubpicture( p_dec );
if( !p_spu ) return NULL;
p_spu->i_start = p_data->i_pts;
/* Create new subtitle region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
/**
The video on which the subtitle sits, is scaled, probably
Two candidates are the video and the other possibility would be
the access module.
*/
- fmt.i_aspect = VOUT_ASPECT_FACTOR;
+ fmt.i_sar_num = p_sys->i_height;
+ fmt.i_sar_den = p_sys->i_width;
fmt.i_width = fmt.i_visible_width = p_sys->i_width;
fmt.i_height = fmt.i_visible_height = p_sys->i_height;
if( !p_region )
{
msg_Err( p_dec, "cannot allocate SVCD subtitle region" );
- p_dec->pf_spu_buffer_del( p_dec, p_spu );
+ decoder_DeleteSubpicture( p_dec, p_spu );
return NULL;
}