Exemplo n.º 1
0
        /**
        * Return the active device and streams profiles, used by the pipeline.
        * The pipeline streams profiles are selected during \c start(). The method returns a valid result only when the pipeline is active -
        * between calls to \c start() and \c stop().
        * After \c stop() is called, the pipeline doesn't own the device, thus, the pipeline selected device may change in
        * subsequent activations.
        *
        * \return  The actual pipeline device and streams profile, which was successfully configured to the streaming device on start.
        */
        pipeline_profile get_active_profile() const
        {
            rs2_error* e = nullptr;
            auto p = std::shared_ptr<rs2_pipeline_profile>(
                rs2_pipeline_get_active_profile(_pipeline.get(), &e),
                rs2_delete_pipeline_profile);

            error::handle(e);
            return pipeline_profile(p);
        }
Exemplo n.º 2
0
        /**
        * Start the pipeline streaming according to the configuraion.
        * The pipeline streaming loop captures samples from the device, and delivers them to the attached computer vision modules
        * and processing blocks, according to each module requirements and threading model.
        * During the loop execution, the application can access the camera streams by calling \c wait_for_frames() or
        * \c poll_for_frames().
        * The streaming loop runs until the pipeline is stopped.
        * Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.
        * The pipeline selects and activates the device upon start, according to configuration or a default configuration.
        * When the rs2::config is provided to the method, the pipeline tries to activate the config \c resolve() result.
        * If the application requests are conflicting with pipeline computer vision modules or no matching device is available on
        * the platform, the method fails.
        * Available configurations and devices may change between config \c resolve() call and pipeline start, in case devices
        * are connected or disconnected, or another application acquires ownership of a device.
        *
        * \param[in] config   A rs2::config with requested filters on the pipeline configuration. By default no filters are applied.
        * \return             The actual pipeline device and streams profile, which was successfully configured to the streaming device.
        */
        pipeline_profile start(const config& config)
        {
            rs2_error* e = nullptr;
            auto p = std::shared_ptr<rs2_pipeline_profile>(
                rs2_pipeline_start_with_config(_pipeline.get(), config.get().get(), &e),
                rs2_delete_pipeline_profile);

            error::handle(e);
            return pipeline_profile(p);
        }
Exemplo n.º 3
0
        /**
        * Resolve the configuration filters, to find a matching device and streams profiles.
        * The method resolves the user configuration filters for the device and streams, and combines them with the requirements
        * of the computer vision modules and processing blocks attached to the pipeline. If there are no conflicts of requests,
        * it looks for an available device, which can satisfy all requests, and selects the first matching streams configuration.
        * In the absence of any request, the rs2::config selects the first available device and the first color and depth
        * streams configuration.
        * The pipeline profile selection during \c start() follows the same method. Thus, the selected profile is the same, if no
        * change occurs to the available devices.
        * Resolving the pipeline configuration provides the application access to the pipeline selected device for advanced
        * control.
        * The returned configuration is not applied to the device, so the application doesn't own the device sensors. However,
        * the application can call \c enable_device(), to enforce the device returned by this method is selected by pipeline \c
        * start(), and configure the device and sensors options or extensions before streaming starts.
        *
        * \param[in] p  The pipeline for which the selected filters are applied
        * \return       A matching device and streams profile, which satisfies the filters and pipeline requests.
        */
        pipeline_profile resolve(std::shared_ptr<rs2_pipeline> p) const
        {
            rs2_error* e = nullptr;
            auto profile = std::shared_ptr<rs2_pipeline_profile>(
                rs2_config_resolve(_config.get(), p.get(), &e),
                rs2_delete_pipeline_profile);

            error::handle(e);
            return pipeline_profile(profile);
        }
Exemplo n.º 4
0
        /**
        * Start the pipeline streaming with its default configuration.
        * The pipeline streaming loop captures samples from the device, and delivers them to the attached computer vision
        * modules and processing blocks, according to each module requirements and threading model.
        * During the loop execution, the application can access the camera streams by calling \c wait_for_frames() or
        * \c poll_for_frames().
        * The streaming loop runs until the pipeline is stopped.
        * Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.
        *
        * \return             The actual pipeline device and streams profile, which was successfully configured to the streaming device.
        */
        pipeline_profile start()
        {
            rs2_error* e = nullptr;
            auto p = std::shared_ptr<rs2_pipeline_profile>(
                rs2_pipeline_start(_pipeline.get(), &e),
                rs2_delete_pipeline_profile);

            error::handle(e);
            return pipeline_profile(p);
        }
Exemplo n.º 5
0
        pipeline_profile start(const config& config, S callback)
        {
            rs2_error* e = nullptr;
            auto p = std::shared_ptr<rs2_pipeline_profile>(
                rs2_pipeline_start_with_config_and_callback_cpp(_pipeline.get(), config.get().get(), new frame_callback<S>(callback), &e),
                rs2_delete_pipeline_profile);

            error::handle(e);
            return pipeline_profile(p);
        }