#include <gst/gst.h>
#include <gst/gstbuffer.h>
+#include <glib.h>
+
#ifdef __cplusplus
extern "C" {
#endif
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 */
- MMRadioThread_t scan;
-
/* seek */
- MMRadioThread_t seek;
int prev_seek_freq;
MMRadioSeekDirectionType seek_direction;
mm_resource_manager_res_h radio_resource;
int interrupted_by_resource_conflict;
- unsigned int subs_id;
float local_volume;
/* region settings */