Read-only consultation snapshot of a media source. More...
#include <StormByte/multimedia/file.hxx>
Public Types | |
| using | DurationProgress = std::function<void(double)> |
| Observer receiving monotone byte-based duration scan percentages. | |
Public Member Functions | |
| File (const File &)=delete | |
| File (File &&other) noexcept | |
| Move constructor. | |
| ~File () noexcept | |
| Destructor. | |
| File & | operator= (const File &)=delete |
| File & | operator= (File &&)=delete |
| StormByte::Safe::String | Path () const |
| Path label: stored path, or reader.Path() if borrowed. | |
| const class Container & | Container () const noexcept |
| Detected container. | |
| const Multimedia::Streams & | Streams () const noexcept |
| Real streams in container order. | |
| const Multimedia::Attachments & | Attachments () const noexcept |
| Container attachments (covers, fonts). | |
| const Metadata::File & | Metadata () const noexcept |
| Container-level tags captured at Open. | |
| const std::optional< Property::Duration > & | Duration () const noexcept |
| Container duration. | |
| const std::optional< Property::Duration > & | Duration (const DurationProgress &progress) const noexcept |
| Resolve duration while reporting packet scan progress. | |
Static Public Member Functions | |
| static ExpectedFile | Open (const std::filesystem::path &path, std::optional< std::chrono::nanoseconds > duration=std::nullopt) noexcept |
Opens and probes path. | |
| static ExpectedFile | Open (StormByte::Buffer::IO::BufferedLocationReader &reader, std::optional< std::chrono::nanoseconds > duration=std::nullopt) noexcept |
Opens and probes reader with AVIO only. | |
Friends | |
| class | StormByte::Multimedia::Backend::Pipeline::Demuxer |
Read-only consultation snapshot of a media source.
Public media file snapshot.
File lists a locator, container, streams (HDR / HDR10+ and other mapped properties), attachments, metadata and duration. It has no write API and is not part of the tube. There is no public Reader().
Open(path) creates a temporary local file leaf and drops it after probing so the handle is not held (Windows locking). Open(reader) probes any BufferedLocationReader with AVIO and keeps a borrowed reference; the caller retains ownership. Duration() uses that reader or builds another temporary local reader from the stored path. Path() returns the stored path or the borrowed reader locator.
Open probes headers and a bounded run of video packets for HDR10+. It does not read the whole source for Duration.
| using StormByte::Multimedia::File::DurationProgress = std::function<void(double)> |
Observer receiving monotone byte-based duration scan percentages.
|
delete |
|
noexcept |
Move constructor.
| other | File to take. |
|
noexcept |
Destructor.
|
noexcept |
|
inlinenoexcept |
Detected container.
|
noexcept |
Container duration.
Returns the header value, the duration passed to Open, or a value cached after the first scan. The first call may read the whole source when Open was used without a duration: even if the container header has a duration, streams that lack one are filled from packet timestamps. After a successful scan the result is reused on this instance. If Open(..., duration) was used, this is that value, there is no extra I/O, and stream durations stay as probed.
|
noexcept |
Resolve duration while reporting packet scan progress.
| progress | Byte-position observer; not called for a cached or supplied duration. |
|
inlinenoexcept |
Container-level tags captured at Open.
|
staticnoexcept |
Opens and probes path.
Temporary reader is dropped.
| path | Media file. |
| duration | Authoritative duration; empty means scan on first Duration(). |
|
staticnoexcept |
Opens and probes reader with AVIO only.
| reader | Existing origin. Not taken. Rewound before return. |
| duration | Authoritative duration; empty means scan on first Duration(). |
| StormByte::Safe::String StormByte::Multimedia::File::Path | ( | ) | const |
Path label: stored path, or reader.Path() if borrowed.
|
inlinenoexcept |
Real streams in container order.
Attached pictures are omitted.
|
friend |