Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Display format information for the fifo data

  • Loading branch information...
commit 488c7c18a9b7df8e0ffbde543f3477c122bf6f01 1 parent 90ac990
Paul Gardiner authored
View
20 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");
}
View
26 mythtv/programs/mythtranscode/transcode.cpp 100644 → 100755
@@ -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;
View
2  mythtv/programs/mythtranscode/transcode.h 100644 → 100755
@@ -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; }
Please sign in to comment.
Something went wrong with that request. Please try again.