Skip to content

Commit

Permalink
feat!(web): use mirakc-arib 0.5.0
Browse files Browse the repository at this point in the history
inserting the program-filter after the post-filter improves the start margin for
`mirakc-arib filter-program` command.

BREAKING CHANGES:
* insert the program-filter after the post-filter
* change --start-margin and --end-margin options
  • Loading branch information
masnagam committed Jun 7, 2020
1 parent 64f0928 commit 104f36d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docker/dockerfile-gen
Expand Up @@ -90,7 +90,7 @@ def dockerfile_gen(kind, platform, arch):
params = {
'ARCH': arch,
'RECDVB': '1.3.2',
'MIRAKC_ARIB_VERSION': '0.4.1',
'MIRAKC_ARIB_VERSION': '0.5.0',
}

build_deps = set()
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Expand Up @@ -26,7 +26,7 @@ suitable for your environment.
| [tuners\[\].disabled] | `false` |
| [filters.pre-filter] | `''` |
| [filters.service-filter] | `mirakc-arib filter-service --sid={{sid}}`|
| [filters.program-filter] | `mirakc-arib filter-program --sid={{sid}} --eid={{eid}} --clock-pcr={{clock_pcr}} --clock-time={{clock_time}} --start-margin=5000 --end-margin=5000 --pre-streaming` |
| [filters.program-filter] | `mirakc-arib filter-program --sid={{sid}} --eid={{eid}} --clock-pcr={{clock_pcr}} --clock-time={{clock_time}} --end-margin=2000 --pre-streaming` |
| [filters.post-filter] | `''` |
| [jobs.scan-services.command] | `mirakc-arib scan-services{{#sids}} --sids={{.}}{{/sids}}{{#xsids}} --xsids={{.}}{{/xsids}}` |
| [jobs.scan-services.schedule] | `'0 31 5 * * * *'` (execute at 05:31 every day) |
Expand Down
21 changes: 12 additions & 9 deletions docs/inside-mirakc.md
Expand Up @@ -39,15 +39,18 @@ mirakc has a pipeline to process MPEG-TS packets.
|
+--(when using filters)
| |
| +---V-------- CommandPipeline --------------+
| | pre-filter (external process) [optional] |
| | | |
| | V |
| | service/program-filter (external process) |
| | | |
| | V |
| | post-filter (external process) [optional] |
| +---|---------------------------------------+
| +---V-------- CommandPipeline -----------------+
| | pre-filter (external process) [optional] |
| | | |
| | V |
| | service-filter (external process) [optional] |
| | | |
| | V |
| | post-filter (external process) [optional] |
| | | |
| | V |
| | program-filter (external process) [optional] |
| +---|------------------------------------------+
| V
| tokio::sync::mpsc::channel (as buffer) <web-buffer>
| |
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Expand Up @@ -165,13 +165,13 @@ impl FiltersConfig {

fn default_program_filter() -> String {
// The --pre-streaming option is used in order to avoid the issue#1313
// in actix/actix-web. PSI/SI TS packets will be sent before the
// program starts.
// in actix/actix-web. PAT TS packets will be sent before the program
// starts.
//
// See masnagam/rust-case-studies for details.
"mirakc-arib filter-program --sid={{sid}} --eid={{eid}} \
--clock-pcr={{clock_pcr}} --clock-time={{clock_time}} \
--start-margin=5000 --end-margin=5000 --pre-streaming".to_string()
--end-margin=2000 --pre-streaming".to_string()
}
}

Expand Down
14 changes: 11 additions & 3 deletions src/web.rs
Expand Up @@ -374,12 +374,20 @@ fn make_program_filters(
pre_filter_required: bool,
post_filter_required: bool,
) -> Result<Vec<String>, Error> {
let filter = make_service_filter_command(
&config.filters.service_filter, program.quad.sid())?;
let mut filters = make_filters(
config, channel, Some(program.quad.sid()), Some(program.quad.eid()),
filter, pre_filter_required, post_filter_required)?;
let filter = make_program_filter_command(
&config.filters.program_filter, program.quad.sid(), program.quad.eid(),
clock)?;
make_filters(
config, channel, Some(program.quad.sid()), Some(program.quad.eid()),
filter, pre_filter_required, post_filter_required)
if filter.is_empty() {
log::warn!("Filter not defined");
} else {
filters.push(filter);
}
Ok(filters)
}

fn make_filters(
Expand Down

0 comments on commit 104f36d

Please sign in to comment.