# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
static block_t *EncodeBlock( encoder_t *, void * );
static int LoadDMO( vlc_object_t *, HINSTANCE *, IMediaObject **,
- es_format_t *, vlc_bool_t );
+ es_format_t *, bool );
static void CopyPicture( decoder_t *, picture_t *, uint8_t * );
vlc_module_begin();
- set_description( _("DirectMedia Object decoder") );
+ set_description( N_("DirectMedia Object decoder") );
add_shortcut( "dmo" );
set_capability( "decoder", 1 );
set_callbacks( DecoderOpen, DecoderClose );
# define ENC_CFG_PREFIX "sout-dmo-"
add_submodule();
- set_description( _("DirectMedia Object encoder") );
+ set_description( N_("DirectMedia Object encoder") );
set_capability( "encoder", 10 );
set_callbacks( EncoderOpen, EncoderClose );
CoInitialize( 0 );
#endif /* LOADER */
- if( LoadDMO( p_this, &hmsdmo_dll, &p_dmo, &p_dec->fmt_in, VLC_FALSE )
+ if( LoadDMO( p_this, &hmsdmo_dll, &p_dmo, &p_dec->fmt_in, false )
!= VLC_SUCCESS )
{
hmsdmo_dll = 0;
dmo_output_type.formattype = FORMAT_VideoInfo;
dmo_output_type.subtype = dmo_output_type.majortype;
dmo_output_type.subtype.Data1 = p_bih->biCompression;
- dmo_output_type.bFixedSizeSamples = VLC_TRUE;
+ dmo_output_type.bFixedSizeSamples = true;
dmo_output_type.bTemporalCompression = 0;
dmo_output_type.lSampleSize = p_bih->biSizeImage;
dmo_output_type.cbFormat = sizeof(VIDEOINFOHEADER);
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
{
- msg_Err( p_dec, "out of memory" );
goto error;
}
else
date_Init( &p_sys->end_date, 25 /* FIXME */, 1 );
- if( p_vih ) free( p_vih );
- if( p_wf ) free( p_wf );
+ free( p_vih );
+ free( p_wf );
return VLC_SUCCESS;
CoUninitialize();
#endif /* LOADER */
- if( p_vih ) free( p_vih );
- if( p_wf ) free( p_wf );
- if( p_sys ) free( p_sys );
+ free( p_vih );
+ free( p_wf );
+ free( p_sys );
return VLC_EGENERIC;
}
*****************************************************************************/
static int LoadDMO( vlc_object_t *p_this, HINSTANCE *p_hmsdmo_dll,
IMediaObject **pp_dmo, es_format_t *p_fmt,
- vlc_bool_t b_out )
+ bool b_out )
{
DMO_PARTIAL_MEDIATYPE dmo_partial_type;
int i_err;
CoUninitialize();
#endif
- if( p_sys->p_buffer ) free( p_sys->p_buffer );
+ free( p_sys->p_buffer );
free( p_sys );
}
{
CMediaBuffer *p_in;
- p_in = CMediaBufferCreate( p_block, p_block->i_buffer, VLC_TRUE );
+ p_in = CMediaBufferCreate( p_block, p_block->i_buffer, true );
i_result = p_sys->p_dmo->vt->ProcessInput( p_sys->p_dmo, 0,
(IMediaBuffer *)p_in, DMO_INPUT_DATA_BUFFERF_SYNCPOINT,
block_out.p_buffer = p_sys->p_buffer;
block_out.i_buffer = 0;
- p_out = CMediaBufferCreate( &block_out, p_sys->i_min_output, VLC_FALSE );
+ p_out = CMediaBufferCreate( &block_out, p_sys->i_min_output, false );
memset( &db, 0, sizeof(db) );
db.pBuffer = (IMediaBuffer *)p_out;
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;
}
vih.rcSource.bottom = p_enc->fmt_in.video.i_height;
vih.rcTarget = vih.rcSource;
- vih.AvgTimePerFrame = I64C(10000000) / 25; //FIXME
+ vih.AvgTimePerFrame = INT64_C(10000000) / 25; //FIXME
dmo_type.majortype = MEDIATYPE_Video;
//dmo_type.subtype = MEDIASUBTYPE_RGB24;
CoInitialize( 0 );
#endif /* LOADER */
- if( LoadDMO( p_this, &hmsdmo_dll, &p_dmo, &p_enc->fmt_out, VLC_TRUE )
+ if( LoadDMO( p_this, &hmsdmo_dll, &p_dmo, &p_enc->fmt_out, true )
!= VLC_SUCCESS )
{
hmsdmo_dll = 0;
if( ( p_enc->p_sys = p_sys =
(encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
{
- msg_Err( p_enc, "out of memory" );
goto error;
}
CoUninitialize();
#endif /* LOADER */
- if( p_sys ) free( p_sys );
+ free( p_sys );
return VLC_EGENERIC;
}
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;
}
}
/* Feed input to the DMO */
- p_in = CMediaBufferCreate( p_block_in, p_block_in->i_buffer, VLC_TRUE );
+ p_in = CMediaBufferCreate( p_block_in, p_block_in->i_buffer, true );
i_result = p_sys->p_dmo->vt->ProcessInput( p_sys->p_dmo, 0,
(IMediaBuffer *)p_in, DMO_INPUT_DATA_BUFFERF_TIME, i_pts * 10, 0 );
{
/* No output generated */
#ifdef DMO_DEBUG
- msg_Dbg( p_enc, "ProcessInput(): no output generated "I64Fd, i_pts );
+ msg_Dbg( p_enc, "ProcessInput(): no output generated %"PRId64, i_pts );
#endif
return NULL;
}
p_block_out = block_New( p_enc, p_sys->i_min_output );
p_block_out->i_buffer = 0;
- p_out = CMediaBufferCreate(p_block_out, p_sys->i_min_output, VLC_FALSE);
+ p_out = CMediaBufferCreate(p_block_out, p_sys->i_min_output, false);
memset( &db, 0, sizeof(db) );
db.pBuffer = (IMediaBuffer *)p_out;
if( db.dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIME )
{
#ifdef DMO_DEBUG
- msg_Dbg( p_enc, "ProcessOutput(): pts: "I64Fd", "I64Fd,
+ msg_Dbg( p_enc, "ProcessOutput(): pts: %"PRId64", %"PRId64,
i_pts, db.rtTimestamp / 10 );
#endif
i_pts = db.rtTimestamp / 10;
{
p_block_out->i_length = db.rtTimelength / 10;
#ifdef DMO_DEBUG
- msg_Dbg( p_enc, "ProcessOutput(): length: "I64Fd,
+ msg_Dbg( p_enc, "ProcessOutput(): length: %"PRId64,
p_block_out->i_length );
#endif
}