Changeset 65bcb3938 in mythtv


Ignore:
Timestamp:
Dec 31, 2009, 9:57:50 PM (15 years ago)
Author:
Daniel Kristjansson <dkristjansson@…>
Branches:
devel/2020-player, devel/ffmpeg-resync, devel/gpu-commflag, fixes/0.23, fixes/0.24, fixes/0.25, fixes/0.26, fixes/0.27, fixes/0.28, fixes/29, fixes/30, fixes/31, github-templates, master
Children:
94c11af802
Parents:
ae87d9d58
Message:

Adds an import recorder.

This was written for my own frontend testing purposes. But with Chris Petersen's system events patch I think this can have more general usefulness.

The old method to use this was to look at the log and move the file into place.. but now you can actually just tie it to a script that is run on the recorded started event.

Mine just has this:
#!/bin/bash
echo start /bin/bash >> /tmp/rec-events.log
cp /video/testing/resolution-change.mpg /video/_.mpg
echo end /bin/bash >> /tmp/rec-events.log

With a RecordingStarted? event of /home/danielk/RecordingStarted.sh %CHANID% %STARTTIME%

git-svn-id: http://svn.mythtv.org/svn/trunk@23044 7dbf422c-18fa-0310-86e9-fd20926502f2

Location:
mythtv/libs/libmythtv
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • mythtv/libs/libmythtv/cardutil.cpp

    rae87d9d58 r65bcb3938  
    16221622    QStringList ret;
    16231623
    1624     if (("FIREWIRE"  == cardtype) ||
    1625         ("FREEBOX"   == cardtype) ||
    1626         ("HDHOMERUN" == cardtype))
    1627     {
     1624    if (IsSingleInputCard(cardtype))
    16281625        ret += "MPEG2TS";
    1629     }
    16301626    else if ("DVB" == cardtype)
    16311627        ret += ProbeDVBInputs(device);
     
    17511747    bool is_dtv = !IsEncoder(cardtype) && !IsUnscanable(cardtype);
    17521748
    1753     if (("FIREWIRE"  == cardtype) ||
    1754         ("FREEBOX"   == cardtype) ||
    1755         ("HDHOMERUN" == cardtype))
    1756     {
     1749    if (IsSingleInputCard(cardtype))
    17571750        inputs += "MPEG2TS";
    1758     }
    17591751    else if ("DVB" != cardtype)
    17601752        inputs += ProbeV4LVideoInputs(device);
  • mythtv/libs/libmythtv/cardutil.h

    rae87d9d58 r65bcb3938  
    6060        HDPVR     = 12,
    6161        DVBS2     = 13,
     62        IMPORT    = 14,
    6263    };
    6364
     
    9293        if ("DVB_S2" == name)
    9394            return DVBS2;
     95        if ("IMPORT" == name)
     96            return IMPORT;
    9497        return ERROR_UNKNOWN;
    9598    }
     
    99102        return
    100103            (rawtype != "DVB")       &&
    101             (rawtype != "FIREWIRE")  &&
     104            (rawtype != "FIREWIRE")  && (rawtype != "IMPORT") &&
    102105            (rawtype != "HDHOMERUN") && (rawtype != "FREEBOX");
    103106    }
     
    111114    {
    112115        return
    113             (rawtype == "FIREWIRE")  ||
     116            (rawtype == "FIREWIRE")  || (rawtype == "IMPORT") ||
    114117            (rawtype == "HDPVR"      || (rawtype == "V4L"));
    115118    }
     
    139142            (rawtype == "V4L")    || (rawtype == "MPEG") ||
    140143            (rawtype == "HDPVR");
     144    }
     145
     146    static bool         IsSingleInputCard(const QString &rawtype)
     147    {
     148        return
     149            (rawtype == "FIREWIRE")  || (rawtype == "FREEBOX") ||
     150            (rawtype == "HDHOMERUN") || (rawtype == "IMPORT");
    141151    }
    142152
  • mythtv/libs/libmythtv/dbcheck.cpp

    rae87d9d58 r65bcb3938  
    1818
    1919/// This is the DB schema version expected by the running MythTV instance.
    20 const QString currentDatabaseVersion = "1247";
     20const QString currentDatabaseVersion = "1248";
    2121
    2222static bool UpdateDBVersionNumber(const QString &newnumber);
     
    135135
    136136The 'defaultinput' field is a another important field for all
    137 cards except "FIREWIRE", "FREEBOX" and "HDHOMERUN" cards.
     137cards except "FIREWIRE", "FREEBOX", "HDHOMERUN", and "IMPORT" cards.
    138138It specifies which
    139139input of the card to use. This does not have to mean a specific
     
    49374937       if (!performActualUpdate(updates, "1247", dbver))
    49384938            return false;
    4939 
    4940        
    4941 
     4939    }
     4940
     4941    if (dbver == "1247")
     4942    {
     4943        const char *updates[] = {
     4944"INSERT INTO profilegroups SET name = \"Import Recorder\", cardtype = 'IMPORT', is_default = 1;",
     4945"INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 14;",
     4946"INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 14;",
     4947"INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 14;",
     4948"INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 14;",
     4949NULL
     4950};
     4951        if (!performActualUpdate(updates, "1248", dbver))
     4952            return false;
    49424953    }
    49434954
  • mythtv/libs/libmythtv/libmythtv.pro

    rae87d9d58 r65bcb3938  
    425425    SOURCES += dtvrecorder.cpp
    426426
     427    # Import recorder
     428    HEADERS += importrecorder.h
     429    SOURCES += importrecorder.cpp
     430
    427431    # Simple NuppelVideo Recorder
    428432    using_ffmpeg_threads:DEFINES += USING_FFMPEG_THREADS
  • mythtv/libs/libmythtv/tv_rec.cpp

    rae87d9d58 r65bcb3938  
    5555#include "iptvrecorder.h"
    5656#include "firewirerecorder.h"
     57#include "importrecorder.h"
    5758
    5859#include "channelgroup.h"
     
    180181#endif
    181182    }
    182     else if (genOpt.cardtype == "MPEG" &&
    183              genOpt.videodev.toLower().left(5) == "file:")
     183    else if ((genOpt.cardtype == "IMPORT") ||
     184             (genOpt.cardtype == "MPEG" &&
     185              genOpt.videodev.toLower().left(5) == "file:"))
    184186    {
    185187        channel = new DummyChannel(this);
     
    395397
    396398    // If this isn't a recording for this instance to make, we are done
    397     if (rcinfo->cardid != cardid)
     399    if (rcinfo->cardid != (uint)cardid)
    398400        return;
    399401
     
    10161018        recorder->SetOption("mrl", genOpt.videodev);
    10171019#endif // USING_IPTV
     1020    }
     1021    else if (genOpt.cardtype == "IMPORT")
     1022    {
     1023        recorder = new ImportRecorder(this);
    10181024    }
    10191025    else
     
    16181624    if ((1 == pendingRecordings.size()) &&
    16191625        (*it).ask &&
    1620         ((*it).info->cardid == cardid) &&
     1626        ((*it).info->cardid == (uint)cardid) &&
    16211627        (GetState() == kState_WatchingLiveTV))
    16221628    {
     
    39923998    if (lastTuningRequest.flags & kFlagRecording)
    39933999    {
    3994         SetRingBuffer(new RingBuffer(rec->GetFileName(), true));
    3995         if (!ringBuffer->IsOpen())
     4000        bool write = genOpt.cardtype != "IMPORT";
     4001        VERBOSE(VB_IMPORTANT, LOC + QString("rec->GetFileName(): '%1'")
     4002                .arg(rec->GetFileName()));
     4003        SetRingBuffer(new RingBuffer(rec->GetFileName(), write));
     4004        if (!ringBuffer->IsOpen() && write)
    39964005        {
    39974006            VERBOSE(VB_IMPORTANT, LOC_ERR +
  • mythtv/libs/libmythtv/videosource.cpp

    rae87d9d58 r65bcb3938  
    16331633};
    16341634
     1635class ImportConfigurationGroup : public VerticalConfigurationGroup
     1636{
     1637  public:
     1638    ImportConfigurationGroup(CaptureCard& a_parent):
     1639       VerticalConfigurationGroup(false, true, false, false),
     1640       parent(a_parent)
     1641    {
     1642        setUseLabel(false);
     1643        addChild(new SingleCardInput(parent));
     1644    };
     1645
     1646  private:
     1647    CaptureCard &parent;
     1648};
     1649
    16351650class HDHomeRunExtra : public ConfigurationWizard
    16361651{
     
    19982013    addTarget("FREEBOX",   new IPTVConfigurationGroup(parent));
    19992014#endif // USING_IPTV
     2015
     2016    addTarget("IMPORT",    new ImportConfigurationGroup(parent));
    20002017}
    20012018
     
    22012218    setting->addSelection(QObject::tr("Network Recorder"), "FREEBOX");
    22022219#endif // USING_IPTV
     2220
     2221    setting->addSelection(QObject::tr("Import Recorder"), "IMPORT");
    22032222}
    22042223
Note: See TracChangeset for help on using the changeset viewer.