Commit 1f8a5172 authored by Ming Rui Zhang's avatar Ming Rui Zhang

recordwidget: video recorder now stops at the last frame when recording finishes

Change-Id: I78741219ef1a848a5d4e42134fd564e4a78812dc
parent 463afd27
...@@ -58,6 +58,11 @@ RecordWidget::finishRecording() ...@@ -58,6 +58,11 @@ RecordWidget::finishRecording()
bool isSuccessful = false; bool isSuccessful = false;
try { try {
LRCInstance::avModel().stopLocalRecorder(recordedFilePath_.toStdString()); LRCInstance::avModel().stopLocalRecorder(recordedFilePath_.toStdString());
if (!isAudio_) {
previewWidget_->toPaintingBackground(false);
previewWidget_->toDrawLastFrame(true);
LRCInstance::avModel().stopPreview();
}
isSuccessful = true; isSuccessful = true;
} catch (...) { } catch (...) {
qDebug() << "The finish of record fails"; qDebug() << "The finish of record fails";
...@@ -83,6 +88,8 @@ void ...@@ -83,6 +88,8 @@ void
RecordWidget::deleteRecording() RecordWidget::deleteRecording()
{ {
Utils::forceDeleteAsync(recordedFilePath_); Utils::forceDeleteAsync(recordedFilePath_);
if (!isAudio_)
LRCInstance::avModel().startPreview();
} }
bool bool
...@@ -129,5 +136,7 @@ RecordWidget::hideEvent(QHideEvent* event) ...@@ -129,5 +136,7 @@ RecordWidget::hideEvent(QHideEvent* event)
Q_UNUSED(event); Q_UNUSED(event);
if(!isAudio_) { if(!isAudio_) {
LRCInstance::avModel().stopPreview(); LRCInstance::avModel().stopPreview();
previewWidget_->toPaintingBackground(true);
previewWidget_->toDrawLastFrame(false);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment