237 lines
5.5 KiB
C++
237 lines
5.5 KiB
C++
#ifndef RM_VIDEOITEM_2CH_H
|
|
#define RM_VIDEOITEM_2CH_H
|
|
|
|
// 각 채널별 파일이 구분되어 있는 단말기의 경우 RMVideoItem 을 별도로 사용함
|
|
|
|
#include "../rm_include.h"
|
|
#include "rm_video_list.h"
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QRunnable>
|
|
#include <QDateTime>
|
|
#include <QThread>
|
|
|
|
// 분리 채널 파일 포멧만 사용
|
|
#if (RM_USE_SEPARATED_CH_FILE)
|
|
|
|
class RMSensorData;
|
|
class RMVideoItem : public QObject
|
|
{
|
|
Q_OBJECT
|
|
friend class RMVideoListLoader;
|
|
friend class RMVideoItemLoader;
|
|
friend class RMPlayerBase;
|
|
|
|
public:
|
|
#ifdef _DEBUG
|
|
void print();
|
|
#endif
|
|
#if (USE_DEBUG_FUNCTIONS)
|
|
static void make_many_files(QString path);
|
|
#endif
|
|
|
|
RMVideoFileList::GROUP_TYPE type;
|
|
|
|
bool checked; ///! 백업용 FLAG
|
|
bool dropItem; // dropitem = single path
|
|
bool added; // 신규로 추가된 아이템을 확인하기위해 추가시 초기화 한다.
|
|
// bool forceSwap; // 후방만 존재하고 전방이 없을 경우=> Player 의 RearSwap.. 을 사용
|
|
|
|
int width; // 해상도 (1CH, 현재 AVI 만 구현)
|
|
int height; // "
|
|
|
|
QString filePath;
|
|
QString fileName; // 경로 제외 명칭
|
|
|
|
#if (RM_MODEL == RM_MODEL_TYPE_AN6000)
|
|
QString decodedPath;
|
|
void removeTemp();
|
|
#endif // RM_MODEL_TYPE_AN6000
|
|
|
|
#if (DUAL_CH_FILE && DUAL_CH_1CH_EXIST)
|
|
bool only1CH;
|
|
#endif
|
|
|
|
#if (RM_MODEL_EMT_KR)
|
|
QString modelName; //! WIDE 지원 모델 영상
|
|
#endif
|
|
|
|
#if (TRI_CHANNEL)
|
|
RMVideoItem(QString path,int CH,QDateTime* pDateTime); // CH 1,2,3
|
|
#else
|
|
RMVideoItem(QString path,bool CH2,QDateTime* pDateTime);
|
|
#endif
|
|
|
|
#if (RM_MODEL_EMT_KR)
|
|
bool isWideMode() {
|
|
return (modelName == "360X" && realCHCount() > 2);
|
|
}
|
|
#endif
|
|
|
|
// MP4 CH2 파일
|
|
QString filePathCH2;
|
|
|
|
#if (TRI_CHANNEL)
|
|
QString filePathCH3;
|
|
bool isCH3Exist() {
|
|
return !filePathCH3.isEmpty();
|
|
}
|
|
#elif (PENTA_CHANNEL)
|
|
QString filePathCH3;
|
|
QString filePathCH4;
|
|
QString filePathCH5;
|
|
#endif // PENTA_CHANNEL
|
|
QString& anyFilePath()
|
|
{
|
|
return filePath.length() > 0 ? filePath : filePathCH2;
|
|
}
|
|
bool isRearOnly() {
|
|
return (filePath.isEmpty() && (filePathCH2.isEmpty() == false));
|
|
}
|
|
bool isFrontOnly() {
|
|
return (filePathCH2.isEmpty() && (filePath.isEmpty() == false));
|
|
}
|
|
|
|
bool isSingleChannel()
|
|
{
|
|
#if (DUAL_CH_FILE && DUAL_CH_1CH_EXIST) // 2CH 파일이나 후방없는 1CH 파일도 존재
|
|
return only1CH;
|
|
#elif (DUAL_CH_FILE || SINGLE_CH_VIEWER)
|
|
return false;
|
|
#else
|
|
return (filePath.length() == 0 || filePathCH2.length() == 0);
|
|
#endif
|
|
}
|
|
|
|
#if (TRI_CHANNEL2)
|
|
int _realCHCount;
|
|
//! \brief 프레임이 존재하지 않는 채널 제외한 채널 개수 확인
|
|
//! AVDemux 에서 확인됨, 초기값은 0
|
|
//! \return
|
|
int realCHCount() {
|
|
return _realCHCount;
|
|
}
|
|
#endif // TRI_CHANNEL2
|
|
|
|
|
|
#if (CHECK_VIDEO_BITRATE)
|
|
// 후방 채널 비디오 비트레이트 확인해서 일정 기준 미만이면 제거
|
|
void testBitrate2CH();
|
|
#endif
|
|
|
|
#if !(SINGLE_CH_VIEWER)
|
|
#if (!FORCE_2CH || (RM_MODEL == RM_MODEL_TYPE_XLDR_88 || SUB_MODEL_CARROT_EMT))
|
|
// 채널정보를 제외한 파일명을 리턴한다
|
|
static QString fileNameWithoutChannel(QString& path);
|
|
#endif
|
|
#endif // SINGLE_CH_VIEWER
|
|
|
|
~RMVideoItem();
|
|
|
|
static bool FileExist(QString path);
|
|
static int IsFeasible(QString path, QDateTime* pDateTime = NULL);
|
|
|
|
int fileFormat();
|
|
|
|
QString title();
|
|
|
|
QString typeString();
|
|
|
|
QString titleDate();
|
|
QString titleTime();
|
|
QString titleDateTime();
|
|
QString titleDuration();
|
|
#if !(DUAL_CH_FILE || SINGLE_CH_VIEWER)
|
|
QString titleFrontRear();
|
|
#endif
|
|
QString titlePrefix();
|
|
|
|
QString titleSize();
|
|
|
|
QString titleCapture(qint64 secs);
|
|
|
|
RMSensorData* getSensorData()
|
|
{
|
|
return sensorData;
|
|
}
|
|
|
|
//static QString recoveredPath(QString filePath);
|
|
static QString durationString(unsigned int sec,bool hms);
|
|
unsigned int durationInMSecs()
|
|
{
|
|
return _durationInMSecs;
|
|
}
|
|
#if (PLAY_SYNC_FIX2)
|
|
unsigned int packetDurationInMSecs; // 재생시작해야 발생함???
|
|
#endif // PLAY_SYNC_FIX2
|
|
|
|
// ?? 사용되지 않는다???
|
|
QDateTime dateTimeInPosition(qreal ratio,double* lat, double* lon); // 전체 플레이 ratio 를 통해 시간 가져오기
|
|
|
|
bool isValid()
|
|
{
|
|
#if (SKIP_VIDEO_PREINFO)
|
|
return true;
|
|
#else
|
|
return (_durationInMSecs > 300); // 0.3?
|
|
#endif
|
|
}
|
|
|
|
QDateTime& startTime()
|
|
{
|
|
return _dateTime;
|
|
}
|
|
|
|
#if (CHECK_REAR_DURATION)
|
|
bool isRearDuration();
|
|
#endif
|
|
|
|
// 인덱스 순으로 정렬
|
|
//int fileIndex();
|
|
|
|
protected:
|
|
#if (!PRE_LOAD_SENSOR_DATA)
|
|
void load()
|
|
{
|
|
emit loadSensorInfoStarted();
|
|
if(getSensorData() == NULL)
|
|
{
|
|
loadSensorInfo();
|
|
}
|
|
emit loadSensorInfoEnd();
|
|
}
|
|
#endif
|
|
void loadSensorInfo();
|
|
private:
|
|
|
|
|
|
signals:
|
|
void loadSensorInfoStarted();
|
|
void loadSensorInfoEnd();
|
|
void loadSensorInfoFail();
|
|
|
|
private:
|
|
#if (TRI_CHANNEL)
|
|
QString filePathWithCH(int ch);
|
|
#endif
|
|
QDateTime _dateTime;
|
|
#if (TRI_CHANNEL)
|
|
bool _loadDuration(int ch); // 1,2,3
|
|
#else
|
|
bool _loadDuration(bool rear = false);
|
|
#endif
|
|
|
|
qint64 _fileSize;
|
|
|
|
// 1초 미만 파일이 있음
|
|
unsigned int _durationInMSecs;
|
|
RMSensorData* sensorData;
|
|
|
|
static QDateTime _fileNameToDateTime(QString baseName);
|
|
public slots:
|
|
void onChecked();
|
|
};
|
|
#endif // #if (RM_USE_SEPARATED_CH_FILE)
|
|
#endif // RM_VIDEOITEM_2CH_H
|