1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Validation shared by transcode I/O adapters.
use Error;
use ErrorKind;
use Result;
use crateTranscodeProgress;
use crateTranscodeStatus;
/// Validates a decoder progress report before the input adapter commits it.
///
/// # Parameters
///
/// - `progress`: Report returned by the transcoder for the current call.
/// - `input_index`: Absolute input index at the start of that call.
/// - `available_input`: Input units available from the starting index.
/// - `output_index`: Absolute output index at the start of that call.
/// - `available_output`: Writable units available from the starting index.
///
/// # Returns
///
/// Returns the unchanged report when its counts and status satisfy the
/// contract.
///
/// # Errors
///
/// Returns [`ErrorKind::InvalidData`] if the report violates progress bounds
/// or status invariants. No adapter state is changed by this validation.
pub
/// Validates an encoder progress report before the output adapter commits it.
///
/// # Parameters
///
/// - `progress`: Report returned by the transcoder for the current call.
/// - `input_index`: Absolute input index at the start of that call.
/// - `available_input`: Input units available from the starting index.
/// - `output_index`: Absolute output index at the start of that call.
/// - `available_output`: Writable units available from the starting index.
///
/// # Returns
///
/// Returns the unchanged report when its counts and status satisfy the
/// contract.
///
/// # Errors
///
/// Returns [`ErrorKind::InvalidData`] if the report violates progress bounds
/// or status invariants, or requests more input. This changes no adapter state.
pub