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

◆ add_stream()

AVStream * MayaFlux::IO::FFmpegMuxContext::add_stream ( )

Allocate a new AVStream inside this context.

Called by AudioEncodeContext::open() and VideoEncodeContext::open() to add their respective streams before write_header().

Returns
Pointer to the new AVStream, or nullptr on failure.

Definition at line 85 of file FFmpegMuxContext.cpp.

86{
87 if (!format_context) {
88 m_last_error = "add_stream called on unopened context";
89 return nullptr;
90 }
91 AVStream* st = avformat_new_stream(format_context, nullptr);
92 if (!st)
93 m_last_error = "avformat_new_stream failed";
94 return st;
95}
AVFormatContext * format_context
Owned; freed in close().

References format_context, and m_last_error.

Referenced by MayaFlux::IO::AudioEncodeContext::open(), and MayaFlux::IO::VideoEncodeContext::open().

+ Here is the caller graph for this function: