13
0

Update libaaf to v1.0-10-g13f0b0a

This commit is contained in:
Robin Gareus 2024-03-19 20:59:04 +01:00
parent da4218c2db
commit 4883867f2b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
20 changed files with 116 additions and 262 deletions

View File

@ -43,13 +43,13 @@
#include "aaf/AAFClass.h" #include "aaf/AAFClass.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__)
#define attachNewProperty(aafd, Class, Prop, Pid, IsReq) \ #define attachNewProperty(aafd, Class, Prop, Pid, IsReq) \
Prop = calloc (1, sizeof (aafPropertyDef)); \ Prop = calloc (1, sizeof (aafPropertyDef)); \
@ -162,8 +162,6 @@ aafclass_setDefaultClasses (AAF_Data* aafd)
{ {
aafPropertyDef* prop = NULL; aafPropertyDef* prop = NULL;
/* TODO test ENOMEM after each class alloc */
aafClass* IOC = aafclass_defineNewClass (aafd, &AAFClassID_InterchangeObject, ABSTRACT, NULL); aafClass* IOC = aafclass_defineNewClass (aafd, &AAFClassID_InterchangeObject, ABSTRACT, NULL);
if (IOC == NULL) { if (IOC == NULL) {

View File

@ -39,13 +39,13 @@
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__)
/** /**
* Loops through each aafStrongRefSetEntry_t of a StrongRefSet Index node stream. * Loops through each aafStrongRefSetEntry_t of a StrongRefSet Index node stream.

View File

@ -45,7 +45,7 @@ aaf_dump_Header (AAF_Data* aafd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -65,7 +65,7 @@ aaf_dump_Identification (AAF_Data* aafd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -99,7 +99,7 @@ aaf_dump_ObjectProperty (AAF_Data* aafd, aafProperty* Prop, const char* padding)
aafd->log->_msg_pos += (size_t)rc; aafd->log->_msg_pos += (size_t)rc;
} }
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -141,7 +141,7 @@ aaf_dump_TaggedValueSet (AAF_Data* aafd, aafObject* ObjCollection, const char* p
(aafUIDCmp (&indirect->TypeDef, &AAFTypeID_String)) ? "\"" : "", (aafUIDCmp (&indirect->TypeDef, &AAFTypeID_String)) ? "\"" : "",
ANSI_COLOR_RESET (log)); ANSI_COLOR_RESET (log));
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
free (name); free (name);
} }
@ -225,7 +225,7 @@ aaf_dump_rawProperties (AAF_Data* aafd, aafByte_t* propStream, const char* paddi
LOG_BUFFER_WRITE (log, "\n"); LOG_BUFFER_WRITE (log, "\n");
} }
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -295,7 +295,7 @@ aaf_dump_MetaDictionary (AAF_Data* aafd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -326,5 +326,5 @@ aaf_dump_Classes (AAF_Data* aafd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)aafd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }

View File

@ -37,16 +37,16 @@
#include "aaf/URIParser.h" #include "aaf/URIParser.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define success(...) \ #define success(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_SUCCESS, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_SUCCESS, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
static int static int
set_audioEssenceWithRIFF (AAF_Iface* aafi, const char* filename, aafiAudioEssenceFile* audioEssenceFile, struct RIFFAudioFile* RIFFAudioFile, int isExternalFile); set_audioEssenceWithRIFF (AAF_Iface* aafi, const char* filename, aafiAudioEssenceFile* audioEssenceFile, struct RIFFAudioFile* RIFFAudioFile, int isExternalFile);
@ -234,7 +234,7 @@ aafi_locate_external_essence_file (AAF_Iface* aafi, const char* original_uri_fil
local_filepath = NULL; local_filepath = NULL;
} }
/* Try AAF essence's URI */ /* Try raw essence's URI, just in case... */
if (laaf_util_file_exists (original_uri_filepath) == 1) { if (laaf_util_file_exists (original_uri_filepath) == 1) {
foundpath = original_uri_filepath; foundpath = original_uri_filepath;
@ -248,24 +248,12 @@ aafi_locate_external_essence_file (AAF_Iface* aafi, const char* original_uri_fil
goto found; goto found;
} }
if (uri->flags & URI_T_LOCALHOST) {
// debug( "URI targets localhost : %s", uri_filepath );
} else {
if (uri->flags & URI_T_HOST_IPV4) {
// debug( "URI targets IPV4 : %s", uri_filepath );
} else if (uri->flags & URI_T_HOST_IPV6) {
// debug( "URI targets IPV6 : %s", uri_filepath );
} else if (uri->flags & URI_T_HOST_REGNAME) {
// debug( "URI targets hostname : %s", uri_filepath );
}
}
/* /*
* Try to locate essence file from the AAF file location. * Try to locate essence file from the AAF file location.
* *
* e.g. * e.g.
* - AAF filepath : /home/user/AAFFile.aaf * AAF filepath : /home/user/AAFFile.aaf
* - Essence URI : file://localhost/C:/Users/user/Desktop/AudioFiles/essence.wav * + Essence URI : file://localhost/C:/Users/user/Desktop/AudioFiles/essence.wav
* = /home/user/AudioFiles/essence.file * = /home/user/AudioFiles/essence.file
*/ */
@ -341,7 +329,6 @@ found:
* So even if foundpath is already absolute, we need that drive letter at it * So even if foundpath is already absolute, we need that drive letter at it
* start. * start.
*/ */
// retpath = laaf_util_c99strdup(foundpath);
retpath = laaf_util_absolute_path (foundpath); retpath = laaf_util_absolute_path (foundpath);
if (!retpath) { if (!retpath) {
@ -364,26 +351,6 @@ end:
free (aaf_path); free (aaf_path);
return retpath; return retpath;
/*
* AAFInfo --aaf-clips ../libaaf_testfiles/fonk_2.AAF
file://localhost/Users/horlaprod/Music/Logic/fonk_2/Audio Files_1/fonk_2_3#04.wav
* AAFInfo --aaf-clips ../libaaf_testfiles/ADP/ADP3_51-ST-MONO-NOBREAKOUT.aaf
file:///C:/Users/Loviniou/Downloads/ChID-BLITS-EBU-Narration441-16b.wav
* AAFInfo --aaf-clips ../libaaf_testfiles/ADP/ADP2_SEQ-FULL.aaf
file://?/E:/Adrien/ADPAAF/Sequence A Rendu.mxf
* AAFInfo --aaf-clips ../libaaf_testfiles/TEST-AVID_COMP2977052\ \ -\ \ OFF\ PODIUM\ ETAPE\ 2.aaf
file:////C:/Users/mix_limo/Desktop/TEST2977052 - OFF PODIUM ETAPE 2.aaf
* AAFInfo --aaf-clips ../ardio/watchfolder/3572607_RUGBY_F_1_1.aaf
file://10.87.230.71/mixage/DR2/Avid MediaFiles/MXF/1/3572607_RUGBY_F2_S65CFA3D0V.mxf
* AAFInfo --aaf-clips ../libaaf_testfiles/ProTools/pt2MCC.aaf
file:///_system/Users/horlaprod/pt2MCCzmhsFRHQgdgsTMQX.mxf
*/
} }
int int
@ -552,29 +519,14 @@ aafi_extractAudioEssenceFile (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenc
assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->originator)); assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->originator));
// if ( tmp < 0 || (size_t)tmp >= sizeof(((struct wavBextChunk *)0)->originator) ) {
// fprintf( stderr, "snprintf() error" );
// goto err;
// }
tmp = snprintf (wavBext.originator_reference, sizeof (((struct wavBextChunk*)0)->originator_reference), "libAAF %s", LIBAAF_VERSION); tmp = snprintf (wavBext.originator_reference, sizeof (((struct wavBextChunk*)0)->originator_reference), "libAAF %s", LIBAAF_VERSION);
assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->originator_reference)); assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->originator_reference));
// if ( tmp < 0 || (size_t)tmp >= sizeof(((struct wavBextChunk *)0)->originator_reference) ) {
// fprintf( stderr, "snprintf() error" );
// goto err;
// }
tmp = snprintf (wavBext.description, sizeof (((struct wavBextChunk*)0)->description), "%s\n%s.aaf", audioEssenceFile->name, aafi->compositionName); tmp = snprintf (wavBext.description, sizeof (((struct wavBextChunk*)0)->description), "%s\n%s.aaf", audioEssenceFile->name, aafi->compositionName);
assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->description)); assert (tmp > 0 && (size_t)tmp < sizeof (((struct wavBextChunk*)0)->description));
// if ( tmp < 0 || (size_t)tmp >= sizeof(((struct wavBextChunk *)0)->description) ) {
// fprintf( stderr, "snprintf() error" );
// goto err;
// }
memcpy (wavBext.origination_date, audioEssenceFile->originationDate, sizeof (((struct wavBextChunk*)0)->origination_date)); memcpy (wavBext.origination_date, audioEssenceFile->originationDate, sizeof (((struct wavBextChunk*)0)->origination_date));
memcpy (wavBext.origination_time, audioEssenceFile->originationTime, sizeof (((struct wavBextChunk*)0)->origination_time)); memcpy (wavBext.origination_time, audioEssenceFile->originationTime, sizeof (((struct wavBextChunk*)0)->origination_time));
@ -712,10 +664,6 @@ set_audioEssenceWithRIFF (AAF_Iface* aafi, const char* filename, aafiAudioEssenc
if (audioEssenceFile->channels > 0 && audioEssenceFile->channels != RIFFAudioFile->channels) { if (audioEssenceFile->channels > 0 && audioEssenceFile->channels != RIFFAudioFile->channels) {
warning ("%s : summary channel count (%i) mismatch %s (%i)", filename, audioEssenceFile->channels, ((isExternalFile) ? "located file" : "previously retrieved data"), RIFFAudioFile->channels); warning ("%s : summary channel count (%i) mismatch %s (%i)", filename, audioEssenceFile->channels, ((isExternalFile) ? "located file" : "previously retrieved data"), RIFFAudioFile->channels);
} }
// else {
// /* In Davinci Resolve embedded multichannel WAV, summary channel is always 1 */
// audioEssenceFile->channels = RIFFAudioFile->channels;
// }
if (audioEssenceFile->samplerate > 0 && audioEssenceFile->samplerate != RIFFAudioFile->sampleRate) { if (audioEssenceFile->samplerate > 0 && audioEssenceFile->samplerate != RIFFAudioFile->sampleRate) {
warning ("%s : summary samplerate (%i) mismatch %s (%i)", filename, audioEssenceFile->samplerate, ((isExternalFile) ? "located file" : "previously retrieved data"), RIFFAudioFile->sampleRate); warning ("%s : summary samplerate (%i) mismatch %s (%i)", filename, audioEssenceFile->samplerate, ((isExternalFile) ? "located file" : "previously retrieved data"), RIFFAudioFile->sampleRate);

View File

@ -67,13 +67,13 @@
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
static aafRational_t AAFI_DEFAULT_TC_EDIT_RATE = { 25, 1 }; static aafRational_t AAFI_DEFAULT_TC_EDIT_RATE = { 25, 1 };
@ -296,22 +296,12 @@ parse_SourceMob (AAF_Iface* aafi, aafObject* SourceMob, td* __ptd)
assert (rc > 0 && (size_t)rc < sizeof (((aafiAudioEssenceFile*)0)->originationDate)); assert (rc > 0 && (size_t)rc < sizeof (((aafiAudioEssenceFile*)0)->originationDate));
// if ( rc < 0 || (size_t)rc >= sizeof(((aafiAudioEssenceFile *)0)->originationDate) ) {
// fprintf( stderr, "snprintf() error" );
// return -1;
// }
rc = snprintf (audioEssenceFile->originationTime, sizeof (((aafiAudioEssenceFile*)0)->originationTime), "%02u:%02u:%02u", rc = snprintf (audioEssenceFile->originationTime, sizeof (((aafiAudioEssenceFile*)0)->originationTime), "%02u:%02u:%02u",
(CreationTime->time.hour <= 99) ? CreationTime->time.hour : 0, (CreationTime->time.hour <= 99) ? CreationTime->time.hour : 0,
(CreationTime->time.minute <= 99) ? CreationTime->time.minute : 0, (CreationTime->time.minute <= 99) ? CreationTime->time.minute : 0,
(CreationTime->time.second <= 99) ? CreationTime->time.second : 0); (CreationTime->time.second <= 99) ? CreationTime->time.second : 0);
assert (rc > 0 && (size_t)rc < sizeof (((aafiAudioEssenceFile*)0)->originationTime)); assert (rc > 0 && (size_t)rc < sizeof (((aafiAudioEssenceFile*)0)->originationTime));
// if ( rc < 0 || (size_t)rc >= sizeof(((aafiAudioEssenceFile *)0)->originationTime) ) {
// fprintf( stderr, "snprintf() error" );
// return -1;
// }
} }
__td.ll[__td.lv] = 2; __td.ll[__td.lv] = 2;
@ -1072,7 +1062,7 @@ parse_SourceClip (AAF_Iface* aafi, aafObject* SourceClip, td* __ptd)
} }
} else if (aafUIDCmp (parentMobUsageCode, &AAFUsage_AdjustedClip)) { } else if (aafUIDCmp (parentMobUsageCode, &AAFUsage_AdjustedClip)) {
// if ( aafi->ctx.current_adjusted_clip_gain ) { // if ( aafi->ctx.current_adjusted_clip_gain ) {
// applyGainOffset( aafi, &aafi->ctx.current_clip->gain, aafi->ctx.current_adjusted_clip_gain ); // aafi_applyGainOffset( aafi, &aafi->ctx.current_clip->gain, aafi->ctx.current_adjusted_clip_gain );
// aafi_freeAudioGain( aafi->ctx.current_adjusted_clip_gain ); // aafi_freeAudioGain( aafi->ctx.current_adjusted_clip_gain );
// aafi->ctx.current_adjusted_clip_gain = NULL; // aafi->ctx.current_adjusted_clip_gain = NULL;
// } // }
@ -3252,7 +3242,7 @@ aafi_dump_obj (AAF_Iface* aafi, aafObject* Obj, struct trace_dump* __td, int sta
return; return;
} }
laaf_write_log (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __FILENAME__, func, line, buf); laaf_write_log (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __FILENAME__, func, line, buf);
free (buf); free (buf);
@ -3635,7 +3625,7 @@ aafi_dump_obj (AAF_Iface* aafi, aafObject* Obj, struct trace_dump* __td, int sta
LOG_BUFFER_WRITE (log, "%s", ANSI_COLOR_RESET (log)); LOG_BUFFER_WRITE (log, "%s", ANSI_COLOR_RESET (log));
} }
log->debug_callback (log, (void*)aafi, DEBUG_SRC_ID_TRACE, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)aafi, LOG_SRC_ID_TRACE, 0, "", "", 0, log->_msg, log->user);
/* if end of branch, print one line padding */ /* if end of branch, print one line padding */
if (Obj && (__td->eob || state == TD_ERROR)) if (Obj && (__td->eob || state == TD_ERROR))

View File

@ -50,20 +50,14 @@
#include "aaf/log.h" #include "aaf/log.h"
#include "aaf/utils.h" #include "aaf/utils.h"
#ifdef _WIN32
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
#endif
#define debug(...) \ #define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
AAF_Iface* AAF_Iface*
aafi_alloc (AAF_Data* aafd) aafi_alloc (AAF_Data* aafd)
@ -111,18 +105,18 @@ err:
} }
void void
aafi_set_debug (AAF_Iface* aafi, verbosityLevel_e v, int ansicolor, FILE* fp, void (*callback) (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user), void* user) aafi_set_debug (AAF_Iface* aafi, enum verbosityLevel_e verb, int ansicolor, FILE* fp, void (*callback) (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user), void* user)
{ {
if (!aafi) { if (!aafi) {
return; return;
} }
aafi->log->verb = v; aafi->log->verb = verb;
aafi->log->ansicolor = ansicolor; aafi->log->ansicolor = ansicolor;
aafi->log->fp = fp; aafi->log->fp = fp;
if (callback) { if (callback) {
aafi->log->debug_callback = callback; aafi->log->log_callback = callback;
} }
if (user) { if (user) {

View File

@ -42,13 +42,13 @@
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafd->log, aafd, DEBUG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafd->log, aafd, LOG_SRC_ID_AAF_CORE, VERB_ERROR, __VA_ARGS__)
const char* const char*
aaft_MobIDToText (aafMobID_t* mobid) aaft_MobIDToText (aafMobID_t* mobid)
@ -69,10 +69,6 @@ aaft_MobIDToText (aafMobID_t* mobid)
rc = snprintf (str + offset, strsz - offset, " - "); rc = snprintf (str + offset, strsz - offset, " - ");
assert (rc > 0 && (size_t)rc < strsz - offset); assert (rc > 0 && (size_t)rc < strsz - offset);
// if ( rc < 0 || (size_t)rc >= strsz-offset ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
offset += (uint32_t)rc; offset += (uint32_t)rc;
@ -86,11 +82,6 @@ aaft_MobIDToText (aafMobID_t* mobid)
assert (rc > 0 && (size_t)rc < strsz - offset); assert (rc > 0 && (size_t)rc < strsz - offset);
// if ( rc < 0 || (size_t)rc >= strsz-offset ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
offset += (uint32_t)rc; offset += (uint32_t)rc;
if (i == 15) { if (i == 15) {
@ -98,11 +89,6 @@ aaft_MobIDToText (aafMobID_t* mobid)
assert (rc > 0 && (size_t)rc < strsz - offset); assert (rc > 0 && (size_t)rc < strsz - offset);
// if ( rc < 0 || (size_t)rc >= strsz-offset ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
offset += (uint32_t)rc; offset += (uint32_t)rc;
break; break;
@ -117,11 +103,6 @@ aaft_MobIDToText (aafMobID_t* mobid)
assert (rc >= 0 && (size_t)rc < strsz - offset); assert (rc >= 0 && (size_t)rc < strsz - offset);
// if ( rc < 0 || (size_t)rc >= strsz-offset ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
return str; return str;
} }
@ -146,11 +127,6 @@ aaft_TimestampToText (aafTimeStamp_t* ts)
ts->time.fraction); ts->time.fraction);
assert (rc > 0 && (size_t)rc < sizeof (str)); assert (rc > 0 && (size_t)rc < sizeof (str));
// if ( rc < 0 || (size_t)rc >= sizeof(str) ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
} }
return str; return str;
@ -172,11 +148,6 @@ aaft_VersionToText (aafVersionType_t* vers)
vers->minor); vers->minor);
assert (rc > 0 && (size_t)rc < sizeof (str)); assert (rc > 0 && (size_t)rc < sizeof (str));
// if ( rc < 0 || (size_t)rc >= sizeof(str) ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
} }
return str; return str;
@ -202,11 +173,6 @@ aaft_ProductVersionToText (aafProductVersion_t* vers)
vers->type); vers->type);
assert (rc > 0 && (size_t)rc < sizeof (str)); assert (rc > 0 && (size_t)rc < sizeof (str));
// if ( rc < 0 || (size_t)rc >= sizeof(str) ) {
// fprintf( stderr, "snprintf() error" );
// return "NULL";
// }
} }
return str; return str;
@ -991,11 +957,6 @@ aaft_DataDefToText (AAF_Data* aafd, const aafUID_t* auid)
assert (rc >= 0 && (size_t)rc < sizeof (TEXTDataDef)); assert (rc >= 0 && (size_t)rc < sizeof (TEXTDataDef));
// if ( rc < 0 || (size_t)rc >= 1024 ) {
// error( "snprintf() error" );
// return NULL;
// }
free (name); free (name);
return TEXTDataDef; return TEXTDataDef;
@ -1096,11 +1057,6 @@ aaft_OperationDefToText (AAF_Data* aafd, const aafUID_t* auid)
assert (rc >= 0 && (size_t)rc < sizeof (TEXTOperationDef)); assert (rc >= 0 && (size_t)rc < sizeof (TEXTOperationDef));
// if ( rc < 0 || (size_t)rc >= 1024 ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
free (name); free (name);
return TEXTOperationDef; return TEXTOperationDef;
@ -1293,11 +1249,6 @@ aaft_ParameterToText (AAF_Data* aafd, const aafUID_t* auid)
assert (rc >= 0 && (size_t)rc < sizeof (TEXTParameterDef)); assert (rc >= 0 && (size_t)rc < sizeof (TEXTParameterDef));
// if ( rc < 0 || (size_t)rc >= 1024 ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
free (name); free (name);
return TEXTParameterDef; return TEXTParameterDef;
@ -2055,11 +2006,6 @@ aaft_PIDToText (AAF_Data* aafd, aafPID_t pid)
assert (rc >= 0 && (size_t)rc < sizeof (PIDText)); assert (rc >= 0 && (size_t)rc < sizeof (PIDText));
// if ( rc < 0 || (size_t)rc >= 1024 ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
return PIDText; return PIDText;
} }
} }
@ -2299,11 +2245,6 @@ aaft_ClassIDToText (AAF_Data* aafd, const aafUID_t* auid)
assert (rc >= 0 && (size_t)rc < sizeof (ClassIDText)); assert (rc >= 0 && (size_t)rc < sizeof (ClassIDText));
// if ( rc < 0 || (size_t)rc >= 1024 ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
return ClassIDText; return ClassIDText;
} }
} }
@ -2368,11 +2309,6 @@ aaft_IndirectValueToText (AAF_Data* aafd, aafIndirect_t* Indirect)
assert (rc >= 0 && (size_t)rc < sizeof (buf)); assert (rc >= 0 && (size_t)rc < sizeof (buf));
// if ( rc < 0 || (size_t)rc >= sizeof(buf) ) {
// fprintf( stderr, "snprintf() error" );
// return NULL;
// }
return buf; return buf;
} }

View File

@ -28,13 +28,13 @@
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_DEBUG, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_WARNING, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_ERROR, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_ERROR, __VA_ARGS__)
void void
cfb_dump_node (CFB_Data* cfbd, cfbNode* node, int print_stream, const char* padding) cfb_dump_node (CFB_Data* cfbd, cfbNode* node, int print_stream, const char* padding)
@ -99,7 +99,7 @@ cfb_dump_node (CFB_Data* cfbd, cfbNode* node, int print_stream, const char* padd
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
if (print_stream == 1) { if (print_stream == 1) {
cfb_dump_nodeStream (cfbd, node, ""); cfb_dump_nodeStream (cfbd, node, "");
@ -137,7 +137,7 @@ cfb_dump_nodeStream (CFB_Data* cfbd, cfbNode* node, const char* padding)
laaf_util_dump_hex (stream, stream_sz, &log->_msg, &log->_msg_size, log->_msg_pos, padding); laaf_util_dump_hex (stream, stream_sz, &log->_msg, &log->_msg_size, log->_msg_pos, padding);
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
free (stream); free (stream);
} }
@ -161,7 +161,7 @@ cfb_dump_nodePathStream (CFB_Data* cfbd, const char* path, const char* padding)
laaf_util_dump_hex (stream, stream_sz, &log->_msg, &log->_msg_size, log->_msg_pos, padding); laaf_util_dump_hex (stream, stream_sz, &log->_msg, &log->_msg_size, log->_msg_pos, padding);
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
free (stream); free (stream);
} }
@ -171,9 +171,8 @@ cfb_dump_nodePaths (CFB_Data* cfbd, uint32_t prevPath, char* strArray[], uint32_
{ {
struct aafLog* log = cfbd->log; struct aafLog* log = cfbd->log;
// if ( !node ) { /* initial function call */
if (firstIteration) { if (firstIteration) {
/* initial function call */
node = &cfbd->nodes[0]; node = &cfbd->nodes[0];
if (!node) { if (!node) {
@ -190,7 +189,6 @@ cfb_dump_nodePaths (CFB_Data* cfbd, uint32_t prevPath, char* strArray[], uint32_
uint32_t thisPath = (*str_i); uint32_t thisPath = (*str_i);
/* TODO snprintf_realloc() ? */
char* nodeName = cfb_w16toUTF8 (node->_ab, node->_cb); char* nodeName = cfb_w16toUTF8 (node->_ab, node->_cb);
laaf_util_snprintf_realloc (&strArray[thisPath], 0, 0, "%s/%s", strArray[prevPath], nodeName); laaf_util_snprintf_realloc (&strArray[thisPath], 0, 0, "%s/%s", strArray[prevPath], nodeName);
@ -209,7 +207,6 @@ cfb_dump_nodePaths (CFB_Data* cfbd, uint32_t prevPath, char* strArray[], uint32_
cfb_dump_nodePaths (cfbd, prevPath, strArray, str_i, &cfbd->nodes[node->_sidRightSib], padding, 0); cfb_dump_nodePaths (cfbd, prevPath, strArray, str_i, &cfbd->nodes[node->_sidRightSib], padding, 0);
/* the end of the first function call, recursion is over. */ /* the end of the first function call, recursion is over. */
// if ( node == &cfbd->nodes[0] ) {
if (firstIteration) { if (firstIteration) {
/* commented out because output seems proper this way... why did we call qsort() in the first place ?! */ /* commented out because output seems proper this way... why did we call qsort() in the first place ?! */
// qsort( strArray, *str_i, sizeof(char*), compareStrings ); // qsort( strArray, *str_i, sizeof(char*), compareStrings );
@ -234,7 +231,7 @@ cfb_dump_nodePaths (CFB_Data* cfbd, uint32_t prevPath, char* strArray[], uint32_
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
} }
@ -286,7 +283,7 @@ cfb_dump_header (CFB_Data* cfbd, const char* padding)
LOG_BUFFER_WRITE (log, "\n"); LOG_BUFFER_WRITE (log, "\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -330,7 +327,7 @@ cfb_dump_FAT (CFB_Data* cfbd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -375,7 +372,7 @@ cfb_dump_MiniFAT (CFB_Data* cfbd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }
void void
@ -420,5 +417,5 @@ cfb_dump_DiFAT (CFB_Data* cfbd, const char* padding)
LOG_BUFFER_WRITE (log, "\n\n"); LOG_BUFFER_WRITE (log, "\n\n");
log->debug_callback (log, (void*)cfbd, DEBUG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user); log->log_callback (log, (void*)cfbd, LOG_SRC_ID_DUMP, 0, "", "", 0, log->_msg, log->user);
} }

View File

@ -107,13 +107,13 @@
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_DEBUG, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_WARNING, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (cfbd->log, cfbd, DEBUG_SRC_ID_LIB_CFB, VERB_ERROR, __VA_ARGS__) AAF_LOG (cfbd->log, cfbd, LOG_SRC_ID_LIB_CFB, VERB_ERROR, __VA_ARGS__)
static int static int
cfb_getFileSize (CFB_Data* cfbd); cfb_getFileSize (CFB_Data* cfbd);

View File

@ -30,13 +30,13 @@
#include "aaf/log.h" #include "aaf/log.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
int int
mediaComposer_AAF (struct AAF_Iface* aafi) mediaComposer_AAF (struct AAF_Iface* aafi)

View File

@ -23,6 +23,15 @@
#include "aaf/AAFIface.h" #include "aaf/AAFIface.h"
#include "aaf/ProTools.h" #include "aaf/ProTools.h"
#define debug(...) \
AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \
AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \
AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
/* English : "Fade " (Same as JA and DE) */ /* English : "Fade " (Same as JA and DE) */
static const char PROTOOLS_CLIP_NAME_FADE_EN[] = "\x46\x61\x64\x65\x20"; static const char PROTOOLS_CLIP_NAME_FADE_EN[] = "\x46\x61\x64\x65\x20";
/* French : "Fondu " */ /* French : "Fondu " */
@ -53,15 +62,6 @@ static const char PROTOOLS_CLIP_NAME_SAMPLE_ACCURATE_EDIT_ZH_CN[] = "\xe7\xb2\xb
/* Chinese (T) : "精確取樣編輯" */ /* Chinese (T) : "精確取樣編輯" */
static const char PROTOOLS_CLIP_NAME_SAMPLE_ACCURATE_EDIT_ZH_TW[] = "\xe7\xb2\xbe\xe7\xa2\xba\xe5\x8f\x96\xe6\xa8\xa3\xe7\xb7\xa8\xe8\xbc\xaf"; static const char PROTOOLS_CLIP_NAME_SAMPLE_ACCURATE_EDIT_ZH_TW[] = "\xe7\xb2\xbe\xe7\xa2\xba\xe5\x8f\x96\xe6\xa8\xa3\xe7\xb7\xa8\xe8\xbc\xaf";
#define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
static int static int
is_rendered_fade (const char* clipName); is_rendered_fade (const char* clipName);
static int static int
@ -76,7 +76,7 @@ protools_AAF (struct AAF_Iface* aafi)
{ {
int probe = 0; int probe = 0;
/* NOTE: CompanyName is "Digidesign, Inc." at least since ProTools 10.3.10.613, and still today */ /* NOTE: CompanyName is "Digidesign, Inc." at least since ProTools 10.3.10.613, and still today (2024) */
if (aafi->aafd->Identification.CompanyName && strcmp (aafi->aafd->Identification.CompanyName, "Digidesign, Inc.") == 0) { if (aafi->aafd->Identification.CompanyName && strcmp (aafi->aafd->Identification.CompanyName, "Digidesign, Inc.") == 0) {
probe++; probe++;
@ -149,7 +149,7 @@ remove_sampleAccurateEditClip (AAF_Iface* aafi, aafiAudioTrack* audioTrack, aafi
return 1; return 1;
} }
// else { // else {
// warning( L"Can't remove SAE \"%s\" : left clip \"%s\" has not enough right handle : %lu but %lu is required", // debug( L"SAE \"%s\" : left clip \"%s\" has not enough right handle : %lu but %lu is required",
// saeClip->essencePointerList->essenceFile->unique_name, // saeClip->essencePointerList->essenceFile->unique_name,
// leftClip->essencePointerList->essenceFile->unique_name, // leftClip->essencePointerList->essenceFile->unique_name,
// (essenceLength - leftClip->essence_offset - leftClip->len), // (essenceLength - leftClip->essence_offset - leftClip->len),
@ -185,7 +185,7 @@ remove_sampleAccurateEditClip (AAF_Iface* aafi, aafiAudioTrack* audioTrack, aafi
return 1; return 1;
} }
// else { // else {
// warning( L"Can't remove SAE \"%s\" : right clip \"%s\" has not enough left handle : %lu but %lu is required", // debug( L"SAE \"%s\" : right clip \"%s\" has not enough left handle : %lu but %lu is required",
// saeClip->essencePointerList->essenceFile->unique_name, // saeClip->essencePointerList->essenceFile->unique_name,
// rightClip->essencePointerList->essenceFile->unique_name, // rightClip->essencePointerList->essenceFile->unique_name,
// rightClip->essence_offset, // rightClip->essence_offset,
@ -404,7 +404,7 @@ protools_post_processing (AAF_Iface* aafi)
aafiTimelineItem* audioItemNext = audioItem->next; aafiTimelineItem* audioItemNext = audioItem->next;
if (audioItem->type != AAFI_AUDIO_CLIP) { if (audioItem->type != AAFI_AUDIO_CLIP) {
audioItem = audioItem->next; audioItem = audioItemNext;
continue; continue;
} }
@ -412,15 +412,21 @@ protools_post_processing (AAF_Iface* aafi)
char* clipName = audioClip->essencePointerList->essenceFile->name; char* clipName = audioClip->essencePointerList->essenceFile->name;
int previousClipCount = audioTrack->clipCount;
if ((aafi->ctx.options.protools & AAFI_PROTOOLS_OPT_REPLACE_CLIP_FADES) && if ((aafi->ctx.options.protools & AAFI_PROTOOLS_OPT_REPLACE_CLIP_FADES) &&
is_rendered_fade (clipName)) { is_rendered_fade (clipName)) {
if (replace_clipFade (aafi, audioTrack, audioItem) > 0) { replace_clipFade (aafi, audioTrack, audioItem);
if (previousClipCount != audioTrack->clipCount) {
audioItem = audioTrack->timelineItems; audioItem = audioTrack->timelineItems;
continue; continue;
} }
} else if ((aafi->ctx.options.protools & AAFI_PROTOOLS_OPT_REMOVE_SAMPLE_ACCURATE_EDIT) && } else if ((aafi->ctx.options.protools & AAFI_PROTOOLS_OPT_REMOVE_SAMPLE_ACCURATE_EDIT) &&
is_sample_accurate_edit (clipName)) { is_sample_accurate_edit (clipName)) {
if (remove_sampleAccurateEditClip (aafi, audioTrack, audioItem)) { remove_sampleAccurateEditClip (aafi, audioTrack, audioItem);
if (previousClipCount != audioTrack->clipCount) {
audioItem = audioTrack->timelineItems; audioItem = audioTrack->timelineItems;
continue; continue;
} }

View File

@ -26,13 +26,13 @@
#include "aaf/RIFFParser.h" #include "aaf/RIFFParser.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
#define BE2LE32(val) \ #define BE2LE32(val) \
(((val >> 24) & 0xff) | ((val << 8) & 0xff0000) | ((val >> 8) & 0xff00) | ((val << 24) & 0xff000000)) (((val >> 24) & 0xff) | ((val << 8) & 0xff0000) | ((val >> 8) & 0xff00) | ((val << 24) & 0xff000000))

View File

@ -30,13 +30,13 @@
#include "aaf/log.h" #include "aaf/log.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (aafi->log, aafi, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (aafi->log, aafi, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
int int
resolve_AAF (struct AAF_Iface* aafi) resolve_AAF (struct AAF_Iface* aafi)

View File

@ -36,13 +36,13 @@ typedef SSIZE_T ssize_t;
#include "aaf/utils.h" #include "aaf/utils.h"
#define debug(...) \ #define debug(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_DEBUG, __VA_ARGS__)
#define warning(...) \ #define warning(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_WARNING, __VA_ARGS__)
#define error(...) \ #define error(...) \
AAF_LOG (log, NULL, DEBUG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__) AAF_LOG (log, NULL, LOG_SRC_ID_AAF_IFACE, VERB_ERROR, __VA_ARGS__)
#define IS_LOWALPHA(c) \ #define IS_LOWALPHA(c) \
((c >= 'a') && (c <= 'z')) ((c >= 'a') && (c <= 'z'))

View File

@ -122,7 +122,7 @@ typedef struct aafPropertyDefinition {
char* name; char* name;
/* /*
* Looks like nobody cares about AAF standard TypeDefinition. All observed files * Looks like nobody cares about AAF standard TypeDefinition. All observed files
* had incorrect values for Type's Name and Identification, even Avid's files. * had incorrect values for Type's Name and Identification, even Avid's files.
* Thus, PDef->type should NOT be trusted. * Thus, PDef->type should NOT be trusted.
* *

View File

@ -110,7 +110,6 @@ typedef enum aafiInterpolation_e {
* Having two curves (AAFI_TRANS_TWO_CURVE) allows a cross fade to have one curve per fade. * Having two curves (AAFI_TRANS_TWO_CURVE) allows a cross fade to have one curve per fade.
* *
* A transition should have at least two points, one at time zero and one at time 1. * A transition should have at least two points, one at time zero and one at time 1.
* TODO To finish
*/ */
typedef struct aafiTransition { typedef struct aafiTransition {
@ -270,7 +269,7 @@ typedef struct aafiAudioEssenceFile {
* instead of name when exporting embedded essences. * instead of name when exporting embedded essences.
*/ */
char* unique_name; // TODO: see creative_post.aaf char* unique_name;
/** /**
* Holds the URI path to the essence file, as specified in NetworkLocator::URLString. * Holds the URI path to the essence file, as specified in NetworkLocator::URLString.
@ -377,7 +376,7 @@ typedef struct aafiAudioEssencePointer {
typedef struct aafiVideoEssence { typedef struct aafiVideoEssence {
char* original_file_path; // NetworkLocator::URLString should point to original essence file if external (and in some cases, points to the AAF itself if internal..) char* original_file_path; // NetworkLocator::URLString should point to original essence file if external (and in some cases, points to the AAF itself if internal..)
char* usable_file_path; // TODO, not that used.. to be tweaked. ---- Holds the file path, once the essence has been exported, copied or linked. char* usable_file_path; // Holds the file path, once the essence has been exported, copied or linked.
char* name; // MasterMob::Name -> file name char* name; // MasterMob::Name -> file name
char* unique_name; // unique name generated from aafiVideoEssence->name. Sometimes, multiple files share the same names so this unique name should be used on export. char* unique_name; // unique name generated from aafiVideoEssence->name. Sometimes, multiple files share the same names so this unique name should be used on export.
@ -755,21 +754,11 @@ typedef struct aafiMarker {
} aafiMarker; } aafiMarker;
typedef struct aafiContext { typedef struct aafiContext {
/*
* Current MobSlot Segment's DataDefinition
* Mob::Slots > MobSlot::Segment > Component::DataDefinition
*/
// aafUID_t *DataDef;
/* Clip */ /* Clip */
aafObject* TopLevelCompositionMob; aafObject* TopLevelCompositionMob;
aafiAudioTrack* current_track; aafiAudioTrack* current_track;
// int current_track_number; // used only when missing MobSlot::PhysicalTrackNumber
// aafPosition_t current_pos;
aafiAudioClip* current_clip; aafiAudioClip* current_clip;
aafiVideoClip* current_video_clip; aafiVideoClip* current_video_clip;
int current_clip_is_muted; int current_clip_is_muted;
@ -810,8 +799,7 @@ typedef struct aafiContext {
char* dump_class_aaf_properties; char* dump_class_aaf_properties;
char* dump_class_raw_properties; char* dump_class_raw_properties;
char* media_location; char* media_location;
// int forbid_nonlatin_filenames; int mobid_essence_filename;
int mobid_essence_filename;
/* vendor specific */ /* vendor specific */
int protools; int protools;

View File

@ -30,12 +30,12 @@
#define __FILENAME__ (strrchr (__FILE__, '/') ? strrchr (__FILE__, '/') + 1 : __FILE__) #define __FILENAME__ (strrchr (__FILE__, '/') ? strrchr (__FILE__, '/') + 1 : __FILE__)
enum debug_source_id { enum log_source_id {
DEBUG_SRC_ID_LIB_CFB, LOG_SRC_ID_LIB_CFB,
DEBUG_SRC_ID_AAF_CORE, LOG_SRC_ID_AAF_CORE,
DEBUG_SRC_ID_AAF_IFACE, LOG_SRC_ID_AAF_IFACE,
DEBUG_SRC_ID_TRACE, LOG_SRC_ID_TRACE,
DEBUG_SRC_ID_DUMP LOG_SRC_ID_DUMP
}; };
typedef enum verbosityLevel_e { typedef enum verbosityLevel_e {
@ -49,7 +49,7 @@ typedef enum verbosityLevel_e {
#define VERB_SUCCESS 99 #define VERB_SUCCESS 99
struct aafLog { struct aafLog {
void (*debug_callback) (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user); void (*log_callback) (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user);
FILE* fp; FILE* fp;
verbosityLevel_e verb; verbosityLevel_e verb;
@ -64,7 +64,7 @@ struct aafLog {
char* _previous_msg; char* _previous_msg;
size_t _previous_pos; size_t _previous_pos;
int _tmp_dbg_msg_pos; int _tmp_msg_pos;
void* user; void* user;
}; };
@ -72,11 +72,11 @@ struct aafLog {
#define AAF_LOG(log, ctxdata, lib, type, ...) \ #define AAF_LOG(log, ctxdata, lib, type, ...) \
laaf_write_log (log, ctxdata, lib, type, __FILENAME__, __func__, __LINE__, __VA_ARGS__) laaf_write_log (log, ctxdata, lib, type, __FILENAME__, __func__, __LINE__, __VA_ARGS__)
#define LOG_BUFFER_WRITE(log, ...) \ #define LOG_BUFFER_WRITE(log, ...) \
log->_tmp_dbg_msg_pos = laaf_util_snprintf_realloc (&log->_msg, &log->_msg_size, log->_msg_pos, __VA_ARGS__); \ log->_tmp_msg_pos = laaf_util_snprintf_realloc (&log->_msg, &log->_msg_size, log->_msg_pos, __VA_ARGS__); \
log->_msg_pos += (log->_tmp_dbg_msg_pos < 0) ? 0 : (size_t)log->_tmp_dbg_msg_pos; log->_msg_pos += (log->_tmp_msg_pos < 0) ? 0 : (size_t)log->_tmp_msg_pos;
#define DBG_BUFFER_RESET(log) \ #define LOG_BUFFER_RESET(log) \
log->_msg_pos = 0; log->_msg_pos = 0;
struct aafLog* struct aafLog*
@ -89,6 +89,6 @@ void
laaf_log_callback (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user); laaf_log_callback (struct aafLog* log, void* ctxdata, int lib, int type, const char* srcfile, const char* srcfunc, int lineno, const char* msg, void* user);
void void
laaf_write_log (struct aafLog* log, void* ctxdata, enum debug_source_id lib, enum verbosityLevel_e type, const char* dbgfile, const char* dbgfunc, int dbgline, const char* format, ...); laaf_write_log (struct aafLog* log, void* ctxdata, enum log_source_id lib, enum verbosityLevel_e type, const char* srcfile, const char* srcfunc, int srcline, const char* format, ...);
#endif // !laaf_log_h__ #endif // !laaf_log_h__

View File

@ -1,2 +1,2 @@
#pragma once #pragma once
#define LIBAAF_VERSION "v1.0-1-gdef35bf" #define LIBAAF_VERSION "v1.0-10-g13f0b0a"

View File

@ -55,9 +55,9 @@ laaf_new_log (void)
return NULL; return NULL;
} }
log->debug_callback = &laaf_log_callback; log->log_callback = &laaf_log_callback;
log->fp = stdout; log->fp = stdout;
log->ansicolor = 0; log->ansicolor = 0;
return log; return log;
} }
@ -85,28 +85,28 @@ laaf_log_callback (struct aafLog* log, void* ctxdata, int libid, int type, const
const char* color = ""; const char* color = "";
if (log->fp == NULL) { if (log->fp == NULL) {
DBG_BUFFER_RESET (log); LOG_BUFFER_RESET (log);
return; return;
} }
switch (libid) { switch (libid) {
case DEBUG_SRC_ID_LIB_CFB: case LOG_SRC_ID_LIB_CFB:
lib = "libCFB"; lib = "libCFB";
aafi = (AAF_Iface*)ctxdata; aafi = (AAF_Iface*)ctxdata;
break; break;
case DEBUG_SRC_ID_AAF_CORE: case LOG_SRC_ID_AAF_CORE:
lib = "AAFCore"; lib = "AAFCore";
aafd = (AAF_Data*)ctxdata; aafd = (AAF_Data*)ctxdata;
break; break;
case DEBUG_SRC_ID_AAF_IFACE: case LOG_SRC_ID_AAF_IFACE:
lib = "AAFIface"; lib = "AAFIface";
cfbd = (CFB_Data*)ctxdata; cfbd = (CFB_Data*)ctxdata;
break; break;
case DEBUG_SRC_ID_TRACE: case LOG_SRC_ID_TRACE:
lib = "trace"; lib = "trace";
aafi = (AAF_Iface*)ctxdata; aafi = (AAF_Iface*)ctxdata;
break; break;
case DEBUG_SRC_ID_DUMP: case LOG_SRC_ID_DUMP:
lib = "dump"; lib = "dump";
break; break;
} }
@ -132,7 +132,7 @@ laaf_log_callback (struct aafLog* log, void* ctxdata, int libid, int type, const
const char* eol = ""; const char* eol = "";
if (libid != DEBUG_SRC_ID_TRACE && libid != DEBUG_SRC_ID_DUMP) { if (libid != LOG_SRC_ID_TRACE && libid != LOG_SRC_ID_DUMP) {
#ifdef __MINGW32__ #ifdef __MINGW32__
fwprintf (log->fp, L"[%" WPRIs "%" WPRIs "%" WPRIs "] %" WPRIs "%" WPRIs ":%i in %" WPRIs "()%" WPRIs " : ", fwprintf (log->fp, L"[%" WPRIs "%" WPRIs "%" WPRIs "] %" WPRIs "%" WPRIs ":%i in %" WPRIs "()%" WPRIs " : ",
color, color,
@ -156,7 +156,7 @@ laaf_log_callback (struct aafLog* log, void* ctxdata, int libid, int type, const
#endif #endif
} }
if (libid != DEBUG_SRC_ID_DUMP) { if (libid != LOG_SRC_ID_DUMP) {
eol = "\n"; eol = "\n";
} }
@ -173,7 +173,7 @@ laaf_log_callback (struct aafLog* log, void* ctxdata, int libid, int type, const
fflush (log->fp); fflush (log->fp);
DBG_BUFFER_RESET (log); LOG_BUFFER_RESET (log);
/* avoids -Wunused-parameter -Wunused-but-set-variable */ /* avoids -Wunused-parameter -Wunused-but-set-variable */
(void)aafi; (void)aafi;
@ -184,13 +184,13 @@ laaf_log_callback (struct aafLog* log, void* ctxdata, int libid, int type, const
} }
void void
laaf_write_log (struct aafLog* log, void* ctxdata, enum debug_source_id lib, enum verbosityLevel_e type, const char* dbgfile, const char* dbgfunc, int dbgline, const char* format, ...) laaf_write_log (struct aafLog* log, void* ctxdata, enum log_source_id lib, enum verbosityLevel_e type, const char* srcfile, const char* srcfunc, int srcline, const char* format, ...)
{ {
if (!log) { if (!log) {
return; return;
} }
if (!log->debug_callback) { if (!log->log_callback) {
return; return;
} }
@ -275,7 +275,7 @@ laaf_write_log (struct aafLog* log, void* ctxdata, enum debug_source_id lib, enu
return; return;
} }
log->debug_callback (log, (void*)ctxdata, lib, type, dbgfile, dbgfunc, dbgline, log->_msg, log->user); log->log_callback (log, (void*)ctxdata, lib, type, srcfile, srcfunc, srcline, log->_msg, log->user);
va_end (ap); va_end (ap);

View File

@ -307,9 +307,6 @@ laaf_util_relative_path (const char* filepath, const char* refpath)
return NULL; return NULL;
} }
// fprintf( stderr, "%s\n", filepath );
// fprintf( stderr, "%s\n", refpath );
int isWindowsPath = 0; int isWindowsPath = 0;
int aWindowsPath = 0; int aWindowsPath = 0;
int bWindowsPath = 0; int bWindowsPath = 0;