#define LT_CHROMA N_("Output chroma for the memory image as a 4-character " \
"string, eg. \"RV32\".")
-#define INVMEM_HELP N_( "This module make possible making video stream from raw-image " \
- "generating (to memory) from rendering program uses libvlc. " \
- "To use this module from libvlc set --codec to invmem, "\
- "set all --invmem-* options in vlc_argv an use " \
- "libvlc_media_new(libvlc, \"fake://\", &ex);. " \
- "Besides is simillar to vmem video output module." )
-
vlc_module_begin()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_VCODEC )
set_shortname( N_("Memory video decoder") )
set_description( N_("Memory video decoder") )
- set_help( INVMEM_HELP )
set_capability( "decoder", 50 )
set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "invmem" )
- add_integer( "invmem-width", 0, NULL, T_WIDTH, LT_WIDTH, false )
- add_integer( "invmem-height", 0, NULL, T_HEIGHT, LT_HEIGHT, false )
- add_string( "invmem-lock", "0", NULL, T_LOCK, LT_LOCK, true )
- add_string( "invmem-unlock", "0", NULL, T_UNLOCK, LT_UNLOCK, true )
- add_string( "invmem-data", "0", NULL, T_DATA, LT_DATA, true )
- add_string( "invmem-chroma", "RV24", NULL, T_CHROMA, LT_CHROMA, true)
+ add_integer( "invmem-width", 0, T_WIDTH, LT_WIDTH, false )
+ add_integer( "invmem-height", 0, T_HEIGHT, LT_HEIGHT, false )
+ add_string( "invmem-lock", "0", T_LOCK, LT_LOCK, true )
+ add_string( "invmem-unlock", "0", T_UNLOCK, LT_UNLOCK, true )
+ add_string( "invmem-data", "0", T_DATA, LT_DATA, true )
+ add_string( "invmem-chroma", "RV24", T_CHROMA, LT_CHROMA, true)
vlc_module_end()
int i_pitch;
vlc_fourcc_t i_chroma;
-
- picture_t *p_pic;
};
p_dec->fmt_out.i_codec = chroma;
p_dec->fmt_out.video.i_width = p_dec->p_sys->i_width;
p_dec->fmt_out.video.i_height = p_dec->p_sys->i_height;
- p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_dec->p_sys->i_width / p_dec->p_sys->i_height;
+ p_dec->fmt_out.video.i_sar_num = 1;
+ p_dec->fmt_out.video.i_sar_den = 1;
p_dec->fmt_out.i_cat = VIDEO_ES;
p_sys->i_pitch = pitch;
- p_sys->p_pic = NULL;
-
/* Set callbacks */
p_dec->pf_decode_video = DecodeBlock;
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block;
+ picture_t* p_pic;
if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block;
// create new picture
- if( p_sys->p_pic != NULL )
- picture_Release( p_sys->p_pic );
- p_sys->p_pic = decoder_NewPicture( p_dec );
- if ( !p_sys->p_pic ) return NULL;
- p_sys->p_pic->b_force = true;
- p_sys->p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
- p_sys->p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
+ p_pic = decoder_NewPicture( p_dec );
+ if ( !p_pic ) return NULL;
+ p_pic->b_force = true;
+ p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
+ p_pic->date = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : p_block->i_dts;
// lock input and copy to picture
- p_sys->p_pic->p->p_pixels = p_sys->pf_lock( p_dec->p_sys->p_data );
+ p_pic->p->p_pixels = p_sys->pf_lock( p_dec->p_sys->p_data );
// unlock input
p_sys->pf_unlock( p_dec->p_sys->p_data );
block_Release( *pp_block ); *pp_block = NULL;
- return p_sys->p_pic;
+ return p_pic;
}
/*****************************************************************************
decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( p_sys->p_pic != NULL )
- picture_Release( p_sys->p_pic );
-
free( p_sys );
}