[0.6.90] Fix getting orientation bug when capture video
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_priv.h
index dbec7f9..73e0154 100644 (file)
@@ -43,7 +43,7 @@
 #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"
@@ -80,6 +80,8 @@
 
 #define MM_MAX_STRING_LENGTH    4000 /* have to be less than MUSE_MSG_MAX_LENGTH */
 
+#define VIDEO360_MAX_ZOOM      10.0f
+
 /*---------------------------------------------------------------------------
 |    GLOBAL CONSTANT DEFINITIONS:                                                                                      |
 ---------------------------------------------------------------------------*/
@@ -227,6 +229,8 @@ enum AudioElementID {
        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,
@@ -241,6 +245,7 @@ enum VideoElementID {
        MMPLAYER_V_SCALE,
        MMPLAYER_V_CAPS,
        MMPLAYER_V_SINK,
+       MMPLAYER_V_360,
        MMPLAYER_V_NUM
 };
 
@@ -335,6 +340,49 @@ typedef enum {
        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:                                                                                     |
 ---------------------------------------------------------------------------*/
@@ -459,6 +507,30 @@ typedef struct {
 } 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
@@ -506,6 +578,7 @@ typedef struct {
        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;
@@ -679,7 +752,10 @@ typedef struct {
        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;
@@ -714,6 +790,8 @@ typedef struct {
        /* 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;
@@ -766,6 +844,21 @@ typedef struct {
        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 {
@@ -847,15 +940,13 @@ int _mmplayer_set_video_hub_download_mode(MMHandleType hplayer, bool mode);
 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);
@@ -896,6 +987,7 @@ int _mmplayer_set_audio_only(MMHandleType hplayer, bool audio_only);
 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
        }