Fixed some major issues with the frame mapper. openshot::FrameMapper is now fully multi-threaded. Fixed a bug in calculating the # of samples on a frame (to always be evenly divisible by the # of channels).

This commit is contained in:
Jonathan Thomas
2015-03-08 21:42:53 -05:00
parent db4a5a7948
commit 591cfbdb5a
8 changed files with 187 additions and 142 deletions

View File

@@ -48,9 +48,9 @@ int main(int argc, char* argv[])
r9.debug = false;
// Mapper
FrameMapper map(&r9, Fraction(24,1), PULLDOWN_NONE, 44100, 2, LAYOUT_STEREO);
FrameMapper map(&r9, Fraction(30,1), PULLDOWN_NONE, 48000, 2, LAYOUT_STEREO);
map.DisplayInfo();
map.debug = false;
map.debug = true;
map.Open();
/* WRITER ---------------- */
@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
//ImageWriter w9("/home/jonathan/output.gif");
// Set options
w9.SetAudioOptions(true, "libmp3lame", r9.info.sample_rate, r9.info.channels, r9.info.channel_layout, 120000);
w9.SetAudioOptions(true, "libmp3lame", map.info.sample_rate, map.info.channels, map.info.channel_layout, 120000);
//w9.SetAudioOptions(true, "libmp3lame", 44100, r9.info.channels, r9.info.channel_layout, 120000);
//w9.SetVideoOptions(true, "libvpx", map.info.fps, map.info.width, map.info.height, map.info.pixel_ratio, false, false, 1500000);
//w9.SetVideoOptions(true, "rawvideo", r9.info.fps, 400, 2, r9.info.pixel_ratio, false, false, 20000000);
@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
int frame_number = ( frame);
cout << "get " << frame << " (frame: " << frame_number << ") " << endl;
tr1::shared_ptr<Frame> f = r9.GetFrame(frame_number);
tr1::shared_ptr<Frame> f = map.GetFrame(frame_number);
cout << "display it (" << f->number << ", " << f << ")" << endl;
//r9.GetFrame(frame_number)->DisplayWaveform();
//if (frame == 49)