[vlc-devel] Re: 3 developer questions: media info, keyboard/mouse input, navigation entries

Derk-Jan Hartman hartman at videolan.org
Sat Jul 23 18:39:57 CEST 2005

On 23 jul 2005, at 18:07, R. Bernstein wrote:
> Any ideas as to how to get "Media Information" appear in "Stream and
> Media Info" when there is no stream initialized?
> For bookmarks there is
>     (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,  
> to find a stream so that the bookmarks can squirrel that information
> away.
> First, it strikes me as a little bit unclean to look for input objects
> anywhere. In my case, I really don't want the input object, but a
> handle to that "Stream and Media" page.

psz_temp = vlc_input_item_GetInfo( &p_item->input, _("Meta- 
information"), _("Artist") );
Where p_item is the playlistitem which you would like to query.

> But second, in the tests I tried in fact there were no streams at
> all. Not surprising since I was "probing" for media.

Correct, if nothing is playing, then there is no active input object  
in the object chain.

> One thought I had was to create a dummy null stream. But now this
> might cause problems in those other places. For example if that
> bookmark place found the dummy null stream, it wouldn't have anything
> to bookmark and worse it would keep it from bookmarking another stream
> should it exist.

please get rid of any such terrible hacky thoughts you have.

> (This brings up a related point: is there a way to find *all* input
> objects? The above just finds a single *any* one. If so probably the
> bookmark code and other place shuld be changed to work on all rather
> than any.)

Use the playlist.

> Another downside of the dummy stream idea, is that somehow I'd need to
> arrange for it to get destroyed.
>  - - -
> I'd like to get mouse and keyboard input in the VCD plugin. Looking at
> code in modules/access/dvdnav.c and I think in a past queries I
> believe I was told that one has to add code for a custom demuxer.  In
> the past made forays into doing that; it's a bit complex and I was not
> successful.

I don't think this is really necessary. I say a separate Eventthread  
such as present in dvdnav.c (housing EventMouse and EventKey) that  
polls the mouse and key variables should be enough.

> (Nor have I been successful in getting someone to
> volunteer to do so.)
Well those VCDs with menus never really did catch on in Europe. I  
gather that explains this more than anything.

> When I look at the code in modules/control/gestures.c, that's a lot
> simpler.

> So wouldn't it be possible to add a keyboard control module for VCD
> input and just somehow trigger events like front-ends do? If events
> like "Digit *n* entered" or "Mouse click at position *x,y*" were  
> added,
> at least for the VCD side, the control module could be generic.

These events are already present. Simply place callbacks on the  
respective mouse and key variables. The callbacks will be executed  
when the variable receives a changed value. The OS interfaces will  
set the correct variables whenever mouse position or key command is  
entered in the vout window.

> And
> probably it would be helpful on any access module that wants to field
> these events but doesn't want to write a demuxer which probably shares
> a bit of common code with other custom demuxers.

The only reason it might have to be a demuxer, is that some commands  
are simply not doable at the access level i guess. Still you can  
probably set them at the higher level api perhaps. However if some of  
the commands simply need to use demux_Control commands instead of  
access_Control commands, then the access module indeed probably needs  
to migrate to access_Demux module instead. Still i see no real reason  
this would still be necessary in the current VLC design.

>  - - -
> In the VCD plugin I set up "Navigation" menus to select "LIDs" and
> "Segments." However, I find that the VCD plugin gets called back via
> SET_TITLE with the positon of the parent "Segment" or "LID". I'm at a
> loss as to how I can get the submenu value.

SET_CHAPTER perhaps? I'm just making a guess, since i have no idea  
what LIDs are exactly.

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list