MayaFlux 0.2.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 73 of file ContiguousAccessProcessor.cpp.

74{
75 if (m_total_elements == 0) {
77 "ContiguousAccessProcessor validation: Container has no data elements");
78 }
79
80 if (m_output_shape.size() != 2) {
82 std::source_location::current(),
83 "Audio output shape must be [frames, channels]");
84 }
85
86 uint64_t frames_requested = m_output_shape[0];
87 uint64_t channels_requested = m_output_shape[1];
88 uint64_t available_channels = m_structure.get_channel_count();
89
90 if (frames_requested == 0 || channels_requested == 0) {
92 std::source_location::current(),
93 "Frame and channel counts cannot be zero");
94 }
95
96 if (frames_requested > m_structure.get_samples_count_per_channel()) {
98 std::source_location::current(),
99 "Requested {} frames exceeds available {} samples per channel",
100 frames_requested,
102 }
103
104 if (channels_requested > available_channels) {
106 std::source_location::current(),
107 "Requested {} channels exceeds available {} channels",
108 channels_requested,
109 available_channels);
110 }
111
112 if (m_current_position.size() != available_channels) {
114 "Current position size {} doesn't match available channel count {}, resetting positions",
115 m_current_position.size(),
116 available_channels);
117 m_current_position.resize(available_channels, 0);
118 }
119
121 "ContiguousAccessProcessor validated: memory layout {}, processing {}×{} blocks, current positions for {} channels",
122 (m_structure.organization == OrganizationStrategy::INTERLEAVED ? "interleaved" : "planar"),
123 frames_requested,
124 channels_requested, m_current_position.size());
125}
#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: