|
MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
|
RAII owner of a single AVFormatContext and associated demux state. More...
#include <FFmpegDemuxContext.hpp>
Collaboration diagram for MayaFlux::IO::FFmpegDemuxContext:Public Member Functions | |
| FFmpegDemuxContext ()=default | |
| ~FFmpegDemuxContext () | |
| FFmpegDemuxContext (const FFmpegDemuxContext &)=delete | |
| FFmpegDemuxContext & | operator= (const FFmpegDemuxContext &)=delete |
| FFmpegDemuxContext (FFmpegDemuxContext &&)=delete | |
| FFmpegDemuxContext & | operator= (FFmpegDemuxContext &&)=delete |
| bool | open (const std::string &filepath) |
| Open a media file and probe stream information. | |
| void | close () |
| Close the format context and release all demux resources. | |
| bool | is_open () const |
| True if the format context is open and stream info was found. | |
| bool | open_device (const std::string &device_name, const std::string &format_name, AVDictionary **options=nullptr) |
| Open an FFmpeg device input (camera, screen capture, etc.). | |
| int | find_best_stream (int media_type, const void **out_codec=nullptr) const |
| Find the best stream of the requested media type. | |
| AVStream * | get_stream (int index) const |
| Access a stream by index. | |
| unsigned int | stream_count () const |
| Number of streams in the container. | |
| bool | seek (int stream_index, int64_t timestamp) |
| Seek to the nearest keyframe at or before the given timestamp. | |
| void | flush () |
| Flush the demuxer's internal read buffers. | |
| void | extract_container_metadata (FileMetadata &out_metadata) const |
| Extract container-level metadata tags into a FileMetadata attributes map. | |
| std::vector< FileRegion > | extract_chapter_regions () const |
| Extract chapter information as FileRegion entries. | |
| double | duration_seconds () const |
| Total container duration in seconds, or 0 if unknown. | |
| const std::string & | last_error () const |
Static Public Member Functions | |
| static void | init_ffmpeg () |
| Initialise FFmpeg logging level once per process. | |
Public Attributes | |
| AVFormatContext * | format_context = nullptr |
| Owned; freed in destructor. | |
Private Attributes | |
| std::string | m_last_error |
Static Private Attributes | |
| static std::atomic< bool > | s_ffmpeg_initialized { false } |
| static std::mutex | s_ffmpeg_init_mutex |
RAII owner of a single AVFormatContext and associated demux state.
Encapsulates all format-level (container) FFmpeg operations:
Does NOT own any codec context, resampler, or scaler — those are domain-specific and belong to AudioStreamContext / VideoStreamContext.
Shared ownership via shared_ptr allows multiple stream contexts to reference the same demuxer without duplicating the format state. Not copyable or movable; always heap-allocated through make_shared.
Definition at line 32 of file FFmpegDemuxContext.hpp.