| 1059 | }; |
| 1060 | |
| 1061 | static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx) |
| 1062 | { |
| 1063 | VAAPIEncodeContext *ctx = avctx->priv_data; |
| 1064 | VAAPIEncodeH265Context *priv = avctx->priv_data; |
| 1065 | |
| 1066 | ctx->codec = &vaapi_encode_type_h265; |
| 1067 | |
| 1068 | if (avctx->profile == AV_PROFILE_UNKNOWN) |
| 1069 | avctx->profile = priv->profile; |
| 1070 | if (avctx->level == AV_LEVEL_UNKNOWN) |
| 1071 | avctx->level = priv->level; |
| 1072 | |
| 1073 | if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { |
| 1074 | av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " |
| 1075 | "in 8-bit unsigned integer.\n", avctx->level); |
| 1076 | return AVERROR(EINVAL); |
| 1077 | } |
| 1078 | |
| 1079 | ctx->desired_packed_headers = |
| 1080 | VA_ENC_PACKED_HEADER_SEQUENCE | // VPS, SPS and PPS. |
| 1081 | VA_ENC_PACKED_HEADER_SLICE | // Slice headers. |
| 1082 | VA_ENC_PACKED_HEADER_MISC; // SEI |
| 1083 | |
| 1084 | if (priv->qp > 0) |
| 1085 | ctx->explicit_qp = priv->qp; |
| 1086 | |
| 1087 | return ff_vaapi_encode_init(avctx); |
| 1088 | } |
| 1089 | |
| 1090 | static av_cold int vaapi_encode_h265_close(AVCodecContext *avctx) |
| 1091 | { |
nothing calls this directly
no test coverage detected