* Check side data preference and clear existing side data from frame * if needed. * * @retval 0 side data of this type can be added to frame * @retval 1 side data of this type should not be added to frame */
| 2129 | * @retval 1 side data of this type should not be added to frame |
| 2130 | */ |
| 2131 | static int side_data_pref(const AVCodecContext *avctx, AVFrameSideData ***sd, |
| 2132 | int *nb_sd, enum AVFrameSideDataType type) |
| 2133 | { |
| 2134 | DecodeContext *dc = decode_ctx(avctx->internal); |
| 2135 | |
| 2136 | // Note: could be skipped for `type` without corresponding packet sd |
| 2137 | if (av_frame_side_data_get(*sd, *nb_sd, type)) { |
| 2138 | if (dc->side_data_pref_mask & (1ULL << type)) |
| 2139 | return 1; |
| 2140 | av_frame_side_data_remove(sd, nb_sd, type); |
| 2141 | } |
| 2142 | |
| 2143 | return 0; |
| 2144 | } |
| 2145 | |
| 2146 | |
| 2147 | int ff_frame_new_side_data(const AVCodecContext *avctx, AVFrame *frame, |
no test coverage detected