#include "mm_player_audioeffect.h"
#include "mm_message.h"
#include "mm_player_ini.h"
-#include "mm_player_resource.h"
+#include <mm_resource_manager.h>
#include "mm_player_sound_focus.h"
#include "mm_player_pd.h"
#include "mm_player_streaming.h"
#define MM_MAX_STRING_LENGTH 4000 /* have to be less than MUSE_MSG_MAX_LENGTH */
+#define VIDEO360_MAX_ZOOM 10.0f
+
/*---------------------------------------------------------------------------
| GLOBAL CONSTANT DEFINITIONS: |
---------------------------------------------------------------------------*/
MMPLAYER_A_FILTER,
MMPLAYER_A_FILTER_SEC,
MMPLAYER_A_CAPS_DEFAULT,
+ MMPLAYER_A_CONV_BFORMAT,
+ MMPLAYER_A_CAPS_360,
MMPLAYER_A_SINK,
MMPLAYER_A_RESAMPLER,
MMPLAYER_A_DEINTERLEAVE,
MMPLAYER_V_SCALE,
MMPLAYER_V_CAPS,
MMPLAYER_V_SINK,
+ MMPLAYER_V_360,
MMPLAYER_V_NUM
};
MMPLAYER_PATH_MAX
} MMPlayerPathType;
+/* Video360 related enums. These are duplication from video360.h from
+ * gst-plugins-tizen.
+ * */
+typedef enum {
+ VIDEO360_MODE_UNKNOWN = -1,
+ VIDEO360_MODE_MONOSCOPIC = 0,
+ VIDEO360_MODE_STEREOSCOPIC_TOP_BOTTOM = 1,
+ VIDEO360_MODE_STEREOSCOPIC_LEFT_RIGHT = 2,
+ VIDEO360_MODE_STEREOSCOPIC_STEREO_MESH = 3,
+ VIDEO360_MODE_LAST_ITEM
+} mm_player_stereo_mode_e;
+
+typedef enum {
+ VIDEO360_PROJECTION_TYPE_UNKNOWN = -1,
+ VIDEO360_PROJECTION_TYPE_EQUIRECTANGULAR = 0,
+ VIDEO360_PROJECTION_TYPE_CUBEMAP = 1,
+ VIDEO360_PROJECTION_TYPE_MESH = 2,
+ VIDEO360_PROJECTION_TYPE_LAST_ITEM
+} mm_player_projection_type_e;
+
+/* Spatial audio related enums. These are duplication from mm_file.h from
+ * libmm-fileinfo.
+ * */
+typedef enum {
+ MMFILE_AMBISONIC_TYPE_UNKNOWN = 0,
+ MMFILE_AMBISONIC_TYPE_PERIPHONIC = 1, /**< To comply with Google's Spatial Audio RFC*/
+ MMFILE_AMBISONIC_TYPE_NON_PERIPHONIC = 2,
+} MMFILE_AMBISONIC_TYPE;
+
+typedef enum {
+ MMFILE_AMBISONIC_FORMAT_UNKNOWN = 0,
+ MMFILE_AMBISONIC_FORMAT_AMBIX = 1, /**< AMBIX (Channel sequence: ACN, Normalization: SN3D) */
+ MMFILE_AMBISONIC_FORMAT_AMB = 2, /**< .AMB, Tetraproc (Channel sequence: FuMa, Normalization: FuMa) */
+ MMFILE_AMBISONIC_FORMAT_UA = 3, /**< Universal Ambisonics (Channel sequence: SID, Normalization: N3D) */
+} MMFILE_AMBISONIC_FORMAT;
+
+typedef enum {
+ MMFILE_AMBISONIC_ORDER_UNKNOWN = 0,
+ MMFILE_AMBISONIC_ORDER_FOA = 1, /**< First order Ambisonics */
+ MMFILE_AMBISONIC_ORDER_SOA = 2, /**< Second order Ambisonics */
+ MMFILE_AMBISONIC_ORDER_TOA = 3, /**< Third order Ambisonics */
+} MMFILE_AMBISONIC_ORDER;
+
/*---------------------------------------------------------------------------
| GLOBAL DATA TYPE DEFINITIONS: |
---------------------------------------------------------------------------*/
storage_type_e type;
storage_state_e state;
int id;
+ char path[MM_MAX_URL_LEN];
} MMPlayerStorageInfo;
typedef struct {
} MMPlayerSetMode;
typedef struct {
- GMainContext *global_default;
- GMainContext *thread_default;
-} MMPlayerGMainContext;
-
-typedef struct {
gint uri_idx;
GList *uri_list;
} MMPlayerUriList;
} MMAdaptiveVariantInfo;
typedef struct {
+ int is_spherical;
+ int is_stitched;
+ char *stitching_software;
+ char *projection_type_string;
+ char *stereo_mode_string;
+ mm_player_projection_type_e projection_type;
+ mm_player_stereo_mode_e stereo_mode;
+ int source_count;
+ int init_view_heading;
+ int init_view_pitch;
+ int init_view_roll;
+ int timestamp;
+ int full_pano_width_pixels;
+ int full_pano_height_pixels;
+ int cropped_area_image_width;
+ int cropped_area_image_height;
+ int cropped_area_left;
+ int cropped_area_top;
+ int ambisonic_type;
+ int ambisonic_format;
+ int ambisonic_order;
+} mm_player_spherical_metadata_t;
+
+typedef struct {
/* STATE */
int state; // player current state
int prev_state; // player previous state
MMPlayerVideoColorspace video_cs;
MMVideoBuffer captured;
+ /* gst bus msg thread, create during realize */
+ GThread* bus_msg_thread;
+ gboolean bus_msg_thread_exit;
+ GCond bus_msg_thread_cond;
+ GMutex bus_msg_thread_mutex;
+ gint bus_msg_timeout; /* ms */
+
/* fakesink handling lock */
GMutex fsink_lock;
/* signal notifiers */
GList* signals[MM_PLAYER_SIGNAL_TYPE_MAX];
- guint bus_watcher;
- MMPlayerGMainContext context;
+ GMainContext *global_default;
MMPlayerUriList uri_info;
gboolean is_sound_extraction;
gboolean is_nv12_tiled;
/* resource manager for H/W resources */
- MMPlayerResourceManager resource_manager[RESOURCE_TYPE_MAX];
+ mm_resource_manager_h resource_manager;
+ mm_resource_manager_res_h video_overlay_resource;
+ mm_resource_manager_res_h video_decoder_resource;
+ gboolean interrupted_by_resource;
/* sound focus for being compatible with legacy session policy internally */
MMPlayerSoundFocus sound_focus;
/* adjust subtitle position store */
gint64 adjust_subtitle_pos;
GList *subtitle_language_list;
+ GCond subtitle_info_cond;
+ GMutex subtitle_info_mutex;
/* To store the current multiwindow status */
gboolean last_multiwin_status;
int pcm_channel;
MMAdaptiveVariantInfo adaptive_info;
+
+ /* Video360 related stuff
+ * */
+ bool is_content_spherical;
+ mm_player_spherical_metadata_t video360_metadata;
+ bool is_openal_plugin_used;
+ bool is_video360_plugin_used;
+ /* User settable values */
+ bool is_video360_enabled;
+ float video360_yaw_radians;
+ float video360_pitch_radians;
+ float video360_zoom;
+ int video360_horizontal_fov;
+ int video360_vertical_fov;
+
} mm_player_t;
typedef struct {
int _mmplayer_use_system_clock(MMHandleType hplayer);
int _mmplayer_set_video_share_master_clock(MMHandleType hplayer, long long clock, long long clock_delta, long long video_time, long long media_clock, long long audio_time);
int _mmplayer_get_video_share_master_clock(MMHandleType hplayer, long long *video_time, long long *media_clock, long long *audio_time);
-int _mmplayer_get_video_rotate_angle(MMHandleType hplayer, int *angle);
int _mmplayer_enable_sync_handler(MMHandleType hplayer, bool enable);
int _mmplayer_set_file_buffering_path(MMHandleType hplayer, const char* file_path);
int _mmplayer_set_uri(MMHandleType hplayer, const char* uri);
int _mmplayer_set_next_uri(MMHandleType hplayer, const char* uri, bool is_first_path);
int _mmplayer_get_next_uri(MMHandleType hplayer, char** uri);
int _mmplayer_has_closed_caption(MMHandleType hplayer, bool* exist);
-void * _mm_player_media_packet_video_stream_internal_buffer_ref(void *buffer);
-void _mm_player_media_packet_video_stream_internal_buffer_unref(void *buffer);
+void _mm_player_video_stream_internal_buffer_unref(void *buffer);
int _mmplayer_set_pcm_spec(MMHandleType hplayer, int samplerate, int channel);
int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout);
int _mmplayer_get_num_of_video_out_buffers(MMHandleType hplayer, int *num, int *extra_num);
-int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int state);
+int _mmplayer_manage_external_storage_state(MMHandleType hplayer, int id, int state);
int __mmplayer_gst_set_state(mm_player_t* player, GstElement * pipeline, GstState state, gboolean async, gint timeout);
int __mmplayer_set_state(mm_player_t* player, int state);
int __mmplayer_check_state(mm_player_t* player, enum PlayerCommandState command);
gboolean __mmplayer_dump_pipeline_state(mm_player_t* player);
void __mmplayer_remove_g_source_from_context(GMainContext *context, guint source_id);
+void _mmplayer_bus_msg_thread_destroy(MMHandleType hplayer);
+
/* util */
const gchar * __get_state_name(int state);
gboolean __mmplayer_can_do_interrupt(mm_player_t *player);
int _mmplayer_get_audio_only(MMHandleType hplayer, bool *paudio_only);
int _mmplayer_set_streaming_buffering_time(MMHandleType hplayer, int buffer_ms, int rebuffer_ms);
int _mmplayer_get_streaming_buffering_time(MMHandleType hplayer, int *buffer_ms, int *rebuffer_ms);
+int _mmplayer_set_codec_type(MMHandleType hplayer, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type);
#ifdef __cplusplus
}