-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[videoplayer] allow custom headers to be sent to ffmpeg & inputstream class property #16847
Conversation
name == "reconnect_delay_max" || name == "icy" || name == "icy_metadata_headers" || | ||
name == "icy_metadata_packet") | ||
{ | ||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() adding custom header option '%s: %s'", it->first.c_str(), value.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ColumnLimit
in.clang-format
is set to100
which defines line length [...]
https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md#3-formatting
else | ||
{ | ||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() ignoring header option '%s: %s'", it->first.c_str(), value.c_str()); | ||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() adding user custom header option '%s: ***********'", it->first.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ColumnLimit
in.clang-format
is set to100
which defines line length [...]
https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md#3-formatting
7b7dd3e
to
63f21b2
Compare
else | ||
{ | ||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() ignoring header option '%s: %s'", it->first.c_str(), value.c_str()); | ||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() ignoring header option '%s'", it->first.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ColumnLimit
in.clang-format
is set to100
which defines line length [...]
https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md#3-formatting
@FernetMenta I added a commit here which would allow channels played from PVR addons such as iptvsimple to also pass ffmpeg headers (similar to using strm files). Is it reasonable to assume that DVDSTREAM_TYPE_FFMPEG will function as well as DVDSTREAM_TYPE_FILE? Happy to remove it if there are more serious consequences to the change. Note that streams with type DVDSTREAM_TYPE_PVRMANAGER (i.e. that handle inputstreams) are would not be covered by this change. |
xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp
Outdated
Show resolved
Hide resolved
@phunkyfish your code targets pvr items that have set a dynPath. Since dynPath is not limited to internet streams only, this change is wrong. |
@FernetMenta, can you explain a little further for my understanding? I'm trying to target pvr items that are internet streams, i.e. could require the ability to pass http headers. Is there another class of items with dynPath that I need to take care of? Are there PVR items that would not set a Or as always, some hints on the right way to go about this ;) |
dynPath can be anything but you don't look at it. your current code assumes that dynPath for pvr items is always an internet stream url that can be handled by ffmpeg. those items with a dynPath that can be handled by ffmpeg should already be considered by the factory. |
Ok, that makes sense. However the factory is not handling any of them currently. For instance Ideally there would be a whitelist of |
http(s) is not supposed to be handled by ffmpeg. passing those to inputstream ffmpeg would break a couple of functions like shoutcast redirect or file caching.
already done by the factory |
Ok, but then what would be the best way to pass http headers if not using inputstream ffmpeg? I guess a url option to request playback by ffmpeg would work. |
why don't those headers find their why to CurlFile? |
They do find there way to CurlFile. But they don’t find their way beyond that to FFmpeg such as for HLS and video fragments. |
If CurlFile handles the http protocol and inputstream, ffmpeg does only demuxing. http headers are meaningless for a demuxer. you seem to have an odd or new case but you don't give much information on that. |
Sorry, never posted the reply. The reason is because the extension needs to be .m3u8 for it to choose inputstream fffmpeg. In my use case I'm serving the file from an API and it doesn't have this extension. So I probably need a way to pass a hint to the factory so it knows the correct file type. |
You are facing the same issue like others before. I don't like the "solutions" for this in Kodi but see yourself: For shoutcast streams, which are served over http(s) too, a new protocol specifier was introduced: Nowadays players get the entire fileitem insead just the url. IMO a much better solution is to set a property on the fileitem that can be examined by the factory. That's btw already done to select particular inputstream addons. |
Perfect, I can use the latter to set a property via the PVR addon easily. That's makes the solution nice and clean. |
This proerty should then get part of the PVR addon API and needs to be documented properly: |
Maybe even the existing "mimetype" property could be used here? |
546bbee
to
0bdd310
Compare
Which would you prefer? I added it as a separate property in latest commit. I made it general and not specific to m3u8, just setting a preference for inputstream ffmpeg. |
Jenkins build this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the code guidelines.
92d4aa2
to
5c269af
Compare
@Rechi, done. It was hard to place the headers in order so added to a commit to reorder them. EDIT, undid header ordering. The order that is there appears to be for a reason. I did not change the lines with the long comments as breaking them still results in lines longer than 100 (plus they look really bad). Let me know if there is anything else out of line but that should be everything. |
c5001af
to
b97c630
Compare
b97c630
to
f0f9734
Compare
Managed to fix the header order. You happy now @Rechi ? |
If there are no further objections I will merge this PR tomorrow. |
The log lines still exceed the column limit of 100 characters. |
f0f9734
to
25bd08f
Compare
Apologies @Rechi didn't include last fixup. Should be good now. |
The include order of |
Can you explain how it’s wrong? I believed it to be correct as per the coding guidelines. |
Look at the diff files in the CI build. |
25bd08f
to
5ad3a30
Compare
Thanks for that @Rechi, a handy thing to know for future reference ;) Should be good now |
changed code now follows the current code guidelines
5ad3a30
to
064a9fe
Compare
064a9fe
to
97f2e87
Compare
[videoplayer] allow custom headers to be sent to ffmpeg & inputstream class property
Description
Currently all unknown headers are not allowed to be passed to ffmpeg. This PR includes a blacklist to stop certain headers ever being sent to ffmpeg ad a whitelist of other ffmpeg headers. This allows all other custom headers to be passed.
Motivation and Context
How Has This Been Tested?
On OSX, verifying that headers get/don't get passed from teh log.
Screenshots (if appropriate):
Types of change
Checklist: