kms: fix crash on intel when using hevc, remove debug print, remove jpeg color range (incorrect colors on intel h264)

This commit is contained in:
dec05eba 2023-04-10 02:38:47 +02:00
parent dddd426904
commit ce5e0169c4
2 changed files with 2 additions and 4 deletions

View File

@ -74,11 +74,9 @@ static int recv_msg_from_server(int server_fd, gsr_kms_response *response) {
struct cmsghdr *cmsg = CMSG_FIRSTHDR(&response_message);
if(cmsg) {
fprintf(stderr, "got cmsg, %d\n", cmsg->cmsg_type);
if(cmsg->cmsg_type == SCM_RIGHTS) {
int kms_fd = 0;
memcpy(&kms_fd, CMSG_DATA(cmsg), sizeof(int));
fprintf(stderr, "kms fd: %d\n", kms_fd);
response->data.fd.fd = kms_fd;
}
}

View File

@ -306,7 +306,7 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
}
codec_context->max_b_frames = 0;
codec_context->pix_fmt = pix_fmt;
codec_context->color_range = AVCOL_RANGE_JPEG; // TODO: Amd/nvidia?
//codec_context->color_range = AVCOL_RANGE_JPEG; // TODO: Amd/nvidia?
//codec_context->color_primaries = AVCOL_PRI_BT709;
//codec_context->color_trc = AVCOL_TRC_BT709;
//codec_context->colorspace = AVCOL_SPC_BT709;
@ -366,7 +366,7 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
//codec_context->bit_rate = codec_context->width * codec_context->height;
av_opt_set(codec_context->priv_data, "rc_mode", "CQP", 0);
//codec_context->global_quality = 4;
codec_context->compression_level = 2;
//codec_context->compression_level = 2;
}
//codec_context->rc_max_rate = codec_context->bit_rate;