Skip to content

Commit 1382a30

Browse files
committed
🐛 Fix bug for base context
1 parent 7c5969b commit 1382a30

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# CHANGELOG
22

3+
## 1.4.1
4+
5+
- Fix: `BaseBmffContext` constructor
6+
37
## 1.4.0
48

5-
- Add `BaseBmffBox` for `BmffBox` and `AsyncBmffBox`;
6-
- Add `fullBoxType` for `BmffBox` with `BaseBmffBox`;
9+
- Add `BaseBmffContext` for `BmffContext` and `AsyncBmffContext`;
10+
- Support custom full box for bmff;
711

812
## 1.3.1
913

lib/src/bmff/io_impl.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:io';
22

33
import 'package:bmff/bmff.dart';
4+
import 'package:bmff/src/box/full_box_type.dart';
45

56
/// {@macro bmff.createBmffFromFile}
67
Bmff createBmffFromFile(String path) {
@@ -21,7 +22,10 @@ class BmffIoContext extends BmffContext {
2122
/// {@macro bmff.BmffIoContext}
2223
///
2324
/// {@macro bmff.bmff_example}
24-
BmffIoContext(this.file);
25+
BmffIoContext(
26+
this.file, {
27+
List<String> fullBoxTypes = fullBoxType,
28+
}) : super(fullBoxTypes: fullBoxTypes);
2529

2630
/// The file of the context.
2731
final File file;

lib/src/context.dart

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ abstract class BaseBmffContext {
3333
///
3434
/// {@endtemplate}
3535
abstract class BmffContext extends BaseBmffContext {
36+
BmffContext({
37+
List<String> fullBoxTypes = fullBoxType,
38+
}) : super(fullBoxTypes);
39+
3640
/// The length of the context.
3741
int get length;
3842

@@ -55,7 +59,10 @@ abstract class BmffContext extends BaseBmffContext {
5559
/// {@endtemplate}
5660
class BmffMemoryContext extends BmffContext {
5761
/// {@macro bmff.BmffMemoryContext}
58-
BmffMemoryContext(this.bytes);
62+
BmffMemoryContext(
63+
this.bytes, {
64+
List<String> fullBoxTypes = fullBoxType,
65+
}) : super(fullBoxTypes: fullBoxTypes);
5966

6067
/// The bytes of the context.
6168
final List<int> bytes;
@@ -84,7 +91,9 @@ typedef RangeDataGetter = Future<List<int>> Function(int start, int end);
8491
///
8592
/// {@endtemplate}
8693
abstract class AsyncBmffContext extends BaseBmffContext {
87-
const AsyncBmffContext();
94+
const AsyncBmffContext({
95+
List<String> fullBoxTypes = fullBoxType,
96+
}) : super(fullBoxTypes);
8897

8998
/// The length of the context.
9099
Future<int> lengthAsync();
@@ -108,7 +117,11 @@ abstract class AsyncBmffContext extends BaseBmffContext {
108117
/// {@endtemplate}
109118
class MemoryAsyncBmffContext extends AsyncBmffContext {
110119
/// {@macro bmff.MemoryAsyncBmffContext}
111-
const MemoryAsyncBmffContext(this.lengthAsyncGetter, this.rangeDataGetter);
120+
const MemoryAsyncBmffContext(
121+
this.lengthAsyncGetter,
122+
this.rangeDataGetter, {
123+
List<String> fullBoxTypes = fullBoxType,
124+
}) : super(fullBoxTypes: fullBoxTypes);
112125

113126
/// Get the length of the context.
114127
final LengthGetter lengthAsyncGetter;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: bmff
22
description: The package provides a library for reading ISO Base Media File Format (BMFF) files.
3-
version: 1.4.0
3+
version: 1.4.1
44
homepage: https://github.com/CaiJingLong/bmff
55

66
environment:

0 commit comments

Comments
 (0)