Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 323fe77

Browse files
authored
Merge pull request #104 from bbc/philipn-release-1.3
Release version 1.3
2 parents e498059 + 9766e41 commit 323fe77

File tree

14 files changed

+80
-33
lines changed

14 files changed

+80
-33
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# bmx Changelog
22

3+
## v1.3
4+
5+
### Breaking changes
6+
7+
* None
8+
9+
### Features
10+
11+
* Add basic support for ANC / VBI frame wrapped in KLV for input into raw2bmx (https://github.com/bbc/bmx/pull/102)
12+
* Add a `--repeat-index` option for RDD 9 (https://github.com/bbc/bmx/pull/96)
13+
* Add support for AVC separate fields (https://github.com/bbc/bmx/pull/94)
14+
* Improve reading growing files (https://github.com/bbc/bmx/pull/90)
15+
* Add a reference to the Conan packages in the README (https://github.com/bbc/bmx/pull/81)
16+
* Add MCA notes for IMF ADM Track Files (https://github.com/bbc/bmx/pull/75)
17+
* Remove a general sample rate check in File Descriptors that was overly restrictive (https://github.com/bbc/bmx/pull/72)
18+
* Set the MXF Descriptor Aspect Ratio from the value parsed from the MPEG-2 video bitstream (https://github.com/bbc/bmx/pull/67)
19+
* Include item and set key in low-level read error messages (https://github.com/bbc/bmx/pull/65)
20+
* MXFDump dumps Generic Stream Partition Packs (https://github.com/bbc/bmx/pull/64)
21+
* Tolerate Track Number not equalling 0x01 in Timed Text essence element keys (https://github.com/bbc/bmx/pull/62)
22+
* Add a link to the [RDD 6 XML Creator](https://bbc.github.io/bmx/meta/rdd6_xml_creator/) (https://github.com/bbc/bmx/pull/61)
23+
* Document adding UUIDs to IMF filenames (https://github.com/bbc/bmx/pull/59)
24+
* Speed improvement for parsing DV, RDD 36 (ProRes), JPEG XS and VC3 formats by using bitstream information about the frame size (https://github.com/bbc/bmx/pull/54)
25+
26+
### Bug fixes
27+
28+
* Fix failure to support variable size ANC / VBI alongside variable size video (https://github.com/bbc/bmx/pull/103)
29+
* Enable precharge and postroll in AVC Long GOP and fix the system timecode when there is precharge (https://github.com/bbc/bmx/pull/100)
30+
* Fix missing commandline output file arg in docs (https://github.com/bbc/bmx/pull/93)
31+
* Handle EMU protection bytes in skipped PIC timing SEI payload in h264dump (https://github.com/bbc/bmx/pull/89)
32+
* Fix various errors found using `-fsanitize` (https://github.com/bbc/bmx/pull/79)
33+
* Fix index out of bounds error in MXFDump (https://github.com/bbc/bmx/pull/76)
34+
* Accept the correct the name for the ProRes 4444 XQ commandline option, `--rdd36_4444_xq`, in addition to the old incorrect name `--rdd36_4444_hq` (https://github.com/bbc/bmx/pull/68/files)
35+
* Set OP1a / RDD 9 default Index Table entry array element flag to 0x80 (random access) to match spec. This effects VC2, Timed Text, RDD 36 and data essence types. (https://github.com/bbc/bmx/pull/63)
36+
37+
### Build changes
38+
39+
* Treat implicit function declarations in C as errors (https://github.com/bbc/bmx/pull/78)
40+
* Remove the fixed `-O2` compile flag (https://github.com/bbc/bmx/pull/73)
41+
* Only set C++11 as a minimum requirement, allowing newer versions to be used (https://github.com/bbc/bmx/pull/71)
42+
* Add a compatibility fix for building using C++20 (https://github.com/bbc/bmx/pull/69)
43+
344
## v1.2
445

546
### Breaking changes

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(bmx
16-
VERSION 1.2
16+
VERSION 1.3
1717
DESCRIPTION "A C++ library and set of utilities to read and write the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/bmx
1919
LANGUAGES C CXX

apps/bmxparse/bmxparse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ int main(int argc, const char **argv)
948948
frame_start = 0;
949949
}
950950

951-
frame_size = parser->ParseFrameSize2(buffer.data, buffer.size);
951+
frame_size = parser->ParseFrameSize2(buffer.data, (uint32_t)buffer.size);
952952

953953
if (frame_size.IsNull()) {
954954
log_error("Failed to parse frame size\n");
@@ -959,7 +959,7 @@ int main(int argc, const char **argv)
959959
if (frame_size.IsUnknown()) {
960960
if (buffer.Fill(file) == 0) {
961961
// Try create a complete frame from the available data assuming it's a valid frame
962-
if (!frame_size.CompleteSize(buffer.size))
962+
if (!frame_size.CompleteSize((uint32_t)buffer.size))
963963
break;
964964

965965
BMX_ASSERT(frame_size.IsComplete());

deps/libMXF/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(libMXF
16-
VERSION 1.2
16+
VERSION 1.3
1717
DESCRIPTION "Low-level C library for reading and writing the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/libMXF
1919
LANGUAGES C CXX

deps/libMXFpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(libMXF++
16-
VERSION 1.2
16+
VERSION 1.3
1717
DESCRIPTION "C++ wrapper library for libMXF that supports reading and writing the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/libMXFpp
1919
LANGUAGES CXX

include/bmx/essence_parser/JXSEssenceParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ namespace bmx
139139
class CAP
140140
{
141141
const unsigned char* m_MarkerData;
142-
uint32_t m_DataSize;
142+
size_t m_DataSize;
143143
NO_COPY_CONSTRUCT(CAP);
144144
CAP();
145145

@@ -181,7 +181,7 @@ namespace bmx
181181
class PIH
182182
{
183183
const unsigned char* m_MarkerData;
184-
uint32_t m_DataSize;
184+
size_t m_DataSize;
185185
NO_COPY_CONSTRUCT(PIH);
186186
PIH();
187187

include/bmx/essence_parser/RawEssenceReader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class RawEssenceReader
5151

5252
void SetMaxReadLength(int64_t len);
5353

54-
void SetFrameStartSize(int64_t len);
55-
void SetReadBlockSize(int64_t len);
54+
void SetFrameStartSize(int64_t len); // len <= uint32 max
55+
void SetReadBlockSize(int64_t len); // len <= uint32 max
5656

5757
void SetFixedSampleSize(uint32_t size);
5858

@@ -84,8 +84,8 @@ class RawEssenceReader
8484
EssenceSource *mEssenceSource;
8585

8686
int64_t mMaxReadLength;
87-
int64_t mFrameStartSize;
88-
int64_t mReadBlockSize;
87+
uint32_t mFrameStartSize;
88+
uint32_t mReadBlockSize;
8989
int64_t mTotalReadLength;
9090
uint32_t mMaxSampleSize;
9191

src/apps/AppUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,6 @@ void bmx::rt_sleep(float rt_factor, uint64_t start_tick, Rational sample_rate, i
15631563
sample_rate.denominator / (rt_factor * sample_rate.numerator));
15641564
uint64_t delta_tick = delta_tick_count(tick, target_tick);
15651565
if (delta_tick)
1566-
sleep_msec(delta_tick);
1566+
sleep_msec((delta_tick <= UINT32_MAX ? (uint32_t)delta_tick : UINT32_MAX));
15671567
}
15681568

src/essence_parser/JXSEssenceParser.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ void JXSEssenceParser::ParseFrameInfo(const unsigned char *data, uint32_t data_s
146146
{
147147
int32_t result = 0;
148148
Marker NextMarker;
149-
unsigned char *start_of_data = 0;
150149
const unsigned char* p = data;
151150
const unsigned char* end_p = p + data_size;
152151
mFrameSize = 0;
@@ -248,7 +247,7 @@ void JXSEssenceParser::ParseFrameInfo(const unsigned char *data, uint32_t data_s
248247
{
249248
if (pih) {
250249
Accessor::CDT CDT_(NextMarker);
251-
int i, count = NextMarker.m_DataSize >> 1;
250+
int i, count = (int)(NextMarker.m_DataSize >> 1);
252251
for (i = 0; i < count && i < m_subDesc.JPEGXSNc; i++) {
253252
image_components[i].Bc = CDT_.Bc(i);
254253
image_components[i].Sx = CDT_.Sx(i); // subsampling in x
@@ -262,8 +261,6 @@ void JXSEssenceParser::ParseFrameInfo(const unsigned char *data, uint32_t data_s
262261
}
263262
break;
264263
case MRK_SLH: // slice header: the entropy coded data starts here
265-
if (start_of_data != 0)
266-
*start_of_data = p - data;
267264
p = end_p;
268265
break;
269266
case MRK_NIL:

src/essence_parser/KLVEssenceReader.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,29 @@ KLVEssenceReader::~KLVEssenceReader()
5656
uint32_t KLVEssenceReader::ReadValue()
5757
{
5858
// Position at the next non-zero Value
59-
uint64_t v_size = 0;
60-
while (v_size == 0) {
61-
if (!mEssenceSource->PositionInV(&v_size) || v_size > UINT32_MAX) {
62-
if (v_size > UINT32_MAX)
63-
log_warn("KLV value size %" PRIu64 " > max uint32 is not supported\n", v_size);
59+
uint64_t v_size64 = 0;
60+
while (v_size64 == 0) {
61+
if (!mEssenceSource->PositionInV(&v_size64)) {
6462
mValueBuffer.SetSize(0);
6563
return 0;
6664
}
6765
}
6866

67+
if (v_size64 > UINT32_MAX) {
68+
log_warn("KLV value size %" PRIu64 " > max uint32 is not supported\n", v_size64);
69+
mValueBuffer.SetSize(0);
70+
return 0;
71+
}
72+
uint32_t value_size = (uint32_t)v_size64;
73+
6974
// Expect to be at the start of the V because the read below reads the whole V
7075
BMX_CHECK(mEssenceSource->GetOffsetInV() == 0);
7176

72-
mValueBuffer.Allocate(v_size);
77+
mValueBuffer.Allocate(value_size);
7378

74-
uint32_t read_size = mEssenceSource->Read(mValueBuffer.GetBytes(), v_size);
75-
if (read_size != v_size) {
76-
log_warn("Incomplete KLV; only read %u of %u\n", read_size, v_size);
79+
uint32_t read_size = mEssenceSource->Read(mValueBuffer.GetBytes(), value_size);
80+
if (read_size != value_size) {
81+
log_warn("Incomplete KLV; only read %u of %u\n", read_size, value_size);
7782
mValueBuffer.SetSize(0);
7883
return 0;
7984
}

0 commit comments

Comments
 (0)