summaryrefslogtreecommitdiff
path: root/src/components/media_manager/src/media_manager_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/media_manager/src/media_manager_impl.cc')
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc52
1 files changed, 24 insertions, 28 deletions
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index d7352d0025..ce80cc3c50 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -57,7 +57,7 @@
namespace media_manager {
-CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
+SDL_CREATE_LOG_VARIABLE("MediaManager")
MediaManagerImpl::MediaManagerImpl(
application_manager::ApplicationManager& application_manager,
@@ -117,10 +117,10 @@ void MediaManagerImpl::set_mock_streamer_listener(
void MediaManagerImpl::Init() {
using namespace protocol_handler;
- LOG4CXX_INFO(logger_, "MediaManagerImpl::Init()");
+ SDL_LOG_INFO("MediaManagerImpl::Init()");
#if defined(EXTENDED_MEDIA_MODE)
- LOG4CXX_INFO(logger_, "Called Init with default configuration.");
+ SDL_LOG_INFO("Called Init with default configuration.");
from_mic_recorder_ = new FromMicRecorderAdapter();
#endif
@@ -185,7 +185,7 @@ void MediaManagerImpl::Init() {
}
void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
#if defined(EXTENDED_MEDIA_MODE)
if (!a2dp_player_ && protocol_handler_) {
@@ -200,7 +200,7 @@ void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
}
void MediaManagerImpl::StopA2DPSource(int32_t application_key) {
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
if (a2dp_player_) {
a2dp_player_->StopActivity(application_key);
}
@@ -224,8 +224,7 @@ void MediaManagerImpl::StartMicrophoneRecording(
mobile_apis::SamplingRate::eType sampling_rate,
mobile_apis::BitsPerSample::eType bits_per_sample,
mobile_apis::AudioType::eType audio_type) {
- LOG4CXX_INFO(logger_,
- "MediaManagerImpl::StartMicrophoneRecording to " << output_file);
+ SDL_LOG_INFO("MediaManagerImpl::StartMicrophoneRecording to " << output_file);
application_manager::ApplicationSharedPtr app =
application_manager_.application(application_key);
std::string file_path = settings().app_storage_folder();
@@ -244,11 +243,11 @@ void MediaManagerImpl::StartMicrophoneRecording(
}
#else
if (file_system::FileExists(file_path)) {
- LOG4CXX_INFO(logger_, "File " << output_file << " exists, removing");
+ SDL_LOG_INFO("File " << output_file << " exists, removing");
if (file_system::DeleteFile(file_path)) {
- LOG4CXX_INFO(logger_, "File " << output_file << " removed");
+ SDL_LOG_INFO("File " << output_file << " removed");
} else {
- LOG4CXX_WARN(logger_, "Could not remove file " << output_file);
+ SDL_LOG_WARN("Could not remove file " << output_file);
}
}
const std::string record_file_source = settings().app_resource_folder() +
@@ -257,21 +256,20 @@ void MediaManagerImpl::StartMicrophoneRecording(
std::vector<uint8_t> buf;
if (file_system::ReadBinaryFile(record_file_source, buf)) {
if (file_system::Write(file_path, buf)) {
- LOG4CXX_INFO(
- logger_,
- "File " << record_file_source << " copied to " << output_file);
+ SDL_LOG_INFO("File " << record_file_source << " copied to "
+ << output_file);
} else {
- LOG4CXX_WARN(logger_, "Could not write to file " << output_file);
+ SDL_LOG_WARN("Could not write to file " << output_file);
}
} else {
- LOG4CXX_WARN(logger_, "Could not read file " << record_file_source);
+ SDL_LOG_WARN("Could not read file " << record_file_source);
}
#endif
from_mic_listener_->OnActivityStarted(application_key);
}
void MediaManagerImpl::StopMicrophoneRecording(int32_t application_key) {
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
#if defined(EXTENDED_MEDIA_MODE)
if (from_mic_recorder_) {
from_mic_recorder_->StopActivity(application_key);
@@ -289,7 +287,7 @@ void MediaManagerImpl::StopMicrophoneRecording(int32_t application_key) {
void MediaManagerImpl::StartStreaming(
int32_t application_key, protocol_handler::ServiceType service_type) {
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
if (streamer_[service_type]) {
streamer_[service_type]->StartActivity(application_key);
@@ -298,7 +296,7 @@ void MediaManagerImpl::StartStreaming(
void MediaManagerImpl::StopStreaming(
int32_t application_key, protocol_handler::ServiceType service_type) {
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
stream_data_size_ = 0ull;
@@ -317,23 +315,23 @@ void MediaManagerImpl::OnMessageReceived(
using namespace protocol_handler;
using namespace application_manager;
using namespace helpers;
- LOG4CXX_AUTO_TRACE(logger_);
+ SDL_LOG_AUTO_TRACE();
const uint32_t streaming_app_id = message->connection_key();
const ServiceType service_type = message->service_type();
if (Compare<ServiceType, NEQ, ALL>(
service_type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- LOG4CXX_DEBUG(logger_, "Unsupported service type in MediaManager");
+ SDL_LOG_DEBUG("Unsupported service type in MediaManager");
return;
}
if (!application_manager_.CanAppStream(streaming_app_id, service_type)) {
application_manager_.ForbidStreaming(streaming_app_id, service_type);
- LOG4CXX_ERROR(logger_,
- "The application is trying to stream when it should not."
- " service type: "
- << service_type);
+ SDL_LOG_ERROR(
+ "The application is trying to stream when it should not."
+ " service type: "
+ << service_type);
return;
}
@@ -383,8 +381,7 @@ void MediaManagerImpl::FramesProcessed(int32_t application_key,
if (audio_stream.use_count() != 0 &&
"pipe" == settings().audio_server_type()) {
size_t audio_queue_size = audio_stream->GetMsgQueueSize();
- LOG4CXX_DEBUG(logger_,
- "# Messages in audio queue = " << audio_queue_size);
+ SDL_LOG_DEBUG("# Messages in audio queue = " << audio_queue_size);
if (audio_queue_size > 0) {
app->WakeUpStreaming(protocol_handler::ServiceType::kAudio);
}
@@ -393,8 +390,7 @@ void MediaManagerImpl::FramesProcessed(int32_t application_key,
if (video_stream.use_count() != 0 &&
"pipe" == settings().video_server_type()) {
size_t video_queue_size = video_stream->GetMsgQueueSize();
- LOG4CXX_DEBUG(logger_,
- "# Messages in video queue = " << video_queue_size);
+ SDL_LOG_DEBUG("# Messages in video queue = " << video_queue_size);
if (video_queue_size > 0) {
app->WakeUpStreaming(protocol_handler::ServiceType::kMobileNav);
}