Skip to content

Commit

Permalink
* r502 release sp build-18850
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Aug 14, 2015
1 parent a66e53f commit ea281a6
Show file tree
Hide file tree
Showing 118 changed files with 1,825 additions and 1,014 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@

vc10
vc11
vc12
vc13
vc15

/zlib.vcxproj.user

Expand Down
2 changes: 1 addition & 1 deletion FlyFeatures/VideoPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void VideoPreview::clear()
if (!_currentFilePreview.empty())
{
QueueManager::LockFileQueueShared l_fileQueue;
auto qi = QueueManager::g_fileQueue.find(_currentFilePreview);
auto qi = QueueManager::FileQueue::find_target(_currentFilePreview);
if (qi)
{
qi->setDelegate(nullptr);
Expand Down
112 changes: 100 additions & 12 deletions FlyFeatures/flyServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ std::unordered_set<unsigned> CFlyServerConfig::g_exclude_error_log;
std::unordered_set<unsigned> CFlyServerConfig::g_exclude_error_syslog;
std::vector<CServerItem> CFlyServerConfig::g_mirror_read_only_servers;
std::vector<CServerItem> CFlyServerConfig::g_mirror_test_port_servers;
CServerItem CFlyServerConfig::g_local_test_server;
CServerItem CFlyServerConfig::g_main_server;
uint16_t CFlyServerAdapter::CFlyServerQueryThread::g_minimal_interval_in_ms = 2000;

Expand Down Expand Up @@ -142,10 +143,18 @@ const CServerItem& CFlyServerConfig::getStatServer()
//======================================================================================================
const std::vector<CServerItem>& CFlyServerConfig::getMirrorTestPortServerArray()
{
dcassert(!g_mirror_test_port_servers.empty());
dcassert(!g_mirror_test_port_servers.empty() || !g_local_test_server.getIp().empty());
if (g_mirror_test_port_servers.empty())
{
g_mirror_test_port_servers.push_back(g_main_server);
// Åñëè îïðåäåëåí ëîêàëüíû òåñò-ñåðâåð - êèäàåìñÿ íà íåãî
if (!g_local_test_server.getIp().empty())
{
g_mirror_test_port_servers.push_back(g_local_test_server);
}
else
{
g_mirror_test_port_servers.push_back(g_main_server);
}
}
return g_mirror_test_port_servers;
}
Expand Down Expand Up @@ -328,6 +337,12 @@ void CFlyServerConfig::loadConfig()
#ifdef _DEBUG
//#define USE_FLYSERVER_LOCAL_FILE
#endif
const auto l_path_local_test_file = Text::toT(Util::getExePath()) + _T("fly-server-getip.config");
if (File::isExist(l_path_local_test_file))
{
const string l_test_server_port = File(l_path_local_test_file, File::READ, File::OPEN).read();
g_local_test_server.init(l_test_server_port);
}
#ifdef USE_FLYSERVER_LOCAL_FILE
const string l_url_config_file = "file://C:/vc10/etc/flylinkdc-config-r5xx.xml";
g_debug_fly_server_url = "localhost";
Expand Down Expand Up @@ -531,13 +546,18 @@ for (auto i = g_block_ip_str.cbegin(); i != g_block_ip_str.cend(); ++i)
if(l_port_pos != string::npos)
g_mirror_read_only_servers.push_back(CServerItem(n.substr(0, l_port_pos), atoi(n.c_str() + l_port_pos + 1)));
});
// Äîñòàíåì çåðêàëà ñåðâåðîâ äëÿ òåñòîâ
l_xml.getChildAttribSplit("mirror_test_port_server", g_mirror_test_port_servers, [this](const string& n)
// Äîñòàíåì çåðêàëà ñåðâåðîâ äëÿ òåñòîâ
if (g_local_test_server.getIp().empty()) // (åñëè íåò ïåðåîïðåäåëåíèÿ ëîêàëüíîãî)
{
const auto l_port_pos = n.find(':');
if(l_port_pos != string::npos)
g_mirror_test_port_servers.push_back(CServerItem(n.substr(0, l_port_pos), atoi(n.c_str() + l_port_pos + 1)));
});
l_xml.getChildAttribSplit("mirror_test_port_server", g_mirror_test_port_servers, [this](const string& n)
{
CServerItem l_server;
if (l_server.init(n))
{
g_mirror_test_port_servers.push_back(l_server);
}
});
}


#endif // FLYLINKDC_USE_MEDIAINFO_SERVER
Expand Down Expand Up @@ -774,6 +794,7 @@ string CFlyServerConfig::DBDelete()
string CFlyServerJSON::g_fly_server_id;
CFlyTTHKeyArray CFlyServerJSON::g_download_counter;
CFlyAntivirusTTHArray CFlyServerJSON::g_antivirus_counter;
CFlyVirusFileListArray CFlyServerJSON::g_antivirus_file_list;
//===================================================================================================================================
void CFlyServerAdapter::post_message_for_update_mediainfo()
{
Expand Down Expand Up @@ -1138,7 +1159,7 @@ void CFlyServerJSON::pushSyslogError(const string& p_error)
syslog(LOG_USER | LOG_INFO, "%s %s %s [%s]", l_cid.c_str(), l_pid.c_str(), p_error.c_str(), Text::fromT(g_full_user_agent).c_str());
}
//======================================================================================================
bool CFlyServerJSON::pushError(unsigned p_error_code, string p_error) // Last Code = 38 (36 - óñòàðåë)
bool CFlyServerJSON::pushError(unsigned p_error_code, string p_error) // Last Code = 40 (36 - óñòàðåë)
{
bool l_is_send = false;
bool l_is_error = false;
Expand Down Expand Up @@ -1642,6 +1663,12 @@ void CFlyServerJSON::addAntivirusCounter(const SearchResult &p_search_result, in
CFlyServerJSON::addAntivirusCounter(l_key, l_server_item);
}
//======================================================================================================
void CFlyServerJSON::addAntivirusCounter(const CFlyVirusFileList& p_file_list)
{
Lock l(g_cs_antivirus_counter);
g_antivirus_file_list.push_back(p_file_list);
}
//======================================================================================================
void CFlyServerJSON::addAntivirusCounter(const CFlyTTHKey& p_key, const CFlyVirusFileInfo& p_file_info)
{
Lock l(g_cs_antivirus_counter);
Expand Down Expand Up @@ -1715,10 +1742,71 @@ bool CFlyServerJSON::sendAntivirusCounter(bool p_is_only_db_if_network_error)
}
}
}
// TODO - ñëîâèòü èñêëþ÷åíèå è åñëè íóæíî ñîõðàíèòü l_copy_array â áàçå.
// ÷òîáû íå ïîòåðÿòü ñ÷åò÷èêè.
return l_is_error;
//
if (!g_antivirus_file_list.empty())
{
CFlyVirusFileListArray l_copy_array;
{
Lock l(g_cs_antivirus_counter);
l_copy_array.swap(g_antivirus_file_list);
}
l_is_error = login();
std::string l_post_query;
Json::Value l_root;
Json::Value& l_arrays = l_root["array_file_list"];
int l_count_record = 0;
for (auto i = l_copy_array.cbegin(); i != l_copy_array.cend(); ++i)
{
Json::Value& l_array_item = l_arrays[l_count_record++];
l_array_item["nick"] = i->m_nick;
l_array_item["ip"] = i->m_ip;
l_array_item["hub_url"] = i->m_hub_url;
l_array_item["virus_path"] = i->m_virus_path;
l_array_item["time"] = i->m_time;

Json::Value& l_tth_array = l_array_item["TTH"];
int l_count_tth = 0;
for (auto j = i->m_files.cbegin(); j != i->m_files.cend(); ++j)
{
const auto l_status_file = CFlylinkDBManager::getInstance()->get_status_file(j->first.m_tth);
if (l_status_file & CFlylinkDBManager::VIRUS_FILE_KNOWN)
continue;
Json::Value& l_tth = l_tth_array[l_count_tth++];
l_tth["tth"] = j->first.m_tth.toBase32();
CFlylinkDBManager::getInstance()->push_add_virus_database_tth(j->first.m_tth);
l_tth["size"] = j->first.m_file_size;
Json::Value& l_files_array = l_tth["files"];
int l_count_files = 0;
for (auto k = j->second.cbegin(); k != j->second.cend(); ++k)
{
l_files_array[l_count_files++] = *k;
}
}
if(l_count_tth)
{
l_post_query = l_root.toStyledString();
}
bool l_is_send = false;
#ifndef _DEBUG
if (l_is_error == false && p_is_only_db_if_network_error == false)
#endif
{
if (!l_post_query.empty())
{
postQuery(true, false, false, true, "fly-antivirus", l_post_query, l_is_send, l_is_error, 1000);
l_post_query.clear();
}
}
}
if (l_is_error || p_is_only_db_if_network_error == true)
{
if (!l_post_query.empty() && BOOLSETTING(USE_FLY_SERVER_STATICTICS_SEND))
{
CFlylinkDBManager::getInstance()->push_json_statistic(l_post_query, "fly-antivirus", false);
}
}
}
return l_is_error;
}
//======================================================================================================
void CFlyServerJSON::addDownloadCounter(const CFlyTTHKey& p_file)
Expand Down
44 changes: 42 additions & 2 deletions FlyFeatures/flyServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ struct CServerItem
{
return getIp() + ':' + Util::toString(getPort());
}
bool init(const string& p_ip_port)
{
m_time_response = 0;
const auto l_port_pos = p_ip_port.find(':');
if (l_port_pos != string::npos)
{
m_ip = p_ip_port.substr(0, l_port_pos);
m_port = atoi(p_ip_port.c_str() + l_port_pos + 1);
const bool l_result = !m_ip.empty() && m_port;
dcassert(l_result);
return l_result;
}
else
{
dcassert(0);
m_ip.clear();
m_port = 0;
}
return false;
}
GETSET(string, m_ip, Ip);
GETSET(uint16_t, m_port, Port);
GETSET(uint32_t, m_time_response, TimeResponse);
Expand Down Expand Up @@ -152,6 +172,7 @@ class CFlyServerConfig
//
static std::vector<CServerItem> g_mirror_read_only_servers;
static std::vector<CServerItem> g_mirror_test_port_servers;
static CServerItem g_local_test_server;
static CServerItem g_main_server;
#ifdef FLYLINKDC_USE_GATHER_STATISTICS
static CServerItem g_stat_server;
Expand Down Expand Up @@ -302,6 +323,21 @@ struct CFlyServerInfo
typedef std::vector<CFlyServerKey> CFlyServerKeyArray;
typedef std::vector<CFlyTTHKey> CFlyTTHKeyArray;
//=======================================================================
struct CFlyVirusFileList
{
string m_nick;
string m_ip;
string m_hub_url;
string m_virus_path;
time_t m_time;
std::map<CFlyTTHKey, std::vector<string> > m_files;
CFlyVirusFileList() : m_time(0)
{
}
};
//=======================================================================
typedef std::vector<CFlyVirusFileList> CFlyVirusFileListArray;
//=======================================================================
struct CFlyVirusFileInfo
{
string m_nick;
Expand All @@ -317,6 +353,7 @@ struct CFlyVirusFileInfo
{
}
};
//=======================================================================
typedef std::vector<CFlyVirusFileInfo> CFlyVirusFileInfoArray;
typedef std::map<CFlyTTHKey, CFlyVirusFileInfoArray > CFlyAntivirusTTHArray;
//=======================================================================
Expand Down Expand Up @@ -464,8 +501,11 @@ class CFlyServerJSON
static void addAntivirusCounter(const CFlyTTHKey& p_key, const CFlyVirusFileInfo& p_file_info);
static void addAntivirusCounter(const SearchResult &p_search_result, int p_count_file, int p_level);
static bool sendAntivirusCounter(bool p_is_only_db_if_network_error);

static string connect(const CFlyServerKeyArray& p_fileInfoArray, bool p_is_fly_set_query, bool p_is_ext_info_for_single_file = false);

static CFlyVirusFileListArray g_antivirus_file_list;
static void addAntivirusCounter(const CFlyVirusFileList& p_file_list);

static string connect(const CFlyServerKeyArray& p_fileInfoArray, bool p_is_fly_set_query, bool p_is_ext_info_for_single_file = false);
static string postQueryTestPort(CFlyLog& p_log, const string& p_body, bool& p_is_send, bool& p_is_error);
static string postQuery(bool p_is_set,
bool p_is_stat_server,
Expand Down
28 changes: 17 additions & 11 deletions FlylinkDC.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ BEGIN
PUSHBUTTON "Move &Down",IDC_MOVE_DOWN,251,202,50,14,WS_DISABLED
END

IDD_FAVORITEHUB DIALOGEX 0, 0, 477, 262
IDD_FAVORITEHUB DIALOGEX 0, 0, 477, 294
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
CAPTION "Favorite Hub Properties"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
Expand Down Expand Up @@ -1072,16 +1072,22 @@ BEGIN
EDITTEXT IDC_SERVER,346,115,80,14,ES_AUTOHSCROLL
GROUPBOX "OP Chat names + auto open PM (wildcards supported, use semicolon to separate)",IDC_OPCHAT,205,151,267,30
EDITTEXT IDC_OPCHAT_STR,210,162,256,14,ES_AUTOHSCROLL
RTEXT "Group:",IDC_FAVGROUP,210,187,104,8
COMBOBOX IDC_FAVGROUP_BOX,318,185,148,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Hub encoding:",IDC_ENCODINGTEXT,210,202,104,8
COMBOBOX IDC_ENCODING,318,200,148,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
RTEXT "The location of the user list",IDC_HUB_POSITION_TEXT,210,219,171,8,NOT WS_VISIBLE | WS_DISABLED
COMBOBOX IDC_HUB_POSITION_COMBO,386,216,80,13,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,369,243,50,14
PUSHBUTTON "Cancel",IDCANCEL,423,243,50,14
RTEXT "Group:",IDC_FAVGROUP,210,224,104,8
COMBOBOX IDC_FAVGROUP_BOX,318,222,148,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Hub encoding:",IDC_ENCODINGTEXT,210,239,104,8
COMBOBOX IDC_ENCODING,318,237,148,30,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
RTEXT "The location of the user list",IDC_HUB_POSITION_TEXT,210,255,171,8,NOT WS_VISIBLE | WS_DISABLED
COMBOBOX IDC_HUB_POSITION_COMBO,386,253,80,13,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,369,275,50,14
PUSHBUTTON "Cancel",IDCANCEL,423,275,50,14
CONTROL "Suppress chat and private messages",IDC_SUPPRESS_FAV_CHAT_AND_PM,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,224,186,8
LTEXT "RAW command (default !banip):",IDC_ANTIVIRUS_COMMAND_IP,213,194,104,8
EDITTEXT IDC_ANTIVIRUS_COMMAND_IP_STR,213,205,112,14,ES_AUTOHSCROLL
CONTROL "Antivirus autoban (IP)",IDC_ANTIVIRUS_AUTOBAN_FOR_IP,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,211,182,86,8
CONTROL "Antivirus autoban (Nick)",IDC_ANTIVIRUS_AUTOBAN_FOR_NICK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,329,182,96,8
END

IDD_TEXT_STYLES_PAGE DIALOGEX 0, 0, 325, 300
Expand Down Expand Up @@ -2419,10 +2425,10 @@ BEGIN
VERTGUIDE, 327
VERTGUIDE, 466
TOPMARGIN, 3
BOTTOMMARGIN, 257
BOTTOMMARGIN, 289
HORZGUIDE, 129
HORZGUIDE, 147
HORZGUIDE, 207
HORZGUIDE, 205
HORZGUIDE, 220
HORZGUIDE, 232
END
Expand Down
14 changes: 14 additions & 0 deletions MediaInfoLib/History_DLL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ bug reports and feature request are here:
https://sourceforge.net/p/mediainfo/_list/tickets


Version 0.7.76, 2015-08-06
--------------
+ XML output: line breaks and indents in between attributes for readability
+ Trace feature: XML trace update, only if compiled with trace feature
+ Amazon S3 support (REST API v2), CLI/DLL only and if compiled with libcurl support
+ FFV1: improved slice analysis (currently activated only with trace feature and for 1st frame)
x MXF: optimization of the parsing, reading a lot less data (e.g. can be reduced from 1 GB to 10 MB with some UHD files)
x MXF: wrong frame count with files not having the video stream as the first stream
x Dolby E in MPEG-TS: "SMPTE ST 302" information was accidentally removed
x MPEG-TS: avoid filling delay from file name, not applicable on MPEG-TS
x MXF: better handling of huge padding blocks, better handling of descriptors without link to a TrackID
x IMX: streams claiming that they are IMX are actually pure MPEG Video, probing both IMX and MPEG Video

Version 0.7.75, 2015-06-30
--------------
+ MXF: consideraing 60 fps timecode tracks with 2 components having a difference of 2 frames as a single timecode
Expand All @@ -17,6 +30,7 @@ x MXF: SDTI 60 fps times were wrong
x #B927, DPX: date/time specific DPX format was used instead of the ISO-like one
x #B927, EBUCore: invalid content in attribute startDate
x ProRes: streams with apcs CodecID were displayed with an incoherent bit depth instead of no bit depth
x IMX: streams claiming that they are IMX are actually pure MPEG Video, probing both IMX and MPEG Video

Version 0.7.74, 2015-05-25
--------------
Expand Down
4 changes: 3 additions & 1 deletion MediaInfoLib/Source/MediaInfo/Audio/File_SmpteSt0302.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ void File_SmpteSt0302::Streams_Fill()

for (size_t Pos=0; Pos<Count_Get(Stream_Audio); Pos++)
if (Retrieve(Stream_Audio, Pos, Audio_MuxingMode).empty()) //TODO: put "SMPTE ST 302" in this field, the current name is there only for legacy
Fill(Stream_Audio, 0, Audio_MuxingMode, "SMPTE ST 302");
Fill(Stream_Audio, Pos, Audio_MuxingMode, "SMPTE ST 302");
else
Fill(Stream_Audio, Pos, Audio_MuxingMode, __T("SMPTE ST 302 / ")+Retrieve(Stream_Audio, Pos, Audio_MuxingMode), true);

if (Count_Get(Stream_Audio)==1)
{
Expand Down
2 changes: 1 addition & 1 deletion MediaInfoLib/Source/MediaInfo/File__Analyze.h
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ protected :
bool FileHeader_Begin_XML(tinyxml2::XMLDocument &Document);
bool Synchronize_0x000001();
public:
void TestContinuousFileNames(size_t CountOfFiles=24, Ztring FileExtension=Ztring());
void TestContinuousFileNames(size_t CountOfFiles=24, Ztring FileExtension=Ztring(), bool SkipComputeDelay=false);

private :

Expand Down
2 changes: 1 addition & 1 deletion MediaInfoLib/Source/MediaInfo/File__Analyze_MinimizeSize.h
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ protected :
bool FileHeader_Begin_XML(tinyxml2::XMLDocument &Document);
bool Synchronize_0x000001();
public:
void TestContinuousFileNames(size_t CountOfFiles=24, Ztring FileExtension=Ztring());
void TestContinuousFileNames(size_t CountOfFiles=24, Ztring FileExtension=Ztring(), bool SkipComputeDelay=false);

private :

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void File__Analyze::Streams_Finish_Global()
}

//---------------------------------------------------------------------------
void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExtension)
void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExtension, bool SkipComputeDelay)
{
if (IsSub || !Config->File_TestContinuousFileNames_Get())
return;
Expand Down Expand Up @@ -230,7 +230,8 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
float64 Demux_Rate=Config->Demux_Rate_Get();
if (!Demux_Rate)
Demux_Rate=24;
Fill(Stream_Video, 0, Video_Delay, float64_int64s(Frame_Count_NotParsedIncluded*1000/Demux_Rate));
if (!SkipComputeDelay)
Fill(Stream_Video, 0, Video_Delay, float64_int64s(Frame_Count_NotParsedIncluded*1000/Demux_Rate));
#endif //MEDIAINFO_DEMUX

#if MEDIAINFO_ADVANCED
Expand Down
Loading

0 comments on commit ea281a6

Please sign in to comment.