Skip to content

Commit

Permalink
fix for ffmpeg 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther committed Aug 4, 2024
1 parent 155e6d5 commit 4ca8b0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/driver/streamts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool CStreamInstance::Stop()
return (OpenThreads::Thread::join() == 0);
}

bool CStreamInstance::Send(ssize_t r, unsigned char *_buf)
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
{
//OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
stream_fds_t cfds;
Expand All @@ -136,7 +136,7 @@ bool CStreamInstance::Send(ssize_t r, unsigned char *_buf)
for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it)
{
int i = 10;
unsigned char *b = _buf ? _buf : buf;
const unsigned char *b = _buf ? _buf : buf;
ssize_t count = r;
do
{
Expand Down Expand Up @@ -837,7 +837,11 @@ CStreamStream::~CStreamStream()
Close();
}

#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
int CStreamStream::write_packet(void *opaque, const uint8_t *buffer, int buf_size)
#else
int CStreamStream::write_packet(void *opaque, uint8_t *buffer, int buf_size)
#endif
{
CStreamStream *st = (CStreamStream *) opaque;
st->Send(buf_size, buffer);
Expand Down
8 changes: 6 additions & 2 deletions src/driver/streamts.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CStreamInstance : public OpenThreads::Thread
stream_pids_t pids;
stream_fds_t fds;

virtual bool Send(ssize_t r, unsigned char *_buf = NULL);
virtual bool Send(ssize_t r, const unsigned char *_buf = NULL);
virtual void Close();
virtual void run();
friend class CStreamManager;
Expand Down Expand Up @@ -104,7 +104,11 @@ class CStreamStream : public CStreamInstance
bool Stop();

static int Interrupt(void *data);
static int write_packet(void *opaque, uint8_t *buf, int buf_size);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
static int write_packet(void *opaque, const uint8_t *buffer, int buf_size);
#else
static int write_packet(void *opaque, uint8_t *buffer, int buf_size);
#endif
};

typedef std::pair<t_channel_id, CStreamInstance *> streammap_pair_t;
Expand Down

0 comments on commit 4ca8b0a

Please sign in to comment.