mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 22:07:46 +08:00
add gst decoder
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#include "mjpeg_decoder.h"
|
||||
#include <gst/gst.h>
|
||||
|
||||
namespace orbbec_camera {
|
||||
enum class HWDecoder : int {
|
||||
ROCKCHIP_MPP = 0,
|
||||
NV_JPEG_DEC = 1,
|
||||
AMLOGIC_CODEC = 2,
|
||||
};
|
||||
|
||||
std::string hwDecoderToString(HWDecoder hw_decoder);
|
||||
|
||||
class GstreamerMjpegDecoder : public MjpegDecoder {
|
||||
public:
|
||||
GstreamerMjpegDecoder(int width, int height, HWDecoder hw_decoder);
|
||||
~GstreamerMjpegDecoder() override;
|
||||
|
||||
bool decode(const std::shared_ptr<ob::ColorFrame>& frame, uint8_t* dest) override;
|
||||
|
||||
private:
|
||||
std::string hw_decoder_;
|
||||
guint buffer_size_ = 0;
|
||||
GstBufferPool* buffer_pool_ = nullptr;
|
||||
GstElement* pipeline_ = nullptr;
|
||||
GstElement* appsrc_ = nullptr;
|
||||
GstElement* appsink_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace orbbec_camera
|
||||
@@ -18,7 +18,6 @@ class MjpegDecoder {
|
||||
protected:
|
||||
int width_ = 0;
|
||||
int height_ = 0;
|
||||
uint8_t *rgb_buffer_ = nullptr;
|
||||
std::string error_msg_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
|
||||
@@ -36,6 +36,7 @@ class RKMjpegDecoder : public MjpegDecoder {
|
||||
MppBufferGroup mpp_packet_group_ = nullptr;
|
||||
MppTask mpp_task_ = nullptr;
|
||||
uint32_t need_split_ = 0;
|
||||
uint8_t * rgb_buffer_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace orbbec_camera
|
||||
Reference in New Issue
Block a user