Skip to content

Commit

Permalink
Add a/v filter to the publication components - #593
Browse files Browse the repository at this point in the history
  • Loading branch information
jstabenow committed Oct 23, 2023
1 parent e579b84 commit a68a39b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add frame interpolation (framerate) filter (thanks to orryverducci)
- Add -referer option for pulling HTTP streams ([PR 40](https://github.com/datarhei/restreamer-ui/pull/40), thanks to mdastgheib)
- Add a/v filter to the publication components ([#593](https://github.com/datarhei/restreamer-ui/issues/593))
- Mod uses placeholders for ingress setups ([#560](https://github.com/datarhei/restreamer-ui/issues/560))
- Mod updates npm
- Fix the advanced settings in the MPEG-TS publication service ([#597](https://github.com/datarhei/restreamer/issues/597), thanks to orryverducci)
Expand All @@ -12,7 +13,6 @@
- Fix MUI warning
- Fix videojs skin


## v1.7.0 > v1.8.0

- Add Add stream key field and protocol detection to RTMP publication service
Expand Down
32 changes: 32 additions & 0 deletions src/views/Publication/Add.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Typography from '@mui/material/Typography';
import * as helper from './helper';
import * as M from '../../utils/metadata';
import EncodingSelect from '../../misc/EncodingSelect';
import FilterSelect from '../../misc/FilterSelect';
import H from '../../utils/help';
import NotifyContext from '../../contexts/Notify';
import Paper from '../../misc/Paper';
Expand Down Expand Up @@ -199,6 +200,17 @@ export default function Add(props) {
});
};

const handleProcessingFilter = (type) => (filter) => {
const profiles = $settings.profiles;

profiles[0][type].filter = filter;

setSettings({
...$settings,
profiles: profiles,
});
};

const handleServiceDone = async () => {
setSaving(true);

Expand Down Expand Up @@ -487,6 +499,16 @@ export default function Add(props) {
onChange={handleProcessing('video')}
/>
</Grid>
{$settings.profiles[0].video.encoder.coder !== 'copy' && (
<Grid item xs={12}>
<FilterSelect
type="video"
profile={$settings.profiles[0].video}
availableFilters={$skills.filter}
onChange={handleProcessingFilter('video')}
/>
</Grid>
)}
<Grid item xs={12}>
<Typography variant="h4">
<Trans>Audio</Trans>
Expand All @@ -502,6 +524,16 @@ export default function Add(props) {
onChange={handleProcessing('audio')}
/>
</Grid>
{$settings.profiles[0].audio.encoder.coder !== 'copy' && (
<Grid item xs={12}>
<FilterSelect
type="audio"
profile={$settings.profiles[0].audio}
availableFilters={$skills.filter}
onChange={handleProcessingFilter('audio')}
/>
</Grid>
)}
</TabContent>
</TabPanel>
</TabsVerticalGrid>
Expand Down
36 changes: 36 additions & 0 deletions src/views/Publication/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import BoxText from '../../misc/BoxText';
import DebugModal from '../../misc/modals/Debug';
import Dialog from '../../misc/modals/Dialog';
import EncodingSelect from '../../misc/EncodingSelect';
import FilterSelect from '../../misc/FilterSelect';
import H from '../../utils/help';
import NotifyContext from '../../contexts/Notify';
import Paper from '../../misc/Paper';
Expand Down Expand Up @@ -235,6 +236,21 @@ export default function Edit(props) {
}
};

const handleFilter = (type) => (filter, automatic) => {
const profiles = $settings.profiles;

profiles[0][type].filter = filter;

setSettings({
...$settings,
profiles: profiles,
});

if (!automatic) {
setUnsavedChanges(true);
}
};

const handleServiceDone = async () => {
setSaving(true);

Expand Down Expand Up @@ -521,6 +537,16 @@ export default function Edit(props) {
onChange={handleEncoding('video')}
/>
</Grid>
{$settings.profiles[0].video.encoder.coder !== 'copy' && (
<Grid item xs={12}>
<FilterSelect
type="video"
profile={$settings.profiles[0].video}
availableFilters={$skills.filter}
onChange={handleFilter('video')}
/>
</Grid>
)}
<Grid item xs={12}>
<Typography variant="h4">
<Trans>Audio settings</Trans>
Expand All @@ -536,6 +562,16 @@ export default function Edit(props) {
onChange={handleEncoding('audio')}
/>
</Grid>
{$settings.profiles[0].audio.encoder.coder !== 'copy' && (
<Grid item xs={12}>
<FilterSelect
type="audio"
profile={$settings.profiles[0].audio}
availableFilters={$skills.filter}
onChange={handleFilter('audio')}
/>
</Grid>
)}
</TabContent>
</TabPanel>
</TabsVerticalGrid>
Expand Down

0 comments on commit a68a39b

Please sign in to comment.