first commit
This commit is contained in:
75
project/fm_viewer/data/fm_video_edit.h
Normal file
75
project/fm_viewer/data/fm_video_edit.h
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
#ifndef FM_VIDEO_EDIT_H
|
||||
#define FM_VIDEO_EDIT_H
|
||||
|
||||
#if (FM_VIDEO_EDIT)
|
||||
#include <QtCore>
|
||||
|
||||
/**
|
||||
* @brief 영상(MP4,AVI) 편집(FILE JOIN,TRACK SPLIT) 기능
|
||||
* @example
|
||||
* FMVideoEdit* ed = new FMVideoEdit(...,...);
|
||||
connect(sp, SIGNAL(done()), SLOT(onSplitVideoDone()));
|
||||
QThreadPool::globalInstance()->start(sp,LOADER_THREAD_PRIORITY);
|
||||
*/
|
||||
class FMVideoEdit : public QObject, public QRunnable
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum EditMode {
|
||||
FileJoin,
|
||||
VideoTrackSplit,
|
||||
};
|
||||
|
||||
enum ErrorCode {
|
||||
ErrorNone = 0,
|
||||
ErrorWrongTrackCount,
|
||||
ErrorFileOpen,
|
||||
ErrorOpenStream,
|
||||
ErrorFileCreate,
|
||||
ErrorCreateStream,
|
||||
ErrorCopyStreamParameters,
|
||||
ErrorFileWrite,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 생성
|
||||
* @param files: 처리할 파일경로(들) - 동일 포맷(+코덱,etc)만 가능
|
||||
* @param dests: 처리완료된 파일경로(들)
|
||||
* @param mode: 처리 모드
|
||||
*/
|
||||
FMVideoEdit(QStringList files, QStringList dests, EditMode mode, bool deleteSrcDone = true);
|
||||
virtual void run();
|
||||
private:
|
||||
QStringList _files; //! 처리할 파일(들)
|
||||
QStringList _dests; //! 처리 결과물 파일 경로(들)
|
||||
EditMode _mode; //! 처리 모드
|
||||
bool _deleteSrcAfter; //! 처리 완료 후 소스 영상 삭제
|
||||
|
||||
/**
|
||||
* @brief 멀티트랙 영상을 N개의 단일트랙 영상+오디오 파일로 저장
|
||||
*/
|
||||
void _splitMP4VideoTracks();
|
||||
|
||||
/**
|
||||
* @brief 처리 완료 후 진행
|
||||
* eg. 소스 파일 삭제 등
|
||||
*/
|
||||
void _afterProcess();
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief 처리완료 (또는 ERROR)
|
||||
* @param error: 에러코드, 0=성공
|
||||
*/
|
||||
void done(int error); //! 처리 완료 결과
|
||||
|
||||
/**
|
||||
* @brief 처리 경과
|
||||
* @param progress , 0~100%
|
||||
*/
|
||||
void progress(int progress); //! 처리 프로그래스
|
||||
};
|
||||
|
||||
#endif // FM_VIDEO_EDIT
|
||||
#endif // FM_VIDEO_EDIT_H
|
||||
Reference in New Issue
Block a user