Commit b7f4eae2 by xia-chu

修复bug

parent e4904623
...@@ -54,7 +54,7 @@ DecoderImp::Ptr DecoderImp::createDecoder(Type type, MediaSinkInterface *sink){ ...@@ -54,7 +54,7 @@ DecoderImp::Ptr DecoderImp::createDecoder(Type type, MediaSinkInterface *sink){
return DecoderImp::Ptr(new DecoderImp(decoder, 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); return _decoder->input(data, bytes);
} }
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
typedef std::function<void(int stream, int codecid, int flags, int64_t pts, int64_t dts, const void *data, size_t bytes)> onDecode; typedef std::function<void(int stream, int codecid, int flags, int64_t pts, int64_t dts, const void *data, size_t bytes)> onDecode;
typedef std::function<void(int stream, int codecid, const void *extra, size_t bytes, int finish)> onStream; typedef std::function<void(int stream, int codecid, const void *extra, size_t bytes, int finish)> 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 setOnDecode(onDecode cb) = 0;
virtual void setOnStream(onStream cb) = 0; virtual void setOnStream(onStream cb) = 0;
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
~DecoderImp() = default; ~DecoderImp() = default;
static Ptr createDecoder(Type type, MediaSinkInterface *sink); 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: protected:
void onTrack(const Track::Ptr &track); void onTrack(const Track::Ptr &track);
......
...@@ -44,7 +44,7 @@ PSDecoder::~PSDecoder() { ...@@ -44,7 +44,7 @@ PSDecoder::~PSDecoder() {
ps_demuxer_destroy((struct ps_demuxer_t*)_ps_demuxer); 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); return ps_demuxer_input((struct ps_demuxer_t*)_ps_demuxer,data,bytes);
} }
......
...@@ -21,7 +21,7 @@ class PSDecoder : public Decoder { ...@@ -21,7 +21,7 @@ class PSDecoder : public Decoder {
public: public:
PSDecoder(); PSDecoder();
~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 setOnDecode(onDecode cb) override;
void setOnStream(onStream cb) override; void setOnStream(onStream cb) override;
......
...@@ -77,7 +77,7 @@ TSDecoder::~TSDecoder() { ...@@ -77,7 +77,7 @@ TSDecoder::~TSDecoder() {
ts_demuxer_destroy(_demuxer_ctx); 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)) { if (TSSegment::isTSPacket((char *)data, bytes)) {
return ts_demuxer_input(_demuxer_ctx, (uint8_t *) data, bytes); return ts_demuxer_input(_demuxer_ctx, (uint8_t *) data, bytes);
} }
......
...@@ -45,7 +45,7 @@ class TSDecoder : public Decoder { ...@@ -45,7 +45,7 @@ class TSDecoder : public Decoder {
public: public:
TSDecoder(); TSDecoder();
~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 setOnDecode(onDecode cb) override;
void setOnStream(onStream cb) override; void setOnStream(onStream cb) override;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论