# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
#include <vlc_vout.h>
#define ENC_CFG_PREFIX "sout-dirac-"
-static const char *ppsz_enc_options[] = {
+static const char *const ppsz_enc_options[] = {
"quality", NULL
};
vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_VCODEC );
- set_description( _("Dirac video decoder") );
+ set_description( N_("Dirac video decoder") );
set_capability( "decoder", 100 );
set_callbacks( OpenDecoder, CloseDecoder );
add_shortcut( "dirac" );
add_submodule();
- set_description( _("Dirac video encoder") );
+ set_description( N_("Dirac video encoder") );
set_capability( "encoder", 100 );
set_callbacks( OpenEncoder, CloseEncoder );
add_float( ENC_CFG_PREFIX "quality", 7.0, NULL, ENC_QUALITY_TEXT,
- ENC_QUALITY_LONGTEXT, VLC_FALSE );
+ ENC_QUALITY_LONGTEXT, false );
vlc_module_end();
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_sys->p_dirac = p_dirac;
int i;
for( i = 0; i < 3; i++ )
{
- if( p_dirac->fbuf->buf[i] ) free( p_dirac->fbuf->buf[i] );
+ free( p_dirac->fbuf->buf[i] );
p_dirac->fbuf->buf[i] = 0;
}
}
p_pic = p_dec->pf_vout_buffer_new( p_dec );
if( p_pic == NULL ) return NULL;
- p_pic->b_progressive = !p_sys->p_dirac->src_params.interlace;
+ p_pic->b_progressive = !p_sys->p_dirac->src_params.source_sampling;
p_pic->b_top_field_first = p_sys->p_dirac->src_params.topfieldfirst;
p_pic->i_nb_fields = 2;
for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ )
{
- p_dec->p_libvlc->pf_memcpy( p_dst, p_src, i_width );
+ vlc_memcpy( p_dst, p_src, i_width );
p_src += i_width;
p_dst += i_dst_stride;
}
FreeFrameBuffer( p_sys->p_dirac );
break;
- case STATE_PICTURE_START:
- msg_Dbg( p_dec, "PICTURE_START: frame_type=%i frame_num=%d",
- p_sys->p_dirac->frame_params.ftype,
- p_sys->p_dirac->frame_params.fnum );
- break;
-
case STATE_PICTURE_AVAIL:
- msg_Dbg( p_dec, "PICTURE_AVAI : frame_type=%i frame_num=%d",
- p_sys->p_dirac->frame_params.ftype,
- p_sys->p_dirac->frame_params.fnum );
+ msg_Dbg( p_dec, "PICTURE_AVAIL : frame_num=%d",
+ p_sys->p_dirac->frame_num );
/* Picture available for display */
p_pic = GetNewPicture( p_dec );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
memset( p_sys, 0, sizeof(encoder_sys_t) );
p_enc->p_sys = p_sys;
p_enc->fmt_in.video.i_frame_rate;
p_sys->ctx.src_params.frame_rate.denominator =
p_enc->fmt_in.video.i_frame_rate_base;
- p_sys->ctx.src_params.interlace = 0;
+ p_sys->ctx.src_params.source_sampling = 0;
p_sys->ctx.src_params.topfieldfirst = 0;
var_Get( p_enc, ENC_CFG_PREFIX "quality", &val );
for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ )
{
- p_enc->p_libvlc->pf_memcpy( p_dst, p_src, i_width );
+ vlc_memcpy( p_dst, p_src, i_width );
p_dst += i_width;
p_src += i_src_stride;
}
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys = p_enc->p_sys;
- msg_Dbg( p_enc, "resulting bit-rate: %i bits/sec",
+ msg_Dbg( p_enc, "resulting bit-rate: %lld bits/sec",
p_sys->p_dirac->enc_seqstats.bit_rate );
/* Free the encoder resources */