Remove radio volume logic for media volume
[platform/core/multimedia/libmm-radio.git] / src / include / mm_radio_priv.h
old mode 100755 (executable)
new mode 100644 (file)
index f6ad141..1c88fe2
 #include <mm_message.h>
 #include <media/mm_resource_manager.h>
 
-#ifdef TIZEN_FEATURE_SOUND_FOCUS
-#include "mm_radio_sound_focus.h"
-#endif
-
 #include "mm_radio.h"
 #include "mm_radio_utils.h"
 #include <linux/videodev2.h>
@@ -45,6 +41,8 @@
 #include <gst/gst.h>
 #include <gst/gstbuffer.h>
 
+#include <glib.h>
+
 #ifdef __cplusplus
        extern "C" {
 #endif
@@ -127,6 +125,39 @@ typedef struct {
        int channel_spacing;                            // TBD
 } MMRadioRegion_t;
 
+typedef struct {
+       pthread_t thread;
+       pthread_mutex_t mutex;
+       pthread_cond_t cond;
+       int thread_id;
+       bool is_running;
+       bool stop;
+       bool thread_exit;
+} MMRadioThread_t;
+
+typedef enum {
+       MM_RADIO_MSG_DESTROY = 0,
+       MM_RADIO_MSG_SCAN_INFO,
+       MM_RADIO_MSG_SCAN_STOPPED,
+       MM_RADIO_MSG_SCAN_FINISHED,
+       MM_RADIO_MSG_SEEK_FINISHED,
+       MM_RADIO_MSG_STATE_INTERRUPTED,
+       MM_RADIO_MSG_NUM
+} MMRadioMsgTypes;
+
+typedef struct {
+       bool destroy;
+       MMRadioMsgTypes msg_type;
+       int data;
+} mm_radio_msg_t;
+
+typedef enum {
+       MM_RADIO_THREAD_MSG = 0,
+       MM_RADIO_THREAD_SEEK,
+       MM_RADIO_THREAD_SCAN,
+       MM_RADIO_THREAD_NUM
+} MMRadioThreadTypes;
+
 /*---------------------------------------------------------------------------
     GLOBAL DATA TYPE DEFINITIONS:
 ---------------------------------------------------------------------------*/
@@ -138,7 +169,6 @@ typedef struct _mm_radio_gstreamer_s {
        GstElement *pipeline;
        GstElement *audiosrc;
        GstElement *queue2;
-       GstElement *volume;
        GstElement *audiosink;
        GstBuffer *output_buffer;
 } mm_radio_gstreamer_s;
@@ -158,7 +188,10 @@ typedef struct {
        /* radio attributes */
        MMHandleType* attrs;
 
+       MMRadioThread_t thread[MM_RADIO_THREAD_NUM];
+
        /* message callback */
+       GAsyncQueue *msg_queue;
        MMMessageCallback msg_cb;
        void* msg_cb_param;
 
@@ -174,19 +207,10 @@ typedef struct {
        /* hw debug */
        struct v4l2_dbg_register reg;
 
-       /* scan */
-       pthread_t       scan_thread;
-       bool    stop_scan;
-
        /* seek */
-       pthread_t seek_thread;
        int prev_seek_freq;
        MMRadioSeekDirectionType seek_direction;
 
-#ifdef TIZEN_FEATURE_SOUND_FOCUS
-       mm_radio_sound_focus sound_focus;
-#endif
-
        int freq;
 #ifdef USE_GST_PIPELINE
        mm_radio_gstreamer_s* pGstreamer_s;
@@ -195,7 +219,6 @@ typedef struct {
        mm_resource_manager_res_h radio_resource;
        int interrupted_by_resource_conflict;
 
-       unsigned int subs_id;
        float local_volume;
 
        /* region settings */