Skip to content

Commit

Permalink
Merge pull request #799 from ElderOrb/secon_output_for_capture
Browse files Browse the repository at this point in the history
let dvrescue-cli to write capture
  • Loading branch information
dericed authored Dec 11, 2023
2 parents 0837a05 + 12cc05f commit 70f3f14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
5 changes: 1 addition & 4 deletions Source/GUI/dvrescue/dvrescue/CapturePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,6 @@ Rectangle {
pendingAction = true;
player.play()

fileWriter.fileName = filePath;
fileWriter.open();

var columnNames = [];
var indexOfFramePos = -1;
var indexOfTimecode = -1;
Expand All @@ -291,7 +288,7 @@ Rectangle {
opts = makeDecklinkOptions();
}

dvrescue.grab(id, filePath, playbackBuffer, fileWriter, csvParser, opts, (launcher) => {
dvrescue.grab(id, filePath, playbackBuffer, csvParser, opts, (launcher) => {
outputFilePath = filePath
csvParser.columnsChanged.connect(onColumnsChanged);
var result = ConnectionUtils.connectToSignalQueued(csvParser, 'entriesReceived(const QStringList&)', csvParserUI, 'entriesReceived(const QStringList&)');
Expand Down
11 changes: 0 additions & 11 deletions Source/GUI/dvrescue/dvrescue/CaptureView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import QtQuick.Controls 2.12
import QtAVMediaPlayer 1.0
import MediaPlayerBuffer 1.0
import FileUtils 1.0
import FileWriter 0.1
import CsvParser 0.1
import Thread 0.1
import Multimedia 1.0
Expand All @@ -27,7 +26,6 @@ Column {
property alias speedInterpretation: speedInterpretation.source
property alias playbackBuffer: player.buffer
property alias player: player
property var fileWriter: fileWriter
property var csvParser: csvParser
property var csvParserUI: csvParserUI
property alias dataModel: dataModel
Expand Down Expand Up @@ -152,15 +150,6 @@ Column {
id: buffer
}

Thread {
id: fileWriterThread
worker: fileWriter
}

FileWriter {
id: fileWriter
}

Thread {
id: csvWriterThread
worker: csvParser
Expand Down
21 changes: 3 additions & 18 deletions Source/GUI/dvrescue/dvrescue/DvRescueCLI.qml
Original file line number Diff line number Diff line change
Expand Up @@ -248,30 +248,15 @@ Item {
return promise;
}

function grab(id, file, playbackBuffer, fileWriter, csvParser, opts, callback) {
console.debug('starting grab: ', file, fileWriter);
function grab(id, file, playbackBuffer, csvParser, opts, callback) {
console.debug('starting grab: ', file);

var promise = new Promise((accept, reject) => {
var launcher = launcherFactory.createObject(null, { useThread: true });

var result = ConnectionUtils.connectToSlotDirect(launcher, 'outputChanged(const QByteArray&)', playbackBuffer, 'write(const QByteArray&)');
var result = ConnectionUtils.connectToSlotQueued(launcher, 'outputChanged(const QByteArray&)', fileWriter, 'write(const QByteArray&)');

var result = ConnectionUtils.connectToSlotQueued(launcher, 'errorChanged(const QByteArray&)', csvParser, 'write(const QByteArray&)');


/*
launcher.errorChanged.connect((errorString) => {
console.debug('errorString: ', errorString)
});
*/
// launcher.outputChanged.connect(fileWriter.write);
/*
launcher.outputChanged.connect((outputString) => {
console.debug('outputString: ', outputString)
});
*/

launcher.errorOccurred.connect((error) => {
try {
reject(error);
Expand Down Expand Up @@ -300,7 +285,7 @@ Item {
var xml = file + ".dvrescue.xml"
var scc = file + ".scc"

var arguments = ['-y', 'device://' + id].concat(opts).concat(['-x', xml, '-c', scc, '--cc-format', 'scc', '-m', '-', '--verbosity', '9', '--csv'])
var arguments = ['-y', 'device://' + id].concat(opts).concat(['-x', xml, '-c', scc, '--cc-format', 'scc', '-m', file, '-m', '-', '--verbosity', '9', '--csv'])

if(settings.endTheCaptureIftheTapeContainsNoDataFor && settings.endTheCaptureIftheTapeContainsNoDataFor !== '') {
arguments.push('--timeout')
Expand Down

0 comments on commit 70f3f14

Please sign in to comment.