1 #include <stdlib.h> /* malloc */
2 #include <string.h> /* memset */
4 static int init(priv_t
*priv
);
5 static int uninit(priv_t
*priv
);
6 static int control(priv_t
*priv
, int cmd
, void *arg
);
7 static int start(priv_t
*priv
);
8 static double grab_video_frame(priv_t
*priv
, char *buffer
, int len
);
9 static int get_video_framesize(priv_t
*priv
);
10 static double grab_audio_frame(priv_t
*priv
, char *buffer
, int len
);
11 static int get_audio_framesize(priv_t
*priv
);
13 int teletext_control(void* p
, int cmd
, void *arg
);
15 static tvi_functions_t functions
=
27 static tvi_handle_t
*new_handle(void)
29 tvi_handle_t
*h
= (tvi_handle_t
*)malloc(sizeof(tvi_handle_t
));
33 h
->priv
= (priv_t
*)malloc(sizeof(priv_t
));
39 memset(h
->priv
, 0, sizeof(priv_t
));
40 h
->functions
= &functions
;
50 static void free_handle(tvi_handle_t
*h
)
62 Fills video frame in given buffer with blue color for yv12,i420,uyvy,yuy2.
63 Other formats will be filled with 0xC0
65 static inline void fill_blank_frame(char* buffer
,int len
,int fmt
){
67 // RGB(0,0,255) <-> YVU(41,110,240)
71 memset(buffer
, 41,4*len
/6); //Y
72 memset(buffer
+4*len
/6, 110,len
/6);//V
73 memset(buffer
+5*len
/6, 240,len
/6);//U
76 memset(buffer
, 41,4*len
/6); //Y
77 memset(buffer
+4*len
/6, 240,len
/6);//U
78 memset(buffer
+5*len
/6, 110,len
/6);//V
98 This is compressed format. I don't know yet how to fill such frame with blue color.
99 Keeping frame unchanged.
103 memset(buffer
,0xC0,len
);