diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..60401c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +# Created by https://www.gitignore.io/api/c++,clion,linux +# Edit at https://www.gitignore.io/?templates=c++,clion,linux + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +### CLion ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +build/ +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### CLion Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# End of https://www.gitignore.io/api/c++,clion,linux \ No newline at end of file diff --git a/.idea/calyp.iml b/.idea/calyp.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/calyp.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8822db8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6f76545 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index c9c05c2..828b019 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -322,7 +322,7 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog ) m_pCurrStream = new CalypStream; } - bool bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness ) || bForceDialog; + bool bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) || bForceDialog; bool bRet = false; for( int iPass = 0; iPass < 2 && !bRet; iPass++ ) { @@ -435,7 +435,7 @@ void VideoSubWindow::updateVideoWindowInfo() } bool VideoSubWindow::guessFormat( QString filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBitsPerPixel, - int& rEndianness ) + int& rEndianness, unsigned int& rFrameRate ) { std::vector stdResList = CalypStream::stdResolutionSizes(); bool bGuessed = true; @@ -542,6 +542,20 @@ bool VideoSubWindow::guessFormat( QString filename, unsigned int& rWidth, unsign } } + // Guess frame rate - match %dbpp + QRegularExpressionMatch FpsMatch = QRegularExpression( "_\\d*fps" ).match( FilenameShort ); + if( FpsMatch.hasMatch() ) + { + QString matchString = FpsMatch.captured( 0 ); + matchString.remove( "_" ); + matchString.remove( "fps" ); + rFrameRate = matchString.toUInt(); + if( rFrameRate < 0 ) + { + rFrameRate = 30; + } + } + // Guess Endianness if( FilenameShort.contains( QStringLiteral( "be" ), Qt::CaseInsensitive ) ) { diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 16cba96..59019c4 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -192,7 +192,7 @@ private: bool goToNextFrame( bool bThreaded = false ); static bool guessFormat( QString filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBitsPerPixel, - int& rEndianness ); + int& rEndianness, unsigned int& rFrameRate ); bool hasRunningModule(); diff --git a/lib/CalypStream.cpp b/lib/CalypStream.cpp index b035578..b140407 100644 --- a/lib/CalypStream.cpp +++ b/lib/CalypStream.cpp @@ -78,6 +78,7 @@ std::vector CalypStream::stdResolutionSizes() std::vector stdResList; CalypStandardResolution stdResElement; + REGIST_CALYP_STANDARD_RESOLUTION( "QCIF", 176, 144 ); REGIST_CALYP_STANDARD_RESOLUTION( "CIF", 352, 288 ); REGIST_CALYP_STANDARD_RESOLUTION( "VGA", 640, 480 ); REGIST_CALYP_STANDARD_RESOLUTION( "WVGA", 832, 480 ); diff --git a/update_upstream_and_merge_into_master.sh b/update_upstream_and_merge_into_master.sh new file mode 100755 index 0000000..d508df7 --- /dev/null +++ b/update_upstream_and_merge_into_master.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +git checkout upstream +git pull https://github.com/pixlra/calyp.git master +git push origin upstream + +git checkout master +git pull origin master +git merge upstream +git push origin master \ No newline at end of file