home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Featured Plugins
UPnP / DLNA Media Server
UPnP / DLNA Media Server for MediaPortal 2
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="morpheus_xx" data-source="post: 1154099" data-attributes="member: 48495"><p>[USER=119106]@henso[/USER] and [USER=106003]@FreakyJ[/USER] , nice to see the good progress on this plugin <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite24" alt="(y)" title="Thumbs Up (y)" loading="lazy" data-shortname="(y)" />.</p><p></p><p>I have some ideas regarding the many "if / else" code blocks for constructing ffmpeg arguments. One example: <a href="https://github.com/MediaPortal/MediaPortal-2/blob/FEAT_DLNAv4/MediaPortal/Incubator/TranscodingService/Transcoders/FFMpeg/FFMpegCommandline.cs#L426-L441" target="_blank">https://github.com/MediaPortal/MediaPortal-2/blob/FEAT_DLNAv4/MediaPortal/Incubator/TranscodingService/Transcoders/FFMpeg/FFMpegCommandline.cs#L426-L441</a>, where there are too many checks.</p><p></p><p>I'd suppose to reduce the lines of code and putting more configuration options into dictionaries like:</p><p>[CODE=CSHARP]</p><p> Dictionary<EncodingPreset, string> SWEncodingPresets = new Dictionary<EncodingPreset, string></p><p> {</p><p> { EncodingPreset.Ultrafast, "-preset ultrafast" },</p><p> { EncodingPreset.Superfast, "-preset superfast" }</p><p> };</p><p> Dictionary<EncodingPreset, string> IntelEncodingPresets = new Dictionary<EncodingPreset, string></p><p> {</p><p> { EncodingPreset.Ultrafast, "-preset ultrafast" },</p><p> { EncodingPreset.Superfast, "-preset superfast" }</p><p> };</p><p> Dictionary<EncodingPreset, string> NVidiaEncodingPresets = new Dictionary<EncodingPreset, string></p><p> {</p><p> { EncodingPreset.Ultrafast, "-preset ultrafast" },</p><p> { EncodingPreset.Superfast, "-preset superfast" }</p><p> };</p><p>[/CODE]</p><p></p><p>Then you have choose the matching dict only once and use a .TryGet() to translate the presets to string args in one line. If you apply this to the other arguments as well, the number of code lines will be significantly reduced. It would also allow moving out the mappings into settings, what would allow easier extension without adding more code lines.</p><p></p><p>I have not checked other parts, but I hope you can apply some of those refactorings <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="morpheus_xx, post: 1154099, member: 48495"] [USER=119106]@henso[/USER] and [USER=106003]@FreakyJ[/USER] , nice to see the good progress on this plugin (y). I have some ideas regarding the many "if / else" code blocks for constructing ffmpeg arguments. One example: [URL]https://github.com/MediaPortal/MediaPortal-2/blob/FEAT_DLNAv4/MediaPortal/Incubator/TranscodingService/Transcoders/FFMpeg/FFMpegCommandline.cs#L426-L441[/URL], where there are too many checks. I'd suppose to reduce the lines of code and putting more configuration options into dictionaries like: [CODE=CSHARP] Dictionary<EncodingPreset, string> SWEncodingPresets = new Dictionary<EncodingPreset, string> { { EncodingPreset.Ultrafast, "-preset ultrafast" }, { EncodingPreset.Superfast, "-preset superfast" } }; Dictionary<EncodingPreset, string> IntelEncodingPresets = new Dictionary<EncodingPreset, string> { { EncodingPreset.Ultrafast, "-preset ultrafast" }, { EncodingPreset.Superfast, "-preset superfast" } }; Dictionary<EncodingPreset, string> NVidiaEncodingPresets = new Dictionary<EncodingPreset, string> { { EncodingPreset.Ultrafast, "-preset ultrafast" }, { EncodingPreset.Superfast, "-preset superfast" } }; [/CODE] Then you have choose the matching dict only once and use a .TryGet() to translate the presets to string args in one line. If you apply this to the other arguments as well, the number of code lines will be significantly reduced. It would also allow moving out the mappings into settings, what would allow easier extension without adding more code lines. I have not checked other parts, but I hope you can apply some of those refactorings :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Featured Plugins
UPnP / DLNA Media Server
UPnP / DLNA Media Server for MediaPortal 2
Contact us
RSS
Top
Bottom