Hello,
I've just compiled Cinelerra Version 4 on my Gentoo Linux.
I'd like to share my changes I had to make to make cin4
compile for me in the hope someone else finds the following
information useful.
I didn't succeed in compiling cin4 without corrupting
quicktime/thirdparty/faad2-2.0/plugins/mpeg4ip/faad2.cpp
That's why I split up the second diff: The first version
seems to be crucial to compile cin4 on a 32bit (Gentoo?)
Linux, the second file contains the first one plus a work-
around to make cin4 actually compile for me.
Both files are outputs of diff -u.
=== Annotations for compiling ===
Obviously, with version 4, a new dependency was introduced:
mpeg4ip. Without having the (devel-!) package installed,
you are likely to run into errors like
faad2.h:28:26: error: codec_plugin.h: No such file or directory
On Gentoo you'll just have to emerge mpeg4ip of course.
Secondly: Errors like
faad2.cpp:86: error: invalid conversion from 'long unsigned int*' to 'uint32_t*'
should be solved by applying my patches. Just as e.g.
faad2.cpp:242: error: too few arguments to function
and others.
Unfortunately I wasn't able to fix the errors in line 370 of faad2.cpp
Example:
faad2.cpp:370: error: cannot convert 'codec_data_t* (*)(const char*, int, int, format_list_t*, audio_info_t*, const uint8_t*, uint32_t, audio_vft_t*,
void*)' to 'const char*' in initialization
Maybe Someone(TM) can solve that. I worked around by commenting
the call to makro out. (see faad2.cpp.2.patch)
=== Annotations for running cinelerra-4 ===
Paradoxically sudo make install didn't install (here) cinelerra in
/usr/local/bin but inside the local directory. Start cin4 by typing
./bin/cinelerra in cinelerra-4 (where you just typed make).
Monitoring audio when playing video in the record-dialog and Video-in
does not work for me 'out of the box', even if the checkbox is marked.
The audio-settings work for normal playback. If I find out how to get
this working here, I'll tell you. ;-)
Finally I'd like to say "Thank you for Cinelerra-4" to Adam Williams.
SimAV
--- aa_file.cpp 2008-05-31 11:25:31.000000000 +0200
+++
/static/cinelerra/cin4/quicktime/thirdparty/faad2-2.0/plugins/mpeg4ip/aa_file.cpp
2008-08-12 15:33:10.000000000 +0200
@@ -56,7 +56,7 @@
aac->m_buffer_size_max,
aac->m_ifile);
- unsigned long freq;
+ uint32_t freq;
unsigned char chans;
faacDecInit(aac->m_info, (unsigned char *)aac->m_buffer,
--- faad2.cpp 2008-05-31 11:25:31.000000000 +0200
+++
/static/cinelerra/cin4/quicktime/thirdparty/faad2-2.0/plugins/mpeg4ip/faad2.cpp
2008-08-12 16:59:50.000000000 +0200
@@ -76,7 +76,7 @@
}
aac->m_info = faacDecOpen();
- unsigned long srate;
+ uint32_t srate;
unsigned char chan;
if ((userdata == NULL && fmtp == NULL) ||
(faacDecInit2(aac->m_info,
@@ -97,7 +97,7 @@
aac->m_output_frame_size = 960;
}
}
- aac->m_freq = srate;
+ aac->m_freq = srate;
aac->m_chans = chan;
aac->m_faad_inited = 1;
aac->m_msec_per_frame = aac->m_output_frame_size;
@@ -188,7 +188,7 @@
* If not initialized, do so.
*/
abort();
- unsigned long freq;
+ uint32_t freq;
unsigned char chans;
faacDecInit(aac->m_info,
@@ -237,9 +237,9 @@
aac->m_vft->audio_configure(aac->m_ifptr,
aac->m_freq,
aac->m_chans,
- AUDIO_S16SYS,
+ (audio_format_t) AUDIO_S16SYS,
aac->m_output_frame_size);
- uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
+ uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr, aac->m_freq,
aac->m_current_time);
aac->m_audio_inited = 1;
}
/*
@@ -322,7 +322,7 @@
}
if (userdata != NULL) {
mpeg4_audio_config_t audio_config;
- decode_mpeg4_audio_config(userdata, userdata_size, &audio_config);
+ decode_mpeg4_audio_config(userdata, userdata_size, &audio_config, false);
message(LOG_DEBUG, "aac", "audio type is %d",
audio_config.audio_object_type);
if (fmtp != NULL) free_fmtp_parse(fmtp);
--- faad2.cpp 2008-05-31 11:25:31.000000000 +0200
+++
/static/cinelerra/cin4/quicktime/thirdparty/faad2-2.0/plugins/mpeg4ip/faad2.cpp
2008-08-12 16:59:50.000000000 +0200
@@ -76,7 +76,7 @@
}
aac->m_info = faacDecOpen();
- unsigned long srate;
+ uint32_t srate;
unsigned char chan;
if ((userdata == NULL && fmtp == NULL) ||
(faacDecInit2(aac->m_info,
@@ -97,7 +97,7 @@
aac->m_output_frame_size = 960;
}
}
- aac->m_freq = srate;
+ aac->m_freq = srate;
aac->m_chans = chan;
aac->m_faad_inited = 1;
aac->m_msec_per_frame = aac->m_output_frame_size;
@@ -188,7 +188,7 @@
* If not initialized, do so.
*/
abort();
- unsigned long freq;
+ uint32_t freq;
unsigned char chans;
faacDecInit(aac->m_info,
@@ -237,9 +237,9 @@
aac->m_vft->audio_configure(aac->m_ifptr,
aac->m_freq,
aac->m_chans,
- AUDIO_S16SYS,
+ (audio_format_t) AUDIO_S16SYS,
aac->m_output_frame_size);
- uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
+ uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr, aac->m_freq,
aac->m_current_time);
aac->m_audio_inited = 1;
}
/*
@@ -322,7 +322,7 @@
}
if (userdata != NULL) {
mpeg4_audio_config_t audio_config;
- decode_mpeg4_audio_config(userdata, userdata_size, &audio_config);
+ decode_mpeg4_audio_config(userdata, userdata_size, &audio_config, false);
message(LOG_DEBUG, "aac", "audio type is %d",
audio_config.audio_object_type);
if (fmtp != NULL) free_fmtp_parse(fmtp);
@@ -367,6 +367,8 @@
aac_file_eof
);
#else
+//commented this Makro out in order to make cinelerra4 compileable
+/*
AUDIO_CODEC_WITH_RAW_FILE_PLUGIN("faad2",
aac_codec_create,
aac_do_pause,
@@ -382,7 +384,34 @@
NULL,
0
);
+*/
+//expanded the makro for error-hunting :)
+//this causes gcc to print out a different error.....
+/*extern "C" {
+codec_plugin_t mpeg4ip_codec_plugin
+=
+{ "faad2",
+"audio",
+"1.0",
+aac_codec_create,
+__null,
+aac_do_pause,
+aac_decode,
+aac_close,
+aac_codec_check,
+aac_file_check,
+aac_file_next_frame,
+aac_file_used_for_frame,
+aac_raw_file_seek_to,
+__null,
+aac_file_eof,
+__null,
+__null,
+__null,
+0,
+__null,
+};
+};
+*/
#endif
/* end file aa.cpp */