コード例 #1
0
ファイル: media.c プロジェクト: LDiracDelta/vlc_censor_plugin
/**************************************************************************
 * input_item_subitem_added (Private) (vlc event Callback)
 **************************************************************************/
static void input_item_subitem_added( const vlc_event_t *p_event,
                                       void * user_data )
{
    libvlc_media_t * p_md = user_data;
    libvlc_media_t * p_md_child;
    libvlc_event_t event;

    p_md_child = libvlc_media_new_from_input_item(
                p_md->p_libvlc_instance,
                p_event->u.input_item_subitem_added.p_new_child );

    /* Add this to our media list */
    if( !p_md->p_subitems )
    {
        p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance );
        libvlc_media_list_set_media( p_md->p_subitems, p_md );
    }
    if( p_md->p_subitems )
    {
        libvlc_media_list_add_media( p_md->p_subitems, p_md_child );
    }

    /* Construct the event */
    event.type = libvlc_MediaSubItemAdded;
    event.u.media_subitem_added.new_child = p_md_child;

    /* Send the event */
    libvlc_event_send( p_md->p_event_manager, &event );
    libvlc_media_release( p_md_child );
}
コード例 #2
0
ファイル: rbvlcmedialist.c プロジェクト: Vasfed/ruby-gnome2
/*
 * Associate media instance with this media list instance.
 * If another media instance was present it will be released.
 * The {#lock} should NOT be held upon entering this function.
 *
 * @param [VLC::Media, Hash] media the media instance or specify media Hash (see {VLC::Media#initialize})
 * @return [VLC::Media] the media instance
 * @raise [ArgumentError] Invalid or unsupported arguments
 * @todo fixme
 */
static VALUE
rg_set_media(VALUE self, VALUE media)
{
    media = get_media(self, media);
    libvlc_media_list_set_media(_SELF(self), RVAL2VLCMEDIA(media));
    return media;
}