Some more renaming
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
namespace Av::Transcoding
|
||||
{
|
||||
|
||||
#define LOG(sev) LMS_LOG(TRANSCODE, sev) << "[" << _debugId << "] - "
|
||||
#define LOG(sev) LMS_LOG(TRANSCODING, sev) << "[" << _debugId << "] - "
|
||||
|
||||
static std::atomic<size_t> globalId{};
|
||||
static std::filesystem::path ffmpegPath;
|
||||
|
||||
@@ -43,9 +43,9 @@ namespace Av::Transcoding
|
||||
, _transcoder{ inputParameters, outputParameters }
|
||||
{
|
||||
if (_estimatedContentLength)
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Estimated content length = " << *_estimatedContentLength;
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Estimated content length = " << *_estimatedContentLength;
|
||||
else
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Not using estimated content length";
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Not using estimated content length";
|
||||
}
|
||||
|
||||
Wt::Http::ResponseContinuation* TranscodingResourceHandler::processRequest(const Wt::Http::Request& /*request*/, Wt::Http::Response& response)
|
||||
@@ -53,11 +53,11 @@ namespace Av::Transcoding
|
||||
if (_estimatedContentLength)
|
||||
response.setContentLength(*_estimatedContentLength);
|
||||
response.setMimeType(_transcoder.getOutputMimeType());
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Transcoder finished = " << _transcoder.finished() << ", total served bytes = " << _totalServedByteCount << ", mime type = " << _transcoder.getOutputMimeType();
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Transcoder finished = " << _transcoder.finished() << ", total served bytes = " << _totalServedByteCount << ", mime type = " << _transcoder.getOutputMimeType();
|
||||
|
||||
if (_bytesReadyCount > 0)
|
||||
{
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Writing " << _bytesReadyCount << " bytes back to client";
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Writing " << _bytesReadyCount << " bytes back to client";
|
||||
|
||||
response.out().write(reinterpret_cast<const char*>(&_buffer[0]), _bytesReadyCount);
|
||||
_totalServedByteCount += _bytesReadyCount;
|
||||
@@ -70,7 +70,7 @@ namespace Av::Transcoding
|
||||
continuation->waitForMoreData();
|
||||
_transcoder.asyncRead(_buffer.data(), _buffer.size(), [=](std::size_t nbBytesRead)
|
||||
{
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Have " << nbBytesRead << " more bytes to send back";
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Have " << nbBytesRead << " more bytes to send back";
|
||||
|
||||
assert(_bytesReadyCount == 0);
|
||||
_bytesReadyCount = nbBytesRead;
|
||||
@@ -86,7 +86,7 @@ namespace Av::Transcoding
|
||||
{
|
||||
const std::size_t padSize{ *_estimatedContentLength - _totalServedByteCount };
|
||||
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Adding " << padSize << " padding bytes";
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Adding " << padSize << " padding bytes";
|
||||
|
||||
for (std::size_t i{}; i < padSize; ++i)
|
||||
response.out().put(0);
|
||||
@@ -94,7 +94,7 @@ namespace Av::Transcoding
|
||||
_totalServedByteCount += padSize;
|
||||
}
|
||||
|
||||
LMS_LOG(TRANSCODE, DEBUG) << "Transcoding finished. Total served byte count = " << _totalServedByteCount;
|
||||
LMS_LOG(TRANSCODING, DEBUG) << "Transcoding finished. Total served byte count = " << _totalServedByteCount;
|
||||
}
|
||||
|
||||
return {};
|
||||
|
||||
@@ -21,59 +21,59 @@
|
||||
|
||||
const char* getModuleName(Module mod)
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
case Module::API_SUBSONIC: return "API_SUBSONIC";
|
||||
case Module::AUTH: return "AUTH";
|
||||
case Module::AV: return "AV";
|
||||
case Module::CHILDPROCESS: return "CHILDPROC";
|
||||
case Module::COVER: return "COVER";
|
||||
case Module::DB: return "DB";
|
||||
case Module::DBUPDATER: return "DB UPDATER";
|
||||
case Module::FEATURE: return "FEATURE";
|
||||
case Module::FEEDBACK: return "FEEDBACK";
|
||||
case Module::HTTP: return "HTTP";
|
||||
case Module::MAIN: return "MAIN";
|
||||
case Module::METADATA: return "METADATA";
|
||||
case Module::REMOTE: return "REMOTE";
|
||||
case Module::SCROBBLING: return "SCROBBLING";
|
||||
case Module::SERVICE: return "SERVICE";
|
||||
case Module::RECOMMENDATION: return "RECOMMENDATION";
|
||||
case Module::TRANSCODE: return "TRANSCODE";
|
||||
case Module::UI: return "UI";
|
||||
case Module::UTILS: return "UTILS";
|
||||
}
|
||||
return "";
|
||||
switch (mod)
|
||||
{
|
||||
case Module::API_SUBSONIC: return "API_SUBSONIC";
|
||||
case Module::AUTH: return "AUTH";
|
||||
case Module::AV: return "AV";
|
||||
case Module::CHILDPROCESS: return "CHILDPROC";
|
||||
case Module::COVER: return "COVER";
|
||||
case Module::DB: return "DB";
|
||||
case Module::DBUPDATER: return "DB UPDATER";
|
||||
case Module::FEATURE: return "FEATURE";
|
||||
case Module::FEEDBACK: return "FEEDBACK";
|
||||
case Module::HTTP: return "HTTP";
|
||||
case Module::MAIN: return "MAIN";
|
||||
case Module::METADATA: return "METADATA";
|
||||
case Module::REMOTE: return "REMOTE";
|
||||
case Module::SCROBBLING: return "SCROBBLING";
|
||||
case Module::SERVICE: return "SERVICE";
|
||||
case Module::RECOMMENDATION: return "RECOMMENDATION";
|
||||
case Module::TRANSCODING: return "TRANSCODING";
|
||||
case Module::UI: return "UI";
|
||||
case Module::UTILS: return "UTILS";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* getSeverityName(Severity sev)
|
||||
{
|
||||
switch (sev)
|
||||
{
|
||||
case Severity::FATAL: return "fatal";
|
||||
case Severity::ERROR: return "error";
|
||||
case Severity::WARNING: return "warning";
|
||||
case Severity::INFO: return "info";
|
||||
case Severity::DEBUG: return "debug";
|
||||
}
|
||||
return "";
|
||||
switch (sev)
|
||||
{
|
||||
case Severity::FATAL: return "fatal";
|
||||
case Severity::ERROR: return "error";
|
||||
case Severity::WARNING: return "warning";
|
||||
case Severity::INFO: return "info";
|
||||
case Severity::DEBUG: return "debug";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Log::Log(Logger* logger, Module module, Severity severity)
|
||||
: _module {module},
|
||||
_severity {severity},
|
||||
_logger {logger}
|
||||
: _module{ module },
|
||||
_severity{ severity },
|
||||
_logger{ logger }
|
||||
{}
|
||||
|
||||
Log::~Log()
|
||||
{
|
||||
if (_logger)
|
||||
_logger->processLog(*this);
|
||||
if (_logger)
|
||||
_logger->processLog(*this);
|
||||
}
|
||||
|
||||
std::string
|
||||
Log::getMessage() const
|
||||
{
|
||||
return _oss.str();
|
||||
return _oss.str();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ enum class Module
|
||||
SCROBBLING,
|
||||
SERVICE,
|
||||
RECOMMENDATION,
|
||||
TRANSCODE,
|
||||
TRANSCODING,
|
||||
UI,
|
||||
UTILS,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user