YARP
Yet Another Robot Platform
H264Stream.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef H264STREAM_INC
7 #define H264STREAM_INC
8 
10 #include <yarp/sig/Image.h>
13 #include "H264Decoder.h"
14 #include <yarp/os/InputStream.h>
15 
16 
17 class H264Stream :
19 {
20 private:
21 
22  DgramTwoWayStream *delegate;
26  int phase;
27  char *cursor;
28  size_t remaining;
29  H264Decoder *decoder;
31 public:
33 
34  virtual ~H264Stream();
35 
37 
38  void start();
39 
40  InputStream& getInputStream() override;
41  OutputStream& getOutputStream() override;
42 
44  void write(const yarp::os::Bytes& b) override;
45 
48 
49  bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void* data) override;
50 
51 };
52 
53 #endif
OutputStream & getOutputStream() override
Get an OutputStream to write to.
Definition: H264Stream.cpp:68
H264Stream(h264Decoder_cfgParamters &config)
Definition: H264Stream.cpp:28
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
Definition: H264Stream.cpp:229
virtual ~H264Stream()
Definition: H264Stream.cpp:38
void start()
Definition: H264Stream.cpp:56
bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void *data) override
Definition: H264Stream.cpp:78
InputStream & getInputStream() override
Get an InputStream to read from.
Definition: H264Stream.cpp:63
bool setStream(yarp::os::impl::DgramTwoWayStream *stream)
Definition: H264Stream.cpp:46
A simple abstraction for a block of bytes.
Definition: Bytes.h:25
virtual int read()
Read and return a single byte.
Definition: InputStream.cpp:20
InputStream()
Constructor.
virtual void write(char ch)
Write a single byte to the stream.
A stream abstraction for datagram communication.
Byte order in image header for network transmission.
::ssize_t ssize_t
Definition: numeric.h:86