Bengt Martensson on Sat, 27 May 2006 12:24:34 +0200 (CEST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

apps/tuxbox/neutrino/daemons/controld controld.cpp scart.conf avs_settings.cpp


barf        06/05/27 12:24:34

  Modified:    tuxbox/neutrino/daemons/controld controld.cpp scart.conf
  Added:       tuxbox/neutrino/daemons/controld avs_settings.cpp
  Log:
  General overhaul of controld etc to get the video outputs right, see http://forum.tuxbox.org/forum/viewtopic.php?t=39520
  
  Revision  Changes    Path
  1.118     +375 -208  apps/tuxbox/neutrino/daemons/controld/controld.cpp
  
  file : http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/controld.cpp?rev=1.118&content-type=text/vnd.viewcvs-markup
  plain: http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/controld.cpp?rev=1.118&content-type=text/plain
  revision graph: http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/controld.cpp?graph=1.118
  diff : http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/controld.cpp.diff?r1=1.117&r2=1.118
  
  Index: controld.cpp
  ===================================================================
  RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/daemons/controld/controld.cpp,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- controld.cpp	22 May 2004 14:34:09 -0000	1.117
  +++ controld.cpp	27 May 2006 10:24:34 -0000	1.118
  @@ -22,7 +22,8 @@
   */
   
   #define USE_LIBTUXBOX 1
  -
  +#define CONFIG_FILE
  +//#define TRACE
   #include <config.h>
   
   #include <fcntl.h>
  @@ -48,6 +49,8 @@
   #include <timerdclient/timerdclient.h>
   #include <irsend/irsend.h>
   
  +#include <fstream>
  +
   #include <basicserver.h>
   #include <configfile.h>
   #include <eventserver.h>
  @@ -63,7 +66,6 @@
   #define AVS_DEVICE	"/dev/dbox/avs0"
   #define SAA7126_DEVICE	"/dev/dbox/saa0"
   
  -
   CZapitClient	zapit;
   CTimerdClient	timerd;
   CEventServer	*eventServer;
  @@ -79,28 +81,250 @@
   	bool mute_avs;
   	bool scale_logarithmic;
   	bool scale_logarithmic_avs;
  -	int  videooutput;
  +	CControld::video_format vcroutput;
  +	CControld::video_format videooutput;
   	int  videoformat;
   	int  csync;
   	CControld::volume_type volume_type;
   	CControld::tuxbox_maker_t boxtype; // not part of the config - set by setBoxType()
   } settings;
   
  -int	nokia_scart[7];
  -int	nokia_dvb[6];
  -int	sagem_scart[7];
  -int	sagem_dvb[6];
  -int	philips_scart[7];
  -int	philips_dvb[6];
  +// A value that can be put into the AVS-Switch (0..7)
  +typedef unsigned char switchvalue;
  +
  +struct tv_format {
  +  switchvalue cvbs;
  +  switchvalue rgb;
  +  switchvalue svideo;
  +  switchvalue yuv_vbs;
  +  switchvalue yuv_cvbs;
  +};
  +
  +struct vcr_format {
  +  switchvalue cvbs;
  +  switchvalue svideo;
  +};
  +
  +struct tv_vcr_format {
  +  vcr_format cvbs;
  +  vcr_format rgb;
  +  vcr_format svideo;
  +  vcr_format yuv_vbs;
  +  vcr_format yuv_cvbs;
  +};
  +
  +struct  avs_settings {
  +  tv_format v1;
  +  switchvalue a1;
  +  tv_vcr_format v2;
  +  switchvalue a2;
  +  tv_format v3;
  +  switchvalue a3;
  +  switchvalue fblk;
  +};
  +
  +struct avs_vendor_settings {
  +  avs_settings dvb_settings;
  +  avs_settings scart_settings;
  +};
  +
  +avs_vendor_settings current_avs_settings;
   char aspectRatio_vcr;
   char aspectRatio_dvb;
   bool vcr;
   bool videoOutputDisabled;
   
  -
  +void routeVideo();
   
   void sig_catch(int);
   
  +#include "avs_settings.cpp"
  +
  +#ifdef CONFIG_FILE
  +
  +#ifdef TRACE
  +void print_avs_settings(avs_settings settings) {
  +  printf("{%d %d %d %d %d} %d {{%d %d} {%d %d} {%d %d} {%d %d} {%d %d}} %d {%d %d %d %d %d} %d %d\n",
  +	 (int) settings.v1.cvbs,
  +	 (int) settings.v1.rgb,
  +	 (int) settings.v1.svideo,
  +	 (int) settings.v1.yuv_vbs,
  +	 (int) settings.v1.yuv_cvbs,
  +	 (int) settings.a1,
  +	 (int) settings.v2.cvbs.cvbs,
  +	 (int) settings.v2.cvbs.svideo,
  +	 (int) settings.v2.rgb.cvbs,
  +	 (int) settings.v2.rgb.svideo,
  +	 (int) settings.v2.svideo.cvbs,
  +	 (int) settings.v2.svideo.svideo,
  +	 (int) settings.v2.yuv_vbs.cvbs,
  +	 (int) settings.v2.yuv_vbs.svideo,
  +	 (int) settings.v2.yuv_cvbs.cvbs,
  +	 (int) settings.v2.yuv_cvbs.svideo,
  +	 (int) settings.a2,
  +	 (int) settings.v3.cvbs,
  +	 (int) settings.v3.rgb,
  +	 (int) settings.v3.svideo,
  +	 (int) settings.v3.yuv_vbs,
  +	 (int) settings.v3.yuv_cvbs,
  +	 (int) settings.a3,
  +	 (int) settings.fblk);
  +}
  +#endif
  +
  +void nuke_leading_whitespace(std::string &s) {
  +  int pos = s.find_first_not_of(" \t");
  +  s.erase(0, pos);
  +}
  +
  +void setup_v1(tv_format &v1, switchvalue cvbs, switchvalue rgb, switchvalue svideo, switchvalue yuv_vbs, switchvalue yuv_cvbs) {
  +  v1.cvbs = cvbs;
  +  v1.rgb = rgb;
  +  v1.svideo = svideo;
  +  v1.yuv_vbs = yuv_vbs;
  +  v1.yuv_cvbs = yuv_cvbs;
  +}
  +
  +void setup_v1(tv_format &v1, std::string v1_string) {
  +  int cvbs, rgb, svideo, yuv_vbs, yuv_cvbs;
  +  sscanf(v1_string.c_str(), "%d %d %d %d %d", &cvbs, &rgb, &svideo, &yuv_vbs, &yuv_cvbs);
  +  setup_v1(v1, cvbs, rgb, svideo, yuv_vbs, yuv_cvbs);
  +}
  +
  +void setup_tv(tv_format &v1, std::string &line) {
  +  nuke_leading_whitespace(line);
  +  if (line[0] == '{') {
  +    int pos = line.find("}");
  +    setup_v1(v1, line.substr(1, pos-1));
  +    line.erase(0,pos+1);
  +  } else {
  +    int n;
  +    sscanf(line.c_str(), "%d", &n);
  +    setup_v1(v1, n, n, n, n, n);
  +    line.erase(0,1);
  +  }
  +}
  +
  +void setup_v2(tv_vcr_format &v2,
  +	      switchvalue cvbs_cvbs,
  +	      switchvalue cvbs_svideo,
  +	      switchvalue rgb_cvbs,
  +	      switchvalue rgb_svideo,
  +	      switchvalue svideo_cvbs,
  +	      switchvalue svideo_svideo,
  +	      switchvalue yuv_vbs_cvbs,
  +	      switchvalue yuv_vbs_svideo,
  +	      switchvalue yuv_cvbs_cvbs,
  +	      switchvalue yuv_cvbs_svideo) {	 
  +  v2.cvbs.cvbs = cvbs_cvbs;
  +  v2.cvbs.svideo = cvbs_svideo;
  +  v2.rgb.cvbs = rgb_cvbs;
  +  v2.rgb.svideo = rgb_svideo;
  +  v2.svideo.cvbs = svideo_cvbs;
  +  v2.svideo.svideo = svideo_svideo;
  +  v2.yuv_vbs.cvbs = yuv_vbs_cvbs;
  +  v2.yuv_vbs.svideo = yuv_vbs_svideo;
  +  v2.yuv_cvbs.cvbs = yuv_cvbs_cvbs;
  +  v2.yuv_cvbs.svideo = yuv_cvbs_svideo;
  +}
  +
  +void setup_v2(tv_vcr_format &v2, std::string &line) {
  +  int cvbs_cvbs;
  +  int cvbs_svideo;
  +  int rgb_cvbs;
  +  int rgb_svideo;
  	<<Truncated>>
  
  
  1.8       +7 -7      apps/tuxbox/neutrino/daemons/controld/scart.conf
  
  file : http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/scart.conf?rev=1.8&content-type=text/vnd.viewcvs-markup
  plain: http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/scart.conf?rev=1.8&content-type=text/plain
  revision graph: http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/scart.conf?graph=1.8
  diff : http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/scart.conf.diff?r1=1.7&r2=1.8
  
  Index: scart.conf
  ===================================================================
  RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/daemons/controld/scart.conf,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- scart.conf	4 Jan 2003 16:45:15 -0000	1.7
  +++ scart.conf	27 May 2006 10:24:34 -0000	1.8
  @@ -1,7 +1,7 @@
  -#typ_vcr/dvb: 	v1 a1 v2 a2 v3 a3 (vcr_only: fblk)
  -nokia_scart: 	3 2 1 0 1 1
  -nokia_dvb: 	5 1 1 0 1 1
  -sagem_scart: 	2 1 0 0 0 0
  -sagem_dvb: 	0 0 0 0 0 0
  -philips_scart: 	3 3 2 2 3 2 
  -philips_dvb: 	1 1 1 1 1 1
  \ No newline at end of file
  +#		    v1      a1           v2                   a2       v3   a3 fblk
  +nokia_scart:     {3 3 3 3 3} 2 {{1 7} {1 7} {1 7} {1 7} {1 7}} 2 {3 3 3 3 3} 2 2
  +nokia_dvb:       {1 5 4 5 5} 1 {{1 2} {1 7} {1 2} {7 7} {1 7}} 1 {0 0 0 0 0} 1
  +sagem_scart:     {2 2 2 2 2} 1 {{0 0} {0 0} {0 0} {0 0} {0 0}} 1 {0 0 0 0 0} 1 3
  +sagem_dvb:       {0 0 1 0 0} 0 {{0 1} {0 7} {0 1} {7 7} {0 7}} 0 {0 0 0 0 0} 0
  +philips_scart:   {3 3 3 3 3} 3 {{2 2} {2 2} {2 2} {2 2} {2 2}} 2 {3 3 3 3 3} 2 3
  +philips_dvb:     {1 1 1 1 1} 1 {{1 1} {1 1} {1 1} {1 1} {1 1}} 1 {1 1 1 1 1} 1
  
  
  
  1.1                  apps/tuxbox/neutrino/daemons/controld/avs_settings.cpp
  
  file : http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/avs_settings.cpp?rev=1.1&content-type=text/vnd.viewcvs-markup
  plain: http://cvs.tuxbox.org/tuxbox/apps/tuxbox/neutrino/daemons/controld/avs_settings.cpp?rev=1.1&content-type=text/plain
  
  Index: avs_settings.cpp
  ===================================================================
  avs_vendor_settings nokia_settings = {
      // v1      a1           v2                     a2       v3     a3 fblk
    {{1,5,4,5,5}, 1, {{1,2},{1,7},{1,2},{7,7},{1,7}}, 1, {0,0,0,0,0}, 1, 0}, // DVB
    {{3,3,3,3,3}, 2, {{1,7},{1,7},{1,7},{1,7},{1,7}}, 2, {3,3,3,3,3}, 2, 2} // Scart
  };
  avs_vendor_settings sagem_settings = {
      // v1      a1           v2                     a2       v3     a3 fblk
    {{0,0,1,0,0}, 0, {{0,1},{0,7},{0,1},{7,7},{0,7}}, 0, {0,0,0,0,0}, 0, 0}, // DVB
    {{2,2,2,2,2}, 1, {{0,0},{0,0},{0,0},{0,0},{0,0}}, 1, {0,0,0,0,0}, 1, 3} // Scart
  };
  avs_vendor_settings philips_settings = {
      // v1      a1           v2                     a2       v3     a3 fblk
    {{1,1,1,1,1}, 1, {{1,1},{1,1},{1,1},{1,1},{1,1}}, 1, {1,1,1,1,1}, 1, 0}, // DVB
    {{3,3,3,3,3}, 3, {{2,2},{2,2},{2,2},{2,2},{2,2}}, 2, {3,3,3,3,3}, 2, 3} // Scart
  };
  
  
  

-- 
To UNSUBSCRIBE, email to tuxbox-cvs-request@cvs.tuxbox.org
with a subject of "unsubscribe". Trouble? Contact listmaster@cvs.tuxbox.org