mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
fftools/ffmpeg: stop using deprecated AVStreamGroup fields
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
1 parent
fc5fab9a87
commit
a0979b646b
3 files changed
+32
-16
No files matched your search
+5
-2
@@ -1278,13 +1278,16 @@ unsigned stream_specifier_match(const StreamSpecifier *ss,
|
||||
ss->list_id);
|
||||
return 0;
|
||||
}
|
||||
nb_streams = g->nb_streams;
|
||||
nb_streams = g->nb_entries;
|
||||
break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
for (int i = start_stream; i < nb_streams; i++) {
|
||||
const AVStream *candidate = s->streams[g ? g->streams[i]->index :
|
||||
if (g && g->entries[i]->type != AV_STREAM_GROUP_ENTRY_STREAM)
|
||||
continue;
|
||||
|
||||
const AVStream *candidate = s->streams[g ? g->entries[i]->stream->index :
|
||||
p ? p->stream_index[i] : i];
|
||||
|
||||
if (ss->media_type != AVMEDIA_TYPE_UNKNOWN &&
|
||||
|
||||
+20
-10
@@ -617,7 +617,7 @@ static int do_bsf_graph(Demuxer *d, DemuxThreadContext *dt, DemuxStreamGroup *ds
|
||||
{
|
||||
const AVStreamGroup *stg = dsg->istg.stg;
|
||||
const AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
|
||||
const int enhancement = ds->ist.index == stg->streams[lcevc->el_index]->index;
|
||||
const int enhancement = ds->ist.index == stg->entries[lcevc->el_index]->stream->index;
|
||||
AVBitStreamFilterContext *source = dsg->lcevc[enhancement];
|
||||
int ret, flags = AV_BSF_SOURCE_FLAG_PUSH;
|
||||
|
||||
@@ -1097,7 +1097,7 @@ int ist_use(InputStream *ist, int decoding_needed,
|
||||
if (!dsg->graph || istg->stg->type != AV_STREAM_GROUP_PARAMS_LCEVC)
|
||||
continue;
|
||||
const AVStreamGroupLayeredVideo *lcevc = istg->stg->params.layered_video;
|
||||
if (ist->st->index == istg->stg->streams[lcevc->el_index]->index)
|
||||
if (ist->st->index == istg->stg->entries[lcevc->el_index]->stream->index)
|
||||
break;
|
||||
|
||||
AVBitStreamFilterContext *lcevc_merge = av_bsf_graph_get_filter(dsg->graph, "lcevc_merge");
|
||||
@@ -1129,7 +1129,7 @@ int ist_use(InputStream *ist, int decoding_needed,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
InputStream *lcevc_ist = d->f.streams[istg->stg->streams[lcevc->el_index]->index];
|
||||
InputStream *lcevc_ist = d->f.streams[istg->stg->entries[lcevc->el_index]->stream->index];
|
||||
lcevc_ist->st->discard = 0;
|
||||
|
||||
dsg->graph_enabled = 1;
|
||||
@@ -2003,8 +2003,8 @@ static int istg_parse_tile_grid(const OptionsContext *o, Demuxer *d, InputStream
|
||||
opts.crop_right = tg->coded_width - tg->width - tg->horizontal_offset;
|
||||
}
|
||||
|
||||
for (int i = 0; i < tg->nb_coded_side_data; i++) {
|
||||
const AVPacketSideData *sd = &tg->coded_side_data[i];
|
||||
for (int i = 0; i < stg->nb_coded_side_data; i++) {
|
||||
const AVPacketSideData *sd = &stg->coded_side_data[i];
|
||||
|
||||
ret = av_packet_side_data_to_frame(&opts.side_data, &opts.nb_side_data, sd, 0);
|
||||
if (ret < 0 && ret != AVERROR(EINVAL))
|
||||
@@ -2032,11 +2032,11 @@ static int istg_parse_lcevc(const OptionsContext *o, Demuxer *d, DemuxStreamGrou
|
||||
const AVStreamGroup *stg = dsg->istg.stg;
|
||||
const AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
|
||||
const AVBitStreamFilter *filter, *lcevc_filter = av_bsf_get_by_name("lcevc_merge");
|
||||
const InputStream *lcevc_ist = f->streams[stg->streams[lcevc->el_index]->index];
|
||||
const InputStream *base_ist = f->streams[stg->streams[!lcevc->el_index]->index];
|
||||
const InputStream *lcevc_ist = f->streams[stg->entries[lcevc->el_index]->stream->index];
|
||||
const InputStream *base_ist = f->streams[stg->entries[!lcevc->el_index]->stream->index];
|
||||
int ret;
|
||||
|
||||
if (!lcevc_filter || stg->nb_streams != 2)
|
||||
if (!lcevc_filter || stg->nb_entries != 2)
|
||||
return 0;
|
||||
|
||||
dsg->graph = av_bsf_graph_alloc();
|
||||
@@ -2092,13 +2092,23 @@ static int istg_add(const OptionsContext *o, Demuxer *d, AVStreamGroup *stg)
|
||||
|
||||
switch (stg->type) {
|
||||
case AV_STREAM_GROUP_PARAMS_LCEVC:
|
||||
for (int i = 0; i < istg->stg->nb_streams; i++) {
|
||||
DemuxStream *ds = ds_from_ist(f->streams[istg->stg->streams[i]->index]);
|
||||
for (int i = 0; i < istg->stg->nb_entries; i++) {
|
||||
AVStreamGroupEntry *entry = istg->stg->entries[i];
|
||||
if (entry->type != AV_STREAM_GROUP_ENTRY_STREAM)
|
||||
return AVERROR_BUG;
|
||||
DemuxStream *ds = ds_from_ist(f->streams[entry->stream->index]);
|
||||
ret = av_dynarray_add_nofree(&ds->dsg, &ds->nb_dsg, dsg);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
case AV_STREAM_GROUP_PARAMS_TILE_GRID:
|
||||
for (int i = 0; i < istg->stg->nb_entries; i++) {
|
||||
AVStreamGroupEntry *entry = istg->stg->entries[i];
|
||||
if (entry->type != AV_STREAM_GROUP_ENTRY_STREAM)
|
||||
return AVERROR_BUG;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1688,8 +1688,11 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
|
||||
if (!istg->fg)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < istg->stg->nb_streams; j++) {
|
||||
AVStream *st = istg->stg->streams[j];
|
||||
for (int j = 0; j < istg->stg->nb_entries; j++) {
|
||||
if (istg->stg->entries[j]->type != AV_STREAM_GROUP_ENTRY_STREAM)
|
||||
continue;
|
||||
|
||||
AVStream *st = istg->stg->entries[j]->stream;
|
||||
|
||||
if (st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) {
|
||||
score = 100000000;
|
||||
@@ -2739,8 +2742,8 @@ static int of_parse_group_token(Muxer *mux, const char *token, char *ptr)
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
for (unsigned i = 0; i < oc->stream_groups[idx]->nb_streams; i++) {
|
||||
ret = avformat_stream_group_add_stream(stg, oc->stream_groups[idx]->streams[i]);
|
||||
for (unsigned i = 0; i < oc->stream_groups[idx]->nb_entries; i++) {
|
||||
ret = avformat_stream_group_add_stream(stg, oc->stream_groups[idx]->entries[i]->stream);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user