Line
Link Here
|
0 |
-- a/src/gfxoutputdrv/ffmpeglib.h |
0 |
++ b/src/gfxoutputdrv/ffmpeglib.h |
Lines 76-81
Link Here
|
76 |
#define AVCodecID CodecID |
76 |
#define AVCodecID CodecID |
77 |
#endif |
77 |
#endif |
78 |
|
78 |
|
|
|
79 |
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(55,17,103) |
80 |
#define VICE_AV_PIX_FMT_RGB24 PIX_FMT_RGB24 |
81 |
#define VICE_AV_PixelFormat PixelFormat |
82 |
#else |
83 |
#define VICE_AV_PIX_FMT_RGB24 AV_PIX_FMT_RGB24 |
84 |
#define VICE_AV_PixelFormat AVPixelFormat |
85 |
#endif |
86 |
|
79 |
/* avcodec fucntions */ |
87 |
/* avcodec fucntions */ |
80 |
typedef void(*av_init_packet_t)(AVPacket *pkt); |
88 |
typedef void(*av_init_packet_t)(AVPacket *pkt); |
81 |
typedef int(*avcodec_open2_t)(AVCodecContext*, AVCodec*, AVDictionary **); |
89 |
typedef int(*avcodec_open2_t)(AVCodecContext*, AVCodec*, AVDictionary **); |
Lines 118-124
Link Here
|
118 |
|
126 |
|
119 |
/* swscale functions */ |
127 |
/* swscale functions */ |
120 |
typedef struct SwsContext * (*sws_getContext_t)(int srcW, int srcH, |
128 |
typedef struct SwsContext * (*sws_getContext_t)(int srcW, int srcH, |
121 |
enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, |
129 |
enum VICE_AV_PixelFormat srcFormat, int dstW, int dstH, enum VICE_AV_PixelFormat dstFormat, |
122 |
int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param); |
130 |
int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param); |
123 |
typedef void (*sws_freeContext_t)(struct SwsContext *swsContext); |
131 |
typedef void (*sws_freeContext_t)(struct SwsContext *swsContext); |
124 |
typedef int (*sws_scale_t)(struct SwsContext *context, uint8_t* srcSlice[], |
132 |
typedef int (*sws_scale_t)(struct SwsContext *context, uint8_t* srcSlice[], |
125 |
-- a/src/gfxoutputdrv/ffmpegdrv.c |
133 |
++ b/src/gfxoutputdrv/ffmpegdrv.c |
Lines 671-678
Link Here
|
671 |
picture is needed too. It is then converted to the required |
671 |
picture is needed too. It is then converted to the required |
672 |
output format */ |
672 |
output format */ |
673 |
video_st.tmp_frame = NULL; |
673 |
video_st.tmp_frame = NULL; |
674 |
if (c->pix_fmt != PIX_FMT_RGB24) { |
674 |
if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) { |
675 |
video_st.tmp_frame = ffmpegdrv_alloc_picture(PIX_FMT_RGB24, c->width, c->height); |
675 |
video_st.tmp_frame = ffmpegdrv_alloc_picture(VICE_AV_PIX_FMT_RGB24, c->width, c->height); |
676 |
if (!video_st.tmp_frame) { |
676 |
if (!video_st.tmp_frame) { |
677 |
log_debug("ffmpegdrv: could not allocate temporary picture"); |
677 |
log_debug("ffmpegdrv: could not allocate temporary picture"); |
678 |
return -1; |
678 |
return -1; |
Lines 769-777
Link Here
|
769 |
|
769 |
|
770 |
#ifdef HAVE_FFMPEG_SWSCALE |
770 |
#ifdef HAVE_FFMPEG_SWSCALE |
771 |
/* setup scaler */ |
771 |
/* setup scaler */ |
772 |
if (c->pix_fmt != PIX_FMT_RGB24) { |
772 |
if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) { |
773 |
sws_ctx = VICE_P_SWS_GETCONTEXT |
773 |
sws_ctx = VICE_P_SWS_GETCONTEXT |
774 |
(video_width, video_height, PIX_FMT_RGB24, |
774 |
(video_width, video_height, VICE_AV_PIX_FMT_RGB24, |
775 |
video_width, video_height, c->pix_fmt, |
775 |
video_width, video_height, c->pix_fmt, |
776 |
SWS_BICUBIC, |
776 |
SWS_BICUBIC, |
777 |
NULL, NULL, NULL); |
777 |
NULL, NULL, NULL); |
Lines 948-954
Link Here
|
948 |
|
948 |
|
949 |
c = video_st.st->codec; |
949 |
c = video_st.st->codec; |
950 |
|
950 |
|
951 |
if (c->pix_fmt != PIX_FMT_RGB24) { |
951 |
if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) { |
952 |
ffmpegdrv_fill_rgb_image(screenshot, video_st.tmp_frame); |
952 |
ffmpegdrv_fill_rgb_image(screenshot, video_st.tmp_frame); |
953 |
|
953 |
|
954 |
if (sws_ctx != NULL) { |
954 |
if (sws_ctx != NULL) { |