-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from patcarter883/dev
Update UI to support AV1 CUDA decoding.
- Loading branch information
Showing
5 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
|
||
import Helper from '../../helper'; | ||
|
||
function init(initialState) { | ||
const state = { | ||
...initialState, | ||
}; | ||
|
||
return state; | ||
} | ||
|
||
function createMapping(settings, stream, skills) { | ||
stream = Helper.InitStream(stream); | ||
skills = Helper.InitSkills(skills); | ||
|
||
const mapping = { | ||
global: [], | ||
local: ['-hwaccel', 'cuda', '-c:v', 'av1_cuvid'], | ||
// local: ['-hwaccel', 'cuda', '-hwaccel_output_format', 'cuda', '-c:v', 'av1_cuvid'], | ||
}; | ||
|
||
return mapping; | ||
} | ||
|
||
function Coder(props) { | ||
const settings = init(props.settings); | ||
const stream = Helper.InitStream(props.stream); | ||
const skills = Helper.InitSkills(props.skills); | ||
|
||
const handleChange = (newSettings) => { | ||
let automatic = false; | ||
if (!newSettings) { | ||
newSettings = settings; | ||
automatic = true; | ||
} | ||
|
||
props.onChange(newSettings, createMapping(newSettings, stream, skills), automatic); | ||
}; | ||
|
||
React.useEffect(() => { | ||
handleChange(null); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return null; | ||
} | ||
|
||
Coder.defaultProps = { | ||
stream: {}, | ||
settings: {}, | ||
skills: {}, | ||
onChange: function (settings, mapping) {}, | ||
}; | ||
|
||
// -hwaccel nvdec | ||
|
||
const coder = 'av1'; | ||
const name = 'AV1 NVDEC (CUDA)'; | ||
const codecs = ['av1']; | ||
const type = 'video'; | ||
const hwaccel = true; | ||
|
||
function defaults(stream, skills) { | ||
const settings = init({}); | ||
|
||
return { | ||
settings: settings, | ||
mapping: createMapping(settings, stream, skills), | ||
}; | ||
} | ||
|
||
export { coder, name, codecs, type, hwaccel, defaults, Coder as component }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters