Function avformat_stream_group_add_stream

Source
pub unsafe extern "C" fn avformat_stream_group_add_stream(
    stg: *mut AVStreamGroup,
    st: *mut AVStream,
) -> i32
Expand description

Add an already allocated stream to a stream group.

When demuxing, it may be called by the demuxer in read_header(). If the flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also be called in read_packet().

When muxing, may be called by the user before avformat_write_header() after having allocated a new group with avformat_stream_group_create() and stream with avformat_new_stream().

User is required to call avformat_free_context() to clean up the allocation by avformat_stream_group_add_stream().

@param stg stream group belonging to a media file. @param st stream in the media file to add to the group.

@retval 0 success @retval AVERROR(EEXIST) the stream was already in the group @retval “another negative error code” legitimate errors

@see avformat_new_stream, avformat_stream_group_create.