00001
00002
00003
00004
00005 #include <stdlib.h>
00006 #include "filter.h"
00007 #include "frame.h"
00008
00009 VideoFilter *
00010 new_force_template (VideoFrameType inpixfmt, VideoFrameType outpixfmt,
00011 VideoFrameType mypixfmt)
00012 {
00013 VideoFilter *filter;
00014
00015 if (inpixfmt != mypixfmt || outpixfmt != mypixfmt)
00016 return NULL;
00017
00018 filter = (VideoFilter *) malloc(sizeof(VideoFilter));
00019
00020 if (filter)
00021 {
00022 filter->filter = NULL;
00023 filter->cleanup = NULL;
00024 }
00025
00026 return filter;
00027 }
00028
00029 VideoFilter *
00030 new_force_yv12 (VideoFrameType inpixfmt, VideoFrameType outpixfmt, int *width,
00031 int *height, char *options)
00032 {
00033 (void) width;
00034 (void) height;
00035 (void) options;
00036
00037 return new_force_template (inpixfmt, outpixfmt, FMT_YV12);
00038 }
00039
00040 VideoFilter *
00041 new_force_yuv422p (VideoFrameType inpixfmt, VideoFrameType outpixfmt, int *width,
00042 int *height, char *options)
00043 {
00044 (void) width;
00045 (void) height;
00046 (void) options;
00047
00048 return new_force_template (inpixfmt, outpixfmt, FMT_YUV422P);
00049 }
00050
00051 VideoFilter *
00052 new_force_rgb24 (VideoFrameType inpixfmt, VideoFrameType outpixfmt, int *width,
00053 int *height, char *options)
00054 {
00055 (void) width;
00056 (void) height;
00057 (void) options;
00058
00059 return new_force_template (inpixfmt, outpixfmt, FMT_RGB24);
00060 }
00061
00062 VideoFilter *
00063 new_force_argb32 (VideoFrameType inpixfmt, VideoFrameType outpixfmt, int *width,
00064 int *height, char *options)
00065 {
00066 (void) width;
00067 (void) height;
00068 (void) options;
00069
00070 return new_force_template (inpixfmt, outpixfmt, FMT_ARGB32);
00071 }
00072
00073 static FmtConv Fmt_List_YV12[] =
00074 {
00075 { FMT_YV12, FMT_YV12 },
00076 FMT_NULL
00077 };
00078
00079 static FmtConv Fmt_List_YUV422P[] =
00080 {
00081 { FMT_YUV422P, FMT_YUV422P },
00082 FMT_NULL
00083 };
00084
00085 static FmtConv Fmt_List_RGB24[] =
00086 {
00087 { FMT_RGB24, FMT_RGB24 },
00088 FMT_NULL
00089 };
00090
00091 static FmtConv Fmt_List_ARGB32[] =
00092 {
00093 { FMT_ARGB32, FMT_ARGB32 },
00094 FMT_NULL
00095 };
00096
00097 FilterInfo filter_table[] =
00098 {
00099 {
00100 symbol: "new_force_yv12",
00101 name: "forceyv12",
00102 descript: "forces use of YV12 video format",
00103 formats: Fmt_List_YV12,
00104 libname: NULL
00105 },
00106 {
00107 symbol: "new_force_yuv422p",
00108 name: "forceyuv422p",
00109 descript: "forces use of YUV422P video format",
00110 formats: Fmt_List_YUV422P,
00111 libname: NULL
00112 },
00113 {
00114 symbol: "new_force_rgb24",
00115 name: "forcergb24",
00116 descript: "forces use of RGB24 video format",
00117 formats: Fmt_List_RGB24,
00118 libname: NULL
00119 },
00120 {
00121 symbol: "new_force_argb32",
00122 name: "forceargb32",
00123 descript: "forces use of ARGB32 video format",
00124 formats: Fmt_List_ARGB32,
00125 libname: NULL
00126 },
00127 FILT_NULL
00128 };