| 886 | } |
| 887 | |
| 888 | AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx) |
| 889 | { |
| 890 | AVPacketSideData *tmp; |
| 891 | AVCPBProperties *props; |
| 892 | size_t size; |
| 893 | int i; |
| 894 | |
| 895 | for (i = 0; i < avctx->nb_coded_side_data; i++) |
| 896 | if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) |
| 897 | return (AVCPBProperties *)avctx->coded_side_data[i].data; |
| 898 | |
| 899 | props = av_cpb_properties_alloc(&size); |
| 900 | if (!props) |
| 901 | return NULL; |
| 902 | |
| 903 | tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); |
| 904 | if (!tmp) { |
| 905 | av_freep(&props); |
| 906 | return NULL; |
| 907 | } |
| 908 | |
| 909 | avctx->coded_side_data = tmp; |
| 910 | avctx->nb_coded_side_data++; |
| 911 | |
| 912 | avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; |
| 913 | avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; |
| 914 | avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; |
| 915 | |
| 916 | return props; |
| 917 | } |
| 918 | |
| 919 | int ff_encode_add_stats_side_data(AVPacket *pkt, int quality, const int64_t error[], |
| 920 | int error_count, enum AVPictureType pict_type) |
no test coverage detected