Go to the documentation of this file.
25 #include <Image/ByteImage.h>
32 usingProxy(getProperty<std::string>(
"UsedStreamProvider").getValue());
33 usingTopic(getProperty<std::string>(
"imageStreamTopicName").getValue());
36 avcodec_register_all();
38 m_decoder = avcodec_find_decoder(AV_CODEC_ID_H264);
45 if (
m_decoder->capabilities & AV_CODEC_CAP_TRUNCATED)
55 AVDictionary* dictionary =
nullptr;
72 streamProvider = getProxy<Stream::StreamProviderPrx>(getProperty<std::string>(
"UsedStreamProvider").getValue());
76 int imgWidth, imgHeight, imgType;
81 ppDecodedImages[i] =
new CByteImage(imgWidth, imgHeight, CByteImage::eRGB24);
84 setImageFormat(visionx::ImageDimension(imgWidth, imgHeight), visionx::eRgb);
85 ImageProvider::onConnectComponent();
123 m_packet.data =
const_cast<Ice::Byte*
>(chunk.data());
129 #pragma GCC diagnostic push
130 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
132 #pragma GCC diagnostic pop
135 std::string err(
"Decoding error");
145 if (
m_picture->format == AV_PIX_FMT_YUV420P)
152 AV_PIX_FMT_RGB24, SWS_GAUSS,
void onDisconnectImageProvider() override
std::mutex decodedImageMutex
void onExitImageProvider() override
This is called when the Component::onExitComponent() setup is called.
std::mutex streamDecodeMutex
void setImageFormat(ImageDimension imageDimension, ImageType imageType, BayerPatternType bayerPatternType=visionx::eBayerPatternRg)
Sets the image basic format data.
CByteImage * pCombinedDecodedImage
void updateTimestamp(Ice::Long timestamp, bool threadSafe=true)
Updates the timestamp of the currently captured image.
AVCodecContext * m_decoderContext
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.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
CByteImage ** ppDecodedImages
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitImageProvider() override
This is called when the Component::onInitComponent() is called.
void reportNewStreamData(const Stream::DataChunk &chunk, Ice::Long imageTimestamp, const Ice::Current &) override
Stream::StreamProviderPrx streamProvider
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
void onConnectComponent() override
Pure virtual hook for the subclass.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
This file offers overloads of toIce() and fromIce() functions for STL container types.