00001 #include "videomux_ctl.h" 00002 #include <stdio.h> 00003 00004 VideoMuxCtl::VideoMuxCtl 00005 ( 00006 const Id& n, 00007 In<VYAimageType>& YUVimgTypeInF0, 00008 In<VYAimageType>& YUVimgTypeInF1, 00009 Out<VYAimageType>& YUVimgTypeOutF 00010 ) 00011 : 00012 Process(n), 00013 00014 YUVimgTypeInP0(id("YUVimgTypeInP0"), YUVimgTypeInF0), 00015 YUVimgTypeInP1(id("YUVimgTypeInP1"), YUVimgTypeInF1), 00016 YUVimgTypeOutP(id("YUVimgTypeOutP"), YUVimgTypeOutF) 00017 { 00018 } 00019 00020 const char* VideoMuxCtl::type() const 00021 { 00022 return "VideoMuxCtl"; 00023 } 00024 00025 void VideoMuxCtl::main() 00026 { 00027 VYAimageType imgType0; 00028 VYAimageType imgType1; 00029 00030 while(true) 00031 { 00032 read(YUVimgTypeInP0, imgType0); 00033 read(YUVimgTypeInP1, imgType1); 00034 00035 if (imgType0 == imgType1) 00036 { 00037 write(YUVimgTypeOutP, imgType0); 00038 } 00039 else 00040 { 00041 printf("%s: image types differ...exit now.\n",fullName()); 00042 exit(1); 00043 } 00044 } 00045 } 00046