* XXX You may also use input_item_New or input_item_NewExt as they need
* less arguments.
*/
-VLC_API input_item_t * input_item_NewWithType( vlc_object_t *, const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration, int i_type ) VLC_USED;
+VLC_API input_item_t * input_item_NewWithType( const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration, int i_type ) VLC_USED;
/**
* This function creates a new input_item_t with the provided information.
*
* Provided for convenience.
*/
-VLC_API input_item_t * input_item_NewExt(vlc_object_t *, const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration ) VLC_USED;
-#define input_item_NewExt(a,b,c,d,e,f,g) input_item_NewExt( VLC_OBJECT(a),b,c,d,e,f,g)
+VLC_API input_item_t * input_item_NewExt( const char *psz_uri, const char *psz_name, int i_options, const char *const *ppsz_options, unsigned i_option_flags, mtime_t i_duration ) VLC_USED;
/**
* This function creates a new input_item_t with the provided information.
*
* Provided for convenience.
*/
-#define input_item_New( a,b,c ) input_item_NewExt( a, b, c, 0, NULL, 0, -1 )
+#define input_item_New( a,b ) input_item_NewExt( a, b, 0, NULL, 0, -1 )
/**
* This function creates a new input_item_t as a copy of another.
*/
-VLC_API input_item_t * input_item_Copy(vlc_object_t *, input_item_t * ) VLC_USED;
+VLC_API input_item_t * input_item_Copy(input_item_t * ) VLC_USED;
/******************
/* Create playlist items */
const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
- p_input_item = input_item_NewWithType( VLC_OBJECT( p_access ),
- psz_uri, psz_name, 0, NULL, 0, i_duration,
- ITEM_TYPE_DISC );
+ p_input_item = input_item_NewWithType( psz_uri, psz_name, 0, NULL, 0,
+ i_duration, ITEM_TYPE_DISC );
input_item_CopyOptions( p_current, p_input_item );
input_item_AddOption( p_input_item, psz_first, VLC_INPUT_OPTION_TRUSTED );
input_item_AddOption( p_input_item, psz_last, VLC_INPUT_OPTION_TRUSTED );
goto error;
}
/** \bug we do not autodelete here */
- p_new_loc = input_item_New( p_access, psz_location, psz_location );
+ p_new_loc = input_item_New( psz_location, psz_location );
input_item_t *p_item = input_GetItem( p_input );
input_item_PostSubItem( p_item, p_new_loc );
/* Now create a playlist item */
if( psz_item_mrl )
{
- p_item = input_item_New( p_intf, psz_item_mrl, NULL );
+ p_item = input_item_New( psz_item_mrl, NULL );
for( i = 0; i < i_options; i++ )
{
input_item_AddOption( p_item, ppsz_options[i], VLC_INPUT_OPTION_TRUSTED );
free( psz_path );
}
msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
- input_item_t *p_input = input_item_New( p_demux, psz_ref, NULL );
+ input_item_t *p_input = input_item_New( psz_ref, NULL );
input_item_CopyOptions( p_current, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
memcpy( psz_string, psz_backup, i_strlen );
psz_string[i_strlen] = '\0';
input_item_t *p_input;
- p_input = input_item_New( p_demux, psz_string, psz_title_asx );
+ p_input = input_item_New( psz_string, psz_title_asx );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
if( asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : psz_current_input_name ) ) != -1 )
{
char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
- p_entry = input_item_NewExt( p_demux, psz_mrl, psz_name,
+ p_entry = input_item_NewExt( psz_mrl, psz_name,
i_options, (const char * const *)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_name );
free( psz_mrl );
char *psz_name = input_item_GetName( p_current_input );
char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
- p_entry = input_item_NewExt( p_demux, psz_mrl, psz_name,
+ p_entry = input_item_NewExt( psz_mrl, psz_name,
0, NULL, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_mrl );
input_item_CopyOptions( p_current_input, p_entry );
// Read the element name
if( !strcmp( node, "entry" ) )
{
- p_input = input_item_New( p_demux, psz_mrl, psz_title );
+ p_input = input_item_New( psz_mrl, psz_title );
if( psz_now )
input_item_SetNowPlaying( p_input, psz_now );
if( psz_genre )
}
}
- p_input = input_item_NewExt( p_demux, psz_uri, psz_name,
+ p_input = input_item_NewExt( psz_uri, psz_name,
i_options, (const char**)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
else
{
- p_input = input_item_New( p_demux, psz_url, psz_title );
+ p_input = input_item_New( psz_url, psz_title );
#define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
p_input, _("Google Video"), type, "%s", field ) ; }
SADD_INFO( "gvp_version", psz_version );
return 0;
input_item_t *p_current_input = GetCurrentItem(p_demux);
- input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
+ input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
memcpy( psz_url + len, "VR_MOVIE.VRO", 13 );
input_item_t *p_current_input = GetCurrentItem(p_demux);
- input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
+ input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
}
msg_Info( p_demux, "Adding '%s'", p_track->location );
- p_new_input = input_item_New( p_demux, p_track->location, NULL );
+ p_new_input = input_item_New( p_track->location, NULL );
input_item_node_AppendItem( p_input_node, p_new_input );
/* add meta info */
goto error;
}
- p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
+ p_input = input_item_NewExt( psz_mrl, psz_name,
i_options, ppsz_options, 0, i_duration );
free( psz_parse );
/* we found a new item, insert the previous */
if( psz_mrl )
{
- p_input = input_item_New( p_demux, psz_mrl, psz_name );
+ p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
/* Add last object */
if( psz_mrl )
{
- p_input = input_item_New( p_demux, psz_mrl, psz_name );
+ p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
goto error;
}
- p_input = input_item_New( p_demux, psz_item_mrl, psz_item_name );
+ p_input = input_item_New( psz_item_mrl, psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_name );
else
{
input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
- p_input = input_item_New( p_demux, psz_src, psz_moviename );
+ p_input = input_item_New( psz_src, psz_moviename );
#define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
p_input, "QuickTime Media Link", type, "%s", field ) ; }
SADD_INFO( "href", psz_href );
vlc_gc_decref( p_input );
if( psz_qtnext )
{
- p_input = input_item_New( p_demux, psz_qtnext, NULL );
+ p_input = input_item_New( psz_qtnext, NULL );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
}
/* Create the input item and pump in all the options into playlist item */
- p_input = input_item_NewExt( p_demux, psz_mrl, psz_title, i_options, ppsz_options, 0, i_duration );
+ p_input = input_item_NewExt( psz_mrl, psz_title, i_options, ppsz_options, 0, i_duration );
if( !EMPTY_STR( psz_artist ) ) input_item_SetArtist( p_input, psz_artist );
if( !EMPTY_STR( psz_author ) ) input_item_SetPublisher( p_input, psz_author );
}
}
- p_child = input_item_NewWithType( VLC_OBJECT(p_demux), p_sys->psz_uri,
+ p_child = input_item_NewWithType( p_sys->psz_uri,
p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
0, NULL, 0, p_sys->i_duration, ITEM_TYPE_NET );
psz_name ) != -1 )
{
input_item_t *p_input;
- p_input = input_item_New( p_demux, psz_mrl, psz_name );
+ p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
input_item_node_AppendItem( p_input_node, p_input );
/* Create the item */
input_item_t *p_input;
- p_input = input_item_New( p_demux, psz_mrl, psz_name );
+ p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
*psz_parse = '\0';
psz_uri = ProcessMRL( psz_uri, p_demux->p_sys->psz_prefix );
- p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
+ p_input = input_item_NewExt( psz_uri, psz_uri,
0, NULL, 0, -1 );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
{NULL, UNKNOWN_CONTENT, {NULL} }
};
- input_item_t *p_new_input = input_item_New( p_demux, NULL, NULL );
+ input_item_t *p_new_input = input_item_New( NULL, NULL );
input_item_node_t *p_new_node = input_item_node_Create( p_new_input );
if( !p_new_input )
msg_Warn( p_demux, "<vlc:node> requires \"title\" attribute" );
return false;
}
- p_new_input = input_item_NewWithType( VLC_OBJECT( p_demux ),
- "vlc://nop", psz_title, 0, NULL, 0, -1,
- ITEM_TYPE_DIRECTORY );
+ p_new_input = input_item_NewWithType( "vlc://nop", psz_title,
+ 0, NULL, 0, -1,
+ ITEM_TYPE_DIRECTORY );
if( p_new_input )
{
p_input_node =
else if( !strncasecmp( psz_parse, "BR!", strlen( "BR!" ) ) )
{
/* create the input item */
- input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
+ input_item_t *p_input = input_item_NewExt( psz_mrl,
psz_title, 0, NULL, 0, i_duration );
input_item_node_AppendItem( p_subitems, p_input );
FREENULL( psz_mrl );
gtk_tree_model_get_iter( model, &iter, path );
gtk_tree_model_get( model, &iter, 0, &filename, -1 );
- p_input = input_item_New( p_intf, filename, NULL );
+ p_input = input_item_New( filename, NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, false );
vlc_gc_decref( p_input );
gtk_widget_destroy( dialog );
- p_input = input_item_New( p_intf, psz_filename, NULL );
+ p_input = input_item_New( psz_filename, NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
PLAYLIST_END, true, false );
return;
}
- p_input = input_item_New( p_intf,
- gtk_entry_get_text( GTK_ENTRY( entry ) ),
+ p_input = input_item_New( gtk_entry_get_text( GTK_ENTRY( entry ) ),
NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
intf_thread_t *p_intf = (intf_thread_t *)user_data;
input_item_t *p_input;
- p_input = input_item_New( p_intf, "v4l2://", NULL );
+ p_input = input_item_New( "v4l2://", NULL );
playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
PLAYLIST_APPEND | PLAYLIST_GO,
PLAYLIST_END, true, false );
NSURL * o_url;
input_item_t *p_input;
- p_input = input_item_New( p_playlist,
- [o_urlString fileSystemRepresentation],
+ p_input = input_item_New( [o_urlString fileSystemRepresentation],
[[[NSFileManager defaultManager]
displayNameAtPath: o_urlString] UTF8String] );
/* FIXME: playlist_AddInput() can fail */
o_uri = o_temp;
}
- p_input = input_item_New( p_playlist, [o_uri fileSystemRepresentation], o_name ? [o_name UTF8String] : NULL );
+ p_input = input_item_New( [o_uri fileSystemRepresentation], o_name ? [o_name UTF8String] : NULL );
if( !p_input )
return NULL;
NSString *tempString = [NSString stringWithFormat:
@"%@ (%i/%i)", _NS("Streaming/Transcoding Wizard"),
( x + 1 ), y];
- input_item_t *p_input = input_item_New( p_playlist,
+ input_item_t *p_input = input_item_New(
[[[o_userSelections objectForKey:@"pathToStrm"]
objectAtIndex:x] UTF8String],
[tempString UTF8String] );
bool b_start = !i && !b_enqueue;
input_item_t *p_input;
- p_input = input_item_New( p_intf, qtu( itemsMRL[i] ), NULL );
+ p_input = input_item_New( qtu( itemsMRL[i] ), NULL );
/* Insert options only for the first element.
We don't know how to edit that anyway. */
RecentsMRL::getInstance( p_intf )->addRecent( qfu(uri) );
- input_item_t *p_input = input_item_New( THEPL, uri, NULL );
+ input_item_t *p_input = input_item_New( uri, NULL );
free( uri );
if( unlikely( p_input == NULL ) )
return;
/* Create Input */
input_item_t *p_input;
- p_input = input_item_New( p_intf, qtu( mrl ), _("Streaming") );
+ p_input = input_item_New( qtu( mrl ), _("Streaming") );
/* Add normal Options */
for( int j = 0; j < options.size(); j++ )
if( !psz_uri )
continue;
- input_item_t* pItem = input_item_New( m_pPlaylist, psz_uri, NULL );
+ input_item_t* pItem = input_item_New( psz_uri, NULL );
if( pItem )
{
int i_mode = PLAYLIST_APPEND;
if( lua_isstring( L, -1 ) )
{
const char *psz_name = lua_tostring( L, -1 );
- input_item_t *p_input = input_item_NewWithType( VLC_OBJECT( p_sd ),
- "vlc://nop",
+ input_item_t *p_input = input_item_NewWithType( "vlc://nop",
psz_name, 0, NULL, 0,
-1, ITEM_TYPE_NODE );
lua_pop( L, 1 );
int i_options = 0;
const char *psz_path = lua_tostring( L, -1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
- input_item_t *p_input = input_item_NewExt( p_sd, psz_path, psz_path,
+ input_item_t *p_input = input_item_NewExt( psz_path, psz_path,
i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 );
const char *psz_path = lua_tostring( L, -1 );
vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
- input_item_t *p_input = input_item_NewExt( p_sd, psz_path,
+ input_item_t *p_input = input_item_NewExt( psz_path,
psz_path, i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED, -1 );
{
const char *psz_name = lua_tostring( L, -1 );
input_item_node_t *p_input_node = input_item_node_Create( *pp_node );
- input_item_t *p_input = input_item_NewWithType( VLC_OBJECT( p_sd ),
- "vlc://nop",
+ input_item_t *p_input = input_item_NewWithType( "vlc://nop",
psz_name, 0, NULL, 0,
-1, ITEM_TYPE_NODE );
lua_pop( L, 1 );
vlclua_read_options( p_this, L, &i_options, &ppsz_options );
/* Create input item */
- p_input = input_item_NewExt( p_playlist, psz_path,
- psz_name, i_options,
+ p_input = input_item_NewExt( psz_path, psz_name, i_options,
(const char **)ppsz_options,
VLC_INPUT_OPTION_TRUSTED,
i_duration );
ml_media_t *p_media )
{
playlist_t *p_pl = pl_Get( p_ml );
- *pp_item = input_item_New( VLC_OBJECT( p_pl ),
- p_media->psz_uri,
- p_media->psz_title );
+ *pp_item = input_item_New( p_media->psz_uri, p_media->psz_title );
/* ITEM_TYPE_FILE ); */
if( !*pp_item )
return VLC_EGENERIC;
if( b_skip )
continue;
- p_input = input_item_New( VLC_OBJECT(p_mon), psz_encoded_uri,
- psz_entry );
+ p_input = input_item_New( psz_encoded_uri, psz_entry );
playlist_t* p_pl = pl_Get( p_mon );
preparsed_item_t* p_itemobject;
if( psz_uri != NULL )
{
- p_input = input_item_New( p_sd, psz_uri, name );
+ p_input = input_item_New( psz_uri, name );
free( psz_uri );
}
if( p_input != NULL )
char* psz_uri = make_URI( psz_dir, "file" );
- input_item_t* p_root = input_item_New( p_sd, psz_uri, NULL );
+ input_item_t* p_root = input_item_New( psz_uri, NULL );
if( p_sys->i_type == Picture )
input_item_AddOption( p_root, "ignore-filetypes=ini,db,lnk,txt",
VLC_INPUT_OPTION_TRUSTED );
return VLC_EGENERIC;
char* psz_uri = make_URI( psz_file, "file" );
- input_item_t* p_item = input_item_New( p_sd, psz_uri, NULL );
+ input_item_t* p_item = input_item_New( psz_uri, NULL );
if( p_sys->i_type == Picture )
{
msg_Err( p_sd, "Error adding %s, skipping it", p_track->filename );
return;
}
- if( ( p_input = input_item_New( p_sd, psz_string,
- p_track->title ) ) == NULL )
+ if( ( p_input = input_item_New( psz_string, p_track->title ) ) == NULL )
{
msg_Err( p_sd, "Error adding %s, skipping it", p_track->filename );
free( psz_string );
strdup( psz_urls ) );
input_item_t *p_input;
- p_input = input_item_New( p_sd, psz_urls, psz_urls );
+ p_input = input_item_New( psz_urls, psz_urls );
input_item_AddOption( p_input, "demux=podcast", VLC_INPUT_OPTION_TRUSTED );
INSERT_ELEM( pp_new_items, i_new_items, i_new_items, p_input );
strdup( psz_request ) );
input_item_t *p_input;
- p_input = input_item_New( p_sd, psz_request, psz_request );
+ p_input = input_item_New( psz_request, psz_request );
input_item_AddOption( p_input, "demux=podcast", VLC_INPUT_OPTION_TRUSTED );
INSERT_ELEM( p_sys->pp_items, p_sys->i_items, p_sys->i_items, p_input );
p_sap->p_sdp = p_sdp;
/* Released in RemoveAnnounce */
- p_input = input_item_NewWithType( VLC_OBJECT(p_sd),
- p_sap->p_sdp->psz_uri,
- p_sdp->psz_sessionname,
- 0, NULL, 0, -1, ITEM_TYPE_NET );
+ p_input = input_item_NewWithType( p_sap->p_sdp->psz_uri,
+ p_sdp->psz_sessionname,
+ 0, NULL, 0, -1, ITEM_TYPE_NET );
p_sap->p_item = p_input;
if( !p_input )
{
if (mrl == NULL)
return 0; /* don't know if it was an error... */
char *name = p_sys->subsys->get_name (dev);
- input_item_t *item = input_item_NewWithType (VLC_OBJECT (sd), mrl,
- name ? name : mrl,
+ input_item_t *item = input_item_NewWithType (mrl, name ? name : mrl,
0, NULL, 0, -1,
p_sys->subsys->item_type);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
{
Container* p_container = p_parent->getContainer( i );
- input_item_t* p_input_item = input_item_New( _p_sd, "vlc://nop",
+ input_item_t* p_input_item = input_item_New( "vlc://nop",
p_container->getTitle() );
input_item_node_t *p_new_node =
input_item_node_AppendItem( p_input_node, p_input_item );
{
Item* p_item = p_parent->getItem( i );
- input_item_t* p_input_item = input_item_NewExt( _p_sd,
- p_item->getResource(),
+ input_item_t* p_input_item = input_item_NewExt( p_item->getResource(),
p_item->getTitle(),
0,
NULL,
msg_Dbg( _p_sd, "Adding server '%s' with uuid '%s'", p_server->getFriendlyName(), p_server->getUDN() );
- p_input_item = input_item_New( _p_sd, "vlc://nop",
- p_server->getFriendlyName() );
+ p_input_item = input_item_New( "vlc://nop", p_server->getFriendlyName() );
input_item_SetDescription( p_input_item, p_server->getUDN() );
continue;
mrl[8] = name[0] = letter;
- item = input_item_NewWithType (VLC_OBJECT (sd), mrl, name,
+ item = input_item_NewWithType (mrl, name,
0, NULL, 0, -1, ITEM_TYPE_DISC);
msg_Dbg (sd, "adding %s (%s)", mrl, name);
if (item == NULL)
else
name = NULL;
- input_item_t *item = input_item_NewWithType (VLC_OBJECT (sd), mrl,
- name ? name : mrl,
+ input_item_t *item = input_item_NewWithType (mrl, name ? name : mrl,
0, NULL, 0, -1,
ITEM_TYPE_CARD /* FIXME */);
free (mrl);
{
input_item_t *item;
- item = input_item_NewWithType (VLC_OBJECT (sd), "screen://", _("Desktop"),
+ item = input_item_NewWithType ("screen://", _("Desktop"),
0, NULL, 0, -1, ITEM_TYPE_CARD);
if (item == NULL)
return;
input_item_t * p_input_item;
libvlc_media_t * p_md;
- p_input_item = input_item_New( p_instance->p_libvlc_int, psz_mrl, NULL );
+ p_input_item = input_item_New( psz_mrl, NULL );
if (!p_input_item)
{
input_item_t * p_input_item;
libvlc_media_t * p_md;
- p_input_item = input_item_New( p_instance->p_libvlc_int, "vlc://nop", psz_name );
+ p_input_item = input_item_New( "vlc://nop", psz_name );
if (!p_input_item)
{
input_item_t * p_input_item;
libvlc_media_t * p_md;
- p_input_item = input_item_NewExt(
- p_mlist->p_libvlc_instance->p_libvlc_int, psz_uri,
+ p_input_item = input_item_NewExt( psz_uri,
_("Media Library"), 0, NULL, 0, -1 );
if( !p_input_item )
static int GuessType( const input_item_t *p_item );
-/** Stuff moved out of vlc_input.h -- FIXME: should probably not be inline
- * anyway. */
-static inline void input_item_Init( vlc_object_t *p_o, input_item_t *p_i )
-{
- memset( p_i, 0, sizeof(input_item_t) );
-
- p_i->psz_name = NULL;
- p_i->psz_uri = NULL;
- TAB_INIT( p_i->i_es, p_i->es );
- TAB_INIT( p_i->i_options, p_i->ppsz_options );
- p_i->optflagv = NULL, p_i->optflagc = 0;
- TAB_INIT( p_i->i_categories, p_i->pp_categories );
- TAB_INIT( p_i->i_epg, p_i->pp_epg );
-
- p_i->i_type = ITEM_TYPE_UNKNOWN;
- p_i->b_fixed_name = true;
-
- p_i->p_stats = NULL;
- p_i->p_meta = NULL;
-
- vlc_mutex_init( &p_i->lock );
- vlc_event_manager_t * p_em = &p_i->event_manager;
- vlc_event_manager_init( p_em, p_i );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemMetaChanged );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemAdded );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemTreeAdded );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemDurationChanged );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemPreparsedChanged );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemNameChanged );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemInfoChanged );
- vlc_event_manager_register_event_type( p_em, vlc_InputItemErrorWhenReadingChanged );
-}
-
static inline void input_item_Clean( input_item_t *p_i )
{
int i;
vlc_event_send( &p_item->event_manager, &event );
}
-#undef input_item_NewExt
-input_item_t *input_item_NewExt( vlc_object_t *p_obj, const char *psz_uri,
+input_item_t *input_item_NewExt( const char *psz_uri,
const char *psz_name,
int i_options,
const char *const *ppsz_options,
unsigned i_option_flags,
mtime_t i_duration )
{
- return input_item_NewWithType( p_obj, psz_uri, psz_name,
+ return input_item_NewWithType( psz_uri, psz_name,
i_options, ppsz_options, i_option_flags,
i_duration, ITEM_TYPE_UNKNOWN );
}
-input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
- const char *psz_name,
- int i_options,
- const char *const *ppsz_options,
- unsigned i_option_flags,
- mtime_t i_duration,
- int i_type )
+input_item_t *
+input_item_NewWithType( const char *psz_uri, const char *psz_name,
+ int i_options, const char *const *ppsz_options,
+ unsigned flags, mtime_t duration, int type )
{
static vlc_atomic_t last_input_id = VLC_ATOMIC_INIT(0);
- input_item_t* p_input = malloc( sizeof(input_item_t ) );
+ input_item_t* p_input = calloc( sizeof( *p_input ), 1 );
if( !p_input )
return NULL;
-
- input_item_Init( p_obj, p_input );
- vlc_gc_init( p_input, input_item_Destroy );
+ vlc_event_manager_t * p_em = &p_input->event_manager;
p_input->i_id = vlc_atomic_inc(&last_input_id);
+ vlc_gc_init( p_input, input_item_Destroy );
- p_input->b_fixed_name = false;
-
- p_input->i_type = i_type;
+ p_input->psz_name = NULL;
+ if( psz_name )
+ input_item_SetName( p_input, psz_name );
+ p_input->psz_uri = NULL;
if( psz_uri )
input_item_SetURI( p_input, psz_uri );
+ else
+ p_input->i_type = ITEM_TYPE_UNKNOWN;
- if( i_type != ITEM_TYPE_UNKNOWN )
- p_input->i_type = i_type;
+ TAB_INIT( p_input->i_options, p_input->ppsz_options );
+ p_input->optflagc = 0;
+ p_input->optflagv = NULL;
+ for( int i = 0; i < i_options; i++ )
+ input_item_AddOption( p_input, ppsz_options[i], flags );
- if( psz_name )
- input_item_SetName( p_input, psz_name );
+ p_input->i_duration = duration;
+ TAB_INIT( p_input->i_categories, p_input->pp_categories );
+ TAB_INIT( p_input->i_es, p_input->es );
+ p_input->p_stats = NULL;
+ p_input->i_nb_played = 0;
+ p_input->p_meta = NULL;
+ TAB_INIT( p_input->i_epg, p_input->pp_epg );
- p_input->i_duration = i_duration;
+ vlc_event_manager_init( p_em, p_input );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemMetaChanged );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemAdded );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemSubItemTreeAdded );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemDurationChanged );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemPreparsedChanged );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemNameChanged );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemInfoChanged );
+ vlc_event_manager_register_event_type( p_em, vlc_InputItemErrorWhenReadingChanged );
- for( int i = 0; i < i_options; i++ )
- input_item_AddOption( p_input, ppsz_options[i], i_option_flags );
+ vlc_mutex_init( &p_input->lock );
+ if( type != ITEM_TYPE_UNKNOWN )
+ p_input->i_type = type;
+ p_input->b_fixed_name = false;
+ p_input->b_error_when_reading = false;
return p_input;
}
-input_item_t *input_item_Copy( vlc_object_t *p_obj, input_item_t *p_input )
+input_item_t *input_item_Copy( input_item_t *p_input )
{
vlc_mutex_lock( &p_input->lock );
input_item_t *p_new_input =
- input_item_NewWithType( p_obj,
- p_input->psz_uri, p_input->psz_name,
+ input_item_NewWithType( p_input->psz_uri, p_input->psz_name,
0, NULL, 0, p_input->i_duration,
p_input->i_type );
vlc_gc_decref( p_media->vod.p_item );
char *psz_uri = make_URI( p_cfg->ppsz_input[0], NULL );
- p_media->vod.p_item = input_item_New( p_vlm, psz_uri,
- p_cfg->psz_name );
+ p_media->vod.p_item = input_item_New( psz_uri, p_cfg->psz_name );
free( psz_uri );
if( p_cfg->psz_output )
p_media->cfg.id = p_vlm->i_id++;
/* FIXME do we do something here if enabled is true ? */
- p_media->vod.p_item = input_item_New( p_vlm, NULL, NULL );
+ p_media->vod.p_item = input_item_New( NULL, NULL );
p_media->vod.p_media = NULL;
TAB_INIT( p_media->i_instance, p_media->instance );
if( psz_name )
p_instance->psz_name = strdup( psz_name );
- p_instance->p_item = input_item_New( p_vlm, NULL, NULL );
+ p_instance->p_item = input_item_New( NULL, NULL );
p_instance->i_index = 0;
p_instance->b_sout_keep = false;
int i_ret;
input_item_t *p_input;
- p_input = input_item_NewExt( p_playlist, psz_uri, psz_name,
+ p_input = input_item_NewExt( psz_uri, psz_name,
i_options, ppsz_options, i_option_flags,
i_duration );
if( p_input == NULL )
if( !(p_item->i_children != -1 && b_flat) )
{
- input_item_t *p_new_input = input_item_Copy( VLC_OBJECT(p_playlist),
- p_input );
+ input_item_t *p_new_input = input_item_Copy( p_input );
if( !p_new_input ) return i_pos;
playlist_item_t *p_new_item = NULL;
if( psz_uri == NULL )
return VLC_EGENERIC;
- p_input = input_item_NewExt( p_playlist, psz_uri, psz_file,
+ p_input = input_item_NewExt( psz_uri, psz_file,
1, &psz_option, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_uri );
const char *const options[1] = { "meta-file", };
/* that option has to be cleaned in input_item_subitem_tree_added() */
/* vlc_gc_decref() in the same function */
- p_input = input_item_NewExt( p_playlist, psz_uri, _("Media Library"),
+ p_input = input_item_NewExt( psz_uri, _("Media Library"),
1, options, VLC_INPUT_OPTION_TRUSTED, -1 );
free( psz_uri );
if( p_input == NULL )
if( !psz_name ) psz_name = _("Undefined");
if( !p_input )
- p_new_input = input_item_NewWithType( VLC_OBJECT(p_playlist), NULL,
- psz_name, 0, NULL, 0, -1, ITEM_TYPE_NODE );
+ p_new_input = input_item_NewWithType( NULL, psz_name, 0, NULL, 0, -1,
+ ITEM_TYPE_NODE );
p_item = playlist_ItemNewFromInput( p_playlist,
p_input ? p_input : p_new_input );
if( p_new_input )