Posted: Fri Dec 07, 2007 10:00 am Post subject: [Asterisk-video] Compiling/using app_h324m and libh32m on 64
Hi all,
First of all: Sergio, thanks a lot for all your excellent work!
We found several problems when using libh324m and app_h324m on 64 bits.
Hopefully this helps others trying to compile on 64 bits platforms (and
Sergio: maybe it fixes a bug in your code).
* The most important problem is a possible bug in the app_h324m code:
It seems, in an ast_frame, the framedata is put at the end of the struct
after a gap of AST_FRIENDLY_OFFSET bytes. The position of the pointer is
determined in the following line:
/* Set data */
send->data = (unsigned char*)send + AST_FRIENDLY_OFFSET;
(this is line 153 of app_h324m.c)
If this is used on a 64 bits platform the send->data pointer will point
into the struct. This is because the size of the ast_frame struct itself
is not taken into account when calculating the pointer. So, we think it
should be:
/* Set data */
send->data = (unsigned char*)send + sizeof(struct ast_frame) +
AST_FRIENDLY_OFFSET;
We are not C guru's so we could be wrong but after this change recording
video (mp4_save) works fine. Before the change, the ast_frame got
corrupted after setting variables in the timeval struct:
* In libh324m in several files the size of the pointer should change
from unsigned int to unsigned long. The files are H245MasterSlave.cpp
(line 29), H324MAL2.cpp (line 79), H324MSession.cpp (line 64) and
FileLogger.cpp (line 46 and line 105).
Posted: Sun Dec 09, 2007 8:11 pm Post subject: [Asterisk-video] Compiling/using app_h324m and libh32m on 64
Hi Bjorn
Thanks for the fix, I've commited it to the repository. I'll check the
unsigned long issue also
during the week.
Best regards
Sergio
----- Original Message -----
From: "Bjorn Hijmans | Mobillion" <Bjorn.Hijmans@mobillion.nl>
To: <asterisk-video@lists.digium.com>
Sent: Friday, December 07, 2007 10:52 AM
Subject: [spam][Asterisk-video] Compiling/using app_h324m and libh32m on 64
bitplatforms
Quote:
Hi all,
First of all: Sergio, thanks a lot for all your excellent work!
We found several problems when using libh324m and app_h324m on 64 bits.
Hopefully this helps others trying to compile on 64 bits platforms (and
Sergio: maybe it fixes a bug in your code).
* The most important problem is a possible bug in the app_h324m code:
It seems, in an ast_frame, the framedata is put at the end of the struct
after a gap of AST_FRIENDLY_OFFSET bytes. The position of the pointer is
determined in the following line:
/* Set data */
send->data = (unsigned char*)send + AST_FRIENDLY_OFFSET;
(this is line 153 of app_h324m.c)
If this is used on a 64 bits platform the send->data pointer will point
into the struct. This is because the size of the ast_frame struct itself
is not taken into account when calculating the pointer. So, we think it
should be:
/* Set data */
send->data = (unsigned char*)send + sizeof(struct ast_frame) +
AST_FRIENDLY_OFFSET;
We are not C guru's so we could be wrong but after this change recording
video (mp4_save) works fine. Before the change, the ast_frame got
corrupted after setting variables in the timeval struct:
* In libh324m in several files the size of the pointer should change
from unsigned int to unsigned long. The files are H245MasterSlave.cpp
(line 29), H324MAL2.cpp (line 79), H324MSession.cpp (line 64) and
FileLogger.cpp (line 46 and line 105).
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum