Apr 162009
 

After some tough time dealing with DirectShow stuffs, finally I can preview video from my own web cam now.

There will be something to be tuned at this moment, like how to arrange the command area and video areas, but I believe I’ve overcome one of the most difficult stuff.

There are still three potential headache ahead:

  1. P2P communication, theoratically it won’t be hard as I did it before, but with Ada I have to deal with those UDP stuffs again, just now sure how easy Ada can handle it
  2. Stream video out, means I need to have my own filter, or, maybe I can find an existing one doing that, but again, I’m not sure
  3. Showing streamed video from the other side (the remote window), have no idea so far

A friend told me I can rely on existing protocols like RSTP or MMS, I have the concerns of violating copyright/patents, but I do some research before picking the protocol I’m going to use. At this moment I prefer some cross platform protocol, maybe all of them are, but again (yes, again and again), I’m not sure.

I will try to see if there anyone who can give me some hints on how to do the layout, by now, I will pause the development for couple of days, take some rest, as I’ve made what I promised (preview video by the end of this week). ๐Ÿ™‚

Apr 152009
 

I guess I’ve got all necessary functions from DirectShow for PPCam project, and created a DirectShow binding. It is still partial as I didn’t check other APIs that are unrelated to PPCam project.

I keyed ~1,800 lines of codes today (include blank and comment lines), what I did is reading MSDN, dig out what kind of APIs I need to use, then check Windows SDK to get the C version of declaration, and write binding. There is a great sample from adapower.org, which taught me how to make it.

Actually this is a nice exercise, using Ada doing DirectShow stuffs is actually using C interface. DirectShow is purely COM based so using OO language, especially C++ is the most natual way, but, I still believe using C is the best way to understand what’s inside, and this helps me know more about the whole structure, and do help implementing good programs.

Apr 112009
 

I got a sample from Windows SDK that uses DirectShow to capture video from webcam, it works for now but I’m still reading, just need to know how much it can fit into my PPCam project.

The problem is, I need to make the C program works for me to capture video and put an extra filter to grab data and send to the other end, and after that I need to convert the program from C to Ada. Or, I should start from the sample provided by the SDK and convert it to Ada, then see how to get the extra filter.

I just made the decision to go with the #2 option, it will make more activities in PPCam project, and would let me think more in Ada way.

By the way, I got all my useful search results from Yahoo, it seems to me Yahoo is not that far away from Google in web search, guess we can slowly get market share back.

Apr 042009
 

I just checked in new codes of PPCam to SVN on sourceforge.net, I guess I won’t spend too much time on visual effect in the future, so what we have now is most likely what we have all the time:

  • no Windows gadget, i.e. no toolbox, no menu, no border, no title bar
  • semi-transparent effect, means you can still read content on windows below PPCam
  • Moving by any point, means you can click on any position of the window and drag & drop the window to the new place, this is a must as it does not have title bar for this

Note that this is data driven ๐Ÿ˜‰ , I learnt the idea from previous music player project – you can just provide a bmp file, and the application will take top-left point as “transparent sample”, then any points in the bmp that has the same color as top-left point will be treated as transparent. This feature makes really easier to change the look and feel.

Other than these visible changes, that are some codes related changes, may or may not be that interesting:

  • Added win32api.ads to include those Win32 APIs that the project needs to use, but are missing in win32ada binding
  • PPCam now becomes a dummy top level package, it used to have those data conversion functions but obviously I can use those from win32ada
  • Added a bmp to the source, this is the bmp I used to debug/demo
  • I’m trying to turn some functions to procedures whenever I don’t need a return code, I think this is another C habit needs to be changed

There will be couple of parts of features to be done in the coming days

  1. Include vfw features, I haven’t got any idea so far
  2. Pop-up menus for the interface to let user enter user name/password/server name, etc
  3. Network, UDP only, then later on I need to have P2P based on it
  4. Server, another GNAT Ada program that will be running on a server to handle authentication, port discovery, etc

I believe this project will be running pretty long thinking of how much I have to learn, if I can make a workable version by June I will be super happy.

I will try to check in at least every week so to make the project active, I will also post documents (svn first, web site later) so to make it possible for others to understand the whole project well.

Apr 042009
 

Slowly, I found more and more evidence that win32ada is based on really old Win32 APIs, be more precisely, it may support Windows 95 but definitely not Windows NT 4.0. I believe the mainstream Windows platform today is XP, with some Vista, so win32ada misses a lot.

I was thinking to create a new package to include those missing APIs that are necessary to my project, but turned out sometime it is impossible – some structures are not 4.0 compatible, so most likely I am still programming for Windows 95.

Now I am, seriously, thinking about creating my own binding, which supports modern Windows APIs, either Vista, or 2008. I can start with manually creating bindings that my project needs, then after making sure I’m doing the right thing, I can run those tools to create full set binding in a (semi-) automatic way.

I will try to avoid layered packages, as I don’t want to do “use” unless it is really necessary (such as “use type” for operators), but remembering where the definition comes from is really tough – WinUser? WinDef? WinGDI? I think they are just C functions stay in same name space, so should be safe to put them in same package.

I know it will be a super big package, but I don’t think people even want to know about it.