summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gardiner <paul@plonty.site>2011-07-05 19:39:17 (GMT)
committer Paul Gardiner <paul@plonty.site>2011-07-05 19:53:23 (GMT)
commit488c7c18a9b7df8e0ffbde543f3477c122bf6f01 (patch)
treed4a8c97d201be66f6d2e576ae742f98554403a2e
parent90ac990bf0d2cfb3c7ea798b65a58239f5b845a6 (diff)
Display format information for the fifo data
-rwxr-xr-xmythtv/programs/mythtranscode/main.cpp20
-rwxr-xr-x[-rw-r--r--]mythtv/programs/mythtranscode/transcode.cpp26
-rwxr-xr-x[-rw-r--r--]mythtv/programs/mythtranscode/transcode.h2
3 files changed, 46 insertions, 2 deletions
diff --git a/mythtv/programs/mythtranscode/main.cpp b/mythtv/programs/mythtranscode/main.cpp
index e396e76..71adf70 100755
--- a/mythtv/programs/mythtranscode/main.cpp
+++ b/mythtv/programs/mythtranscode/main.cpp
@@ -57,6 +57,7 @@ static void usage(char *progname)
cerr << "\t If --fifodir is specified, 'audout' and 'vidout'\n";
cerr << "\t will be created in the specified directory\n";
cerr << "\t--fifosync : Enforce fifo sync\n";
+ cerr << "\t--fifoinfo : Stop after displaying the format of the fifo data\n";
cerr << "\t--buildindex or -b: Build a new keyframe index\n";
cerr << "\t (use only if audio and video fifos are read independantly)\n";
cerr << "\t--video : Specifies that this is not a mythtv recording\n";
@@ -145,6 +146,7 @@ int main(int argc, char *argv[])
int otype = REPLEX_MPEG2;
bool useCutlist = false, keyframesonly = false;
bool build_index = false, fifosync = false, showprogress = false, mpeg2 = false;
+ bool fifo_info = false;
QMap<QString, QString> settingsOverride;
frm_dir_map_t deleteMap;
frm_pos_map_t posMap;
@@ -399,6 +401,10 @@ int main(int argc, char *argv[])
return TRANSCODE_EXIT_INVALID_CMDLINE;
}
}
+ else if (!strcmp(a.argv()[argpos],"--fifoinfo"))
+ {
+ fifo_info = true;
+ }
else if (!strcmp(a.argv()[argpos],"-ro") ||
!strcmp(a.argv()[argpos],"--recorderOptions"))
{
@@ -562,6 +568,18 @@ int main(int argc, char *argv[])
cerr << "Must specify --fifodir to use --fifosync\n";
return TRANSCODE_EXIT_INVALID_CMDLINE;
}
+ if (fifo_info && !fifodir.isEmpty())
+ {
+ cerr << "Cannot specify both --fifodir and --fifoinfo\n";
+ return TRANSCODE_EXIT_INVALID_CMDLINE;
+ }
+
+ if (fifo_info)
+ {
+ // Setup a dummy fifodir path, so that the "fifodir" code path
+ // is taken. The path wont actually be used.
+ fifodir = "DummyFifoPath";
+ }
VERBOSE(VB_IMPORTANT, QString("Enabled verbose msgs: %1").arg(verboseString));
@@ -639,7 +657,7 @@ int main(int argc, char *argv[])
result = transcode->TranscodeFile(infile, outfile,
profilename, useCutlist,
(fifosync || keyframesonly), jobID,
- fifodir, deleteMap);
+ fifodir, fifo_info, deleteMap);
if ((result == REENCODE_OK) && (jobID >= 0))
JobQueue::ChangeJobArgs(jobID, "RENAME_TO_NUV");
}
diff --git a/mythtv/programs/mythtranscode/transcode.cpp b/mythtv/programs/mythtranscode/transcode.cpp
index 51ce1b2..3e66f65 100644..100755
--- a/mythtv/programs/mythtranscode/transcode.cpp
+++ b/mythtv/programs/mythtranscode/transcode.cpp
@@ -361,6 +361,7 @@ int Transcode::TranscodeFile(
const QString &profileName,
bool honorCutList, bool framecontrol,
int jobID, QString fifodir,
+ bool fifo_info,
frm_dir_map_t &deleteMap)
{
QDateTime curtime = QDateTime::currentDateTime();
@@ -727,6 +728,31 @@ int Transcode::TranscodeFile(
if (!fifodir.isEmpty())
{
+ const char *audio_codec_name;
+
+ audio_codec_name = "raw";
+
+ // Display details of the format of the fifo data.
+ // Circumvent logging system so that output is independent
+ // of logging level.
+ cout << "FifoVideoWidth " << video_width << endl;
+ cout << "FifoVideoHeight " << video_height << endl;
+ cout << "FifoVideoAspectRatio "<< player->GetVideoAspect() << endl;
+ cout << "FifoVideoFrameRate " << video_frame_rate << endl;
+ cout << "FifoAudioFormat " << audio_codec_name << endl;
+ cout << "FifoAudioChannels " << arb->channels << endl;
+ cout << "FifoAudioHz " << arb->eff_audiorate << endl;
+
+ if(fifo_info)
+ {
+ // Request was for just the format of fifo data, not for
+ // the actual transcode, so stop here.
+ unlink(outputname.toLocal8Bit().constData());
+ if (player_ctx)
+ delete player_ctx;
+ return REENCODE_OK;
+ }
+
QString audfifo = fifodir + QString("/audout");
QString vidfifo = fifodir + QString("/vidout");
int audio_size = arb->eff_audiorate * arb->bytes_per_frame;
diff --git a/mythtv/programs/mythtranscode/transcode.h b/mythtv/programs/mythtranscode/transcode.h
index 867d872..33332a4 100644..100755
--- a/mythtv/programs/mythtranscode/transcode.h
+++ b/mythtv/programs/mythtranscode/transcode.h
@@ -20,7 +20,7 @@ class Transcode : public QObject
const QString &outputname,
const QString &profileName,
bool honorCutList, bool framecontrol, int jobID,
- QString fifodir, frm_dir_map_t &deleteMap);
+ QString fifodir, bool fifo_info, frm_dir_map_t &deleteMap);
void ShowProgress(bool val) { showprogress = val; }
void SetRecorderOptions(QString options) { recorderOptions = options; }