<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 7/7/22 19:13, John P Poet wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CACSqvJnP3_GpBCnpCrzJOJw_pJa8vvsjFxBM=YAj2tQ4W6dxwA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">On Thu, Jul 7, 2022 at 5:02 PM David Engel <<a
href="mailto:david@istwok.net" moz-do-not-send="true"
class="moz-txt-link-freetext">david@istwok.net</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">On Thu, Jul 07, 2022 at
01:33:49PM -0600, John P Poet wrote:<br>
> Hi David,<br>
> <br>
> After a call to<br>
> CardUtil::CreateCaptureCard()<br>
> and<br>
> CardUtil::CreateCardInput()<br>
> <br>
> The resulting capturecard and inputgroup tables look
like:<br>
> <br>
> select * from capturecard;<br>
>
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+<br>
> | cardid | parentid | videodevice<br>
> | audiodevice | vbidevice | cardtype |
defaultinput |<br>
> audioratelimit | hostname | dvb_swfilter |
dvb_sat_type |<br>
> dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand |
dvb_diseqc_type |<br>
> firewire_speed | firewire_model | firewire_connection |
signal_timeout |<br>
> channel_timeout | dvb_tuning_delay | contrast |
brightness | colour | hue |<br>
> diseqcid | dvb_eitscan | inputname | sourceid |
externalcommand |<br>
> changer_device | changer_model | tunechan | startchan |
displayname |<br>
> dishnet_eit | recpriority | quicktune | schedorder |
livetvorder | reclimit<br>
> | schedgroup |<br>
>
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+<br>
> | 1 | 0 | /usr/local/bin/mythexternrecorder
--conf<br>
> /home/mythtv/etc/mag-1-2.conf | NULL | NULL
| EXTERNAL |<br>
> Television | NULL | <a
href="http://cubic.sobie.us" rel="noreferrer"
target="_blank" moz-do-not-send="true">cubic.sobie.us</a>
| 0 |<br>
> 0 | 1 | 0 |
1 | 0<br>
> | 0 | NULL | 0
| 0 |<br>
> 4000 | 0 | 0 |
0 | 0 | 0 |<br>
> NULL | 0 | MPEG2TS | 2 |
|<br>
> | | | | mag/1-2
| 0 |<br>
> 1 | 0 | 1 | 0 |
1 | 1 |<br>
>
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+<br>
> 1 row in set (0.001 sec)<br>
> <br>
> select * from inputgroup;<br>
>
+-------------+--------------+-----------------------------------------------------------------------------------------+<br>
> | cardinputid | inputgroupid | inputgroupname<br>
> |<br>
>
+-------------+--------------+-----------------------------------------------------------------------------------------+<br>
> | 0 | 1 | <a
href="http://cubic.sobie.us" rel="noreferrer"
target="_blank" moz-do-not-send="true">cubic.sobie.us</a>|/usr/local/bin/mythexternrecorder<br>
> --conf /home/mythtv/etc/mag-1-2.conf|1 |<br>
> | 1 | 1 | <a
href="http://cubic.sobie.us" rel="noreferrer"
target="_blank" moz-do-not-send="true">cubic.sobie.us</a>|/usr/local/bin/mythexternrecorder<br>
> --conf /home/mythtv/etc/mag-1-2.conf|1 |<br>
>
+-------------+--------------+-----------------------------------------------------------------------------------------+<br>
> 2 rows in set (0.001 sec)<br>
> <br>
> I am curious about the entry in inputgroup with a
cardinputid of zero (0).<br>
> Is that what you would expect to see or is something
amiss?<br>
> <br>
> I know you did some magic to make "multirec" work
without having to create<br>
> a bunch of inputs. Does this happen automatically with
a call<br>
> CardUtil::CreateCaptureCard() and/or
CardUtil::CreateCardInput(), or are<br>
> extra steps necessary? I see that the default
"reclimit" is 1, but did not<br>
> dig enough to see if that is still relevant. Does the
multirec magic happen<br>
> when schedgroup is 1?<br>
> <br>
> To be clear, I am making these calls via the
ServicesAPI and want to make<br>
> sure I am not missing any steps. I do want multirec to
work.<br>
<br>
Okay. I've refreshed my memory and remember what a mess is
still left<br>
over.<br>
<br>
The inputgroup entry with cardinputid = 0 is a hold over
from Daniel<br>
K's bad design of that table. Basically, that entry is a
placeholder<br>
for the mythtv-setup GUI to see the group name. It's
eventually<br>
cleaned up when CardUtil::UnlinkInputGroup(0, 0) is called.
The<br>
services API or whatever it ultimately calls also needs to
make sure<br>
that cleanup occurs. It's harmless as there can never be an
inputid =<br>
0 but still should be cleaned up.<br>
<br>
The separate CardUtil::CreateCaptureCard() and<br>
CardUtil::CreateCardInput() methods are a holdover from the
very, old<br>
days when they were truly separate. The intent that was
never<br>
finished was to combine the mythtv-setup screens for capture
cards and<br>
inputs together. The new services API should not perpetuate
that<br>
split card/input interface. IOW, the new API should have a
single<br>
CreateInput() method exposed to API users. (*) (**). As
I've stated<br>
before the old, services API for cards and inputs was so
bad, it<br>
should simple be deleted and never spoken of again.<br>
<br>
David<br>
<br>
(*)At the time card/input was refactored, "input" was chosen
as the<br>
perferred name for tuner thingies. I think all user-facing
code<br>
except mythtv-setup tries to follow that naming.<br>
<br>
(**)Unless you are feeling really enegetic and want to
rewrite much of<br>
CardUtil and it's callers to fully eradicate the remaining
vestiges of<br>
separete cards and inputs, the API will need to call the
separate,<br>
lower, level methods in the right way. See
CaptureCard::Save() and<br>
CardInput::Save() in videosource.cpp for examples.<br>
<br>
-- <br>
David Engel</blockquote>
<div><br>
</div>
<div>My first thought was that CardUtil::UnlinkInputGroup(0,
0) should be added to the bottom of
CardUtil::CreateCardInput, but that would be <i>slightly</i>
inefficient. <br>
</div>
<div><br>
</div>
<div>Apparently there is an issue with the ServicesAPI and a
limit to the maximum number of arguments. With V2, long
argument lists are being passed as JSON to get around that
issue. I will take a look at merging the capturecard and
cardinput API calls for V2.</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<p>I am already using the capturecard apis as they are now, in
developing the new setup pages. The new setup works the same as
the old setup. If you want to join the capture card creation page
with the input setup page let me know how it should look. The
problem I see is that you have to set up the listings source
before you set up the input, so it makes somewhat sense to have
them separate, i.e. create capture card, then create listings
source, then link them up using the input setup. Otherwise you
would have to set up your listings source before the capture card.</p>
<p>Another problem is that there will be some 10 capture card setup
pages to be developed, for all the capture card types, but it
seems tedious to have the input setup process repeated in the code
10 times for each capture card type.<br>
</p>
<p>You can test the setup pages I have already done. I have done the
general setup, and the ceton and DVB capture cards so far, plus
the deletion of cards, delete all cards, delete all cards on all
hosts.</p>
<p>The update for capture cards via the API is rather primitive and
different from others, you specify database columns to update one
at a time. I have used it anyway.<br>
</p>
<p>Peter<br>
</p>
<p><br>
</p>
</body>
</html>