YARP
Yet Another Robot Platform
H264Stream.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef H264STREAM_INC
10 #define H264STREAM_INC
11 
13 #include <yarp/sig/Image.h>
16 #include "H264Decoder.h"
17 #include <yarp/os/InputStream.h>
18 
19 
20 class H264Stream :
22 {
23 private:
24 
25  DgramTwoWayStream *delegate;
29  int phase;
30  char *cursor;
31  size_t remaining;
32  H264Decoder *decoder;
34 public:
36 
37  virtual ~H264Stream();
38 
40 
41  void start();
42 
43  InputStream& getInputStream() override;
44  OutputStream& getOutputStream() override;
45 
47  void write(const yarp::os::Bytes& b) override;
48 
51 
52  bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void* data) override;
53 
54 };
55 
56 #endif
OutputStream & getOutputStream() override
Get an OutputStream to write to.
Definition: H264Stream.cpp:72
H264Stream(h264Decoder_cfgParamters &config)
Definition: H264Stream.cpp:32
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
Definition: H264Stream.cpp:233
virtual ~H264Stream()
Definition: H264Stream.cpp:42
void start()
Definition: H264Stream.cpp:60
bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void *data) override
Definition: H264Stream.cpp:82
InputStream & getInputStream() override
Get an InputStream to read from.
Definition: H264Stream.cpp:67
bool setStream(yarp::os::impl::DgramTwoWayStream *stream)
Definition: H264Stream.cpp:50
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
virtual int read()
Read and return a single byte.
Definition: InputStream.cpp:23
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:60