Permalink
Browse files

Write some of the compression-type data to the file.

Update frequencies.c with the latest from xawtv.


git-svn-id: http://svn.mythtv.org/svn/trunk@178 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent d837063 commit 6e86c91ffecaa845bd3e52b82bded6f98335ceea Isaac Richards committed Aug 19, 2002
@@ -115,6 +115,14 @@ NuppelVideoRecorder::~NuppelVideoRecorder(void)
avcodec_close(&mpa_ctx);
}
+void NuppelVideoRecorder::SetTVFormat(QString tvformat)
+{
+ if (tvformat.lower() == "ntsc" || tvformat.lower() == "ntsc-jp")
+ ntsc = 1;
+ else
+ ntsc = 0;
+}
+
bool NuppelVideoRecorder::SetupAVCodec(void)
{
if (mpa_codec)
@@ -316,12 +324,10 @@ void NuppelVideoRecorder::StartRecording(void)
strm = new signed char[w * h + (w * h) / 2 + 10];
- if (CreateNuppelFile() != 0)
- {
- cerr << "Cannot open '" << ringBuffer->GetFilename() << "' for "
- << "writing, exiting\n";
- return;
- }
+ if (ntsc)
+ video_frame_rate = 29.97;
+ else
+ video_frame_rate = 25.0;
if (codec.lower() == "rtjpeg")
useavcodec = false;
@@ -343,7 +349,14 @@ void NuppelVideoRecorder::StartRecording(void)
setval = 2;
rtjc->SetIntra(&setval, &M1, &M2);
}
-
+
+ if (CreateNuppelFile() != 0)
+ {
+ cerr << "Cannot open '" << ringBuffer->GetFilename() << "' for "
+ << "writing, exiting\n";
+ return;
+ }
+
if (childrenLive)
return;
@@ -803,6 +816,25 @@ void NuppelVideoRecorder::WriteHeader(bool todumpfile)
else
ringBuffer->Write(&frameheader, FRAMEHEADERSIZE);
+ memset(tbls, 0, sizeof(tbls));
+
+ if (useavcodec)
+ {
+ tbls[0] = 1;
+ tbls[1] = (int)(mpa_codec->id);
+ tbls[2] = mpa_ctx.bit_rate;
+ tbls[3] = mpa_ctx.qmin;
+ tbls[4] = mpa_ctx.qmax;
+ tbls[5] = mpa_ctx.max_qdiff;
+ }
+ else
+ {
+ tbls[0] = 0;
+ tbls[1] = Q;
+ tbls[2] = M1;
+ tbls[3] = M2;
+ }
+
// compression configuration data
if (todumpfile)
ringBuffer->WriteToDumpFile(tbls, sizeof(tbls));
@@ -51,7 +51,8 @@ class NuppelVideoRecorder
void SetFilename(QString filename) { sfilename = filename; }
void SetAudioDevice(QString device) { audiodevice = device; }
void SetVideoDevice(QString device) { videodevice = device; }
-
+ void SetTVFormat(QString tvformat);
+
void Initialize(void);
void StartRecording(void);
void StopRecording(void) { encoding = false; }
@@ -693,6 +693,58 @@ static struct CHANLIST pal_australia[] = {
{ "69", 814250 },
};
+static struct CHANLIST pal_australia_optus[] = {
+ { "1", 138250 },
+ { "2", 147250 },
+ { "3", 154250 },
+ { "4", 161250 },
+ { "5", 168250 },
+ { "6", 175250 },
+ { "7", 182250 },
+ { "8", 189250 },
+ { "9", 196250 },
+ { "10", 209250 },
+ { "11", 216250 },
+ { "12", 224250 },
+ { "13", 231250 },
+ { "14", 238250 },
+ { "15", 245250 },
+ { "16", 252250 },
+ { "17", 259250 },
+ { "18", 266250 },
+ { "19", 273250 },
+ { "20", 280250 },
+ { "21", 287250 },
+ { "22", 294250 },
+ { "23", 303250 },
+ { "24", 310250 },
+ { "25", 317250 },
+ { "26", 324250 },
+ { "27", 338250 },
+ { "28", 345250 },
+ { "29", 352250 },
+ { "30", 359250 },
+ { "31", 366250 },
+ { "32", 373250 },
+ { "33", 380250 },
+ { "34", 387250 },
+ { "35", 394250 },
+ { "36", 401250 },
+ { "37", 408250 },
+ { "38", 415250 },
+ { "39", 422250 },
+ { "40", 429250 },
+ { "41", 436250 },
+ { "42", 443250 },
+ { "43", 450250 },
+ { "44", 457250 },
+ { "45", 464250 },
+ { "46", 471250 },
+ { "47", 478250 },
+ { "48", 485250 },
+};
+
+
/* --------------------------------------------------------------------- */
/* europe */
@@ -1220,5 +1272,6 @@ struct CHANLISTS chanlists[] = {
{ "southafrica", pal_bcast_za, CHAN_COUNT(pal_bcast_za) },
{ "argentina", argentina, CHAN_COUNT(argentina) },
{ "canada-cable", ntsc_cable_ca, CHAN_COUNT(ntsc_cable_ca) },
+ { "australia-optus", pal_australia_optus, CHAN_COUNT(pal_australia_optus) },
{ NULL, NULL, 0 } /* EOF */
};
@@ -576,6 +576,7 @@ void TV::SetupRecorder(void)
nvr->SetVideoDevice(settings->GetSetting("V4LDevice"));
nvr->SetResolution(settings->GetNumSetting("Width"),
settings->GetNumSetting("Height"));
+ nvr->SetTVFormat(settings->GetSetting("TVFormat"));
nvr->SetCodec(settings->GetSetting("Codec"));
nvr->SetRTJpegMotionLevels(settings->GetNumSetting("LumaFilter"),

0 comments on commit 6e86c91

Please sign in to comment.