Line
Link Here
|
0 |
-- libextractor-1.3.orig/src/plugins/thumbnailffmpeg_extractor.c |
0 |
++ libextractor-1.3/src/plugins/thumbnailffmpeg_extractor.c |
Lines 153-159
seek_cb (void *opaque,
Link Here
|
153 |
static size_t |
153 |
static size_t |
154 |
create_thumbnail (int src_width, int src_height, |
154 |
create_thumbnail (int src_width, int src_height, |
155 |
int src_stride[], |
155 |
int src_stride[], |
156 |
enum PixelFormat src_pixfmt, |
156 |
enum AVPixelFormat src_pixfmt, |
157 |
const uint8_t * const src_data[], |
157 |
const uint8_t * const src_data[], |
158 |
int dst_width, int dst_height, |
158 |
int dst_width, int dst_height, |
159 |
uint8_t **output_data, |
159 |
uint8_t **output_data, |
Lines 189-195
create_thumbnail (int src_width, int src
Link Here
|
189 |
if (NULL == |
189 |
if (NULL == |
190 |
(scaler_ctx = |
190 |
(scaler_ctx = |
191 |
sws_getContext (src_width, src_height, src_pixfmt, |
191 |
sws_getContext (src_width, src_height, src_pixfmt, |
192 |
dst_width, dst_height, PIX_FMT_RGB24, |
192 |
dst_width, dst_height, AV_PIX_FMT_RGB24, |
193 |
SWS_BILINEAR, NULL, NULL, NULL))) |
193 |
SWS_BILINEAR, NULL, NULL, NULL))) |
194 |
{ |
194 |
{ |
195 |
#if DEBUG |
195 |
#if DEBUG |
Lines 214-220
create_thumbnail (int src_width, int src
Link Here
|
214 |
return 0; |
214 |
return 0; |
215 |
} |
215 |
} |
216 |
if (NULL == (dst_buffer = |
216 |
if (NULL == (dst_buffer = |
217 |
av_malloc (avpicture_get_size (PIX_FMT_RGB24, dst_width, dst_height)))) |
217 |
av_malloc (avpicture_get_size (AV_PIX_FMT_RGB24, dst_width, dst_height)))) |
218 |
{ |
218 |
{ |
219 |
#if DEBUG |
219 |
#if DEBUG |
220 |
fprintf (stderr, |
220 |
fprintf (stderr, |
Lines 229-235
create_thumbnail (int src_width, int src
Link Here
|
229 |
return 0; |
229 |
return 0; |
230 |
} |
230 |
} |
231 |
avpicture_fill ((AVPicture *) dst_frame, dst_buffer, |
231 |
avpicture_fill ((AVPicture *) dst_frame, dst_buffer, |
232 |
PIX_FMT_RGB24, dst_width, dst_height); |
232 |
AV_PIX_FMT_RGB24, dst_width, dst_height); |
233 |
sws_scale (scaler_ctx, |
233 |
sws_scale (scaler_ctx, |
234 |
src_data, |
234 |
src_data, |
235 |
src_stride, |
235 |
src_stride, |
Lines 272-278
create_thumbnail (int src_width, int src
Link Here
|
272 |
} |
272 |
} |
273 |
encoder_codec_ctx->width = dst_width; |
273 |
encoder_codec_ctx->width = dst_width; |
274 |
encoder_codec_ctx->height = dst_height; |
274 |
encoder_codec_ctx->height = dst_height; |
275 |
encoder_codec_ctx->pix_fmt = PIX_FMT_RGB24; |
275 |
encoder_codec_ctx->pix_fmt = AV_PIX_FMT_RGB24; |
276 |
opts = NULL; |
276 |
opts = NULL; |
277 |
if (avcodec_open2 (encoder_codec_ctx, encoder_codec, &opts) < 0) |
277 |
if (avcodec_open2 (encoder_codec_ctx, encoder_codec, &opts) < 0) |
278 |
{ |
278 |
{ |