mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Update libaaf to v1.0-11-gb04c547
This commit is contained in:
parent
895fe2f753
commit
41587d3c06
16 changed files with 158 additions and 101 deletions
|
|
@ -2138,7 +2138,7 @@ getNodeProperties (AAF_Data* aafd, cfbNode* Node)
|
||||||
warning( L"Stream length (%lu Bytes) does not match property length (%u Bytes).",
|
warning( L"Stream length (%lu Bytes) does not match property length (%u Bytes).",
|
||||||
stream_sz,
|
stream_sz,
|
||||||
prop_sz );
|
prop_sz );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ aaf_dump_TaggedValueSet (AAF_Data* aafd, aafObject* ObjCollection, const char* p
|
||||||
ANSI_COLOR_DARKGREY (log),
|
ANSI_COLOR_DARKGREY (log),
|
||||||
(name) ? name : "<unknown>",
|
(name) ? name : "<unknown>",
|
||||||
ANSI_COLOR_RESET (log),
|
ANSI_COLOR_RESET (log),
|
||||||
(name) ? (size_t) (34 - (int)strlen (name)) : (size_t) (34 - strlen ("<unknown>")), " ",
|
(name) ? (size_t)(34 - (int)strlen (name)) : (size_t)(34 - strlen ("<unknown>")), " ",
|
||||||
ANSI_COLOR_DARKGREY (log),
|
ANSI_COLOR_DARKGREY (log),
|
||||||
aaft_TypeIDToText (&indirect->TypeDef),
|
aaft_TypeIDToText (&indirect->TypeDef),
|
||||||
ANSI_COLOR_RESET (log),
|
ANSI_COLOR_RESET (log),
|
||||||
|
|
|
||||||
|
|
@ -888,3 +888,44 @@ externalAudioDataReaderCallback (unsigned char* buf, size_t offset, size_t reqle
|
||||||
|
|
||||||
return byteRead;
|
return byteRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aafiAudioEssencePointer*
|
||||||
|
aafi_audioEssencePointer_exists_before (AAF_Iface* aafi, aafiAudioEssencePointer* audioEssencePointerList)
|
||||||
|
{
|
||||||
|
aafiAudioTrack* at = NULL;
|
||||||
|
aafiTimelineItem* ai = NULL;
|
||||||
|
aafiAudioClip* ac = NULL;
|
||||||
|
|
||||||
|
aafiAudioEssencePointer* aep1 = NULL;
|
||||||
|
aafiAudioEssencePointer* aep2 = NULL;
|
||||||
|
|
||||||
|
AAFI_foreachAudioTrack (aafi, at)
|
||||||
|
{
|
||||||
|
AAFI_foreachTrackItem (at, ai)
|
||||||
|
{
|
||||||
|
if (ai->type != AAFI_AUDIO_CLIP) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ac = (aafiAudioClip*)ai->data;
|
||||||
|
aep1 = audioEssencePointerList;
|
||||||
|
|
||||||
|
int found = 1;
|
||||||
|
|
||||||
|
AAFI_foreachEssencePointer (ac->essencePointerList, aep2)
|
||||||
|
{
|
||||||
|
if (!aep1 || aep1->essenceFile != aep2->essenceFile || aep1->essenceChannel != aep2->essenceChannel) {
|
||||||
|
found = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
aep1 = aep1->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found && aep1 == NULL) {
|
||||||
|
return ac->essencePointerList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3166,12 +3166,23 @@ aafi_retrieveData (AAF_Iface* aafi)
|
||||||
|
|
||||||
AAFI_foreachTrackItem (audioTrack, audioItem)
|
AAFI_foreachTrackItem (audioTrack, audioItem)
|
||||||
{
|
{
|
||||||
if (audioItem->type == AAFI_TRANS) {
|
if (audioItem->type != AAFI_AUDIO_CLIP) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
audioClip = (aafiAudioClip*)audioItem->data;
|
audioClip = (aafiAudioClip*)audioItem->data;
|
||||||
audioClip->channels = aafi_getAudioEssencePointerChannelCount (audioClip->essencePointerList);
|
audioClip->channels = aafi_getAudioEssencePointerChannelCount (audioClip->essencePointerList);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we check if any previous clip is using the exact same essence pointer,
|
||||||
|
* to avoid duplication and allow to detect when multiple clips are using
|
||||||
|
* the same essence.
|
||||||
|
*/
|
||||||
|
aafiAudioEssencePointer* prev = aafi_audioEssencePointer_exists_before (aafi, audioClip->essencePointerList);
|
||||||
|
|
||||||
|
if (prev) {
|
||||||
|
audioClip->essencePointerList = prev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,12 @@ aafi_release (AAF_Iface** aafi)
|
||||||
aafi_freeAudioTracks (&(*aafi)->Audio->Tracks);
|
aafi_freeAudioTracks (&(*aafi)->Audio->Tracks);
|
||||||
aafi_freeAudioEssences (&(*aafi)->Audio->essenceFiles);
|
aafi_freeAudioEssences (&(*aafi)->Audio->essenceFiles);
|
||||||
|
|
||||||
|
aafiAudioEssencePointer* essencePointer = (*aafi)->Audio->essencePointerList;
|
||||||
|
|
||||||
|
while (essencePointer) {
|
||||||
|
essencePointer = aafi_freeAudioEssencePointer (essencePointer);
|
||||||
|
}
|
||||||
|
|
||||||
free ((*aafi)->Audio);
|
free ((*aafi)->Audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,7 +364,7 @@ aafi_convertUnit (aafPosition_t value, aafRational_t* valueEditRate, aafRational
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (aafPosition_t) ((double)value * (destEditRateFloat / valueEditRateFloat));
|
return (aafPosition_t)((double)value * (destEditRateFloat / valueEditRateFloat));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
|
|
@ -391,7 +397,7 @@ aafi_convertUnitUint64 (aafPosition_t value, aafRational_t* valueEditRate, aafRa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (uint64_t) ((double)value * (destEditRateFloat / valueEditRateFloat));
|
return (uint64_t)((double)value * (destEditRateFloat / valueEditRateFloat));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -506,8 +512,8 @@ aafi_applyGainOffset (AAF_Iface* aafi, aafiAudioGain** gain, aafiAudioGain* offs
|
||||||
* is the same accross all gains in file. Thus, we devide both gain numbers
|
* is the same accross all gains in file. Thus, we devide both gain numbers
|
||||||
* by offset denominator, so we fit inside uint32_t.
|
* by offset denominator, so we fit inside uint32_t.
|
||||||
*/
|
*/
|
||||||
(*gain)->value[i].numerator = (int32_t) (((int64_t) (*gain)->value[i].numerator * (int64_t)offset->value[0].numerator) / (int64_t)offset->value[0].denominator);
|
(*gain)->value[i].numerator = (int32_t)(((int64_t)(*gain)->value[i].numerator * (int64_t)offset->value[0].numerator) / (int64_t)offset->value[0].denominator);
|
||||||
(*gain)->value[i].denominator = (int32_t) (((int64_t) (*gain)->value[i].denominator * (int64_t)offset->value[0].denominator) / (int64_t)offset->value[0].denominator);
|
(*gain)->value[i].denominator = (int32_t)(((int64_t)(*gain)->value[i].denominator * (int64_t)offset->value[0].denominator) / (int64_t)offset->value[0].denominator);
|
||||||
// debug( "Setting (*gain)->value[%i] = %i/%i * %i/%i",
|
// debug( "Setting (*gain)->value[%i] = %i/%i * %i/%i",
|
||||||
// i,
|
// i,
|
||||||
// (*gain)->value[i].numerator,
|
// (*gain)->value[i].numerator,
|
||||||
|
|
@ -798,10 +804,10 @@ aafi_newAudioEssencePointer (AAF_Iface* aafi, aafiAudioEssencePointer** list, aa
|
||||||
last->next = essencePointer;
|
last->next = essencePointer;
|
||||||
} else {
|
} else {
|
||||||
*list = essencePointer;
|
*list = essencePointer;
|
||||||
|
}
|
||||||
|
|
||||||
essencePointer->aafiNext = aafi->Audio->essencePointerList;
|
essencePointer->aafiNext = aafi->Audio->essencePointerList;
|
||||||
aafi->Audio->essencePointerList = essencePointer;
|
aafi->Audio->essencePointerList = essencePointer;
|
||||||
}
|
|
||||||
|
|
||||||
return *list;
|
return *list;
|
||||||
}
|
}
|
||||||
|
|
@ -985,8 +991,6 @@ aafi_freeAudioClip (aafiAudioClip* audioClip)
|
||||||
aafi_freeAudioGain (audioClip->automation);
|
aafi_freeAudioGain (audioClip->automation);
|
||||||
aafi_freeMetadata (&(audioClip->metadata));
|
aafi_freeMetadata (&(audioClip->metadata));
|
||||||
|
|
||||||
aafi_freeAudioEssencePointer (audioClip->essencePointerList);
|
|
||||||
|
|
||||||
free (audioClip);
|
free (audioClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1042,16 +1046,14 @@ aafi_freeMetadata (aafiMetaData** CommentList)
|
||||||
*CommentList = NULL;
|
*CommentList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
aafiAudioEssencePointer*
|
||||||
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* essencePointer)
|
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* essencePointer)
|
||||||
{
|
{
|
||||||
aafiAudioEssencePointer* next = NULL;
|
aafiAudioEssencePointer* next = essencePointer->aafiNext;
|
||||||
|
|
||||||
while (essencePointer) {
|
|
||||||
next = essencePointer->next;
|
|
||||||
free (essencePointer);
|
free (essencePointer);
|
||||||
essencePointer = next;
|
|
||||||
}
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -729,7 +729,7 @@ cfb_getStream (CFB_Data* cfbd, cfbNode* node, unsigned char** stream, uint64_t*
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpy_sz = ((stream_len - offset) < (uint64_t) (1 << cfbd->hdr->_uMiniSectorShift)) ? (stream_len - offset) : (uint64_t) (1 << cfbd->hdr->_uMiniSectorShift);
|
cpy_sz = ((stream_len - offset) < (uint64_t)(1 << cfbd->hdr->_uMiniSectorShift)) ? (stream_len - offset) : (uint64_t)(1 << cfbd->hdr->_uMiniSectorShift);
|
||||||
|
|
||||||
memcpy (*stream + offset, buf, cpy_sz);
|
memcpy (*stream + offset, buf, cpy_sz);
|
||||||
|
|
||||||
|
|
@ -740,7 +740,7 @@ cfb_getStream (CFB_Data* cfbd, cfbNode* node, unsigned char** stream, uint64_t*
|
||||||
} else {
|
} else {
|
||||||
CFB_foreachSectorInChain (cfbd, buf, id)
|
CFB_foreachSectorInChain (cfbd, buf, id)
|
||||||
{
|
{
|
||||||
cpy_sz = ((stream_len - offset) < (uint64_t) (1 << cfbd->hdr->_uSectorShift)) ? (stream_len - offset) : (uint64_t) (1 << cfbd->hdr->_uSectorShift);
|
cpy_sz = ((stream_len - offset) < (uint64_t)(1 << cfbd->hdr->_uSectorShift)) ? (stream_len - offset) : (uint64_t)(1 << cfbd->hdr->_uSectorShift);
|
||||||
|
|
||||||
memcpy (*stream + offset, buf, cpy_sz);
|
memcpy (*stream + offset, buf, cpy_sz);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,14 +94,14 @@ typedef SSIZE_T ssize_t;
|
||||||
|
|
||||||
#define URI_SET_STR(str, start, end) \
|
#define URI_SET_STR(str, start, end) \
|
||||||
\
|
\
|
||||||
str = malloc (sizeof (char) * (uint32_t) ((end - start) + 1)); \
|
str = malloc (sizeof (char) * (uint32_t)((end - start) + 1)); \
|
||||||
\
|
\
|
||||||
if (!str) { \
|
if (!str) { \
|
||||||
error ("Out of memory"); \
|
error ("Out of memory"); \
|
||||||
goto err; \
|
goto err; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
snprintf (str, (uint32_t) (end - start) + 1, "%s", start);
|
snprintf (str, (uint32_t)(end - start) + 1, "%s", start);
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
uriDecodeString (char* src, char* dst);
|
uriDecodeString (char* src, char* dst);
|
||||||
|
|
@ -787,7 +787,7 @@ uriIsIPv6 (const char* s, size_t size, char** err)
|
||||||
if (!IS_DIGIT (*(s + i))) {
|
if (!IS_DIGIT (*(s + i))) {
|
||||||
loopback = -1;
|
loopback = -1;
|
||||||
} else {
|
} else {
|
||||||
loopback += (*(s + i) - '0'); //atoi(*(s+i));
|
loopback += (*(s + i) - '0'); // atoi(*(s+i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -601,7 +601,7 @@ typedef struct _aafData {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define aafRationalToint64(r) \
|
#define aafRationalToint64(r) \
|
||||||
(((r).denominator == 0) ? 0 : (int64_t) ((r).numerator / (r).denominator))
|
(((r).denominator == 0) ? 0 : (int64_t)((r).numerator / (r).denominator))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loops through each aafPropertyIndexEntry_t of a "properties" node stream.
|
* Loops through each aafPropertyIndexEntry_t of a "properties" node stream.
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,9 @@ aafi_parse_audio_essence (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenceFil
|
||||||
int
|
int
|
||||||
aafi_build_unique_audio_essence_name (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenceFile);
|
aafi_build_unique_audio_essence_name (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenceFile);
|
||||||
|
|
||||||
|
aafiAudioEssencePointer*
|
||||||
|
aafi_audioEssencePointer_exists_before (AAF_Iface* aafi, aafiAudioEssencePointer* audioEssencePointerList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1060,7 +1060,7 @@ aafi_freeMarkers (aafiMarker** aafi);
|
||||||
void
|
void
|
||||||
aafi_freeMetadata (aafiMetaData** CommentList);
|
aafi_freeMetadata (aafiMetaData** CommentList);
|
||||||
|
|
||||||
void
|
aafiAudioEssencePointer*
|
||||||
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* audioEssenceGroupEntry);
|
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* audioEssenceGroupEntry);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ typedef enum _eAAFTypeCategory_e
|
||||||
/*
|
/*
|
||||||
* :: Types Definition
|
* :: Types Definition
|
||||||
* see Git nevali/aaf/ref-impl/include/ref-api/AAFTypes.h
|
* see Git nevali/aaf/ref-impl/include/ref-api/AAFTypes.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef unsigned char aafByte_t;
|
typedef unsigned char aafByte_t;
|
||||||
|
|
||||||
|
|
@ -369,7 +369,7 @@ typedef struct _aafRGBAComponent_t {
|
||||||
|
|
||||||
} aafRGBAComponent_t;
|
} aafRGBAComponent_t;
|
||||||
|
|
||||||
//typedef aafRGBAComponent_t aafRGBALayout[8];
|
// typedef aafRGBAComponent_t aafRGBALayout[8];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This structure map the first bytes in a **properties** stream
|
* This structure map the first bytes in a **properties** stream
|
||||||
|
|
|
||||||
|
|
@ -710,7 +710,7 @@ typedef struct CFB_Data {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CFB_getNodeStreamLen(cfbd, node) \
|
#define CFB_getNodeStreamLen(cfbd, node) \
|
||||||
((cfbd->hdr->_uSectorShift > 9) ? (uint64_t) (((uint64_t) (node->_ulSizeHigh) << 32) | (node->_ulSizeLow)) : node->_ulSizeLow)
|
((cfbd->hdr->_uSectorShift > 9) ? (uint64_t)(((uint64_t)(node->_ulSizeHigh) << 32) | (node->_ulSizeLow)) : node->_ulSizeLow)
|
||||||
|
|
||||||
#define CFB_getStreamSectorShift(cfbd, node) \
|
#define CFB_getStreamSectorShift(cfbd, node) \
|
||||||
((CFB_getNodeStreamLen (cfbd, node) < cfbd->hdr->_ulMiniSectorCutoff) ? cfbd->hdr->_uMiniSectorShift : cfbd->hdr->_uSectorShift)
|
((CFB_getNodeStreamLen (cfbd, node) < cfbd->hdr->_ulMiniSectorCutoff) ? cfbd->hdr->_uMiniSectorShift : cfbd->hdr->_uSectorShift)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#define LIBAAF_VERSION "v1.0-10-g13f0b0a"
|
#define LIBAAF_VERSION "v1.0-11-gb04c547"
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ laaf_util_build_path (const char* sep, const char* first, ...)
|
||||||
|
|
||||||
int written = snprintf (str + offset, len - offset, "%s%.*s",
|
int written = snprintf (str + offset, len - offset, "%s%.*s",
|
||||||
((element_count == 0 && has_leading_sep) || (element_count > 0)) ? sep : "",
|
((element_count == 0 && has_leading_sep) || (element_count > 0)) ? sep : "",
|
||||||
(uint32_t) (arglen - argstart),
|
(uint32_t)(arglen - argstart),
|
||||||
arg + argstart);
|
arg + argstart);
|
||||||
|
|
||||||
if (written < 0 || (size_t)written >= (len - offset)) {
|
if (written < 0 || (size_t)written >= (len - offset)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue