3 * Copyright (c) 2002 Philip Gladstone
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "framehook.h"
27 void Release(void *ctx
)
30 ci
= (ContextInfo
*) ctx
;
36 int Configure(void **ctxp
, int argc
, char *argv
[])
38 fprintf(stderr
, "Called with argc=%d\n", argc
);
40 *ctxp
= av_mallocz(sizeof(ContextInfo
));
44 void Process(void *ctx
, AVPicture
*picture
, enum PixelFormat pix_fmt
, int width
, int height
, INT64 pts
)
46 ContextInfo
*ci
= (ContextInfo
*) ctx
;
49 AVPicture
*pict
= picture
;
53 if (pix_fmt
!= PIX_FMT_RGB24
) {
56 size
= avpicture_get_size(PIX_FMT_RGB24
, width
, height
);
57 buf
= av_malloc(size
);
59 avpicture_fill(&picture1
, buf
, PIX_FMT_RGB24
, width
, height
);
60 if (img_convert(&picture1
, PIX_FMT_RGB24
,
61 picture
, pix_fmt
, width
, height
) < 0) {
68 /* Insert filter code here */
70 if (pix_fmt
!= PIX_FMT_RGB24
) {
71 if (img_convert(picture
, pix_fmt
,
72 &picture1
, PIX_FMT_RGB24
, width
, height
) < 0) {