You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avformat/utils: Move ff_find_stream_index to demux_utils.c
It is only used by demuxers (and it is generally demuxers who have to translate format-specific IDs to stream indices). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -226,4 +226,10 @@ int ff_generate_avci_extradata(AVStream *st);
|
|||||||
*/
|
*/
|
||||||
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size);
|
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find stream index based on format-specific stream ID
|
||||||
|
* @return stream index, or < 0 on error
|
||||||
|
*/
|
||||||
|
int ff_find_stream_index(const AVFormatContext *s, int id);
|
||||||
|
|
||||||
#endif /* AVFORMAT_DEMUX_H */
|
#endif /* AVFORMAT_DEMUX_H */
|
||||||
|
|||||||
@@ -367,3 +367,11 @@ int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ff_find_stream_index(const AVFormatContext *s, int id)
|
||||||
|
{
|
||||||
|
for (unsigned i = 0; i < s->nb_streams; i++)
|
||||||
|
if (s->streams[i]->id == id)
|
||||||
|
return i;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
#include "demux.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "gxf.h"
|
#include "gxf.h"
|
||||||
|
|
||||||
|
|||||||
@@ -558,12 +558,6 @@ typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
|
|||||||
void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
|
void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
|
||||||
void *context);
|
void *context);
|
||||||
|
|
||||||
/**
|
|
||||||
* Find stream index based on format-specific stream ID
|
|
||||||
* @return stream index, or < 0 on error
|
|
||||||
*/
|
|
||||||
int ff_find_stream_index(const AVFormatContext *s, int id);
|
|
||||||
|
|
||||||
enum AVCodecID ff_guess_image2_codec(const char *filename);
|
enum AVCodecID ff_guess_image2_codec(const char *filename);
|
||||||
|
|
||||||
const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
|
const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
|
||||||
|
|||||||
@@ -644,14 +644,6 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_find_stream_index(const AVFormatContext *s, int id)
|
|
||||||
{
|
|
||||||
for (unsigned i = 0; i < s->nb_streams; i++)
|
|
||||||
if (s->streams[i]->id == id)
|
|
||||||
return i;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int avformat_network_init(void)
|
int avformat_network_init(void)
|
||||||
{
|
{
|
||||||
#if CONFIG_NETWORK
|
#if CONFIG_NETWORK
|
||||||
|
|||||||
Reference in New Issue
Block a user