Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Rockchip ffmpeg #4

Open
wants to merge 9 commits into
base: rockchip
Choose a base branch
from

Conversation

zillevdr
Copy link

@zillevdr zillevdr commented Oct 3, 2017

No description provided.

LongChair and others added 8 commits September 23, 2017 22:37
This adds hardware decoding for h264 / HEVC / VP8 using MPP Rockchip API.
Will return frames holding an AVDRMFrameDescriptor struct in buf[0] that allows drm / dmabuf usage.
Was tested on RK3288 (TinkerBoard) and RK3328.

Changes from Previous patch :
- Frame colorspace info is now filled.
- Frame interlacing is now filled (Note : currently had a bug in mpp which will be fixed soon by rockchip, will set the to progressive).
- hw_frame_context returns none as format for the rockchip specific 10 bits.
- Added support for VP9 codec.
- removed MPG4 codec : it seems that MPP doesn't handle properly all the MPEG4 formats
- removed MPEG2 : there is still an issue with MPEG2 decoder, this is being investigated by RockChip.
- the ION format has been kept for MPP init (rather than DRM) as this is the only one working right, using DRM format will cause assertions upon close.
- Other minor comments have been taken into account
@LongChair
Copy link
Owner

Thnaks for that PR , but the patch was sent upstream :)

So if you want to make imporvements about all this you probably want to send you patches to ffmpeg :)

Copy link
Owner

@LongChair LongChair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why most of these changes are done. They wouldn't be upstreamed in that form to ffmpeg anyways. My repo is not the right place to send them now, as my code was already merged by ffmpeg


// make sure we keep decoder full
if (freeslots > 1 && decoder->first_frame)
return AVERROR(EAGAIN);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this be unnecessary ?

ret = decoder->mpi->control(decoder->ctx, MPP_DEC_SET_PARSER_SPLIT_MODE, &paramS32);
if (ret != MPP_OK) {
av_log(avctx, AV_LOG_ERROR, "Failed to set parser split mode on MPI (code = %d).\n", ret);
ret = AVERROR_UNKNOWN;
goto fail;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice that this would affect pts order, where dud you see that ?

}
if (ret != MPP_OK) {
av_log(avctx, AV_LOG_ERROR, "can't get a frame frome decoder (code = %d)\n", ret);
goto fail;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would happen almost at each start and was confirmed by rk, we don't want error log in normal conditions at each start

mpp_frame_deinit(&mppframe);
usleep(10000);
goto retry_get_frame;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mpp frames are all released upon avframe relase. Realeasing some here dosn't make sene

ret = AVERROR_EXIT;
goto fail;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That return code is not appropriate here. Once again i have already upstreamed those changes and if you feel that a few things should be changed, you need to send those patches to ffmpeg upstream, as the reference code is there now :)

@zillevdr
Copy link
Author

zillevdr commented Oct 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants