Prepare for adaptive streams

This commit is contained in:
jojo61 2025-01-11 12:16:22 +01:00
parent 6768bc5b18
commit f3ae69042f
3 changed files with 17 additions and 3 deletions

View File

@ -469,6 +469,7 @@ void CodecVideoDecode(VideoDecoder *decoder, const AVPacket *avpkt) {
*pkt = *avpkt; // use copy *pkt = *avpkt; // use copy
ret = avcodec_send_packet(video_ctx, pkt); ret = avcodec_send_packet(video_ctx, pkt);
//printf("send packet %x\n",ret);
if (ret < 0) { if (ret < 0) {
return; return;
} }
@ -487,7 +488,8 @@ void CodecVideoDecode(VideoDecoder *decoder, const AVPacket *avpkt) {
return; return;
} }
if (ret >= 0) { if (ret >= 0) {
if (decoder->filter) { //printf("Videosize %d:%d ttf %d\n",frame->width,frame->height,frame->interlaced_frame);
if ((frame->flags & AV_FRAME_FLAG_INTERLACED) && decoder->filter) {
if (decoder->filter == 1) { if (decoder->filter == 1) {
if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) { if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) {
Debug(3, "video: Init of VAAPI deint Filter failed\n"); Debug(3, "video: Init of VAAPI deint Filter failed\n");
@ -558,7 +560,7 @@ next_part:
// printf("video frame pts %#012" PRIx64 " // printf("video frame pts %#012" PRIx64 "
//%dms\n",frame->pts,(int)(apts - frame->pts) / 90); //%dms\n",frame->pts,(int)(apts - frame->pts) / 90);
#ifdef YADIF #ifdef YADIF
if (decoder->filter) { if ((frame->flags & AV_FRAME_FLAG_INTERLACED) && decoder->filter) {
if (decoder->filter == 1) { if (decoder->filter == 1) {
if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) { if (init_filters(video_ctx, decoder->HwDecoder, frame) < 0) {
Debug(3,"video: Init of YADIF Filter failed\n"); Debug(3,"video: Init of YADIF Filter failed\n");

View File

@ -61,7 +61,7 @@ extern void ToggleLUT();
/// vdr-plugin version number. /// vdr-plugin version number.
/// Makefile extracts the version number for generating the file name /// Makefile extracts the version number for generating the file name
/// for the distribution archive. /// for the distribution archive.
static const char *const VERSION = "3.27" static const char *const VERSION = "3.28"
#ifdef GIT_REV #ifdef GIT_REV
"-GIT" GIT_REV "-GIT" GIT_REV
#endif #endif

12
video.c
View File

@ -3503,6 +3503,18 @@ static void CuvidRenderFrame(CuvidDecoder *decoder, const AVCodecContext *video_
VideoSetPts(&decoder->PTS, decoder->Interlaced, video_ctx, frame); VideoSetPts(&decoder->PTS, decoder->Interlaced, video_ctx, frame);
} }
if ((decoder->InputWidth != frame->width) || (decoder->InputHeight != frame->height)) {
printf("Framesize change\n");
CuvidCleanup(decoder);
decoder->InputAspect = frame->sample_aspect_ratio;
decoder->InputWidth = frame->width;
decoder->InputHeight = frame->height;
decoder->Interlaced = 0;
decoder->SurfacesNeeded = VIDEO_SURFACES_MAX + 1;
CuvidSetupOutput(decoder);
}
// update aspect ratio changes // update aspect ratio changes
if (decoder->InputWidth && decoder->InputHeight && av_cmp_q(decoder->InputAspect, frame->sample_aspect_ratio)) { if (decoder->InputWidth && decoder->InputHeight && av_cmp_q(decoder->InputAspect, frame->sample_aspect_ratio)) {
Debug(3, "video/cuvid: aspect ratio changed\n"); Debug(3, "video/cuvid: aspect ratio changed\n");