23#pragma warning (disable : 4091)
66 cinfo->src->next_input_byte =
mybuffer;
67 cinfo->src->bytes_in_buffer = 2;
73 (*cinfo->err->output_message) (cinfo);
82 while (
num_bytes > (
long) src->bytes_in_buffer) {
84 (
void) (*src->fill_input_buffer) (cinfo);
96 if (cinfo->src ==
nullptr) {
108 src->bytes_in_buffer =
buflen;
109 src->next_input_byte = (
JOCTET *)buf;
172 while (
cinfo.output_scanline <
cinfo.output_height) {
179 Bytes envelope(
reinterpret_cast<char*
>(
cinfo.marker_list->data),
cinfo.marker_list->data_length);
199#define HELPER(x) (*((MjpegDecompressionHelper*)(x)))
207 if (system_resource!=
nullptr) {
208 delete &
HELPER(system_resource);
209 system_resource =
nullptr;
229#ifdef MJPEG_AUTOCOMPRESS
void jpeg_net_src(j_decompress_ptr cinfo, char *buf, int buflen)
void net_error_exit(j_common_ptr cinfo)
net_error_mgr * net_error_ptr
jpeg_source_mgr * net_src_ptr
void term_net_source(j_decompress_ptr cinfo)
void init_net_source(j_decompress_ptr cinfo)
void skip_net_input_data(j_decompress_ptr cinfo, long num_bytes)
boolean fill_net_input_buffer(j_decompress_ptr cinfo)
const yarp::os::LogComponent & MJPEGCARRIER()
void * readEnvelopeCallbackData
bool decompress(const Bytes &cimg, FlexImage &img)
~MjpegDecompressionHelper()
bool setReadEnvelopeCallback(yarp::os::InputStream::readEnvelopeCallbackType callback, void *data)
MjpegDecompressionHelper()
struct net_error_mgr jerr
yarp::os::InputStream::readEnvelopeCallbackType readEnvelopeCallback
struct jpeg_decompress_struct cinfo
virtual ~MjpegDecompression()
bool decompress(const yarp::os::Bytes &data, yarp::sig::FlexImage &image)
bool setReadEnvelopeCallback(yarp::os::InputStream::readEnvelopeCallbackType callback, void *data)
A mini-server for performing network communication in the background.
BufferedPort()
Constructor.
A simple abstraction for a block of bytes.
Image class with user control of representation details.
void setPixelCode(int imgPixelCode)
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
unsigned char * getPixelAddress(size_t x, size_t y) const
Get address of a pixel in memory.
#define yCAssert(component, x)
#define yCTrace(component,...)
#define yCWarning(component,...)
An interface to the operating system, including Port based communication.
struct jpeg_error_mgr pub