这是indexloc提供的服务,不要输入任何密码
Skip to content

build pipeline config from args #26

@github-actions

Description

@github-actions

// TODO: build pipeline config from args

}


fn automatic_recording(
    mut commands: Commands,
    time: Res<Time>,
    mut ev_person: EventReader<PersonDetectedEvent>,
    stream_manager: Res<RtspStreamManager>,
    mut live_session: ResMut<LiveSession>,
    mut person_timeout: Local<Stopwatch>,
) {
    if live_session.0.is_some() {
        if person_timeout.elapsed_secs() > 3.0 {
            person_timeout.reset();

            println!("no person detected for 3 seconds, stopping recording");

            let session_entity = live_session.0.take().unwrap();
            let raw_streams = stream_manager.stop_recording();

            commands.entity(session_entity)
                .insert(RawStreams {
                    streams: raw_streams,
                });
        }

        person_timeout.tick(time.delta());

        for _ev in ev_person.read() {
            person_timeout.reset();
        }

        return;
    }

    for ev in ev_person.read() {
        println!("person detected: {:?}", ev);

        // TODO: deduplicate start recording logic
        let session = Session::new("capture".to_string());

        stream_manager.start_recording(
            &session,
        );

        // TODO: build pipeline config from args
        let entity = commands.spawn(
            StreamSessionBundle {
                session: session,
                raw_streams: RawStreams::default(),
                config: PipelineConfig::default(),
            },
        ).id();
        live_session.0 = Some(entity);

        break;
    }
}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions