-
-
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
Decoderfilter implementation #15744
Decoderfilter implementation #15744
Conversation
|
||
#include "media/decoderfilter/DecoderFilterManager.h" | ||
|
||
|
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.
extra line
This is a great idea! I don't really understand though why you went for the xml route instead of just hooking up the GUI to use a blacklist for the decoders. It seems to me like you only need one method or the other and the GUI approach would be more useful IMO. |
I changed the initial comment, there you can see that things are sometimes more complex as they seem on the first look. Goal is a.) to be flexible for other platforms / decoders (maybe include color formats / codec levels) and b.) to be able to use our setting implementation to easily display them in our GUI if needed. XML is currently the format our GUI setting is based on |
|
||
std::string codecname = codec_info.getName(); | ||
uint32_t flags = CDecoderFilter::FLAG_GENERAL_ALLOWED | CDecoderFilter::FLAG_DVD_ALLOWED; | ||
for (const char **ptr = blacklisted_decoders; *ptr && flags; ptr++) |
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.
why not make blacklisted_decoders a std::array<std::string>
and use a ranged based for loop?
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.
Pls. read again the initial (edited) post, its not only a blacklist.
Edit: nvm. Its copy/paste from initial implementation. you can also make a std::set and have binary search, but I was lazy here and used what was there.
Edit2: But question here again: why std::string for constant strings, which get malloced on the heap if I use std::string?
@peak3d It's just a small thing, but could you in general align the pointer/reference modifiers to the type instead of the variable? i.e. |
Merged, alltough flagged as "v19"? |
@@ -127,11 +128,15 @@ class CServiceBroker | |||
static void RegisterAppPort(std::shared_ptr<CAppInboundProtocol> port); | |||
static void UnregisterAppPort(); | |||
|
|||
static void RegisterDecoderFilterManager(CDecoderFilterManager* manager); |
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.
why is there no unregister method? is the memory leaked intentionally?
@ksooo K18 / K19 the PR was initially created for K18, but it seems that I forgot to set labels :-( There are many ways which lead to rome (ownership ServiceBroker e.g.), or smart_ptr. |
Can I setup decoderfilter to use amlogic amcodec decoder? Does decoderfilter can enable/disable existing codecs only? |
Existing decoders only. |
Description
Implementation of a xml configuration file to control usage of platform decoders.
By adding xbmc/media/decoderfilter to your platform subdirs.txt file, kodi builds a common CDecoderFilterManager implementation.
You as a platform maintainer now have to instanciate this or an derived class of CDecoderFilterManager , add all existing / relevant platform decoders, and register this interface in ServiceBroker (at kodi / windowing initialization time, once).
In your decoder initialization part you access the DecoderFilterManager through ServiceBroker and can check if a selected decoder should be used for playback by passing the StrreamInfo hints.
CDecoderFilter's members for validateing / serializing can be overwritten if your platform has conditions which differ from the common implementation.
Serialization is already implemented and leads to [userdata]/decoderfilter.xml file.
The implementation should be flexible enough to add GUI settings handling, regardless if conditions differ between platforms. GUI settings is not part of this PR, if I find time in the future, I'll add it.
For now experienced users can manually edit the decoderfilter.xml file.
Default XML implementation file format:
This PR builds / uses the implementation only for Android
Motivation and Context
tons of tickets regarding not working / half working platform decoders
How Has This Been Tested?
Android,
Types of change