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
yarp::sig::ImageNetworkHeader
Byte order in image header for network transmission.
Definition: ImageNetworkHeader.h:33
ImageNetworkHeader.h
BlobNetworkHeader.h
H264Decoder.h
yarp::os::OutputStream::write
virtual void write(char ch)
Write a single byte to the stream.
Definition: OutputStream.cpp:17
yarp::os::InputStream::InputStream
InputStream()
Constructor.
yarp::os::impl::DgramTwoWayStream::DgramTwoWayStream
DgramTwoWayStream()
Definition: DgramTwoWayStream.h:43
H264Stream::~H264Stream
virtual ~H264Stream()
Definition: H264Stream.cpp:42
yarp::sig::ImageOf< yarp::sig::PixelRgb >
yarp::wire_rep_utils::BlobNetworkHeader
Definition: BlobNetworkHeader.h:22
H264Stream::getInputStream
InputStream & getInputStream() override
Get an InputStream to read from.
Definition: H264Stream.cpp:67
H264Stream
Definition: H264Stream.h:22
h264Decoder_cfgParamters
Definition: H264Decoder.h:17
H264Stream::H264Stream
H264Stream(h264Decoder_cfgParamters &config)
Definition: H264Stream.cpp:32
yarp::conf::ssize_t
::ssize_t ssize_t
Definition: numeric.h:60
yarp::os::impl::DgramTwoWayStream
A stream abstraction for datagram communication.
Definition: DgramTwoWayStream.h:40
yarp::os::Bytes
A simple abstraction for a block of bytes.
Definition: Bytes.h:28
H264Stream::start
void start()
Definition: H264Stream.cpp:60
DgramTwoWayStream.h
Image.h
H264Stream::write
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
Definition: H264Stream.cpp:233
H264Stream::getOutputStream
OutputStream & getOutputStream() override
Get an OutputStream to write to.
Definition: H264Stream.cpp:72
yarp::os::InputStream::read
virtual int read()
Read and return a single byte.
Definition: InputStream.cpp:23
H264Stream::setReadEnvelopeCallback
bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void *data) override
Definition: H264Stream.cpp:82
H264Decoder
Definition: H264Decoder.h:38
InputStream.h
H264Stream::setStream
bool setStream(yarp::os::impl::DgramTwoWayStream *stream)
Definition: H264Stream.cpp:50