Those are private fields, no reason to have them exposed in a public header.tags/n4.4
@@ -1197,18 +1197,6 @@ typedef struct AVStream { | |||||
uint8_t dts_ordered; | uint8_t dts_ordered; | ||||
uint8_t dts_misordered; | uint8_t dts_misordered; | ||||
/** | |||||
* Internal data to inject global side data | |||||
*/ | |||||
int inject_global_side_data; | |||||
/** | |||||
* display aspect ratio (0 if unknown) | |||||
* - encoding: unused | |||||
* - decoding: Set by libavformat to calculate sample_aspect_ratio internally | |||||
*/ | |||||
AVRational display_aspect_ratio; | |||||
/** | /** | ||||
* An opaque field for libavformat internal usage. | * An opaque field for libavformat internal usage. | ||||
* Must not be accessed in any way by callers. | * Must not be accessed in any way by callers. | ||||
@@ -224,6 +224,18 @@ struct AVStreamInternal { | |||||
int fps_last_dts_idx; | int fps_last_dts_idx; | ||||
} *info; | } *info; | ||||
/** | |||||
* Internal data to inject global side data | |||||
*/ | |||||
int inject_global_side_data; | |||||
/** | |||||
* display aspect ratio (0 if unknown) | |||||
* - encoding: unused | |||||
* - decoding: Set by libavformat to calculate sample_aspect_ratio internally | |||||
*/ | |||||
AVRational display_aspect_ratio; | |||||
}; | }; | ||||
#ifdef __GNUC__ | #ifdef __GNUC__ | ||||
@@ -1767,8 +1767,8 @@ static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom) | |||||
return 0; | return 0; | ||||
den *= 2; | den *= 2; | ||||
case 1: | case 1: | ||||
c->fc->streams[c->fc->nb_streams-1]->display_aspect_ratio.num = num; | |||||
c->fc->streams[c->fc->nb_streams-1]->display_aspect_ratio.den = den; | |||||
c->fc->streams[c->fc->nb_streams-1]->internal->display_aspect_ratio.num = num; | |||||
c->fc->streams[c->fc->nb_streams-1]->internal->display_aspect_ratio.den = den; | |||||
default: | default: | ||||
return 0; | return 0; | ||||
} | } | ||||
@@ -2586,7 +2586,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) | |||||
av_dict_set_int(&st->metadata, "source_track_origin", source_track->sequence->origin, 0); | av_dict_set_int(&st->metadata, "source_track_origin", source_track->sequence->origin, 0); | ||||
} | } | ||||
if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den) | if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den) | ||||
st->display_aspect_ratio = descriptor->aspect_ratio; | |||||
st->internal->display_aspect_ratio = descriptor->aspect_ratio; | |||||
st->codecpar->color_range = mxf_get_color_range(mxf, descriptor); | st->codecpar->color_range = mxf_get_color_range(mxf, descriptor); | ||||
st->codecpar->color_primaries = mxf_get_codec_ul(ff_mxf_color_primaries_uls, &descriptor->color_primaries_ul)->id; | st->codecpar->color_primaries = mxf_get_codec_ul(ff_mxf_color_primaries_uls, &descriptor->color_primaries_ul)->id; | ||||
st->codecpar->color_trc = mxf_get_codec_ul(ff_mxf_color_trc_uls, &descriptor->color_trc_ul)->id; | st->codecpar->color_trc = mxf_get_codec_ul(ff_mxf_color_trc_uls, &descriptor->color_trc_ul)->id; | ||||
@@ -153,7 +153,7 @@ void av_format_inject_global_side_data(AVFormatContext *s) | |||||
s->internal->inject_global_side_data = 1; | s->internal->inject_global_side_data = 1; | ||||
for (i = 0; i < s->nb_streams; i++) { | for (i = 0; i < s->nb_streams; i++) { | ||||
AVStream *st = s->streams[i]; | AVStream *st = s->streams[i]; | ||||
st->inject_global_side_data = 1; | |||||
st->internal->inject_global_side_data = 1; | |||||
} | } | ||||
} | } | ||||
@@ -1660,7 +1660,7 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
st->skip_samples = 0; | st->skip_samples = 0; | ||||
} | } | ||||
if (st->inject_global_side_data) { | |||||
if (st->internal->inject_global_side_data) { | |||||
for (i = 0; i < st->nb_side_data; i++) { | for (i = 0; i < st->nb_side_data; i++) { | ||||
AVPacketSideData *src_sd = &st->side_data[i]; | AVPacketSideData *src_sd = &st->side_data[i]; | ||||
uint8_t *dst_data; | uint8_t *dst_data; | ||||
@@ -1676,7 +1676,7 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
memcpy(dst_data, src_sd->data, src_sd->size); | memcpy(dst_data, src_sd->data, src_sd->size); | ||||
} | } | ||||
st->inject_global_side_data = 0; | |||||
st->internal->inject_global_side_data = 0; | |||||
} | } | ||||
} | } | ||||
@@ -1889,7 +1889,7 @@ void ff_read_frame_flush(AVFormatContext *s) | |||||
st->pts_buffer[j] = AV_NOPTS_VALUE; | st->pts_buffer[j] = AV_NOPTS_VALUE; | ||||
if (s->internal->inject_global_side_data) | if (s->internal->inject_global_side_data) | ||||
st->inject_global_side_data = 1; | |||||
st->internal->inject_global_side_data = 1; | |||||
st->skip_samples = 0; | st->skip_samples = 0; | ||||
} | } | ||||
@@ -4008,9 +4008,9 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
st->r_frame_rate.den = st->time_base.num; | st->r_frame_rate.den = st->time_base.num; | ||||
} | } | ||||
} | } | ||||
if (st->display_aspect_ratio.num && st->display_aspect_ratio.den) { | |||||
if (st->internal->display_aspect_ratio.num && st->internal->display_aspect_ratio.den) { | |||||
AVRational hw_ratio = { avctx->height, avctx->width }; | AVRational hw_ratio = { avctx->height, avctx->width }; | ||||
st->sample_aspect_ratio = av_mul_q(st->display_aspect_ratio, | |||||
st->sample_aspect_ratio = av_mul_q(st->internal->display_aspect_ratio, | |||||
hw_ratio); | hw_ratio); | ||||
} | } | ||||
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { | } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { | ||||
@@ -4536,7 +4536,7 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
st->internal->info->fps_first_dts = AV_NOPTS_VALUE; | st->internal->info->fps_first_dts = AV_NOPTS_VALUE; | ||||
st->internal->info->fps_last_dts = AV_NOPTS_VALUE; | st->internal->info->fps_last_dts = AV_NOPTS_VALUE; | ||||
st->inject_global_side_data = s->internal->inject_global_side_data; | |||||
st->internal->inject_global_side_data = s->internal->inject_global_side_data; | |||||
st->internal->need_context_update = 1; | st->internal->need_context_update = 1; | ||||