Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.6.101
+Version: 0.6.102
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
extern "C" {
#endif
-/**
- @addtogroup PLAYER
- @{
-
- @par
- This part describes APIs used for playback of multimedia contents.
- All multimedia contents are created by a media player through handle of playback.
- In creating a player, it displays the player's status or information
- by registering callback function.
-
- @par
- In case of streaming playback, network has to be opend by using datanetwork API.
- If proxy, cookies and the other attributes for streaming playback are needed,
- set those attributes using mm_player_set_attribute() before create player.
-
- @par
- The subtitle for local video playback is supported. Set "subtitle_uri" attribute
- using mm_player_set_attribute() before the application creates the player.
- Then the application could receive MMMessageParamType which includes subtitle string and duration.
-
- @par
- Player can have 5 states, and each state can be changed by calling
- described functions on "Figure1. State of Player".
-
- @par
- @image html player_state.jpg "Figure1. State of Player" width=12cm
- @image latex player_state.jpg "Figure1. State of Player" width=12cm
-
- @par
- Most of functions which change player state work as synchronous. But, mm_player_start() should be used
- asynchronously. Both mm_player_pause() and mm_player_resume() should also be used asynchronously
- in the case of streaming data.
- So, application have to confirm the result of those APIs through message callback function.
-
- @par
- Note that "None" and Null" state could be reached from any state
- by calling mm_player_destroy() and mm_player_unrealize().
-
- @par
- <div><table>
- <tr>
- <td><B>FUNCTION</B></td>
- <td><B>PRE-STATE</B></td>
- <td><B>POST-STATE</B></td>
- <td><B>SYNC TYPE</B></td>
- </tr>
- <tr>
- <td>mm_player_create()</td>
- <td>NONE</td>
- <td>NULL</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_destroy()</td>
- <td>NULL</td>
- <td>NONE</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_realize()</td>
- <td>NULL</td>
- <td>READY</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_unrealize()</td>
- <td>READY</td>
- <td>NULL</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_start()</td>
- <td>READY</td>
- <td>PLAYING</td>
- <td>ASYNC</td>
- </tr>
- <tr>
- <td>mm_player_stop()</td>
- <td>PLAYING</td>
- <td>READY</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_pause()</td>
- <td>PLAYING</td>
- <td>PAUSED</td>
- <td>ASYNC</td>
- </tr>
- <tr>
- <td>mm_player_resume()</td>
- <td>PAUSED</td>
- <td>PLAYING</td>
- <td>ASYNC</td>
- </tr>
- <tr>
- <td>mm_player_set_message_callback()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_get_state()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_set_volume()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_get_volume()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_set_position()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_get_position()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_get_attribute()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- <tr>
- <td>mm_player_set_attribute()</td>
- <td>N/A</td>
- <td>N/A</td>
- <td>SYNC</td>
- </tr>
- </table></div>
-
- @par
- Following are the attributes supported in player which may be set after initialization. \n
- Those are handled as a string.
-
- @par
- <div><table>
- <tr>
- <td>PROPERTY</td>
- <td>TYPE</td>
- <td>VALID TYPE</td>
- </tr>
- <tr>
- <td>"profile_uri"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"content_duration"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"content_video_width"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"content_video_height"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"display_evas_do_scaling"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"display_evas_surface_sink"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"profile_user_param"</td>
- <td>data</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"profile_play_count"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"streaming_type"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"streaming_udp_timeout"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"streaming_user_agent"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"streaming_wap_profile"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"streaming_network_bandwidth"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"streaming_cookie"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"streaming_proxy_ip"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"streaming_proxy_port"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"streaming_timeout"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"display_overlay"</td>
- <td>data</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"display_rotation"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"subtitle_uri"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- </table></div>
-
- @par
- Following attributes are supported for playing stream data. Those value can be readable only and valid after starting playback.\n
- Please use mm_fileinfo for local playback.
-
- @par
- <div><table>
- <tr>
- <td>PROPERTY</td>
- <td>TYPE</td>
- <td>VALID TYPE</td>
- </tr>
- <tr>
- <td>"content_video_found"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"content_video_codec"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"content_video_track_num"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"content_audio_found"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"content_audio_codec"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"content_audio_bitrate"</td>
- <td>int</td>
- <td>array</td>
- </tr>
- <tr>
- <td>"content_audio_channels"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"content_audio_samplerate"</td>
- <td>int</td>
- <td>array</td>
- </tr>
- <tr>
- <td>"content_audio_track_num"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"content_text_track_num"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- <tr>
- <td>"tag_artist"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_title"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_album"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_genre"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_author"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_copyright"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_date"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_description"</td>
- <td>string</td>
- <td>N/A</td>
- </tr>
- <tr>
- <td>"tag_track_num"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- </table></div>
-
- */
-
-
/*===========================================================================================
| |
| GLOBAL DEFINITIONS AND DECLARATIONS |
*/
#define MM_PLAYER_VIDEO_HEIGHT "content_video_height"
/**
- * MM_PLAYER_VIDEO_EVAS_SURFACE_DO_SCALING:
- *
- * set whether or not to scale frames size for evas surface.
- * if TRUE, it scales down width, height size of frames with given size.
- * if FALSE, it does not scale down any frames.
- *
- */
-#define MM_PLAYER_VIDEO_EVAS_SURFACE_DO_SCALING "display_evas_do_scaling"
-/**
* MM_PLAYER_VIDEO_EVAS_SURFACE_SINK:
*
* get the video evas surface sink plugin name (string), It's guaranteed after calling mm_player_create()
*/
#define MM_PLAYER_SUBTITLE_URI "subtitle_uri"
/**
- * MM_PLAYER_STREAMING_TYPE
- *
- * set the streaming type (int)
- * @see MMStreamingType
- */
-#define MM_PLAYER_STREAMING_TYPE "streaming_type"
-/**
- * MM_PLAYER_STREAMING_UDP_TIMEOUT
- *
- * set the streaming udp timeout(int)
- */
-#define MM_PLAYER_STREAMING_UDP_TIMEOUT "streaming_udp_timeout"
-/**
* MM_PLAYER_STREAMING_USER_AGENT
*
* set the streaming user agent (string)
*/
#define MM_PLAYER_STREAMING_USER_AGENT "streaming_user_agent"
/**
- * MM_PLAYER_STREAMING_WAP_PROFILE
- *
- * set the streaming wap profile (int)
- */
-#define MM_PLAYER_STREAMING_WAP_PROFILE "streaming_wap_profile"
-/**
- * MM_PLAYER_STREAMING_NET_BANDWIDTH
- *
- * set the streaming network bandwidth (int)
- */
-#define MM_PLAYER_STREAMING_NET_BANDWIDTH "streaming_network_bandwidth"
-/**
* MM_PLAYER_STREAMING_COOKIE
*
* set the streaming cookie (int)
*/
#define MM_PLAYER_STREAMING_COOKIE "streaming_cookie"
/**
- * MM_PLAYER_STREAMING_PROXY_IP
- *
- * set the streaming proxy ip (string)
- */
-#define MM_PLAYER_STREAMING_PROXY_IP "streaming_proxy_ip"
-/**
- * MM_PLAYER_STREAMING_PROXY_PORT
- *
- * set the streaming proxy port (int)
- */
-#define MM_PLAYER_STREAMING_PROXY_PORT "streaming_proxy_port"
-/**
- * MM_PLAYER_STREAMING_TIMEOUT
- *
- * set the streaming timeout (int)
- */
-#define MM_PLAYER_STREAMING_TIMEOUT "streaming_timeout"
-/**
* MM_PLAYER_VIDEO_CODEC
*
* codec the video data is stored in (string)
*/
#define MM_PLAYER_VIDEO_CODEC "content_video_codec"
/**
- * MM_PLAYER_VIDEO_TRACK_NUM
- *
- * track number inside a collection (int)
- */
-#define MM_PLAYER_VIDEO_TRACK_NUM "content_video_track_num"
-/**
* MM_PLAYER_AUDIO_CODEC
*
* codec the audio data is stored in (string)
*/
#define MM_PLAYER_TAG_ARTIST "tag_artist"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_TITLE
*
* title (string)
*/
#define MM_PLAYER_TAG_TITLE "tag_title"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_ALBUM
*
* album containing this data (string)
*/
#define MM_PLAYER_TAG_ALBUM "tag_album"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_GENRE
*
* genre this data belongs to (string)
*/
#define MM_PLAYER_TAG_GENRE "tag_genre"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_AUTHOUR
*
* author (string)
*/
#define MM_PLAYER_TAG_AUTHOUR "tag_author"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_COPYRIGHT
*
* copyright notice of the data (string)
*/
#define MM_PLAYER_TAG_COPYRIGHT "tag_copyright"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_DATE
*
* date the data was created (string)
*/
#define MM_PLAYER_TAG_DATE "tag_date"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_DESCRIPRION
*
* short text describing the content of the data (string)
*/
#define MM_PLAYER_TAG_DESCRIPRION "tag_description"
/**
- * MM_PLAYER_TAG_ARTIST
+ * MM_PLAYER_TAG_TRACK_NUM
*
* track number inside a collection (int)
*/
extern "C" {
#endif
-/**
- @addtogroup PLAYER-INTERNAL
- @{
-
- @par
- <div><table>
- <tr>
- <td>PROPERTY</td>
- <td>TYPE</td>
- <td>VALID TYPE</td>
- <td>DEFAULT VALUE</td>
- </tr>
- <tr>
- <td>"display_roi_x"</td>
- <td>int</td>
- <td>range</td>
- <td>0</td>
- </tr>
- <tr>
- <td>"display_roi_y"</td>
- <td>int</td>
- <td>range</td>
- <td>0</td>
- </tr>
- <tr>
- <td>"display_roi_width"</td>
- <td>int</td>
- <td>range</td>
- <td>640</td>
- </tr>
- <tr>
- <td>"display_roi_height"</td>
- <td>int</td>
- <td>range</td>
- <td>480</td>
- </tr>
- <tr>
- <td>"display_method"</td>
- <td>int</td>
- <td>range</td>
- <td>MM_DISPLAY_METHOD_LETTER_BOX</td>
- </tr>
- <tr>
- <td>"sound_volume_type"</td>
- <td>int</td>
- <td>range</td>
- <td>MM_SOUND_VOLUME_TYPE_CALL</td>
- </tr>
- <tr>
- <td>"sound_route"</td>
- <td>int</td>
- <td>range</td>
- <td>MM_AUDIOROUTE_USE_EXTERNAL_SETTING</td>
- </tr>
- <tr>
- <td>"sound_stop_when_unplugged"</td>
- <td>int</td>
- <td>range</td>
- </tr>
- </table></div>
-
-*/
-
/*
* Enumerations of video colorspace
*/
bool util_is_sdp_file(const char *path);
int util_exist_file_path(const char *file_path);
char** util_get_cookie_list(const char *cookies);
-bool util_check_valid_url(const char *proxy);
const char* util_get_charset(const char *file_path);
int util_get_pixtype(unsigned int fourcc);
bool util_get_storage_info(const char *path, MMPlayerStorageInfo *storage_info);
0,
1
},
- { /* update registry for downloadable codec */
- "profile_update_registry",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- 1
- },
- {
- "streaming_type",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) STREAMING_SERVICE_NONE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- STREAMING_SERVICE_VOD,
- STREAMING_SERVICE_NUM
- },
- {
- "streaming_udp_timeout",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 10000,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
{
"streaming_user_agent",
MM_ATTRS_TYPE_STRING,
0
},
{
- "streaming_wap_profile",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- (void *) NULL,
- MM_ATTRS_VALID_TYPE_NONE,
- 0,
- 0
- },
- {
- "streaming_network_bandwidth",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 128000,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
"streaming_cookie",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
0
},
{
- "streaming_proxy",
- MM_ATTRS_TYPE_STRING,
- MM_ATTRS_FLAG_RW,
- (void *) NULL,
- MM_ATTRS_VALID_TYPE_NONE,
- 0,
- 0
- },
- {
- "streaming_timeout",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) -1, // DEFAULT_HTTP_TIMEOUT
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- -1,
- MMPLAYER_MAX_INT
- },
- {
"subtitle_uri",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
- "content_video_track_num",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "content_audio_found",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- 1
- },
- {
"content_audio_codec",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
- "content_audio_format",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
"content_text_track_num",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
0
},
{
- "display_src_crop_x",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_src_crop_y",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_src_crop_width",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_src_crop_height",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_roi_x",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_roi_y",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_roi_width",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 480,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_roi_height",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 800,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_roi_mode",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
- MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
- },
- {
"display_rotation",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
0
},
{
- "wl_display",
- MM_ATTRS_TYPE_DATA,
- MM_ATTRS_FLAG_RW,
- (void *) NULL,
- MM_ATTRS_VALID_TYPE_NONE,
- 0,
- 0
- },
- {
"wl_window_render_x",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
- "display_overlay_user_data",
- MM_ATTRS_TYPE_DATA,
- MM_ATTRS_FLAG_RW,
- (void *) NULL,
- MM_ATTRS_VALID_TYPE_NONE,
- 0,
- 0
- },
- {
"display_surface_type",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
MM_DISPLAY_SURFACE_NUM - 1
},
{
- "display_force_aspect_ration",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 1,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_width", // dest width of fimcconvert ouput
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_height", // dest height of fimcconvert ouput
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_evas_do_scaling",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) TRUE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
- },
- {
- "sound_fadeup",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) FALSE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
- },
- {
- "sound_fadedown",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) FALSE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
- },
- {
- "sound_volume_type",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) MM_SOUND_VOLUME_TYPE_MEDIA,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
"sound_stream_type",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
- "sound_route",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) MM_AUDIOROUTE_USE_EXTERNAL_SETTING,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- MM_AUDIOROUTE_USE_EXTERNAL_SETTING,
- MM_AUDIOROUTE_CAPTURE_STEREOMIC_ONLY
- },
- {
- "sound_stop_when_unplugged",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) TRUE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
- },
- {
- "sound_application_pid",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "sound_spk_out_only",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) FALSE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- FALSE,
- TRUE
- },
- {
- "sound_priority",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0, // 0: normal, 1: high 2: high with sound transition 3: mix with others regardless of priority
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- 3
- },
- {
- "sound_close_resource",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- 1
- },
- {
"sound_latency_mode",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
MMPLAYER_MAX_INT
},
{
- "profile_smooth_repeat",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) FALSE,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "profile_progress_interval", // will be deprecated
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 500,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_x",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
- "display_y",
- MM_ATTRS_TYPE_INT,
- MM_ATTRS_FLAG_RW,
- (void *) 0,
- MM_ATTRS_VALID_TYPE_INT_RANGE,
- 0,
- MMPLAYER_MAX_INT
- },
- {
"pd_mode",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
static int __mmplayer_set_pcm_extraction(mm_player_t* player);
static gboolean __mmplayer_can_extract_pcm(mm_player_t* player);
-/*fadeout */
-static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time);
-static void __mmplayer_undo_sound_fadedown(mm_player_t* player);
-
/* util */
static gboolean __is_ms_buff_src(mm_player_t* player);
static gboolean __has_suffix(mm_player_t * player, const gchar * suffix);
GstStructure* p = NULL;
MMHandleType attrs = 0;
gchar *path = NULL;
- MMStreamingType stream_service_type = STREAMING_SERVICE_NONE;
struct stat sb;
MMPLAYER_FENTER();
player->duration = 0;
}
- /* try to get streaming service type */
- stream_service_type = __mmplayer_get_stream_service_type(player);
- if (stream_service_type < STREAMING_SERVICE_NONE)
- mm_attrs_set_int_by_name(attrs, "streaming_type", stream_service_type);
+ /* update streaming service type */
+ player->streaming_type = __mmplayer_get_stream_service_type(player);
/* check duration is OK */
if (dur_nsec == 0 && !MMPLAYER_IS_LIVE_STREAMING(player)) {
LOGE("should not get here");
}
- player->streaming_type = streaming_type;
MMPLAYER_FLEAVE();
return streaming_type;
case MM_PLAYER_STATE_PAUSED:
{
- if (!player->sent_bos) {
- int found = 0;
- #define MMPLAYER_MAX_SOUND_PRIORITY 3
-
+ if (!player->sent_bos) {
/* rtsp case, get content attrs by GstMessage */
if (!MMPLAYER_IS_RTSP_STREAMING(player)) {
/* it's first time to update all content attrs. */
_mmplayer_update_content_attrs(player, ATTR_ALL);
}
-
- /* set max sound priority to keep own sound and not to mute other's one */
- mm_attrs_get_int_by_name(player->attrs, "content_video_found", &found);
- if (found) {
- mm_attrs_get_int_by_name(player->attrs, "content_audio_found", &found);
- if (found) {
- LOGD("set max audio priority");
- g_object_set(player->pipeline->audiobin[MMPLAYER_A_SINK].gst, "priority", MMPLAYER_MAX_SOUND_PRIORITY, NULL);
- }
- }
-
- }
+ }
/* add audio callback probe if condition is satisfied */
if (!player->audio_cb_probe_id && player->set_mode.pcm_extraction && !player->audio_stream_render_cb_ex)
__mmplayer_configure_audio_callback(player);
- /* FIXIT : handle return value */
+
+ /* FIXIT : handle return value */
}
break;
attrs = MMPLAYER_GET_ATTRS(player);
if (attrs) {
- gboolean smooth_repeat = FALSE;
-
mm_attrs_get_int_by_name(attrs, "profile_play_count", &count);
- mm_attrs_get_int_by_name(attrs, "profile_smooth_repeat", &smooth_repeat);
-
player->play_count = count;
LOGD("remaining play count: %d, playback rate: %f\n", count, player->playback_rate);
if (count > 1 || count == -1 || player->playback_rate < 0.0) /* default value is 1 */ {
- if (smooth_repeat) {
- LOGD("smooth repeat enabled. seeking operation will be excuted in new thread\n");
+ gint ret_value = 0;
- MMPLAYER_REPEAT_THREAD_SIGNAL(player);
-
- break;
+ if (player->section_repeat) {
+ ret_value = _mmplayer_activate_section_repeat((MMHandleType)player, player->section_repeat_start, player->section_repeat_end);
} else {
- gint ret_value = 0;
-
- if (player->section_repeat) {
- ret_value = _mmplayer_activate_section_repeat((MMHandleType)player, player->section_repeat_start, player->section_repeat_end);
- } else {
- if (player->playback_rate < 0.0) {
- player->resumed_by_rewind = TRUE;
- _mmplayer_set_mute((MMHandleType)player, 0);
- MMPLAYER_POST_MSG(player, MM_MESSAGE_RESUMED_BY_REW, NULL);
- }
-
- __mmplayer_handle_eos_delay(player, player->ini.delay_before_repeat);
-
- /* initialize */
- player->sent_bos = FALSE;
+ if (player->playback_rate < 0.0) {
+ player->resumed_by_rewind = TRUE;
+ _mmplayer_set_mute((MMHandleType)player, 0);
+ MMPLAYER_POST_MSG(player, MM_MESSAGE_RESUMED_BY_REW, NULL);
}
- if (MM_ERROR_NONE != ret_value)
- LOGE("failed to set position to zero for rewind\n");
+ __mmplayer_handle_eos_delay(player, player->ini.delay_before_repeat);
- /* not posting eos when repeating */
- break;
+ /* initialize */
+ player->sent_bos = FALSE;
}
+
+ if (MM_ERROR_NONE != ret_value)
+ LOGE("failed to set position to zero for rewind\n");
+
+ /* not posting eos when repeating */
+ break;
}
}
gst_structure_get(gst_message_get_structure(msg), "rtsp_duration", G_TYPE_UINT64, &player->duration, NULL);
LOGD("rtsp duration : %lld msec", GST_TIME_AS_MSECONDS(player->duration));
- __mmplayer_get_stream_service_type(player);
+ player->streaming_type = __mmplayer_get_stream_service_type(player);
mm_attrs_set_int_by_name(attrs, "content_duration", GST_TIME_AS_MSECONDS(player->duration));
gst_structure_get(gst_message_get_structure(msg), "rtsp_audio_codec", G_TYPE_STRING, &audio_codec, NULL);
_mmplayer_update_content_attrs(player, ATTR_VIDEO);
}
- /* FIXIT : track number shouldn't be hardcoded */
- mm_attrs_set_int_by_name(attrs, "content_video_track_num", 1);
player->videosink_linked = 1;
sinkpad = gst_element_get_static_pad(GST_ELEMENT(sinkbin), "sink");
gst_object_unref(pad);
g_list_free(element_bucket);
-
- mm_attrs_set_int_by_name(attrs, "content_audio_found", TRUE);
-
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
/* rtsp streamming */
case MM_PLAYER_URI_TYPE_URL_RTSP:
{
- gint network_bandwidth;
- gchar *user_agent, *wap_profile;
+ gchar *user_agent;
element = gst_element_factory_make("rtspsrc", "rtsp source");
}
/* make it zero */
- network_bandwidth = 0;
- user_agent = wap_profile = NULL;
+ user_agent = NULL;
/* get attribute */
mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
- mm_attrs_get_string_by_name(attrs, "streaming_wap_profile", &wap_profile);
- mm_attrs_get_int_by_name(attrs, "streaming_network_bandwidth", &network_bandwidth);
SECURE_LOGD("user_agent : %s\n", user_agent);
- SECURE_LOGD("wap_profile : %s\n", wap_profile);
/* setting property to streaming source */
g_object_set(G_OBJECT(element), "location", player->profile.uri, NULL);
if (user_agent)
g_object_set(G_OBJECT(element), "user-agent", user_agent, NULL);
- if (wap_profile)
- g_object_set(G_OBJECT(element), "wap_profile", wap_profile, NULL);
MMPLAYER_SIGNAL_CONNECT(player, G_OBJECT(element), MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "pad-added",
G_CALLBACK(__mmplayer_gst_rtp_dynamic_pad), player);
/* http streaming*/
case MM_PLAYER_URI_TYPE_URL_HTTP:
{
- gchar *user_agent, *proxy, *cookies, **cookie_list;
+ gchar *user_agent, *cookies, **cookie_list;
gint http_timeout = DEFAULT_HTTP_TIMEOUT;
- user_agent = proxy = cookies = NULL;
+ user_agent = cookies = NULL;
cookie_list = NULL;
gint mode = MM_PLAYER_PD_MODE_NONE;
/* get attribute */
mm_attrs_get_string_by_name(attrs, "streaming_cookie", &cookies);
mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
- mm_attrs_get_string_by_name(attrs, "streaming_proxy", &proxy);
- mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
- if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
- (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT)) {
+ if (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT) {
LOGD("get timeout from ini\n");
http_timeout = player->ini.http_timeout;
}
/* get attribute */
SECURE_LOGD("location : %s\n", player->profile.uri);
SECURE_LOGD("cookies : %s\n", cookies);
- SECURE_LOGD("proxy : %s\n", proxy);
SECURE_LOGD("user_agent : %s\n", user_agent);
LOGD("timeout : %d\n", http_timeout);
g_object_set(G_OBJECT(element), "timeout", http_timeout, NULL);
g_object_set(G_OBJECT(element), "blocksize", (unsigned long)(64*1024), NULL);
- /* check if proxy is valid or not */
- if (util_check_valid_url(proxy))
- g_object_set(G_OBJECT(element), "proxy", proxy, NULL);
/* parsing cookies */
if ((cookie_list = util_get_cookie_list((const char*)cookies))) {
g_object_set(G_OBJECT(element), "cookies", cookie_list, NULL);
break;
}
- mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
-
- if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
- (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT)) {
+ if (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT) {
LOGD("get timeout from ini\n");
http_timeout = player->ini.http_timeout;
}
return ret;
}
-static void __mmplayer_do_sound_fadedown(mm_player_t* player, unsigned int time)
-{
- MMPLAYER_FENTER();
-
- MMPLAYER_RETURN_IF_FAIL(player
- && player->pipeline
- && player->pipeline->audiobin
- && player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
-
- g_object_set(G_OBJECT(player->pipeline->audiobin[MMPLAYER_A_SINK].gst), "mute", TRUE, NULL);
-
- usleep(time);
-
- MMPLAYER_FLEAVE();
-}
-
-static void __mmplayer_undo_sound_fadedown(mm_player_t* player)
-{
- MMPLAYER_FENTER();
-
- MMPLAYER_RETURN_IF_FAIL(player
- && player->pipeline
- && player->pipeline->audiobin
- && player->pipeline->audiobin[MMPLAYER_A_SINK].gst);
-
- g_object_set(G_OBJECT(player->pipeline->audiobin[MMPLAYER_A_SINK].gst), "mute", FALSE, NULL);
-
- MMPLAYER_FLEAVE();
-}
-
static int __gst_stop(mm_player_t* player)
{
GstStateChangeReturn change_ret = GST_STATE_CHANGE_SUCCESS;
MMHandleType attrs = 0;
- gboolean fadedown = FALSE;
gboolean rewind = FALSE;
gint timeout = 0;
int ret = MM_ERROR_NONE;
return MM_ERROR_PLAYER_INTERNAL;
}
- mm_attrs_get_int_by_name(attrs, "sound_fadedown", &fadedown);
-
- /* enable fadedown */
- if (fadedown)
- __mmplayer_do_sound_fadedown(player, MM_PLAYER_FADEOUT_TIME_DEFAULT);
-
/* Just set state to PAUESED and the rewind. it's usual player behavior. */
timeout = MMPLAYER_STATE_CHANGE_TIMEOUT(player);
/* set gst state */
ret = __mmplayer_gst_set_state(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED, async, timeout);
- /* disable fadeout */
- if (fadedown)
- __mmplayer_undo_sound_fadedown(player);
-
/* return if set_state has failed */
if (ret != MM_ERROR_NONE) {
LOGE("failed to set state.\n");
mm_player_t* player = (mm_player_t*)hplayer;
char *uri = NULL;
void *param = NULL;
- gboolean update_registry = FALSE;
MMHandleType attrs = 0;
int ret = MM_ERROR_NONE;
/* set the subtitle ON default */
player->is_subtitle_off = FALSE;
- /* registry should be updated for downloadable codec */
- mm_attrs_get_int_by_name(attrs, "profile_update_registry", &update_registry);
-
- if (update_registry) {
- LOGD("updating registry...\n");
- gst_update_registry();
- }
-
/* realize pipeline */
ret = __gst_realize(player);
if (ret != MM_ERROR_NONE)
}
mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0);
- mm_attrs_set_int_by_name(player->attrs, "content_audio_found", 0);
/* clean found parsers */
if (player->parsers) {
}
case MM_PLAYER_URI_TYPE_URL_HTTP:
{
- gchar *user_agent, *proxy, *cookies, **cookie_list;
+ gchar *user_agent, *cookies, **cookie_list;
gint http_timeout = DEFAULT_HTTP_TIMEOUT;
- user_agent = proxy = cookies = NULL;
+ user_agent = cookies = NULL;
cookie_list = NULL;
element = gst_element_factory_make(player->ini.httpsrc_element, "http_streaming_source");
/* get attribute */
mm_attrs_get_string_by_name(attrs, "streaming_cookie", &cookies);
mm_attrs_get_string_by_name(attrs, "streaming_user_agent", &user_agent);
- mm_attrs_get_string_by_name(attrs, "streaming_proxy", &proxy);
- mm_attrs_get_int_by_name(attrs, "streaming_timeout", &http_timeout);
- if ((http_timeout == DEFAULT_HTTP_TIMEOUT) &&
- (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT)) {
+ if (player->ini.http_timeout != DEFAULT_HTTP_TIMEOUT) {
LOGD("get timeout from ini\n");
http_timeout = player->ini.http_timeout;
}
/* get attribute */
SECURE_LOGD("location : %s\n", player->profile.uri);
SECURE_LOGD("cookies : %s\n", cookies);
- SECURE_LOGD("proxy : %s\n", proxy);
SECURE_LOGD("user_agent : %s\n", user_agent);
LOGD("timeout : %d\n", http_timeout);
g_object_set(G_OBJECT(element), "timeout", http_timeout, NULL);
g_object_set(G_OBJECT(element), "blocksize", (unsigned long)(64*1024), NULL);
- /* check if prosy is vailid or not */
- if (util_check_valid_url(proxy))
- g_object_set(G_OBJECT(element), "proxy", proxy, NULL);
/* parsing cookies */
if ((cookie_list = util_get_cookie_list((const char*)cookies)))
g_object_set(G_OBJECT(element), "cookies", cookie_list, NULL);
MMPLAYER_RETURN_IF_FAIL(player);
mm_attrs_set_int_by_name(player->attrs, "content_video_found", 0);
- mm_attrs_set_int_by_name(player->attrs, "content_audio_found", 0);
/* clean found parsers */
if (player->parsers) {
attrs = MMPLAYER_GET_ATTRS(player);
if (attrs) {
mm_attrs_set_int_by_name(attrs, "content_audio_track_num", 0);
- mm_attrs_set_int_by_name(attrs, "content_video_track_num", 0);
mm_attrs_set_int_by_name(attrs, "content_text_track_num", 0);
if (mmf_attrs_commit(attrs))
return cookie_list;
}
-bool util_check_valid_url(const char *proxy)
-{
- struct in_addr proxy_addr;
- bool ret = TRUE;
-
- MMPLAYER_RETURN_VAL_IF_FAIL(proxy, FALSE);
- MMPLAYER_RETURN_VAL_IF_FAIL(strlen(proxy), FALSE);
-
- if (inet_aton(proxy, &proxy_addr) != 0) {
- LOGW("invalid proxy is set. \n");
- ret = FALSE;
- }
-
- return ret;
-}
-
/* check the given path is indicating sdp file */
bool
util_is_sdp_file(const char *path)