MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ validate()

void ContiguousAccessProcessor::validate ( )
private

Validate the container's structure and output configuration.

Throws if configuration is invalid.

Definition at line 71 of file ContiguousAccessProcessor.cpp.

72{
73 if (m_total_elements == 0) {
75 "ContiguousAccessProcessor validation: Container has no data elements");
76 }
77
78 if (m_output_shape.size() != 2) {
80 std::source_location::current(),
81 "Audio output shape must be [frames, channels]");
82 }
83
84 uint64_t frames_requested = m_output_shape[0];
85 uint64_t channels_requested = m_output_shape[1];
86 uint64_t available_channels = m_structure.get_channel_count();
87
88 if (frames_requested == 0 || channels_requested == 0) {
90 std::source_location::current(),
91 "Frame and channel counts cannot be zero");
92 }
93
94 if (frames_requested > m_structure.get_samples_count_per_channel()) {
96 std::source_location::current(),
97 "Requested {} frames exceeds available {} samples per channel",
98 frames_requested,
100 }
101
102 if (channels_requested > available_channels) {
104 std::source_location::current(),
105 "Requested {} channels exceeds available {} channels",
106 channels_requested,
107 available_channels);
108 }
109
110 if (m_current_position.size() != available_channels) {
112 "Current position size {} doesn't match available channel count {}, resetting positions",
113 m_current_position.size(),
114 available_channels);
115 m_current_position.resize(available_channels, 0);
116 }
117
119 "ContiguousAccessProcessor validated: memory layout {}, processing {}×{} blocks, current positions for {} channels",
120 (m_structure.organization == OrganizationStrategy::INTERLEAVED ? "interleaved" : "planar"),
121 frames_requested,
122 channels_requested, m_current_position.size());
123}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
static uint64_t get_channel_count(const std::vector< DataDimension > &dimensions)
Extract channel count from dimensions.
static uint64_t get_samples_count_per_channel(const std::vector< DataDimension > &dimensions)
Get samples per channel (time dimension only).

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Kakshya::ContainerDataStructure::get_channel_count(), MayaFlux::Kakshya::ContainerDataStructure::get_samples_count_per_channel(), MayaFlux::Kakshya::INTERLEAVED, MayaFlux::Journal::Kakshya, m_current_position, m_output_shape, m_structure, m_total_elements, MF_ERROR, MF_INFO, MF_WARN, and MayaFlux::Kakshya::ContainerDataStructure::organization.

Referenced by on_attach(), and set_output_size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: