summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Klimenko <dklimenko@luxoft.com>2014-07-03 00:42:13 -0700
committerDmitriy Klimenko <dklimenko@luxoft.com>2014-07-03 00:42:48 -0700
commitf196d60f18b2d0bdca09552643e99a78a2459b2b (patch)
tree29c0230edcdad30495dc248d82e6314578e84e16
parentaa52fb4bdfe1ae8542bc3bb4ccd11e330bf375e6 (diff)
downloadsdl_core-f196d60f18b2d0bdca09552643e99a78a2459b2b.tar.gz
Stream file/pipe creation issue under QNX was fixed
-rw-r--r--src/appMain/smartDeviceLink.ini6
-rw-r--r--src/components/config_profile/src/profile.cc4
-rw-r--r--src/components/media_manager/src/pipe_streamer_adapter.cc6
-rw-r--r--src/components/media_manager/src/video/video_stream_to_file_adapter.cc8
4 files changed, 19 insertions, 5 deletions
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index f33f2ca5b0..6409ff3339 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -62,8 +62,10 @@ EnableRedecoding = false
VideoStreamConsumer = pipe
AudioStreamConsumer = pipe
;Temp solution: if you change NamedPipePath also change path to pipe in src/components/qt_hmi/qml_model_qtXX/views/SDLNavi.qml
-NamedVideoPipePath = /tmp/video_stream_pipe
-NamedAudioPipePath = /tmp/audio_stream_pipe
+;Named pipe path will be constructed using AppStorageFolder + name
+NamedVideoPipePath = video_stream_pipe
+NamedAudioPipePath = audio_stream_pipe
+;File path will be constructed using AppStorageFolder + name
VideoStreamFile = video_stream_file
AudioStreamFile = audio_stream_file
; Recording file source (used for audio pass thru emulation only)
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 65808a654d..310f823904 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -619,6 +619,8 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
ReadStringValue(&named_video_pipe_path_, "" , kMediaManagerSection,
kNamedVideoPipePathKey);
+ named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_;
+
LOG_UPDATED_VALUE(named_video_pipe_path_, kNamedVideoPipePathKey,
kMediaManagerSection);
@@ -626,6 +628,8 @@ ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
ReadStringValue(&named_audio_pipe_path_, "" , kMediaManagerSection,
kNamedAudioPipePathKey);
+ named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_;
+
LOG_UPDATED_VALUE(named_audio_pipe_path_, kNamedAudioPipePathKey,
kMediaManagerSection);
diff --git a/src/components/media_manager/src/pipe_streamer_adapter.cc b/src/components/media_manager/src/pipe_streamer_adapter.cc
index c14f4caefc..00fab596f0 100644
--- a/src/components/media_manager/src/pipe_streamer_adapter.cc
+++ b/src/components/media_manager/src/pipe_streamer_adapter.cc
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include "utils/logger.h"
+#include "utils/file_system.h"
#include "config_profile/profile.h"
#include "media_manager/pipe_streamer_adapter.h"
@@ -195,7 +196,10 @@ bool PipeStreamerAdapter::Streamer::exitThreadMain() {
void PipeStreamerAdapter::Streamer::open() {
- LOG4CXX_INFO(logger, "Streamer::open()" << server_->named_pipe_path_.c_str());
+ LOG4CXX_INFO(logger, "Streamer::open() " << server_->named_pipe_path_.c_str());
+
+ DCHECK(file_system::CreateDirectoryRecursively(
+ profile::Profile::instance()->app_storage_folder()));
if ((mkfifo(server_->named_pipe_path_.c_str(),
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0)
diff --git a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
index 723ddf6205..0b0a4aeded 100644
--- a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
+++ b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
@@ -30,9 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "media_manager/video/video_stream_to_file_adapter.h"
-#include "utils/file_system.h"
#include "utils/logger.h"
+#include "utils/file_system.h"
+#include "config_profile/profile.h"
+#include "media_manager/video/video_stream_to_file_adapter.h"
namespace media_manager {
@@ -179,6 +180,9 @@ bool VideoStreamToFileAdapter::Streamer::exitThreadMain() {
void VideoStreamToFileAdapter::Streamer::open() {
LOG4CXX_INFO(logger, "Streamer::open()" << server_->file_name_.c_str());
+ DCHECK(file_system::CreateDirectoryRecursively(
+ profile::Profile::instance()->app_storage_folder()));
+
file_stream_ = file_system::Open(server_->file_name_);
if (!file_stream_) {
LOG4CXX_WARN(logger, "Can't open file stream! " << server_->file_name_);