[mythtv] PATCH: TVFormat

Brad Allen Ulmo-myth-dev at usenet.Q.Net
Thu Jan 15 21:22:36 EST 2004


From: Isaac Richards <ijr at po.cwru.edu>
Subject: Re: [mythtv] PATCH: TVFormat
Date: Thu, 15 Jan 2004 16:21:50 -0500

> The native alsa support does not belong in the docs, as it's not
> finished or working right.

With that change, here are the two patches again:

First one is to channelsettings.cpp, same as before: lets user set up
mythconverg.channel.tvformat in myth setup's new channel editor.  This
is useful for Myth systems that have multiple formats, such as both
NTSC and ATSC.

Are you resisting this because this format is not finalized?  I guess
that means right now pcHDTV HD-2000 users with other cards elsewhere
also in Myth that can do NTSC (such as any v4l card, PVR 250 or 350
card, or an HD-2000 with normal v4l support) will always have to use
mysql, even though that seems unecessary to me for something that
really wouldn't require it with this simple patch.

There are certainly a lot of other issues to solve with pcHDTV HD-2000:

*  Input port first or second (not addressed or affected by this patch)
*  Switching modes on the card (ATSC vs. NTSC)

All this patch does is tell Myth which format that particular channel
will be when it gets to the card.  Is there another way we're
standardizing on for this, and mythconverg.channel.tvformat is
deprecated?

While figuring out how to make this little patched code, I copied that
data from two other sources, as found easily again with this find
command:

$ find -name '*.cpp' |xargs egrep -e NTSC-JP
./libs/libmythtv/channelsettings.cpp:   addSelection("NTSC-JP");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ my new entry
./libs/libmythtv/channel.cpp:        else if (fmt == "NTSC-JP")
./libs/libmythtv/channel.cpp:    else if (fmt == "NTSC-JP")
./setup/backendsettings.cpp:        addSelection("NTSC-JP");
$ 

Ideally, there would be one table of these someplace, and only one place
to update them, since now there are three duplicates of the same data.
Would you like me to make a simple table someplace that does that?
It would be something like:

struct tvformattypes_t {
  char *fmt;
//  ./libs/libmythtv/channel.h:    int videomode;
// perhaps should be typedef int videomode_t; videomode_t videomode; ??
// ditto for mode
  int v4l2_videomode, v4l_mode;
} tvformattypes[]={
	{"NTSC", V4L2_STD_NTSC, VIDEO_MODE_NTSC}, 
	{"ATSC", V4L2_STD_ATSC_8_VSB, VIDEO_MODE_ATSC}, 
	{"PAL", V4L2_STD_PAL, VIDEO_MODE_PAL}, 
	{"SECAM", V4L2_STD_SECAM, VIDEO_MODE_SECAM}, 
	{"PAL-NC", V4L2_STD_PAL_Nc, 3}, 
	{"PAL-M", V4L2_STD_PAL_M, 4}, 
	{"PAL-N", V4L2_STD_PAL_N, 5}, 
	{"NTSC-JP", V4L2_STD_NTSC_M_JP, 6}, 
	{NULL,0,0}};

in some public code in some file in libmythtv.  Then, each one would
just do its thing -- in channel.cpp, v4l2 would
strncmp(...tvformattypes[i].fmt...) each one for
tvformattypes[i].v4l2_videomode, v4l would
strncmp(...tvformattypes[i].fmt...) each one for
tvformattypes[i].v4l_mode, and the two setup screens would each
addSelection(tvformattypes[i].fmt) each one (with a preceding
addSelection("Default") in channelsettings.cpp).

Isaac, do you want me to make the above changes, or just keep the
patches as is?  Since I don't know C++, it'll look more like C until
someone C++ifies it.


Second patch is to docs, and this time only includes a small amount
about the above field, and a new section to include the abovementioned
channel editor; I took out the old ALSA stuff I had in there from last
time.  I simply referred to my copious help field in the code from the
HOWTO, since I didn't think it would make sense to be redundant.  I
left out the PDF file again, since it is far different between our
systems.
-------------- next part --------------
Index: channelsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/channelsettings.cpp,v
retrieving revision 1.4
diff -u -b -r1.4 channelsettings.cpp
--- channelsettings.cpp	3 Jan 2004 02:58:03 -0000	1.4
+++ channelsettings.cpp	16 Jan 2004 01:22:24 -0000
@@ -103,6 +103,30 @@
     };
 };
 
+class TVFormat: public ComboBoxSetting, public CSetting {
+public:
+    TVFormat(const ChannelID& id):
+	ComboBoxSetting(), CSetting(id, "tvformat") {
+	setLabel("TV Format");
+	setHelpText("If this channel uses a format other than TV Format "
+		    "in the General Backend Setup screen, set it here.  "
+		    "Default is to use TV Format from General Backend Setup.  "
+		    "Example is if you have NTSC set in General Backend "
+		    "Setup, but also have a pcHDTV HD-2000 card and this "
+ 		    "is an ATSC channel; you'd select ATSC here; otherwise, "
+		    "if it is NTSC, you could leave Default or select NTSC.");
+	addSelection("Default");
+	addSelection("NTSC");
+	addSelection("ATSC");
+	addSelection("PAL");
+	addSelection("SECAM");
+	addSelection("PAL-NC");
+	addSelection("PAL-M");
+	addSelection("PAL-N");
+	addSelection("NTSC-JP");
+    };
+};
+
 class Rank: public SpinBoxSetting, public CSetting {
 public:
     Rank(const ChannelID& id):
@@ -500,6 +524,7 @@
 
     VerticalConfigurationGroup* right = new VerticalConfigurationGroup(false, true);
     right->addChild(new Source(id));
+    right->addChild(new TVFormat(id));
     right->addChild(new Rank(id));
     group1->addChild(right);
 
-------------- next part --------------
Index: mythtv-HOWTO-9.html
===================================================================
RCS file: /var/lib/mythcvs/mythtv/docs/mythtv-HOWTO-9.html,v
retrieving revision 1.41
diff -u -b -B -r1.41 mythtv-HOWTO-9.html
--- mythtv-HOWTO-9.html	1 Jan 2004 18:04:58 -0000	1.41
+++ mythtv-HOWTO-9.html	16 Jan 2004 01:53:52 -0000
@@ -147,7 +147,8 @@
 appropriate value.  </P>
 <P>If you're outside of North America, then some manual interaction will be
 required with XMLTV.</P>
-<P>Once you have chosen your provider, press RETURN to continue.  XMLTV will
+<P>Once you have chosen your provider and set the appropriate frequency
+table for that video source, press RETURN to continue.  XMLTV will
 now begin collecting the initial data for your location.  The screen may
 blank for a few seconds to several minutes, depending on the load of the
 listings provider and the speed of your connection to the Internet.  Be
@@ -185,6 +186,14 @@
 <P>Press ESC to return to the main menu, and press ESC again if you have no
 further items to configure, thereby returning you to the command line.</P>
 
+<H3>Channel Editor</H3>
+
+<P>It's useful to return to this screen after
+<CODE>mythfilldatabase</CODE> has populated the channel table.  At that
+time, be sure to set TV Format to the proper value for any mixed TV
+format systems (e.g., a Myth setup with both NTSC and ATSC inputs);
+the help item for that setting is self explanatory.</P>
+
 <H2><A NAME="ss9.2">9.2</A> <A HREF="mythtv-HOWTO.html#toc9.2">Post-configuration.</A>
 </H2>
 
Index: mythtv-HOWTO-singlehtml.html
===================================================================
RCS file: /var/lib/mythcvs/mythtv/docs/mythtv-HOWTO-singlehtml.html,v
retrieving revision 1.51
diff -u -b -B -r1.51 mythtv-HOWTO-singlehtml.html
--- mythtv-HOWTO-singlehtml.html	13 Jan 2004 18:31:50 -0000	1.51
+++ mythtv-HOWTO-singlehtml.html	16 Jan 2004 01:54:27 -0000
@@ -2648,7 +2648,8 @@
 appropriate value.  </P>
 <P>If you're outside of North America, then some manual interaction will be
 required with XMLTV.</P>
-<P>Once you have chosen your provider, press RETURN to continue.  XMLTV will
+<P>Once you have chosen your provider and set the appropriate frequency
+table for that video source, press RETURN to continue.  XMLTV will
 now begin collecting the initial data for your location.  The screen may
 blank for a few seconds to several minutes, depending on the load of the
 listings provider and the speed of your connection to the Internet.  Be
@@ -2686,6 +2687,14 @@
 <P>Press ESC to return to the main menu, and press ESC again if you have no
 further items to configure, thereby returning you to the command line.</P>
 
+<H3>Channel Editor</H3>
+
+<P>It's useful to return to this screen after
+<CODE>mythfilldatabase</CODE> has populated the channel table.  At that
+time, be sure to set TV Format to the proper value for any mixed TV
+format systems (e.g., a Myth setup with both NTSC and ATSC inputs);
+the help item for that setting is self explanatory.</P>
+
 <H2><A NAME="ss9.2">9.2</A> <A HREF="#toc9.2">Post-configuration.</A>
 </H2>
 
Index: mythtv-HOWTO.sgml
===================================================================
RCS file: /var/lib/mythcvs/mythtv/docs/mythtv-HOWTO.sgml,v
retrieving revision 1.203
diff -u -b -B -r1.203 mythtv-HOWTO.sgml
--- mythtv-HOWTO.sgml	13 Jan 2004 18:32:35 -0000	1.203
+++ mythtv-HOWTO.sgml	16 Jan 2004 01:55:02 -0000
@@ -2245,7 +2245,8 @@
 If you're outside of North America, then some manual interaction will be
 required with XMLTV.
 
-Once you have chosen your provider, press RETURN to continue.  XMLTV will
+Once you have chosen your provider and set the appropriate frequency
+table for that video source, press RETURN to continue.  XMLTV will
 now begin collecting the initial data for your location.  The screen may
 blank for a few seconds to several minutes, depending on the load of the
 listings provider and the speed of your connection to the Internet.  Be
@@ -2287,6 +2288,13 @@
 Press ESC to return to the main menu, and press ESC again if you have no
 further items to configure, thereby returning you to the command line.
 
+<sect2>Channel Editor
+<p>It's useful to return to this screen after
+<tt>mythfilldatabase</tt> has populated the channel table.  At that
+time, be sure to set TV Format to the proper value for any mixed TV
+format systems (e.g., a Myth setup with both NTSC and ATSC inputs);
+the help item for that setting is self explanatory.
+
 <sect1>Post-configuration.
 <p>Run the <tt>mythfilldatabase</tt> program as directed.  The master
 backend will obtain guide data for all the video sources you defined during
Index: mythtv-HOWTO.txt
===================================================================
RCS file: /var/lib/mythcvs/mythtv/docs/mythtv-HOWTO.txt,v
retrieving revision 1.194
diff -u -b -B -r1.194 mythtv-HOWTO.txt
--- mythtv-HOWTO.txt	13 Jan 2004 18:32:38 -0000	1.194
+++ mythtv-HOWTO.txt	16 Jan 2004 01:55:31 -0000
@@ -113,6 +113,7 @@
         9.1.2 Capture Cards
         9.1.3 Video Sources
         9.1.4 Input Connections
+        9.1.5 Channel Editor
      9.2 Post-configuration.
      9.3 Configuring a non-master backend.
      9.4 Configuring and running mythfilldatabase.
@@ -2889,11 +2890,12 @@
   If you're outside of North America, then some manual interaction will
   be required with XMLTV.
 
-  Once you have chosen your provider, press RETURN to continue.  XMLTV
-  will now begin collecting the initial data for your location.  The
-  screen may blank for a few seconds to several minutes, depending on
-  the load of the listings provider and the speed of your connection to
-  the Internet.  Be patient!
+  Once you have chosen your provider and set the appropriate frequency
+  table for that video source, press RETURN to continue.  XMLTV will now
+  begin collecting the initial data for your location.  The screen may
+  blank for a few seconds to several minutes, depending on the load of
+  the listings provider and the speed of your connection to the
+  Internet.  Be patient!
 
   You will then be returned to the Video Sources screen.  If you have
   multiple video sources available, such as Antenna, Cable, etc, go
@@ -2937,6 +2939,15 @@
   line.
 
 
+  9.1.5.  Channel Editor
+
+  It's useful to return to this screen after mythfilldatabase has
+  populated the channel table.  At that time, be sure to set TV Format
+  to the proper value for any mixed TV format systems (e.g., a Myth
+  setup with both NTSC and ATSC inputs); the help item for that setting
+  is self explanatory.
+
+
   9.2.  Post-configuration.
 
   Run the mythfilldatabase program as directed.  The master backend will


More information about the mythtv-dev mailing list