1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-01-16 02:25:32 -05:00

DATV modulator: use the libavcodec version to figure out write_packet_cb prototype

This commit is contained in:
f4exb 2026-01-03 13:36:43 +01:00
parent ce2c5207aa
commit c334ffeeec
2 changed files with 5 additions and 4 deletions

View File

@ -17,8 +17,8 @@
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/channel_layout.h>
#include <libavutil/common.h>
@ -376,7 +376,7 @@ void TSGenerator::encode_frame_to_ts(AVFormatContext* oc, AVCodecContext* codec_
}
// Write callback - stores TS packets in memory
#if FF_API_AVIO_WRITE_NONCONST
#if LIBAVFORMAT_VERSION_INT < ((61 << 16) | (0 << 8) | 0)
int TSGenerator::write_packet_cb(void* opaque, uint8_t* buf, int buf_size)
#else
int TSGenerator::write_packet_cb(void* opaque, const uint8_t* buf, int buf_size)

View File

@ -21,6 +21,7 @@
#include <vector>
#include <cstdint>
#include <string>
#include <libavformat/version.h>
#include "datvmodsettings.h"
@ -67,7 +68,7 @@ private:
int setup_ts_context(AVFormatContext** oc, AVCodecContext* codec_ctx);
void encode_frame_to_ts(AVFormatContext* oc, AVCodecContext* codec_ctx, AVFrame* frame, int stream_idx = 0);
std::pair<const AVCodec*, AVCodecContext*> create_codec_context(int fps, int bitrate, int width, int height, int duration_sec);
#if FF_API_AVIO_WRITE_NONCONST
#if LIBAVFORMAT_VERSION_INT < ((61 << 16) | (0 << 8) | 0)
static int write_packet_cb(void* opaque, uint8_t* buf, int buf_size);
#else
static int write_packet_cb(void* opaque, const uint8_t* buf, int buf_size);