Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.4 updates #111

Merged
merged 7 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# bmx Changelog

## v1.4

### Breaking changes

* None

### Features

* Add support for the ARD ZDF XDF Multi Essence Location Style profile (https://github.com/bbc/bmx/pull/105)
* Detect more platform and architectures for the MXF Identification platform string (https://github.com/bbc/bmx/pull/84)
* Improve compliance of RDD 9 partition durations and sizes (https://github.com/bbc/bmx/pull/12)

### Bug fixes

* Fix a missing file execute permission on the libMXF run test file script (https://github.com/bbc/bmx/pull/109)

### Build changes

* None

## v1.3

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else()
endif()

project(bmx
VERSION 1.3
VERSION 1.4
DESCRIPTION "A C++ library and set of utilities to read and write the SMPTE ST 377-1 MXF file format"
HOMEPAGE_URL https://github.com/bbc/bmx
LANGUAGES C CXX
Expand Down
2 changes: 1 addition & 1 deletion deps/libMXF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else()
endif()

project(libMXF
VERSION 1.3
VERSION 1.4
DESCRIPTION "Low-level C library for reading and writing the SMPTE ST 377-1 MXF file format"
HOMEPAGE_URL https://github.com/bbc/libMXF
LANGUAGES C CXX
Expand Down
36 changes: 19 additions & 17 deletions deps/libMXF/examples/archive/write/write_archive_mxf.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#define MIN_LLEN 4
#define ESS_ELEMENT_LLEN 4

#define LIMIT_UINT32(val) ((val) > UINT32_MAX ? UINT32_MAX : (uint32_t)(val))


typedef struct
Expand Down Expand Up @@ -1427,13 +1428,14 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
int i;
int64_t filePos;
long j;
uint32_t k;
MXFListIterator iter;
const PSEFailure *pseFailure;
const VTRError *vtrError;
const DigiBetaDropout *digiBetaDropout;
const TimecodeBreak *timecodeBreak;
uint32_t nextTrackID;
int numTracks;
uint32_t numTracks;
TimecodeIndexSearcher vitcIndexSearcher;
TimecodeIndexSearcher ltcIndexSearcher;
int64_t errorPosition;
Expand All @@ -1454,10 +1456,10 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou

/* update the PSE failure and VTR error counts */

CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_VTRErrorCount), numVTRErrors));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_PSEFailureCount), numPSEFailures));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_DigiBetaDropoutCount), numDigiBetaDropouts));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_TimecodeBreakCount), numTimecodeBreaks));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_VTRErrorCount), LIMIT_UINT32(numVTRErrors)));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_PSEFailureCount), LIMIT_UINT32(numPSEFailures)));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_DigiBetaDropoutCount), LIMIT_UINT32(numDigiBetaDropouts)));
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_TimecodeBreakCount), LIMIT_UINT32(numTimecodeBreaks)));


/* update the header metadata durations and audio sequence offset */
Expand Down Expand Up @@ -1545,8 +1547,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
{
/* if num PSE failures exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
written in > 1 tracks */
numTracks = (numPSEFailures + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
for (i = 0; i < numTracks; i++)
numTracks = LIMIT_UINT32((numPSEFailures + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
for (k = 0; k < numTracks; k++)
{
/* Preface - ContentStorage - SourcePackage - DM Event Track */
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
Expand Down Expand Up @@ -1628,8 +1630,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
{
/* if numVTRErrorsLocated exceeds MAX_STRONG_REF_ARRAY_COUNT then the errors are
written in > 1 tracks */
numTracks = (numVTRErrorsLocated + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
for (j = 0; j < numTracks; j++)
numTracks = LIMIT_UINT32((numVTRErrorsLocated + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
for (k = 0; k < numTracks; k++)
{
/* Preface - ContentStorage - SourcePackage - DM Event Track */
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
Expand All @@ -1656,8 +1658,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
{
/* if num dropouts exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
written in > 1 tracks */
numTracks = (numDigiBetaDropouts + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
for (i = 0; i < numTracks; i++)
numTracks = LIMIT_UINT32((numDigiBetaDropouts + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
for (k = 0; k < numTracks; k++)
{
/* Preface - ContentStorage - SourcePackage - DM Event Track */
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
Expand All @@ -1681,8 +1683,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
{
/* if num breaks exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
written in > 1 tracks */
numTracks = (numTimecodeBreaks + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
for (i = 0; i < numTracks; i++)
numTracks = LIMIT_UINT32((numTimecodeBreaks + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
for (k = 0; k < numTracks; k++)
{
/* Preface - ContentStorage - SourcePackage - DM Event Track */
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
Expand Down Expand Up @@ -1733,7 +1735,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));

for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && timecodeBreakIndex < numTimecodeBreaks; j++, timecodeBreakIndex++)
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && timecodeBreakIndex < numTimecodeBreaks; k++, timecodeBreakIndex++)
{
timecodeBreak = (const TimecodeBreak*)&timecodeBreaks[timecodeBreakIndex];

Expand Down Expand Up @@ -1790,7 +1792,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));

for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && digiBetaDropoutIndex < numDigiBetaDropouts; j++, digiBetaDropoutIndex++)
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && digiBetaDropoutIndex < numDigiBetaDropouts; k++, digiBetaDropoutIndex++)
{
digiBetaDropout = (const DigiBetaDropout*)&digiBetaDropouts[digiBetaDropoutIndex];

Expand Down Expand Up @@ -1846,7 +1848,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));

for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && failureIndex < numPSEFailures; j++, failureIndex++)
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && failureIndex < numPSEFailures; k++, failureIndex++)
{
pseFailure = (const PSEFailure*)&pseFailures[failureIndex];

Expand Down Expand Up @@ -1910,7 +1912,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));

for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && errorIndex < numVTRErrors; j++, errorIndex++)
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && errorIndex < numVTRErrors; k++, errorIndex++)
{
vtrError = (const VTRError*)&vtrErrors[errorIndex];

Expand Down
7 changes: 4 additions & 3 deletions deps/libMXF/tools/MXFDump/MXFDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <limits.h>

#if defined (_MSC_VER) && defined(_M_IX86) && defined(_WIN32)
#define MXF_COMPILER_MSC_INTEL_WINDOWS
Expand Down Expand Up @@ -7179,11 +7180,11 @@ bool getInteger(int& i, char* s)
bool result;
char* expectedEnd = &s[strlen(s)];
char* end;
int b = strtoul(s, &end, 10);
if (end != expectedEnd) {
long b = strtoul(s, &end, 10);
if (end != expectedEnd || b > INT_MAX || b < INT_MIN) {
result = false;
} else {
i = b;
i = (int)b;
result = true;
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion deps/libMXFpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else()
endif()

project(libMXF++
VERSION 1.3
VERSION 1.4
DESCRIPTION "C++ wrapper library for libMXF that supports reading and writing the SMPTE ST 377-1 MXF file format"
HOMEPAGE_URL https://github.com/bbc/libMXFpp
LANGUAGES CXX
Expand Down
9 changes: 8 additions & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ This describes the steps for making a release.
* Check the [runner versions](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) (e.g. `windows-2019` and `macos-13`) in the [release.yml](../.github/workflows/release.yml) workflow file are still available
* Select the oldest macOS version available to help with compatibility
* Run the [Release](https://github.com/bbc/bmx/actions/workflows/release.yml) workflow in GitHub Actions using the release branch to check it succeeds
* Create a temporary tag using the steps from [Create a Release Tag](#create-a-release-tag) and then delete the tag once the workflow succeeds using the following commands:

```bash
git push --delete origin v${BMX_VERSION}
git tag -d v${BMX_VERSION}
```

* Create and merge a PR for the release branch into `main`

## Create a Release Tag
Expand All @@ -24,7 +31,7 @@ This describes the steps for making a release.
export BMX_VERSION=<major version>.<minor version>
git checkout main
git pull --rebase
git tag -a v${BMX_VERSION} -m "Version ${BMX_VERSION}"`
git tag -a v${BMX_VERSION} -m "Version ${BMX_VERSION}"
git push origin v${BMX_VERSION}
```

Expand Down
8 changes: 4 additions & 4 deletions include/bmx/essence_parser/JXSEssenceParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ namespace bmx
inline uint32_t Swap32(uint32_t i)
{
return
((i & 0x000000ffUL) << 24) |
((i & 0xff000000UL) >> 24) |
((i & 0x0000ff00UL) << 8) |
((i & 0x00ff0000UL) >> 8);
((i & 0x000000ffU) << 24) |
((i & 0xff000000U) >> 24) |
((i & 0x0000ff00U) << 8) |
((i & 0x00ff0000U) >> 8);
}

struct JPEGXSPictureSubDescriptor
Expand Down
8 changes: 6 additions & 2 deletions src/rdd9_mxf/RDD9IndexTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include "config.h"
#endif

#define __STDC_LIMIT_MACROS

#include <climits>

#include <algorithm>

#include <bmx/rdd9_mxf/RDD9ContentPackage.h>
Expand Down Expand Up @@ -515,8 +519,8 @@ void RDD9IndexTable::WriteVBESegments(File *mxf_file, Partition *partition, vect
partition->fillToKag(mxf_file);
} else {
int64_t current_count = mxf_file->tell() - segment_start_file_pos;
if (current_count < mFirstIndexSegmentCount)
partition->allocateSpaceToKag(mxf_file, mFirstIndexSegmentCount - current_count);
if (current_count < mFirstIndexSegmentCount && mFirstIndexSegmentCount - current_count <= UINT32_MAX)
partition->allocateSpaceToKag(mxf_file, (uint32_t)(mFirstIndexSegmentCount - current_count));
else
partition->fillToKag(mxf_file);
}
Expand Down
Loading