1 
printConf(void)2 char *AVDMVideoKeepOdd::printConf( void )
3 {
4         static char buf[50];
5 
6         sprintf((char *)buf," Keep Odd Fields");
7         return buf;
8 }
printConf(void)9 char *AVDMVideoKeepEven::printConf( void )
10 {
11         static char buf[50];
12 
13         sprintf((char *)buf," Keep Even Fields");
14         return buf;
15 }
16 //_______________________________________________________________
AVDMVideoKeepOdd(AVDMGenericVideoStream * in,CONFcouple * setup)17 AVDMVideoKeepOdd::AVDMVideoKeepOdd(
18                                                                         AVDMGenericVideoStream *in,CONFcouple *setup)
19 {
20 UNUSED_ARG(setup);
21         _in=in;
22         memcpy(&_info,_in->getInfo(),sizeof(_info));
23         _uncompressed=new ADMImage(_info.width,_info.height);
24         _info.height>>=1;
25 
26 }
27 // ___ destructor_____________
~AVDMVideoKeepOdd()28 AVDMVideoKeepOdd::~AVDMVideoKeepOdd()
29 {
30         delete _uncompressed;
31         _uncompressed=NULL;
32 
33 }
34 
35 
36 
getFrameNumberNoAlloc(uint32_t frame,uint32_t * len,ADMImage * data,uint32_t * flags)37 uint8_t AVDMVideoKeepOdd::getFrameNumberNoAlloc(uint32_t frame,
38                                 uint32_t *len,
39                                 ADMImage *data,
40                                 uint32_t *flags)
41 {
42 //static Image in,out;
43                 if(frame>= _info.nb_frames) return 0;
44                         if(!_in->getFrameNumberNoAlloc(frame, len,_uncompressed,flags)) return 0;
45 
46 
47                 uint32_t w=_info.width;
48                 uint32_t h=_info.height;
49 
50                 vidFieldKeepOdd(  w,  h, YPLANE(_uncompressed),YPLANE(data));
51                 data->copyInfo(_uncompressed);
52 
53       return 1;
54 }
55 
getFrameNumberNoAlloc(uint32_t frame,uint32_t * len,ADMImage * data,uint32_t * flags)56 uint8_t AVDMVideoKeepEven::getFrameNumberNoAlloc(uint32_t frame,
57                                 uint32_t *len,
58                                 ADMImage *data,
59                                 uint32_t *flags)
60 {
61 //static Image in,out;
62                         if(frame>=_info.nb_frames) return 0;
63 
64 
65                         // read uncompressed frame
66                 if(!_in->getFrameNumberNoAlloc(frame, len,_uncompressed,flags)) return 0;
67 
68                 uint32_t w=_info.width;
69                 uint32_t h=_info.height;
70 
71 
72                 data->copyInfo(_uncompressed);
73                 vidFieldKeepEven(  w,  h, YPLANE(_uncompressed),YPLANE(data));
74       return 1;
75 }