Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
media_proxy.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <zephyr/bluetooth/bluetooth.h>
#include "mcs.h"

Go to the source code of this file.

Data Structures

struct  mpl_cmd
 Media player command. More...
 
struct  mpl_cmd_ntf
 Media command notification. More...
 
struct  mpl_sci
 Search control item. More...
 
struct  mpl_search
 Search. More...
 
struct  media_proxy_ctrl_cbs
 Callbacks to a controller, from the media proxy. More...
 
struct  media_proxy_pl_calls
 Available calls in a player, that the media proxy can call. More...
 

Macros

#define MEDIA_PROXY_PLAYBACK_SPEED_MIN   -128
 Playback speed parameters.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_QUARTER   -128
 
#define MEDIA_PROXY_PLAYBACK_SPEED_HALF   -64
 
#define MEDIA_PROXY_PLAYBACK_SPEED_UNITY   0
 
#define MEDIA_PROXY_PLAYBACK_SPEED_DOUBLE   64
 
#define MEDIA_PROXY_PLAYBACK_SPEED_MAX   127
 
#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MAX   64
 Seeking speed factors.
 
#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MIN   4
 
#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_ZERO   0
 
#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_ONCE   0x01
 Playing orders.
 
#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_REPEAT   0x02
 
#define MEDIA_PROXY_PLAYING_ORDER_INORDER_ONCE   0x03
 
#define MEDIA_PROXY_PLAYING_ORDER_INORDER_REPEAT   0x04
 
#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_ONCE   0x05
 
#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_REPEAT   0x06
 
#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_ONCE   0x07
 
#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_REPEAT   0x08
 
#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_ONCE   0x09
 
#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_REPEAT   0x0a
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE   BIT(0)
 Playing orders supported.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT   BIT(1)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE   BIT(2)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT   BIT(3)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE   BIT(4)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT   BIT(5)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE   BIT(6)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT   BIT(7)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE   BIT(8)
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT   BIT(9)
 
#define MEDIA_PROXY_STATE_INACTIVE   0x00
 Media player states.
 
#define MEDIA_PROXY_STATE_PLAYING   0x01
 
#define MEDIA_PROXY_STATE_PAUSED   0x02
 
#define MEDIA_PROXY_STATE_SEEKING   0x03
 
#define MEDIA_PROXY_STATE_LAST   0x04
 
#define MEDIA_PROXY_OP_PLAY   0x01
 Media player command opcodes.
 
#define MEDIA_PROXY_OP_PAUSE   0x02
 
#define MEDIA_PROXY_OP_FAST_REWIND   0x03
 
#define MEDIA_PROXY_OP_FAST_FORWARD   0x04
 
#define MEDIA_PROXY_OP_STOP   0x05
 
#define MEDIA_PROXY_OP_MOVE_RELATIVE   0x10
 
#define MEDIA_PROXY_OP_PREV_SEGMENT   0x20
 
#define MEDIA_PROXY_OP_NEXT_SEGMENT   0x21
 
#define MEDIA_PROXY_OP_FIRST_SEGMENT   0x22
 
#define MEDIA_PROXY_OP_LAST_SEGMENT   0x23
 
#define MEDIA_PROXY_OP_GOTO_SEGMENT   0x24
 
#define MEDIA_PROXY_OP_PREV_TRACK   0x30
 
#define MEDIA_PROXY_OP_NEXT_TRACK   0x31
 
#define MEDIA_PROXY_OP_FIRST_TRACK   0x32
 
#define MEDIA_PROXY_OP_LAST_TRACK   0x33
 
#define MEDIA_PROXY_OP_GOTO_TRACK   0x34
 
#define MEDIA_PROXY_OP_PREV_GROUP   0x40
 
#define MEDIA_PROXY_OP_NEXT_GROUP   0x41
 
#define MEDIA_PROXY_OP_FIRST_GROUP   0x42
 
#define MEDIA_PROXY_OP_LAST_GROUP   0x43
 
#define MEDIA_PROXY_OP_GOTO_GROUP   0x44
 
#define MEDIA_PROXY_OPCODES_SUPPORTED_LEN   4
 Media player supported opcodes length.
 
#define MEDIA_PROXY_OP_SUP_PLAY   BIT(0)
 Media player supported command opcodes.
 
#define MEDIA_PROXY_OP_SUP_PAUSE   BIT(1)
 
#define MEDIA_PROXY_OP_SUP_FAST_REWIND   BIT(2)
 
#define MEDIA_PROXY_OP_SUP_FAST_FORWARD   BIT(3)
 
#define MEDIA_PROXY_OP_SUP_STOP   BIT(4)
 
#define MEDIA_PROXY_OP_SUP_MOVE_RELATIVE   BIT(5)
 
#define MEDIA_PROXY_OP_SUP_PREV_SEGMENT   BIT(6)
 
#define MEDIA_PROXY_OP_SUP_NEXT_SEGMENT   BIT(7)
 
#define MEDIA_PROXY_OP_SUP_FIRST_SEGMENT   BIT(8)
 
#define MEDIA_PROXY_OP_SUP_LAST_SEGMENT   BIT(9)
 
#define MEDIA_PROXY_OP_SUP_GOTO_SEGMENT   BIT(10)
 
#define MEDIA_PROXY_OP_SUP_PREV_TRACK   BIT(11)
 
#define MEDIA_PROXY_OP_SUP_NEXT_TRACK   BIT(12)
 
#define MEDIA_PROXY_OP_SUP_FIRST_TRACK   BIT(13)
 
#define MEDIA_PROXY_OP_SUP_LAST_TRACK   BIT(14)
 
#define MEDIA_PROXY_OP_SUP_GOTO_TRACK   BIT(15)
 
#define MEDIA_PROXY_OP_SUP_PREV_GROUP   BIT(16)
 
#define MEDIA_PROXY_OP_SUP_NEXT_GROUP   BIT(17)
 
#define MEDIA_PROXY_OP_SUP_FIRST_GROUP   BIT(18)
 
#define MEDIA_PROXY_OP_SUP_LAST_GROUP   BIT(19)
 
#define MEDIA_PROXY_OP_SUP_GOTO_GROUP   BIT(20)
 
#define MEDIA_PROXY_CMD_SUCCESS   0x01
 Media player command result codes.
 
#define MEDIA_PROXY_CMD_NOT_SUPPORTED   0x02
 
#define MEDIA_PROXY_CMD_PLAYER_INACTIVE   0x03
 
#define MEDIA_PROXY_CMD_CANNOT_BE_COMPLETED   0x04
 
#define MEDIA_PROXY_SEARCH_TYPE_TRACK_NAME   0x01
 Search operation type values.
 
#define MEDIA_PROXY_SEARCH_TYPE_ARTIST_NAME   0x02
 
#define MEDIA_PROXY_SEARCH_TYPE_ALBUM_NAME   0x03
 
#define MEDIA_PROXY_SEARCH_TYPE_GROUP_NAME   0x04
 
#define MEDIA_PROXY_SEARCH_TYPE_EARLIEST_YEAR   0x05
 
#define MEDIA_PROXY_SEARCH_TYPE_LATEST_YEAR   0x06
 
#define MEDIA_PROXY_SEARCH_TYPE_GENRE   0x07
 
#define MEDIA_PROXY_SEARCH_TYPE_ONLY_TRACKS   0x08
 
#define MEDIA_PROXY_SEARCH_TYPE_ONLY_GROUPS   0x09
 
#define MEDIA_PROXY_SEARCH_SUCCESS   0x01
 Search operation result codes.
 
#define MEDIA_PROXY_SEARCH_FAILURE   0x02
 
#define MEDIA_PROXY_GROUP_OBJECT_TRACK_TYPE   0x00
 
#define MEDIA_PROXY_GROUP_OBJECT_GROUP_TYPE   0x01
 

Functions

int media_proxy_ctrl_register (struct media_proxy_ctrl_cbs *ctrl_cbs)
 Register a controller with the media_proxy.
 
int media_proxy_ctrl_discover_player (struct bt_conn *conn)
 Discover a remote media player.
 
int media_proxy_ctrl_get_player_name (struct media_player *player)
 Read Media Player Name.
 
int media_proxy_ctrl_get_icon_id (struct media_player *player)
 Read Icon Object ID.
 
int media_proxy_ctrl_get_icon_url (struct media_player *player)
 Read Icon URL.
 
int media_proxy_ctrl_get_track_title (struct media_player *player)
 Read Track Title.
 
int media_proxy_ctrl_get_track_duration (struct media_player *player)
 Read Track Duration.
 
int media_proxy_ctrl_get_track_position (struct media_player *player)
 Read Track Position.
 
int media_proxy_ctrl_set_track_position (struct media_player *player, int32_t position)
 Set Track Position.
 
int media_proxy_ctrl_get_playback_speed (struct media_player *player)
 Get Playback Speed.
 
int media_proxy_ctrl_set_playback_speed (struct media_player *player, int8_t speed)
 Set Playback Speed.
 
int media_proxy_ctrl_get_seeking_speed (struct media_player *player)
 Get Seeking Speed.
 
int media_proxy_ctrl_get_track_segments_id (struct media_player *player)
 Read Current Track Segments Object ID.
 
int media_proxy_ctrl_get_current_track_id (struct media_player *player)
 Read Current Track Object ID.
 
int media_proxy_ctrl_set_current_track_id (struct media_player *player, uint64_t id)
 Set Current Track Object ID.
 
int media_proxy_ctrl_get_next_track_id (struct media_player *player)
 Read Next Track Object ID.
 
int media_proxy_ctrl_set_next_track_id (struct media_player *player, uint64_t id)
 Set Next Track Object ID.
 
int media_proxy_ctrl_get_parent_group_id (struct media_player *player)
 Read Parent Group Object ID.
 
int media_proxy_ctrl_get_current_group_id (struct media_player *player)
 Read Current Group Object ID.
 
int media_proxy_ctrl_set_current_group_id (struct media_player *player, uint64_t id)
 Set Current Group Object ID.
 
int media_proxy_ctrl_get_playing_order (struct media_player *player)
 Read Playing Order.
 
int media_proxy_ctrl_set_playing_order (struct media_player *player, uint8_t order)
 Set Playing Order.
 
int media_proxy_ctrl_get_playing_orders_supported (struct media_player *player)
 Read Playing Orders Supported.
 
int media_proxy_ctrl_get_media_state (struct media_player *player)
 Read Media State.
 
int media_proxy_ctrl_send_command (struct media_player *player, const struct mpl_cmd *command)
 Send Command.
 
int media_proxy_ctrl_get_commands_supported (struct media_player *player)
 Read Commands Supported.
 
int media_proxy_ctrl_send_search (struct media_player *player, const struct mpl_search *search)
 Set Search.
 
int media_proxy_ctrl_get_search_results_id (struct media_player *player)
 Read Search Results Object ID.
 
uint8_t media_proxy_ctrl_get_content_ctrl_id (struct media_player *player)
 Read Content Control ID.
 
int media_proxy_pl_register (struct media_proxy_pl_calls *pl_calls)
 Register a player with the media proxy.
 
int media_proxy_pl_init (void)
 
struct bt_ots * bt_mcs_get_ots (void)
 
void media_proxy_pl_name_cb (const char *name)
 Player name changed callback.
 
void media_proxy_pl_icon_url_cb (const char *url)
 Player icon URL changed callback.
 
void media_proxy_pl_track_changed_cb (void)
 Track changed callback.
 
void media_proxy_pl_track_title_cb (char *title)
 Track title callback.
 
void media_proxy_pl_track_duration_cb (int32_t duration)
 Track duration callback.
 
void media_proxy_pl_track_position_cb (int32_t position)
 Track position callback.
 
void media_proxy_pl_playback_speed_cb (int8_t speed)
 Playback speed callback.
 
void media_proxy_pl_seeking_speed_cb (int8_t speed)
 Seeking speed callback.
 
void media_proxy_pl_current_track_id_cb (uint64_t id)
 Current track object ID callback.
 
void media_proxy_pl_next_track_id_cb (uint64_t id)
 Next track object ID callback.
 
void media_proxy_pl_parent_group_id_cb (uint64_t id)
 Parent group object ID callback.
 
void media_proxy_pl_current_group_id_cb (uint64_t id)
 Current group object ID callback.
 
void media_proxy_pl_playing_order_cb (uint8_t order)
 Playing order callback.
 
void media_proxy_pl_media_state_cb (uint8_t state)
 Media state callback.
 
void media_proxy_pl_command_cb (const struct mpl_cmd_ntf *cmd_ntf)
 Command callback.
 
void media_proxy_pl_commands_supported_cb (uint32_t opcodes)
 Commands supported callback.
 
void media_proxy_pl_search_cb (uint8_t result_code)
 Search callback.
 
void media_proxy_pl_search_results_id_cb (uint64_t id)
 Search Results object ID callback.