Log in

View Full Version : Latest GPAC not compatible with x264?


bnshrdr
7th March 2010, 05:21
I have been trying to compile GPAC with x264, but if I grab the latest release, 0.4.5, x264 tells me it is too old. So I grabbed the latest cvs and get the following errors when compiling x264:
output/mp4.o:mp4.c:(.text+0x273): undefined reference to `free_is_disabled_in_gpac_use_gf_free'
output/mp4.o:mp4.c:(.text+0x3d8): undefined reference to `free_is_disabled_in_gpac_use_gf_free'
output/mp4.o:mp4.c:(.text+0x622): undefined reference to `malloc_is_disabled_in_gpac_use_gf_malloc'
output/mp4.o:mp4.c:(.text+0x652): undefined reference to `malloc_is_disabled_in_gpac_use_gf_malloc'
output/mp4.o:mp4.c:(.text+0x687): undefined reference to `malloc_is_disabled_in_gpac_use_gf_malloc'
output/mp4.o:mp4.c:(.text+0x6a2): undefined reference to `malloc_is_disabled_in_gpac_use_gf_malloc'
output/mp4.o:mp4.c:(.text+0x92d): undefined reference to `malloc_is_disabled_in_gpac_use_gf_malloc'
output/mp4.o:mp4.c:(.text+0xa3f): more undefined references to `malloc_is_disabled_in_gpac_use_gf_malloc' follow
output/mp4.o:mp4.c:(.text+0xb18): undefined reference to `free_is_disabled_in_gpac_use_gf_free'
output/mp4.o:mp4.c:(.text+0xc66): undefined reference to `free_is_disabled_in_gpac_use_gf_free'
collect2: ld returned 1 exit status
make: *** [x264.exe] Error 1

Is anyone else having problems or have a suggestion as to how I can compile my own gpac for use with x264?

Dark Shikari
7th March 2010, 07:38
GPAC developers decided to randomly break their API for no reason without telling anyone.

And I thought we were the king of that.

Next x264 release will have a fix, thanks to VFRManiac.

bnshrdr
7th March 2010, 18:25
So what build has everyone been using? Or is this fix coming within the next few days or so and I should just wait?

roozhou
7th March 2010, 18:27
Any reason to use new GPAC? Does new version bring any bugfix or improvement in MP4 muxing?

bnshrdr
7th March 2010, 18:35
Absolutely no idea. I was just using it due to the fact that x264's configure reported 0.4.5 was out of date.

qyot27
7th March 2010, 23:54
I don't remember any warnings about GPAC, and I'm using 0.4.5. The git log mentions the GPAC version check was implemented 12 days ago, and I did a build of 1471 two days ago. Where in the output does the warning appear? Maybe I just overlooked it.

But despite that, I don't know of any problems concerning GPAC 0.4.5 and x264 interacting - it's always worked fine for me. I tried to build GPAC from CVS a few days ago and miserably failed, even though 0.4.5 compiles fine for me using the exact same steps.

bnshrdr
8th March 2010, 00:17
Huh, strange, I just recompiled GPAC 0.4.5 (if failing half-way through but taking libgpac_static.a out is considered recompiled) and x264 didn't complain. I swear my distribution of MinGW/MSYS is screwed up.

Cerera
13th March 2010, 19:01
Try this:

diff --git a/output/mp4.c b/output/mp4.c
index b99eaed..21548a2 100644
--- a/output/mp4.c
+++ b/output/mp4.c
@@ -104,7 +104,7 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
if( p_mp4->p_sample )
{
if( p_mp4->p_sample->data )
- free( p_mp4->p_sample->data );
+ gf_free( p_mp4->p_sample->data );

gf_isom_sample_del( &p_mp4->p_sample );
}
@@ -145,7 +145,7 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
gf_isom_close( p_mp4->p_file );
}

- free( p_mp4 );
+ gf_free( p_mp4 );

return 0;
}
@@ -165,7 +165,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle )
}
fclose( fh );

- if( !(p_mp4 = malloc( sizeof(mp4_hnd_t) )) )
+ if( !(p_mp4 = gf_malloc( sizeof(mp4_hnd_t) )) )
return -1;

memset( p_mp4, 0, sizeof(mp4_hnd_t) );
@@ -216,7 +216,7 @@ static int set_param( hnd_t handle, x264_param_t *p_param )
gf_isom_set_track_layout_info( p_mp4->p_file, p_mp4->i_track, dw, dh, 0, 0, 0 );
}

- p_mp4->p_sample->data = malloc( p_param->i_width * p_param->i_height * 3 / 2 );
+ p_mp4->p_sample->data = gf_malloc( p_param->i_width * p_param->i_height * 3 / 2 );
if( !p_mp4->p_sample->data )
return -1;

@@ -242,11 +242,11 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal )
p_mp4->p_config->AVCProfileIndication = sps[1];
p_mp4->p_config->profile_compatibility = sps[2];
p_mp4->p_config->AVCLevelIndication = sps[3];
- p_slot = malloc( sizeof(GF_AVCConfigSlot) );
+ p_slot = gf_malloc( sizeof(GF_AVCConfigSlot) );
if( !p_slot )
return -1;
p_slot->size = sps_size;
- p_slot->data = malloc( p_slot->size );
+ p_slot->data = gf_malloc( p_slot->size );
if( !p_slot->data )
return -1;
memcpy( p_slot->data, sps, sps_size );
@@ -254,11 +254,11 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal )

// PPS

- p_slot = malloc( sizeof(GF_AVCConfigSlot) );
+ p_slot = gf_malloc( sizeof(GF_AVCConfigSlot) );
if( !p_slot )
return -1;
p_slot->size = pps_size;
- p_slot->data = malloc( p_slot->size );
+ p_slot->data = gf_malloc( p_slot->size );
if( !p_slot->data )
return -1;
memcpy( p_slot->data, pps, pps_size );

bnshrdr
14th March 2010, 00:52
Works well, thanks!

Sammydoll
14th April 2010, 11:57
It is convenient to have your MinGW installation mounted on /mingw, since /mingw is on MSYS PATH by default. For this to work, just type (assuming MinGW is on c:\mingw):
mount c:/mingw /mingw
To install 3rd party library and applications which uses the autotools build system the following commands are often used.

./configure --prefix=/mingw
make
make install

JEEB
14th April 2010, 12:25
It is convenient to have your MinGW installation mounted on /mingw, since /mingw is on MSYS PATH by default. For this to work, just type (assuming MinGW is on c:\mingw):
mount c:/mingw /mingw
Or you just add it to etc/fstab ;)

C:/msys/cross-mingw.gcc443.generic.20100124 /mingw
for an example.

This way you can have an empty folder mounted in, say, /mingw64 if you decide to build your own GCC some day :) And it's automagic.