#include <gst/gst.h>

#include <fstream>
#include <iostream>

#include "gstnvdsmeta.h"
#include "config_manager.hpp"
#include "custom_gstnvdsinfer.hpp"

class NvOsdManager {
   private:
   public:
    GstElement *nvosd = NULL;
    static bool write_full_frame_to_disk, write_cropped_objects_to_disk;
    NvOsdManager();
    bool create_nv_osd();
    ~NvOsdManager();
    static gint frame_number;
    void attach_probe_to_src_nvosd(NvDsObjEncCtxHandle);
    static GstPadProbeReturn osd_src_pad_buffer_probe(GstPad *,
                                                      GstPadProbeInfo *,
                                                      gpointer);
    void attach_probe_to_sink_nvosd();
    static GstPadProbeReturn osd_sink_pad_buffer_probe(GstPad *,
                                                       GstPadProbeInfo *,
                                                       gpointer);
    static void save_full_frame(NvDsFrameMeta *);
    static void save_cropped_objects(NvDsFrameMeta *, NvDsObjectMeta *, guint);
};