From 9310825d9301396c6c22b1c8ad704968e7fd6132 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 3 Mar 2021 09:54:38 -0500 Subject: [PATCH] Add get_video_stream and get_audio_stream. --- src/zm_ffmpeg_input.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/zm_ffmpeg_input.h b/src/zm_ffmpeg_input.h index 6a339f081..5ca5f07dc 100644 --- a/src/zm_ffmpeg_input.h +++ b/src/zm_ffmpeg_input.h @@ -36,7 +36,13 @@ class FFmpeg_Input { int get_audio_stream_id() const { return audio_stream_id; } - AVFormatContext * get_format_context() { return input_format_context; }; + AVStream *get_video_stream() { + return ( video_stream_id >= 0 ) ? input_format_context->streams[video_stream_id] : nullptr; + } + AVStream *get_audio_stream() { + return ( audio_stream_id >= 0 ) ? input_format_context->streams[audio_stream_id] : nullptr; + } + AVFormatContext *get_format_context() { return input_format_context; }; private: typedef struct {