#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>
#include <gst/gst.h>
#include <gst/gstbuffer.h>
+#include <glib.h>
+
#ifdef __cplusplus
extern "C" {
#endif
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:
---------------------------------------------------------------------------*/
GstElement *pipeline;
GstElement *audiosrc;
GstElement *queue2;
- GstElement *volume;
GstElement *audiosink;
GstBuffer *output_buffer;
} mm_radio_gstreamer_s;
/* radio attributes */
MMHandleType* attrs;
+ MMRadioThread_t thread[MM_RADIO_THREAD_NUM];
+
/* message callback */
+ GAsyncQueue *msg_queue;
MMMessageCallback msg_cb;
void* msg_cb_param;
/* 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;
mm_resource_manager_res_h radio_resource;
int interrupted_by_resource_conflict;
- unsigned int subs_id;
float local_volume;
/* region settings */