Media Manager Update
authorJustin Dickow <jjdickow@gmail.com>
Thu, 17 Jul 2014 18:05:21 +0000 (14:05 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Thu, 17 Jul 2014 18:05:21 +0000 (14:05 -0400)
Authors

Dmitriy Klimenko
Dmitry Chmerev

Signed-off-by: Justin Dickow <jjdickow@gmail.com>
src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
src/components/media_manager/src/media_manager_impl.cc

index dd0beb5..74c2352 100644 (file)
@@ -97,7 +97,7 @@ void FromMicToFileRecorderThread::threadMain() {
   initArgs();
 
   GstElement* pipeline;
-  GstElement* alsasrc, *panorama, *wavenc, *filesink;
+  GstElement* alsasrc, *wavenc, *filesink;
   GstBus* bus;
 
   const gchar* device = "hw:0,0";
@@ -158,26 +158,23 @@ void FromMicToFileRecorderThread::threadMain() {
 
   // Create all of the elements to be added to the pipeline
   alsasrc = gst_element_factory_make("alsasrc", "alsasrc0");
-  panorama = gst_element_factory_make("audiopanorama", "panorama0");
   wavenc = gst_element_factory_make("wavenc", "wavenc0");
   filesink = gst_element_factory_make("filesink", "filesink0");
 
   // Assert that all the elements were created
-  if (!alsasrc || !panorama || !wavenc || !filesink) {
+  if (!alsasrc || !wavenc || !filesink) {
     g_error("Failed creating one or more of the pipeline elements.\n");
   }
 
   // Set input and output destinations
   g_object_set(G_OBJECT(alsasrc), "device", device, NULL);
-  g_object_set(G_OBJECT(panorama), "panorama", 0.5, NULL);
   g_object_set(G_OBJECT(filesink), "location", outfile, NULL);
 
   // Add the elements to the pipeline
-  gst_bin_add_many(GST_BIN(pipeline), alsasrc,
-                   panorama, wavenc, filesink, NULL);
+  gst_bin_add_many(GST_BIN(pipeline), alsasrc, wavenc, filesink, NULL);
 
   // Link the elements
-  gst_element_link_many(alsasrc, panorama, wavenc, filesink, NULL);
+  gst_element_link_many(alsasrc, wavenc, filesink, NULL);
 
   gst_element_set_state(pipeline, GST_STATE_PLAYING);
 
index 15bab01..2c9c27b 100644 (file)
@@ -157,10 +157,6 @@ void MediaManagerImpl::StartMicrophoneRecording(
       application(application_key);
   std::string file_path = profile::Profile::instance()->app_storage_folder();
   file_path += "/";
-  file_path += app->folder_name();
-  file_system::CreateDirectory(file_path);
-
-  file_path += "/";
   file_path += output_file;
   from_mic_listener_ = new FromMicRecorderListener(file_path);
 #if defined(EXTENDED_MEDIA_MODE)
@@ -182,21 +178,21 @@ void MediaManagerImpl::StartMicrophoneRecording(
       LOG4CXX_WARN(logger_, "Could not remove file " << output_file);
     }
   }
-  const std::string predefined_rec_file =
+  const std::string record_file_source =
       profile::Profile::instance()->app_resourse_folder() + "/" +
-      profile::Profile::instance()->recording_file();
+      profile::Profile::instance()->recording_file_source();
   std::vector<uint8_t> buf;
-  if (file_system::ReadBinaryFile(predefined_rec_file, buf)) {
+  if (file_system::ReadBinaryFile(record_file_source, buf)) {
     if (file_system::Write(file_path, buf)) {
       LOG4CXX_INFO(logger_,
-        "File " << predefined_rec_file << " copied to " << output_file);
+        "File " << record_file_source << " copied to " << output_file);
     }
     else {
       LOG4CXX_WARN(logger_, "Could not write to file " << output_file);
     }
   }
   else {
-    LOG4CXX_WARN(logger_, "Could not read file " << predefined_rec_file);
+    LOG4CXX_WARN(logger_, "Could not read file " << record_file_source);
   }
 #endif
   from_mic_listener_->OnActivityStarted(application_key);