diff --git a/src/codeccontext.cpp b/src/codeccontext.cpp index 234c598e..499c9990 100644 --- a/src/codeccontext.cpp +++ b/src/codeccontext.cpp @@ -17,14 +17,14 @@ using namespace std; namespace av { namespace { -std::pair +std::pair make_error_pair(Errors errc) { - return make_pair(static_cast(errc), &avcpp_category()); + return make_pair(static_cast(errc), &avcpp_category()); } -std::pair -make_error_pair(ssize_t status) +std::pair +make_error_pair(int status) { if (status < 0) return make_pair(status, &ffmpeg_category()); @@ -757,7 +757,7 @@ void CodecContext2::open(const Codec &codec, AVDictionary **options, OptionalErr throws_if(ec, stat, ffmpeg_category()); } -std::pair CodecContext2::decodeCommon(AVFrame *outFrame, const Packet &inPacket, size_t offset, int &frameFinished, int (*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *)) noexcept +std::pair CodecContext2::decodeCommon(AVFrame *outFrame, const Packet &inPacket, size_t offset, int &frameFinished, int (*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *)) noexcept { if (!isValid()) return make_error_pair(Errors::CodecInvalid); @@ -781,7 +781,7 @@ std::pair CodecContext2::decodeCommon(AVFrame * return make_error_pair(decoded); } -std::pair CodecContext2::encodeCommon(Packet &outPacket, const AVFrame *inFrame, int &gotPacket, int (*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *)) noexcept +std::pair CodecContext2::encodeCommon(Packet &outPacket, const AVFrame *inFrame, int &gotPacket, int (*encodeProc)(AVCodecContext *, AVPacket *, const AVFrame *, int *)) noexcept { if (!isValid()) { fflog(AV_LOG_ERROR, "Invalid context\n"); diff --git a/src/codeccontext.h b/src/codeccontext.h index 814ff93b..66cb040d 100644 --- a/src/codeccontext.h +++ b/src/codeccontext.h @@ -129,17 +129,17 @@ class CodecContext2 : public FFWrapperPtr, public noncopyable void open(const Codec &codec, AVDictionary **options, OptionalErrorCode ec); - std::pair + std::pair decodeCommon(AVFrame *outFrame, const class Packet &inPacket, size_t offset, int &frameFinished, int (*decodeProc)(AVCodecContext*, AVFrame*,int *, const AVPacket *)) noexcept; - std::pair + std::pair encodeCommon(class Packet &outPacket, const AVFrame *inFrame, int &gotPacket, int (*encodeProc)(AVCodecContext*, AVPacket*,const AVFrame*, int*)) noexcept; public: template - std::pair + std::pair decodeCommon(T &outFrame, const class Packet &inPacket, size_t offset, @@ -147,7 +147,7 @@ class CodecContext2 : public FFWrapperPtr, public noncopyable int (*decodeProc)(AVCodecContext *, AVFrame *, int *, const AVPacket *)); template - std::pair + std::pair encodeCommon(class Packet &outPacket, const T &inFrame, int &gotPacket, diff --git a/src/formatcontext.cpp b/src/formatcontext.cpp index 80f4b1b2..623d883d 100644 --- a/src/formatcontext.cpp +++ b/src/formatcontext.cpp @@ -932,7 +932,7 @@ void FormatContext::closeCodecContexts() #endif } -ssize_t FormatContext::checkPbError(ssize_t stat) +int FormatContext::checkPbError(int stat) { // WORKAROUND: a lot of format specific writer_packet() functions always return zero code // and av_write_frame() in FFMPEG prio 1.0 does not contain follow wrapper diff --git a/src/formatcontext.h b/src/formatcontext.h index 3e7c35ed..749dfbec 100644 --- a/src/formatcontext.h +++ b/src/formatcontext.h @@ -27,13 +27,13 @@ using AvioInterruptCb = std::function; struct CustomIO { virtual ~CustomIO() {} - virtual ssize_t write(const uint8_t *data, size_t size) + virtual int write(const uint8_t *data, size_t size) { static_cast(data); static_cast(size); return -1; } - virtual ssize_t read(uint8_t *data, size_t size) + virtual int read(uint8_t *data, size_t size) { static_cast(data); static_cast(size); @@ -202,7 +202,7 @@ class FormatContext : public FFWrapperPtr, public noncopyable void resetSocketAccess(); void findStreamInfo(AVDictionary **options, size_t optionsCount, OptionalErrorCode ec); void closeCodecContexts(); - ssize_t checkPbError(ssize_t stat); + int checkPbError(int stat); void openCustomIO(CustomIO *io, size_t internalBufferSize, bool isWritable, OptionalErrorCode ec); void openCustomIOInput(CustomIO *io, size_t internalBufferSize, OptionalErrorCode ec);