mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 13:57:46 +08:00
first work gst decoder
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
#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);
|
||||
|
||||
@@ -24,6 +18,9 @@ class GstreamerMjpegDecoder : public MjpegDecoder {
|
||||
GstBufferPool* buffer_pool_ = nullptr;
|
||||
GstElement* pipeline_ = nullptr;
|
||||
GstElement* appsrc_ = nullptr;
|
||||
GstElement* jpegparse_ = nullptr;
|
||||
GstElement* jpegdec_ = nullptr;
|
||||
GstElement* videoconvert_ = nullptr;
|
||||
GstElement* appsink_ = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
|
||||
namespace orbbec_camera {
|
||||
enum HWDecoder {
|
||||
ROCKCHIP_MPP = 0,
|
||||
NV_JPEG_DEC = 1,
|
||||
AMLOGIC_CODEC = 2,
|
||||
AV_CODEC = 3,
|
||||
};
|
||||
|
||||
class MjpegDecoder {
|
||||
public:
|
||||
MjpegDecoder(int width, int height);
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
#include "orbbec_camera/d2c_viewer.h"
|
||||
#include "magic_enum/magic_enum.hpp"
|
||||
#include "mjpeg_decoder.h"
|
||||
#if defined(USE_RK_HW_DECODER)
|
||||
#include "orbbec_camera/rk_mpp_decoder.h"
|
||||
#elif defined(USE_GST_HW_DECODER)
|
||||
#include "orbbec_camera/gst_decoder.h"
|
||||
#endif
|
||||
|
||||
#define STREAM_NAME(sip) \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() \
|
||||
@@ -404,5 +409,6 @@ class OBCameraNode {
|
||||
// mjpeg decoder
|
||||
std::shared_ptr<MjpegDecoder> mjpeg_decoder_ = nullptr;
|
||||
uint8_t* rgb_buffer_ = nullptr;
|
||||
HWDecoder hw_decoder_ = HWDecoder::AV_CODEC;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
|
||||
Reference in New Issue
Block a user