Accessing modules from other modules (question)

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
CryHavoc
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Apr 2004 22:28

Accessing modules from other modules (question)

Postby CryHavoc » 06 Jun 2004 23:30

I created a control module (modules/control/xxxx.c). I added it to the modules.am and compiled it clean. It runs fine.

Now I want to access it from modules/control/http.c using the ubiquitous vlc_object_find( p_input, <object type>, <search method>).

The <object type> is defined in include/vlc_objects.h.

Can someone explain to me how the object is located based on this define, or explain to me how to find a loaded module so I can access it.

Regards

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 07 Jun 2004 13:32

A control module could be loaded by passing it in the extraintf parameter to vlc. Or it could be loaded from source by using VLC_AddIntf() at the libvlc level or intf_Create() at the vlc-internal level. You should try not to use vlc_object_find to find an instance of a controller module.

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 07 Jun 2004 13:42

I would guess that a intf is the child of the object passed to intf_Create(), so you could find it with vlc_object_find() with that object as first parameter and the FIND_CHILD search method.

btw what does this module do?`(so we can reduce duplicate efforts in case someone else also wants this functionallity)

CryHavoc
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Apr 2004 22:28

Postby CryHavoc » 07 Jun 2004 20:35

Currently working on a live stream (TV capture) timeshifting implementation.

- Built a DirectShow Filter which captures live streams and writes a set of n-minute files (defined minutes per file and defined number of files in a rotating queue). i.e. 24 files each of 5 mins gives 2 hour pause/rewind buffer.
- Modified File Access Module to synchronize with the DirectShow filter (graph). It essentially treats the graph as a file by implementing its own Open/Read/Seek/Close methods to simulate a single file.
- Created a tvtuner control module to allow the changing of channels/input/whatever.
- Modified control/http to add tuner control functions (channel changing 'MVLC_CHANNEL', etc.)
- Modified vlc_object.c & h (VLC_OBJECT_TVTUNER) to recognize plugin interface struct.

The last part I did yesterday after going to the irc chat and speaking with <fen>. I am not an official developer of VLC to any degree. I just started peeking at/poking at VLC in the last couple of weeks after getting frustrated with my homebrew PVR being done entirely with Java/DirectShow. I am currently playing with the VLC core to replace the DirectShow core that I had implemented.

I am mainly an OO developer and haven't used straight C in 10 years or so (mainly C++ and Java). 80% windows 20% other. Current development is being done with a combination of Cygwin, MSVC, Netbeans, ANT using 0.7.3 vlc-trunk.

I don't know if my work is worthy enough to be coordinated with the real developers, since I am just beginning to figure the system out. I realize from <fen> that someone is about to rewrite the input core.

If you have any additional questions about what I am screwing with, feel free to contact me.

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 07 Jun 2004 21:37

Sounds like interesting stuff. I would love to see the record-in-certain-chunk-sizes brought in as a mainstream feature, generalized (not necessarily attached to DirectShow input). The reason is for record/replay of streamed video. You have 1 to N cameras at remote locations, point-to-point WAN links to a central location. At the central location you want to let operators be able to select what camera they are watching, no problem, but you also want to do record/replay of the streams. A 5 minute boundary feels reasonable, maybe something with a 30-character filename of the form: YYYYMMDDHHmm18_character_user_supplied name
Year/month/day/hour/minute/name_of_stream makes for a relatively straightforward mechanism for selecting the files during replay. The 18_character_user_supplied_name should be stored in a vlc conf file, and, ideally, able to be input at a VLC command line (so that you can have multiple isntances running on one machine, each recording their own video stream).

CryHavoc
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Apr 2004 22:28

Postby CryHavoc » 07 Jun 2004 22:11

I will look into a file naming scheme as per your suggestion. Currently using Buffer[index].mpg.

My question above was based on an attempt to keep the file buffer reading separate from the DirectShow graph control. File_access just thinks its reading from a single file (allowing one to replace the capture/control portion with another mechanism).

The 5 min buffers may not always be 5 mins. During testing, I noticed that at startup a number of seek requests are made (4 for some reason). So now when I change channels I force a new buffer (file) to be started. Not sure the entire reason for the seeks, but empirical testing has shown that if a file is opened and run, the startup time is almost instant. If a file is open then a seek is done to the end (to get to the current live point), this takes about 8 seconds on my machine (2.4 ghz Pentium 4). If this sounds confusing, it may be because I am confused.

Currently, the timeshifting stuff is kicked off by file_access recognizing "TVCapture" as the fle name. This will no doubt need to be changed to something more inline with the VLC development philosophy. As I said earllier, I've just started understanding VLC and there is still a lot more to learn.

Thanks for the support.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 32 guests