diff --git a/src/Rtp/Decoder.cpp b/src/Rtp/Decoder.cpp index dcf1ba0d..1d97430e 100644 --- a/src/Rtp/Decoder.cpp +++ b/src/Rtp/Decoder.cpp @@ -54,7 +54,7 @@ DecoderImp::Ptr DecoderImp::createDecoder(Type type, MediaSinkInterface *sink){ return DecoderImp::Ptr(new DecoderImp(decoder, sink)); } -size_t DecoderImp::input(const uint8_t *data, size_t bytes){ +ssize_t DecoderImp::input(const uint8_t *data, size_t bytes){ return _decoder->input(data, bytes); } diff --git a/src/Rtp/Decoder.h b/src/Rtp/Decoder.h index 7f53a062..5d57ceda 100644 --- a/src/Rtp/Decoder.h +++ b/src/Rtp/Decoder.h @@ -25,7 +25,7 @@ public: typedef std::function onDecode; typedef std::function onStream; - virtual size_t input(const uint8_t *data, size_t bytes) = 0; + virtual ssize_t input(const uint8_t *data, size_t bytes) = 0; virtual void setOnDecode(onDecode cb) = 0; virtual void setOnStream(onStream cb) = 0; @@ -57,7 +57,7 @@ public: ~DecoderImp() = default; static Ptr createDecoder(Type type, MediaSinkInterface *sink); - size_t input(const uint8_t *data, size_t bytes); + ssize_t input(const uint8_t *data, size_t bytes); protected: void onTrack(const Track::Ptr &track); diff --git a/src/Rtp/PSDecoder.cpp b/src/Rtp/PSDecoder.cpp index 4d3629d7..7854e1af 100644 --- a/src/Rtp/PSDecoder.cpp +++ b/src/Rtp/PSDecoder.cpp @@ -44,7 +44,7 @@ PSDecoder::~PSDecoder() { ps_demuxer_destroy((struct ps_demuxer_t*)_ps_demuxer); } -size_t PSDecoder::input(const uint8_t *data, size_t bytes) { +ssize_t PSDecoder::input(const uint8_t *data, size_t bytes) { return ps_demuxer_input((struct ps_demuxer_t*)_ps_demuxer,data,bytes); } diff --git a/src/Rtp/PSDecoder.h b/src/Rtp/PSDecoder.h index 7f9d1016..270f929a 100644 --- a/src/Rtp/PSDecoder.h +++ b/src/Rtp/PSDecoder.h @@ -21,7 +21,7 @@ class PSDecoder : public Decoder { public: PSDecoder(); ~PSDecoder(); - size_t input(const uint8_t* data, size_t bytes) override; + ssize_t input(const uint8_t* data, size_t bytes) override; void setOnDecode(onDecode cb) override; void setOnStream(onStream cb) override; diff --git a/src/Rtp/TSDecoder.cpp b/src/Rtp/TSDecoder.cpp index 31dae4a2..7a5aee2a 100644 --- a/src/Rtp/TSDecoder.cpp +++ b/src/Rtp/TSDecoder.cpp @@ -77,7 +77,7 @@ TSDecoder::~TSDecoder() { ts_demuxer_destroy(_demuxer_ctx); } -size_t TSDecoder::input(const uint8_t *data, size_t bytes) { +ssize_t TSDecoder::input(const uint8_t *data, size_t bytes) { if (TSSegment::isTSPacket((char *)data, bytes)) { return ts_demuxer_input(_demuxer_ctx, (uint8_t *) data, bytes); } diff --git a/src/Rtp/TSDecoder.h b/src/Rtp/TSDecoder.h index 2f92421a..a6231ae9 100644 --- a/src/Rtp/TSDecoder.h +++ b/src/Rtp/TSDecoder.h @@ -45,7 +45,7 @@ class TSDecoder : public Decoder { public: TSDecoder(); ~TSDecoder(); - size_t input(const uint8_t* data, size_t bytes) override ; + ssize_t input(const uint8_t* data, size_t bytes) override ; void setOnDecode(onDecode cb) override; void setOnStream(onStream cb) override;