PDA

View Full Version : XviD versioning


dr.Prozac
20th March 2006, 13:23
Hi !

This message is directed to all XviD developers.
I am wondering why there is no version info contained in the XviD library file :confused:
Each library application like avisynth.dll, vobsub.dll and the like contains its version number.
In my opinion it is a fundamental and basic importance for every application to include the version number in an executable file or the library.
XviD is one of the most popular encoders used by many various GUI applications. XviD versions change dynamically. The settings change. If we are not able to detect the right version of XviD we are also not able to set the right settings for the encoder.
I'm sure many developers encountered difficulties related to this subject. Many programmers solve this problem by supporting only one or two versions of XviD.
My own program has to search for XviD version in releasenotes.txt file in XviD installation directory or get the registry value stored under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XviD_is1
But what about other compilations that do not contain releasenotes.txt file or even the setup installer.
So this is my big request and entreaty (especially to Koepi) to include the File Version and Product Version numbers to the xvidvfw.dll files
:thanks:

celtic_druid
20th March 2006, 15:15
I could add version info, but I don't see xvidvfw as that important since it is xvidcore that does the encoding.

dr.Prozac
20th March 2006, 16:18
I could add version info, but I don't see xvidvfw as that important since it is xvidcore that does the encoding.
Sure, xvidcore.dll is a main encoding library.
I was thinking exactly about xvidcore though xvidvfw is also a part of the codec so I won't be be offended if it also contains a version info ;)
So please, consider my request.
I'm sure it will be very very useful for many developers and programmers :)
:thanks:

celtic_druid
20th March 2006, 16:35
xvidcore already has version info. Check the xvid VfW about box or mplayer/mencoder when using xvid to encode/decode.

dr.Prozac
20th March 2006, 19:41
Hmmm. I can't see it. Windows doesn't see any version info. So how can I grab it by my application ?

celtic_druid
21st March 2006, 04:16
Have a look in xvidcore/vfw/src/config.c or main/libmpcodecs/ve_xvid4.c/vd_xvid4.c

http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/~checkout~main/libmpcodecs/ve_xvid4.c?rev=1.25&content-type=text/plain
http://www.xvid.org/cvs/chora/co.php/xvidcore/vfw/src/config.c?login=2&r=1.31

sysKin
21st March 2006, 08:05
Hmmm. I can't see it. Windows doesn't see any version info. So how can I grab it by my application ?

#include "xvid.h"

{
xvid_gbl_info_t info;
HINSTANCE m_hdll;

memset(&info, 0, sizeof(info));
info.version = XVID_VERSION;
m_hdll = LoadLibrary(XVID_DLL_NAME);
if (m_hdll != NULL) {
((int (__cdecl *)(void *, int, void *, void*))GetProcAddress(m_hdll, "xvid_global"))(0, XVID_GBL_INFO, &info, NULL);

printf("xvidcore.dll version %d.%d.%d (\"%s\")",
XVID_VERSION_MAJOR(info.actual_version),
XVID_VERSION_MINOR(info.actual_version),
XVID_VERSION_PATCH(info.actual_version),
info.build);

FreeLibrary(m_hdll);
} else {
printf("xvidcore.dll not found!");
}

dr.Prozac
21st March 2006, 18:08
Hi guys !

Thanks for your replies.

Well, I'm not very familiar with C++. I use Delphi Pascal and the following code to get the file versions:

function GetVersion(sFile: string; bIncludeBuild : boolean): String;
var
dwfvw, dwZero, dwvsf: DWORD;
Major, Minor, Release, Build : DWord;
pfvw: PChar;
pvsf: PVSFixedFileInfo;
s: String;
begin
Result := '';
dwfvw := GetFileVersionInfoSize(PChar(sFile), dwZero);
if dwfvw <> 0 then
begin
GetMem(pfvw, dwfvw);
try
if (GetFileVersionInfo(PChar(sFile), dwZero, dwfvw, pfvw)) then
begin
if (VerQueryValue(pfvw, '', Pointer(pvsf), dwvsf)) then
begin
if ((pvsf^.dwFileFlags and VS_FF_PRERELEASE) > 0) then
begin
s := 'beta; '
end
else
begin
s := '';
end;
Major := HIWORD(pvsf^.dwFileVersionMS);
Minor := LOWORD(pvsf^.dwFileVersionMS);
Release := HIWORD(pvsf^.dwFileVersionLS);
Build := LOWORD(pvsf^.dwFileVersionLS);

if bIncludeBuild then
begin
if Release > 0 then
begin
Result := Format('Version %d.%d.%d Build %d',[Major, Minor, Release, Build])
end
else
begin
Result := Format('Version %d.%d Build %d',[Major, Minor, Build])
end;
end
else
begin
if Release > 0 then
begin
Result := Format('Version %d.%d.%d',[Major, Minor, Release])
end
else
begin
Result := Format('Version %d.%d',[Major, Minor])
end;
end;
end;
end;
finally
FreeMem(pfvw);
end;
end;
end;


Using this code I am not able to get xvidcore version number. Every time I get an empty string although I can get the version of avisynth.dll, vobsub.dll and other libraries which versions are displayed by the Windows explorer.

dr.Prozac
27th March 2006, 21:43
Well, as I can see you are confusing the VersionInfo which is set in project properties with the version info in the file properties. I'm not talking about the project. I'm talking about the final product and the information included in its about box. Hope you will consider your standpoint of this issue.
Thanks.

squid_80
28th March 2006, 03:11
That is up to the person compiling the dll to implement. xvid.org only provides the source code, not the "final product."

sysKin
28th March 2006, 05:21
Well, as I can see you are confusing the VersionInfo which is set in project properties with the version info in the file properties. I'm not talking about the project.
Who? No one is talking about the project, in fact ~50% of XviD builds out there were not built with the VS project at all.

I'm talking about the final product
xvid.org's final product is source code, just like squid_80 said.

I'm talking about the final product and the information included in its about box.
The code I posted above is almost a direct copy&paste of VfW's about box.


xvid.org doesn't release binaries so has virtually no way of including version numbers in these binaries. What we could do is modify official windows build scripts (which are VS6 project and cross-platform Makefile) to include the version number, but you would have to invent a way for these scripts to automatically extract version number from xvid.h and put it into library. We'll definitely not be able to update makefiles separately with every version change.

Note that xvidvfw.dll and xvid.ax don't have versions at all, only xvidcore.dll has.

dr.Prozac
28th March 2006, 09:12
OK. Now I know everything.
So, seems my thread and my request are directed to people compiling the final dll libraries and making the installers.

bxfy
2nd April 2006, 13:20
I could add version info, but I don't see xvidvfw as that important since it is xvidcore that does the encoding.
yes i agree