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

◆ close()

void MayaFlux::IO::VideoFileReader::close ( )
overridevirtual

Close the currently open file.

Implements MayaFlux::IO::FileReader.

Definition at line 118 of file VideoFileReader.cpp.

119{
121 m_container_ref.reset();
122
123 std::unique_lock ctx_lock(m_context_mutex);
124
125 if (m_audio) {
126 m_audio->close();
127 m_audio.reset();
128 }
129 if (m_video) {
130 m_video->close();
131 m_video.reset();
132 }
133 if (m_demux) {
134 m_demux->close();
135 m_demux.reset();
136 }
137
138 m_audio_container.reset();
139 m_sws_buf.clear();
140 m_sws_buf.shrink_to_fit();
141
142 {
143 std::lock_guard lock(m_metadata_mutex);
144 m_cached_metadata.reset();
145 m_cached_regions.clear();
146 }
147
148 m_decode_head.store(0);
149 clear_error();
150
151 if (m_owns_io_service) {
153 .unregister_service<Registry::Service::IOService>();
154 m_io_service.reset();
155 m_owns_io_service = false;
156 }
157}
std::vector< FileRegion > m_cached_regions
std::vector< uint8_t > m_sws_buf
One-frame sws scratch buffer (padded linesize, reused by decode thread).
std::weak_ptr< Kakshya::VideoFileContainer > m_container_ref
std::shared_ptr< FFmpegDemuxContext > m_demux
std::shared_ptr< Registry::Service::IOService > m_io_service
std::shared_ptr< VideoStreamContext > m_video
std::shared_ptr< AudioStreamContext > m_audio
std::optional< FileMetadata > m_cached_metadata
std::shared_ptr< Kakshya::SoundFileContainer > m_audio_container
std::atomic< uint64_t > m_decode_head
static BackendRegistry & instance()
Get the global registry instance.
void unregister_service()
Unregister a service.

References clear_error(), MayaFlux::Registry::BackendRegistry::instance(), m_audio, m_audio_container, m_cached_metadata, m_cached_regions, m_container_ref, m_context_mutex, m_decode_head, m_demux, m_io_service, m_metadata_mutex, m_owns_io_service, m_sws_buf, m_video, stop_decode_thread(), and MayaFlux::Registry::BackendRegistry::unregister_service().

Referenced by open(), and ~VideoFileReader().

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