25#include <Image/ByteImage.h>
36 avcodec_register_all();
38 m_decoder = avcodec_find_decoder(AV_CODEC_ID_H264);
45 if (
m_decoder->capabilities & AV_CODEC_CAP_TRUNCATED)
56 AVDictionary* dictionary =
nullptr;
78 int imgWidth, imgHeight, imgType;
83 ppDecodedImages[i] =
new CByteImage(imgWidth, imgHeight, CByteImage::eRGB24);
86 setImageFormat(visionx::ImageDimension(imgWidth, imgHeight), visionx::eRgb);
87 ImageProvider::onConnectComponent();
122 Ice::Long imageTimestamp,
127 m_packet.data =
const_cast<Ice::Byte*
>(chunk.data());
133#pragma GCC diagnostic push
134#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
136#pragma GCC diagnostic pop
139 std::string err(
"Decoding error");
149 if (
m_picture->format == AV_PIX_FMT_YUV420P)
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
AVCodecContext * m_decoderContext
CByteImage ** ppDecodedImages
void reportNewStreamData(const Stream::DataChunk &chunk, Ice::Long imageTimestamp, const Ice::Current &) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Stream::StreamProviderPrx streamProvider
void onConnectComponent() override
Pure virtual hook for the subclass.
std::mutex decodedImageMutex
std::mutex streamDecodeMutex
void onInitImageProvider() override
This is called when the Component::onInitComponent() is called.
void onExitImageProvider() override
This is called when the Component::onExitComponent() setup is called.
CByteImage * pCombinedDecodedImage
void onDisconnectImageProvider() override
void updateTimestamp(Ice::Long timestamp, bool threadSafe=true)
Updates the timestamp of the currently captured image.
void setImageFormat(ImageDimension imageDimension, ImageType imageType, BayerPatternType bayerPatternType=visionx::eBayerPatternRg)
Sets the image basic format data.
void provideImages(void **inputBuffers, const IceUtil::Time &imageTimestamp=IceUtil::Time())
send images raw.
void setNumberImages(int numberImages)
Sets the number of images on each capture.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.