*/
VLC_EXPORT( char *, input_CreateFilename, ( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) );
+/**
+ * This function detaches resources from a dead input.
+ *
+ * It MUST be called on a dead input (p_input->b_dead true) otherwise
+ * it will assert.
+ * It does not support concurrent calls.
+ */
+VLC_EXPORT(input_resource_t *, input_DetachResource, ( input_thread_t * ) );
+
+/**
+ * This function releases the input resource.
+ */
+VLC_EXPORT(void, input_resource_Delete, ( input_resource_t * ) );
+
#endif
/* We owned this one */
input_Stop( p_input_thread, b_input_abort );
+
vlc_thread_join( p_input_thread );
+ assert( p_mi->p_input_resource == NULL );
+ assert( p_input_thread->b_dead );
+ /* Store the input resource for future use. */
+ p_mi->p_input_resource = input_DetachResource( p_input_thread );
+
var_Destroy( p_input_thread, "drawable-hwnd" );
var_Destroy( p_input_thread, "drawable-xid" );
var_Destroy( p_input_thread, "drawable-agl" );
p_mi->drawable.nsobject = NULL;
p_mi->p_libvlc_instance = p_libvlc_instance;
p_mi->p_input_thread = NULL;
+ p_mi->p_input_resource = NULL;
p_mi->i_refcount = 1;
vlc_mutex_init( &p_mi->object_lock );
p_mi->p_event_manager = libvlc_event_manager_new( p_mi,
var_DelCallback( p_mi->p_libvlc_instance->p_libvlc_int,
"vout-snapshottaken", SnapshotTakenCallback, p_mi );
- /* Realease the input thread */
+ /* Release the input thread */
release_input_thread( p_mi, true );
+ if( p_mi->p_input_resource )
+ {
+ input_resource_Delete( p_mi->p_input_resource );
+ p_mi->p_input_resource = NULL;
+ }
+
libvlc_event_manager_release( p_mi->p_event_manager );
libvlc_media_release( p_mi->p_md );
vlc_mutex_destroy( &p_mi->object_lock );
}
p_mi->p_input_thread = input_Create( p_mi->p_libvlc_instance->p_libvlc_int,
- p_mi->p_md->p_input_item, NULL, NULL );
+ p_mi->p_md->p_input_item, NULL, p_mi->p_input_resource );
if( !p_mi->p_input_thread )
{
return;
}
+ p_mi->p_input_resource = NULL;
p_input_thread = p_mi->p_input_thread;
var_Create( p_input_thread, "drawable-agl", VLC_VAR_INTEGER );
#include <vlc/vlc.h>
#include <vlc/libvlc_structures.h>
#include <vlc/libvlc_media.h>
+#include <vlc_input.h>
struct libvlc_media_player_t
{
int i_refcount;
vlc_mutex_t object_lock;
input_thread_t * p_input_thread;
+ input_resource_t * p_input_resource;
struct libvlc_instance_t * p_libvlc_instance; /* Parent instance */
libvlc_media_t * p_md; /* current media descriptor */
libvlc_event_manager_t * p_event_manager;
* FIXME it should NOT be defined here or not coded in misc/stats.c */
input_stats_t *stats_NewInputStats( input_thread_t *p_input );
-/**
- * This function releases an input_resource_t and all associated resources.
- */
-void input_resource_Delete( input_resource_t * );
-
/**
* This function deletes the current sout in the resources.
*/
/* input.c */
-/**
- * This function detaches resources from a dead input.
- *
- * It MUST be called on a dead input (p_input->b_dead true) otherwise
- * it will assert.
- * It does not support concurrent calls.
- */
-input_resource_t *input_DetachResource( input_thread_t * );
-
/* */
typedef enum
{