1 #ifndef MPLAYER_TVI_DEF_H
2 #define MPLAYER_TVI_DEF_H
4 #include <stdlib.h> /* malloc */
5 #include <string.h> /* memset */
6 #include "libmpcodecs/img_format.h"
9 static int init(priv_t
*priv
);
10 static int uninit(priv_t
*priv
);
11 static int control(priv_t
*priv
, int cmd
, void *arg
);
12 static int start(priv_t
*priv
);
13 static double grab_video_frame(priv_t
*priv
, char *buffer
, int len
);
14 static int get_video_framesize(priv_t
*priv
);
15 static double grab_audio_frame(priv_t
*priv
, char *buffer
, int len
);
16 static int get_audio_framesize(priv_t
*priv
);
18 int teletext_control(void* p
, int cmd
, void *arg
);
20 static const tvi_functions_t functions
=
32 static tvi_handle_t
*new_handle(void)
34 tvi_handle_t
*h
= (tvi_handle_t
*)malloc(sizeof(tvi_handle_t
));
38 h
->priv
= (priv_t
*)malloc(sizeof(priv_t
));
44 memset(h
->priv
, 0, sizeof(priv_t
));
45 h
->functions
= &functions
;
55 static void free_handle(tvi_handle_t
*h
)
67 Fills video frame in given buffer with blue color for yv12,i420,uyvy,yuy2.
68 Other formats will be filled with 0xC0
70 static inline void fill_blank_frame(char* buffer
,int len
,int fmt
){
72 // RGB(0,0,255) <-> YVU(41,110,240)
76 memset(buffer
, 41,4*len
/6); //Y
77 memset(buffer
+4*len
/6, 110,len
/6);//V
78 memset(buffer
+5*len
/6, 240,len
/6);//U
81 memset(buffer
, 41,4*len
/6); //Y
82 memset(buffer
+4*len
/6, 240,len
/6);//U
83 memset(buffer
+5*len
/6, 110,len
/6);//V
103 This is compressed format. I don't know yet how to fill such frame with blue color.
104 Keeping frame unchanged.
108 memset(buffer
,0xC0,len
);
112 #endif /* MPLAYER_TVI_DEF_H */