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

Eliminate usage of internal FFmpeg headers #931

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

Conversation

ulmus-scott
Copy link
Contributor

This eliminates the use of FFmpeg's private headers. There are still other modifications to FFmpeg's public headers preventing use of an unmodified FFmpeg; however, this works towards that goal.

I performed a few tests, but I am not aware of any HTTP streams to test with.

Checklist

Instead of the internal FFmpeg header compat/cuda/dynlink_loader.h.  This leaves
only one internal FFmpeg header used by MythTV.

Per the comment on win32_dlopen() in FFmpeg/compat/w32dlfcn.h, Windows will now
additionally search the current directory for nvcuda.dll and nvcuvid.dll, which
FFmpeg considers less secure.

This is an atomic block and the order must be preserved:
 #include "libavutil/log.h"
 #define FFNV_LOG_FUNC(logctx, msg, ...) av_log(logctx, AV_LOG_ERROR, msg,  __VA_ARGS__)
 #define FFNV_DEBUG_LOG_FUNC(logctx, msg, ...) av_log(logctx, AV_LOG_DEBUG, msg,  __VA_ARGS__)
 #include <ffnvcodec/dynlink_loader.h>

 #include "libavutil/hwcontext_cuda.h"
must come after
 #include <ffnvcodec/dynlink_cuda.h>
which is also transitively included by #include <ffnvcodec/dynlink_loader.h>
This reverts commit 5f9b27c.

MythTV no longer uses that file, so remove the modification.
…h (part 1)

Since we don't need the full buffer, we could use avio_read_partial() instead.
…h (part 3)

I don't know if any of this is necessary since FFmpeg's avio API is already
buffered.  However, I did not investigate using avio directly with avio_open()
nor did I investigate what our buffer actually does.

I'm not sure why MythAVFormatBuffer::Seek() with Whence = SEEK_END did not ever
actually seek.

libavformat/avio.h says this about read_packet:
"
A function for refilling the buffer, may be NULL.
For stream protocols, must never return 0 but rather
a proper AVERROR code.
"

So I'm not sure the first return of 0 was correct.  AVERROR(EINVAL) is a more
useful return value for all of the functions, instead of 0.
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.

1 participant