wangrong
2025-01-23 02819b5c047bb354b0ef2374e7c6a6ac4bbd5bba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
 
#include <string>
 
#include "vp_node.h"
#include "vp_stream_status_hookable.h"
 
namespace vp_nodes {
    // base class for des nodes, end point of meta/pipeline.
    class vp_des_node: public vp_node, public vp_stream_status_hookable {
    private:
        // cache for stream status at current des node.
        vp_stream_status stream_status;
 
        // period(ms) to calculate output fps
        int fps_epoch = 500;
        int fps_counter = 0;
        std::chrono::system_clock::time_point fps_last_time;
    protected:
        // do nothing in des nodes
        virtual void dispatch_run() override final;
        // sample implementation, return nullptr in all des nodes.
        virtual std::shared_ptr<vp_objects::vp_meta> handle_frame_meta(std::shared_ptr<vp_objects::vp_frame_meta> meta) override; 
        // sample implementation, return nullptr in all des nodes.
        virtual std::shared_ptr<vp_objects::vp_meta> handle_control_meta(std::shared_ptr<vp_objects::vp_control_meta> meta) override;
 
        // protected as it can't be instanstiated directly.        
        vp_des_node(std::string node_name, int channel_index);
    public:
        ~vp_des_node();
 
        virtual vp_node_type node_type() override;
 
        int channel_index;
    };
}