#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
-#include "vlc_bits.h"
+#include <vlc_bits.h>
/* #define DEBUG_DVBSUB 1 */
static void CloseEncoder( vlc_object_t * );
static block_t *Encode ( encoder_t *, subpicture_t * );
-vlc_module_begin();
+vlc_module_begin ()
# define DVBSUB_CFG_PREFIX "dvbsub-"
- set_description( N_("DVB subtitles decoder") );
- set_capability( "decoder", 50 );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_SCODEC );
- set_callbacks( Open, Close );
-
- add_integer( DVBSUB_CFG_PREFIX "position", 8, NULL, POS_TEXT, POS_LONGTEXT, true );
- change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
- add_integer( DVBSUB_CFG_PREFIX "x", -1, NULL, POSX_TEXT, POSX_LONGTEXT, false );
- add_integer( DVBSUB_CFG_PREFIX "y", -1, NULL, POSY_TEXT, POSY_LONGTEXT, false );
+ set_description( N_("DVB subtitles decoder") )
+ set_shortname( N_("DVB subtitles") )
+ set_capability( "decoder", 50 )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_SCODEC )
+ set_callbacks( Open, Close )
+
+ add_integer( DVBSUB_CFG_PREFIX "position", 8, NULL, POS_TEXT, POS_LONGTEXT, true )
+ change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL )
+ add_integer( DVBSUB_CFG_PREFIX "x", -1, NULL, POSX_TEXT, POSX_LONGTEXT, false )
+ add_integer( DVBSUB_CFG_PREFIX "y", -1, NULL, POSY_TEXT, POSY_LONGTEXT, false )
# define ENC_CFG_PREFIX "sout-dvbsub-"
- add_submodule();
- set_description( N_("DVB subtitles encoder") );
- set_capability( "encoder", 100 );
- set_callbacks( OpenEncoder, CloseEncoder );
+ add_submodule ()
+ set_description( N_("DVB subtitles encoder") )
+ set_capability( "encoder", 100 )
+ set_callbacks( OpenEncoder, CloseEncoder )
- add_integer( ENC_CFG_PREFIX "x", -1, NULL, ENC_POSX_TEXT, ENC_POSX_LONGTEXT, false );
- add_integer( ENC_CFG_PREFIX "y", -1, NULL, ENC_POSY_TEXT, ENC_POSY_LONGTEXT, false );
- add_obsolete_integer( ENC_CFG_PREFIX "timeout" ); /* Suppressed since 0.8.5 */
-vlc_module_end();
+ add_integer( ENC_CFG_PREFIX "x", -1, NULL, ENC_POSX_TEXT, ENC_POSX_LONGTEXT, false )
+ add_integer( ENC_CFG_PREFIX "y", -1, NULL, ENC_POSY_TEXT, ENC_POSY_LONGTEXT, false )
+ add_obsolete_integer( ENC_CFG_PREFIX "timeout" ) /* Suppressed since 0.8.5 */
+vlc_module_end ()
static const char *const ppsz_enc_options[] = { "x", "y", NULL };
vlc_value_t val;
int i_posx, i_posy;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC('d','v','b','s') )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_DVBS )
{
return VLC_EGENERIC;
}
p_sys->i_spu_y = i_posy;
}
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'd','v','b','s' ) );
+ p_dec->fmt_out.i_cat = SPU_ES;
+ p_dec->fmt_out.i_codec = 0;
default_clut_init( p_dec );
continue;
}
- /* FIXME: don't create a subpicture region with VLC_FOURCC YUVP
+ /* FIXME: don't create a subpicture region with VLC CODEC YUVP
* when it actually is a TEXT region */
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('Y','U','V','P');
+ fmt.i_chroma = VLC_CODEC_YUVP;
fmt.i_aspect = 0; /* 0 means use aspect ratio of background video */
fmt.i_width = fmt.i_visible_width = p_region->i_width;
fmt.i_height = fmt.i_visible_height = p_region->i_height;
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );
- fmt.i_chroma = VLC_FOURCC('T','E','X','T');
+ fmt.i_chroma = VLC_CODEC_TEXT;
fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_width = fmt.i_visible_width = p_region->i_width;
fmt.i_height = fmt.i_visible_height = p_region->i_height;
encoder_sys_t *p_sys;
vlc_value_t val;
- if( ( p_enc->fmt_out.i_codec != VLC_FOURCC('d','v','b','s') ) &&
+ if( ( p_enc->fmt_out.i_codec != VLC_CODEC_DVBS ) &&
!p_enc->b_force )
{
return VLC_EGENERIC;
p_enc->p_sys = p_sys;
p_enc->pf_encode_sub = Encode;
- p_enc->fmt_out.i_codec = VLC_FOURCC('d','v','b','s');
+ p_enc->fmt_out.i_codec = VLC_CODEC_DVBS;
p_enc->fmt_out.subs.dvb.i_id = 1 << 16 | 1;
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
return VLC_SUCCESS;
}
-/* FIXME: this routine is a hack to convert VLC_FOURCC('Y','U','V','A')
- * into VLC_FOURCC('Y','U','V','P')
+/* FIXME: this routine is a hack to convert VLC_CODEC_YUVA
+ * into VLC_CODEC_YUVP
*/
static subpicture_t *YuvaYuvp( subpicture_t *p_subpic )
{
#ifdef DEBUG_DVBSUB
msg_Dbg( p_enc, "YuvaYuvp: i_pixels=%d, i_iterator=%d", i_pixels, i_iterator );
#endif
- p_fmt->i_chroma = VLC_FOURCC('Y','U','V','P');
+ p_fmt->i_chroma = VLC_CODEC_YUVP;
p_fmt->p_palette = (video_palette_t *) malloc( sizeof( video_palette_t ) );
if( !p_fmt->p_palette ) break;
p_fmt->p_palette->i_entries = 0;
if( !p_subpic || !p_subpic->p_region ) return NULL;
- /* FIXME: this is a hack to convert VLC_FOURCC('Y','U','V','A') into
- * VLC_FOURCC('Y','U','V','P')
+ /* FIXME: this is a hack to convert VLC_CODEC_YUVA into
+ * VLC_CODEC_YUVP
*/
p_region = p_subpic->p_region;
- if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') )
+ if( p_region->fmt.i_chroma == VLC_CODEC_YUVA )
{
p_temp = YuvaYuvp( p_subpic );
if( !p_temp )
/* Sanity check */
if( !p_region ) return NULL;
- if( ( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') ) &&
- ( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) )
+ if( ( p_region->fmt.i_chroma != VLC_CODEC_TEXT ) &&
+ ( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) )
{
char psz_fourcc[5];
memset( &psz_fourcc, 0, sizeof( psz_fourcc ) );
/* Sanity check */
if( !p_region ) return;
- if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','P') )
+ if( p_region->fmt.i_chroma == VLC_CODEC_YUVP )
{
p_pal = p_region->fmt.p_palette;
}
{
int i_entries = 4, i_depth = 0x1, i_bg = 0;
bool b_text =
- ( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') );
+ ( p_region->fmt.i_chroma == VLC_CODEC_TEXT );
if( !b_text )
{
/* object coding method */
switch( p_region->fmt.i_chroma )
{
- case VLC_FOURCC( 'Y','U','V','P' ):
+ case VLC_CODEC_YUVP:
bs_write( s, 2, 0 );
break;
- case VLC_FOURCC( 'T','E','X','T' ):
+ case VLC_CODEC_TEXT:
bs_write( s, 2, 1 );
break;
default:
bs_write( s, 1, 0 ); /* non modifying color flag */
bs_write( s, 1, 0 ); /* Reserved */
- if( p_region->fmt.i_chroma == VLC_FOURCC( 'T','E','X','T' ) )
+ if( p_region->fmt.i_chroma == VLC_CODEC_TEXT )
{
int i_size, i;
unsigned int i_line;
/* Sanity check */
- if( p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) return;
+ if( p_region->fmt.i_chroma != VLC_CODEC_YUVP ) return;
/* Encode line by line */
for( i_line = !b_top; i_line < p_region->fmt.i_visible_height;