ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
TMBOY
Date:
Tue Jul 18 16:54:45 2017 +0800
Revision:
47:9e361da97763
?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TMBOY 47:9e361da97763 1 // Copyright 2017 Baidu Inc. All Rights Reserved.
TMBOY 47:9e361da97763 2 // Author: Chen Xihao (chenxihao@baidu.com)
TMBOY 47:9e361da97763 3 //
TMBOY 47:9e361da97763 4 // Description: Media player API
TMBOY 47:9e361da97763 5
TMBOY 47:9e361da97763 6 #ifndef BAIDU_TINYDU_IOT_OS_SRC_MEDIA_PLAYER_BAIDU_MEDIA_PLAY_H
TMBOY 47:9e361da97763 7 #define BAIDU_TINYDU_IOT_OS_SRC_MEDIA_PLAYER_BAIDU_MEDIA_PLAY_H
TMBOY 47:9e361da97763 8
TMBOY 47:9e361da97763 9 #include "baidu_media_play_type.h"
TMBOY 47:9e361da97763 10 #include "baidu_media_type.h"
TMBOY 47:9e361da97763 11 #include "baidu_media_play_buffer.h"
TMBOY 47:9e361da97763 12
TMBOY 47:9e361da97763 13 namespace duer {
TMBOY 47:9e361da97763 14
TMBOY 47:9e361da97763 15 enum MediaPlayerCmd {
TMBOY 47:9e361da97763 16 PLAYER_CMD_START, //to start playing media
TMBOY 47:9e361da97763 17 PLAYER_CMD_CONTINUE, //media data stream
TMBOY 47:9e361da97763 18 PLAYER_CMD_STOP //to stop mediaplayer
TMBOY 47:9e361da97763 19 };
TMBOY 47:9e361da97763 20
TMBOY 47:9e361da97763 21 struct MediaPlayerMessage {
TMBOY 47:9e361da97763 22 MediaPlayerCmd cmd; //command to mediaplayer
TMBOY 47:9e361da97763 23 MediaType type;
TMBOY 47:9e361da97763 24 int size; //data size in MediaPlayBuffer
TMBOY 47:9e361da97763 25 };
TMBOY 47:9e361da97763 26
TMBOY 47:9e361da97763 27 void start_media_play_thread();
TMBOY 47:9e361da97763 28 void start_media_voice_thread();
TMBOY 47:9e361da97763 29 // return last status of media player
TMBOY 47:9e361da97763 30 MediaPlayerStatus media_play_pause_or_resume();
TMBOY 47:9e361da97763 31 MediaPlayerStatus media_play_stop();
TMBOY 47:9e361da97763 32 MediaPlayerStatus media_play_get_status();
TMBOY 47:9e361da97763 33 int media_play_register_stop_callback(media_player_stop_callback callback);
TMBOY 47:9e361da97763 34 int media_play_unregister_stop_callback(media_player_stop_callback callback);
TMBOY 47:9e361da97763 35 void media_play_set_volume(unsigned char vol);
TMBOY 47:9e361da97763 36
TMBOY 47:9e361da97763 37 extern MediaPlayBuffer* g_media_play_buffer;
TMBOY 47:9e361da97763 38
TMBOY 47:9e361da97763 39 } // namespace duer
TMBOY 47:9e361da97763 40
TMBOY 47:9e361da97763 41 #endif // BAIDU_TINYDU_IOT_OS_SRC_MEDIA_PLAYER_BAIDU_MEDIA_PLAY_H