AVI file format : inconsistent interpretation of size fields

26 05 2008

I started again a kind of AVI Riff format viewer for Macintosh. Because Mac is used a lot in video industry and handling AVI file formats is very crucial. So, it would be nice if we have such a program for the Macintosh. Although there is a command line interface version of RIFF viewer, GUI version seems not to exist.

Anyway, while I was parsing the RIFF format, I found something inconsistent and which was not documented well. Let’s take a look at basic format which is related to what I describe.
Difference in size fields for movi and idx1 chunk

The value of size field in movi chunk means the size of data. For example, for 01dc block, the size field contains value for the size of its following data.

On the other hand, the idx1 chunk has its own 01dc chunks and each 01dc chunk has its own size field. The size field means the whole 01dc chunk size, i.e its fcc type ( 01dc), the size field, and a data field. So, the whole 01dc chunk size is 16 bytes, not the one indicated by the size field, while that of movi chunk is the actual data size.

So, be careful in parsing the RIFF format.
I’m checking if each field is parsed OK. Most are not documented.





GNAT vs. GNATS : Crazy open source names

22 03 2008

I wanted to compile a GHDL for my PowerPC iMac G4 17″.
However, instead of compiling it for myself, I tried the MacPort to download prebuilt binaries for the necessary tools.
I knew that gnatmake is necessary. It seems to me that it is in GNAT project. So, I searched the MacPort. Oh.. there is the GNATS.
So, I downloaded it. But there was no gnatmake.

So, probably the gnats has something wrong, and decided to build for myself. Hmm.. I downloaded the GNAT. and it complains some conflicted declaration on wswap, and so on.
I didn’t want to waste my time, although I tried modifying troubled source codes at least. So, I searched where I can get the gnatmake from the MacPort.

Wow.. what I found out from searching is that GNAT is different from GNATS.

GNAT is a GNU bug tracking software, while the GNATS is the Ada compiler.

Wow…………………..
People should be careful about naming projects…





Duh….MSDN document AVIMAINHEADER vs. MainAVIHeader

3 03 2008

I don’t understand the mechanism MS people think.

Try finding AVIMAINHEADER and MainAVIHeader on the MSDN site.

They are very similar structure, but the MSDN document doesn’t explain what they are, how they are different, and when to use what.

AVI format is also very bad.

There is a so-called original AVI format, called AVI 1.0, while there is another one called, OpenDML.

They are not compatible, and there seems to be no way to detect what format a specific AVI file is stored as by looking at the beginning part of the header.

Also, OpenDML document mentions “hybrid” format, but there is no explanation on how the hybrid format looks like.

I don’t like explanation and writing style on the MSDN.

P.S. I’m sorry that I posted a few complaints recently. I want to write only technical issue, but sometimes I need to complain.





So religious fight between Windows people and Mac people

1 03 2008

What a great day!

I posted my inquiry to the Apple’s mailing list, darwin-drivers@lists.apple.com, and a USENET newsgroup, microsoft.public.development.device.drivers.

My question is how to get information on H/W to write a device driver. That question is very platform independent and specific to devices.

One of the response I got from the MS newsgroup is :

You bought a MacBook to run Windows, interesting idea. And you bought a
notebook (MacBook)because you want to write drvice drivers for those devices
(designed for Mac)not supported by Windows. Don’t quite get it. I thought
Apple is eviler than Microsoft.

Windows HC miniport is completely undocumented, good luck.

Calvin

Many developers buy Mac H/W because they can use tools which are only available or better on  one platform. There are many developers who should write their code for the two platforms, and so on. I’m one of them. The reason I want to write drivers for the MacBook is that I want to make my devices recognized, and actually I want to learn how to develop drivers.

Another response is from the Apple’s mailing list.

On Feb 29, 2008, at 1:42 PM, JongAm Park wrote:

> I’m trying to write my own mouse driver and external HDD driver for the Windows XP x64 installed on my MacBook.
> Although I understand that this mailing list, darwin-drivers@lists.apple.com, is for device driver developers for the MacOS X, I think my inquiry is common to any driver writer. So, please understand my post.

“I understand that this mailing list is not for the questions I ask, but I am going to ask them anyway”.

You’re right, it’s not.

> I found out that the MS HID-compatible device driver doesn’t work with mice connected to the MacBook on Windows XP x64. Also, My external HDD, more specifically the enclosure manufactured by the Vantek, doesn’t work with it.
> So, I decided to write my own device driver for them. ( Anyway, the reason I bought a MacBook was to study writing device drivers. )
> So, I need H/W information for the Apple’s own H/W.

Why? And what “Apple’s own H/W”?

> For example, what address are allocated for devices like the USB hub controller and so on, what I/O model they use, i.e. memory mapped I/O or port I/O, what IRP do they expect, etc.

The USB host controller works fine with your vendor-supplied driver; the “advice” you got from the “MS device driver newsgroup” is bad.

Make sure that you have the most recent BootCamp driver pack installed, and contact your operating system vendor for support. It’s what you paid them for, right?

= Mike

People say that the Mike, or Michael Smith, is a developer at the Apple.
How unprofessional response it is!!!
Does he even understand what device drivers are?
I wanted to know information on Apple’s own H/W which you should know to write device drivers. He maybe a too strong pro-Apple, but he should understand that “Windows”-installable Mac actually helps selling the Mac, and it becomes sound foundation for the Apple’s success.

I’m not going to pirate things and do hacking.

Why do they act so childish?





Xcode 3.0/Objective-C 2.0 and its previous version

24 02 2008

Well, I like the new features of the Xcode 3.0. It has nicer debug feature, and more streamlined menus. For example, “Find/Replace” menu items are now under the Edit menu, which is consistent with other programs. I didn’t understand why there have separate source editor window open for debug session, find session, and so on. Now, with the Xcode 3.0, there is a mini debugger with which you can debug right from the source code editor. (This is not so great feature for the Visual C++ programmers. Except for the Cocoa/Objective-C, I don’t like the overall Xcode environment. )

Research Assistance, code folding and colorization with the code folding are great.

… Until you find out that you can’t install it on the MacOS X 10.4 Tiger.

Well, there are framework functions which are only available to the OS X 10.5 leopard. However, it doesn’t mean that the Xcode, the Interface Builder, and the Objective-C 2.0 should be prohibited from the pre-MacOS X 10.5 Leopard. However, they can’t be installed on the Tiger.

Also, the new Xcode 3.0 doesn’t have an option to convert code from Objective-C 2.0 syntanx to pre-2.0 syntax, although it has a menu item for converting pre-Objective-C 2.0 syntax to Objective-C 2.0. In my opinion, the MacOS X 10.4 Tiger is quite a robust OS. It has most of the features people need. The new features of the 10.5 are just auxillary. Given that in mind, if someone gave you source codes written in the Objective-C 2.0 syntax, you can’t compile them without modifying them.  If converting from pre-2.0 to 2.0 is possible, then it should be possible to do so in opposite direction.

To me, the Apple Inc. starts showing its greediness. The Apples seems to force programmers to upgrade their OS.  To the contrary, the MS made it possible to use the Visual C++ 2005 for building codes targeted to the Vista. Probably it is because lots of programmers are reluctant to follow the MS way nowadays. The migration to the Vista is said to be “not so popular” although the MS says differently. Probably it is the  reason.

Then, does Apple people think that they gained enough number of independent programmers and S/W companies?





The 3rd graded product

17 02 2008

Well, I know it is pretty hard to design and implement operating systems. Although there are many people who don’t like the Windows, I should say that people who made it are great.

OK. Let’s start based on that. Although I understand how difficult it is to make operating systems, something is wrong with the Windows.

I have used my external HDD, which I assembled. The enclosure is from a company, Vantec, and its model name is NST-350UF. It supports the Firewire and the USB at the same time. So, I hooked it up to a Mac via the Firewire, and a PC via the USB.

However, I recently upgraded the Windows to the Windows XP x64, and hoped that it would work flawlessly. You know, if a machine understand the Firewire protocol and the USB protocol, it should be no problem in using that.

However, the Windows XP x64 detected that it was a new device, and failed in installing a device driver for it! The Vantec provides drivers only for Windows 98!

Then how come the Apple Mac OS X have had no problem in using it!!!

As I mentioned, there should be no problem if it understand the standard protocol!

What’s wrong with the Windows XP x64? It has a device driver for the Firewire and the USB!!

You know, although Mac also has some quality issue and some bugs because people make it, the design consideration looks very good. However, the Windows is not.

Whether it is good or not becomes clear when it approaches its edge!