Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.6.184
+Version: 0.6.185
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
includelibmmfplayerdir = $(includedir)/mmf
includelibmmfplayer_HEADERS = include/mm_player.h \
- include/mm_player_internal.h \
include/mm_player_audioeffect.h
libmmfplayer_la_SOURCES = mm_player.c \
#define BUFFER_MAX_PLANE_NUM (4)
-typedef struct {
- MMPixelFormatType format; /**< image format */
- int width; /**< width of video buffer */
- int height; /**< height of video buffer */
- unsigned int timestamp; /**< timestamp of stream buffer (msec)*/
- unsigned int length_total; /**< total length of stream buffer (in byte)*/
- void *data[BUFFER_MAX_PLANE_NUM];
- void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */
- void *internal_buffer; /**< Internal buffer pointer */
- int stride[BUFFER_MAX_PLANE_NUM]; /**< stride of plane */
- int elevation[BUFFER_MAX_PLANE_NUM]; /**< elevation of plane */
- int orientation; /**< orientation */
- int bo_size; /**< TBM buffer object size */
- int plane_num; /**< number of Plane */
-} mmplayer_video_decoded_data_info_t;
-
/**
* Enumerations of player state.
*/
MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE_WITH_PLAYBACK = MM_PLAYER_AUDIO_EXTRACT_DEINTERLEAVE | MM_PLAYER_AUDIO_EXTRACT_WITH_PLAYBACK,
} mmplayer_audio_extract_opt_e;
+/*
+ * Enumerations of video colorspace
+ */
+typedef enum {
+ MM_PLAYER_COLORSPACE_I420 = 0, /**< I420 format - planer */
+ MM_PLAYER_COLORSPACE_RGB888, /**< RGB888 pixel format */
+ MM_PLAYER_COLORSPACE_NV12_TILED, /**< Customized color format */
+ MM_PLAYER_COLORSPACE_NV12,
+ MM_PLAYER_COLORSPACE_BGRx, /**< BGRx pixel format */
+ MM_PLAYER_COLORSPACE_MAX = 0x7FFFFFFF
+} mmplayer_video_color_space_e;
+
/**
* Attribute validity structure
*/
};
} mmplayer_attrs_info_t;
+typedef struct {
+ MMPixelFormatType format; /**< image format */
+ int width; /**< width of video buffer */
+ int height; /**< height of video buffer */
+ unsigned int timestamp; /**< timestamp of stream buffer (msec)*/
+ unsigned int length_total; /**< total length of stream buffer (in byte)*/
+ void *data[BUFFER_MAX_PLANE_NUM];
+ void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */
+ void *internal_buffer; /**< Internal buffer pointer */
+ int stride[BUFFER_MAX_PLANE_NUM]; /**< stride of plane */
+ int elevation[BUFFER_MAX_PLANE_NUM]; /**< elevation of plane */
+ int orientation; /**< orientation */
+ int bo_size; /**< TBM buffer object size */
+ int plane_num; /**< number of Plane */
+} mmplayer_video_decoded_data_info_t;
+
+typedef struct {
+ void *data;
+ int data_size;
+ int channel;
+ int bitrate;
+ int depth;
+ bool is_little_endian;
+ guint64 channel_mask;
+ media_format_mimetype_e pcm_format;
+} mmplayer_audio_decoded_data_info_t;
+
+typedef struct {
+ unsigned char *data; /* capture image buffer */
+ int size; /* capture image size */
+ mmplayer_video_color_space_e fmt; /* color space type */
+ unsigned int width; /* width of captured image */
+ unsigned int height; /* height of captured image */
+ unsigned int orientation; /* content orientation */
+} mmplayer_video_capture_t;
+
/**
* Video stream info in external demux case
*
*/
typedef bool (*mm_player_stream_changed_callback)(void *user_param);
+/**
+ * Video decoded callback function type.
+ *
+ * @param stream [in] Reference pointer to video frame data
+ * @param stream_size [in] Size of video frame data
+ * @param user_param [in] User defined parameter which is passed when set
+ * video stream callback
+ * @param width [in] width of video frame
+ * @param height [in] height of video frame
+ *
+ * @return This callback function have to return MM_ERROR_NONE.
+ */
+typedef bool (*mm_player_video_decoded_callback)(void *stream, void *user_param);
+
+/**
+ * Audio stream callback function type.
+ *
+ * @param stream [in] Reference pointer to audio frame data
+ * @param stream_size [in] Size of audio frame data
+ * @param user_param [in] User defined parameter which is passed when set
+ * audio stream callback
+ *
+ * @return This callback function have to return MM_ERROR_NONE.
+ */
+typedef bool (*mm_player_video_capture_callback)(void *stream, int stream_size, void *user_param);
+
+/**
+ * Video frame render error callback function type.
+ *
+ * @param error_id [in] cause of error
+ * @param user_param [in] User defined parameter which is passed when set
+ * video frame render error callback
+ *
+ * @return This callback function have to return MM_ERROR_NONE.
+ */
+typedef bool (*mm_player_video_frame_render_error_callback)(void *error_id, void *user_param);
+
+/**
+ * Audio stream callback function type.
+ *
+ * @param stream [in] Reference pointer to audio frame data
+ * @param user_param [in] User defined parameter which is passed when set
+ * audio stream callback
+ *
+ * @return This callback function have to return MM_ERROR_NONE.
+ */
+typedef bool (*mm_player_audio_decoded_callback)(void *stream, void *user_param);
/*===========================================================================================
| |
int mm_player_get_video_roi_area(MMHandleType player, double *scale_x, double *scale_y, double *scale_width, double *scale_height);
/**
+ * This function is to set play speed for playback.
+ *
+ * @param player [in] Handle of player.
+ * @param ratio [in] Speed for playback.
+ * @param streaming [in] If @c true, rate value can be set even if it is streaming playback.
+ * @return This function returns zero on success, or negative value with error
+ * code
+ * @remark The current supported range is from -64x to 64x.
+ * But, the quailty is dependent on codec performance.
+ * And, the sound is muted under normal speed and more than double speed.
+ * @see
+ * @since
+ */
+int mm_player_set_play_speed(MMHandleType player, float rate, bool streaming);
+
+/**
+ * This function set callback function for receiving video stream from player.
+ *
+ * @param player [in] Handle of player.
+ * @param callback [in] Video stream callback function.
+ * @param user_param [in] User parameter.
+ *
+ * @return This function returns zero on success, or negative value with error
+ * code.
+ * @remark
+ * @since
+ */
+int mm_player_set_video_decoded_callback(MMHandleType player, mm_player_video_decoded_callback callback, void *user_param);
+
+/**
+ * This function set callback function for receiving audio stream from player.
+ *
+ * @param player [in] Handle of player.
+ * @param opt [in] audio extract option.
+ * @param callback [in] audio stream callback function.
+ * @param user_param [in] User parameter.
+ *
+ * @return This function returns zero on success, or negative value with error
+ * code.
+ * @remark
+ * @see mm_player_audio_decoded_callback
+ * @since
+ */
+int mm_player_set_audio_decoded_callback(MMHandleType player, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param);
+
+/**
+ * This function is to capture video frame.
+ *
+ * @param player [in] Handle of player.
+ *
+ * @return This function returns zero on success, or negative value with error
+ * code.
+ *
+ * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
+ * And, application should free the captured buffer directly.
+ * @see MM_MESSAGE_VIDEO_CAPTURED
+ * @since
+ */
+int mm_player_do_video_capture(MMHandleType player);
+
+/**
+ * This function changes the previous videosink plugin for a new one
+ *
+ * @param player [in] Handle of player.
+ * @param display_surface_type [in] display surface type to set
+ * @param display_overlay [in] display overlay to set
+ *
+ * @return This function returns zero on success, or negative value with error
+ * code.
+ * @remark
+ * @see
+ * @since
+ */
+int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
+
+/**
@}
*/
+++ /dev/null
-/*
- * libmm-player
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
- * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __MM_PLAYER_INTERNAL_H__
-#define __MM_PLAYER_INTERNAL_H__
-
-#include <mm_types.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/*
- * Enumerations of video colorspace
- */
-typedef enum {
- MM_PLAYER_COLORSPACE_I420 = 0, /**< I420 format - planer */
- MM_PLAYER_COLORSPACE_RGB888, /**< RGB888 pixel format */
- MM_PLAYER_COLORSPACE_NV12_TILED, /**< Customized color format */
- MM_PLAYER_COLORSPACE_NV12,
- MM_PLAYER_COLORSPACE_BGRx, /**< BGRx pixel format */
- MM_PLAYER_COLORSPACE_MAX = 0x7FFFFFFF
-} mmplayer_video_color_space_e;
-
-typedef struct {
- unsigned char *data; /* capture image buffer */
- int size; /* capture image size */
- mmplayer_video_color_space_e fmt; /* color space type */
- unsigned int width; /* width of captured image */
- unsigned int height; /* height of captured image */
- unsigned int orientation; /* content orientation */
-} mmplayer_video_capture_t;
-
-typedef struct {
- void *data;
- int data_size;
- int channel;
- int bitrate;
- int depth;
- bool is_little_endian;
- guint64 channel_mask;
-} mmplayer_audio_decoded_data_info_t;
-
-/**
- * Video decoded callback function type.
- *
- * @param stream [in] Reference pointer to video frame data
- * @param stream_size [in] Size of video frame data
- * @param user_param [in] User defined parameter which is passed when set
- * video stream callback
- * @param width [in] width of video frame
- * @param height [in] height of video frame
- *
- * @return This callback function have to return MM_ERROR_NONE.
- */
-typedef bool (*mm_player_video_decoded_callback)(void *stream, void *user_param);
-
-/**
- * Audio stream callback function type.
- *
- * @param stream [in] Reference pointer to audio frame data
- * @param stream_size [in] Size of audio frame data
- * @param user_param [in] User defined parameter which is passed when set
- * audio stream callback
- *
- * @return This callback function have to return MM_ERROR_NONE.
- */
-typedef bool (*mm_player_video_capture_callback)(void *stream, int stream_size, void *user_param);
-
-/**
- * Video frame render error callback function type.
- *
- * @param error_id [in] cause of error
- * @param user_param [in] User defined parameter which is passed when set
- * video frame render error callback
- *
- * @return This callback function have to return MM_ERROR_NONE.
- */
-typedef bool (*mm_player_video_frame_render_error_callback)(void *error_id, void *user_param);
-
-/**
- * Audio stream callback function type.
- *
- * @param stream [in] Reference pointer to audio frame data
- * @param user_param [in] User defined parameter which is passed when set
- * audio stream callback
- *
- * @return This callback function have to return MM_ERROR_NONE.
- */
-typedef bool (*mm_player_audio_decoded_callback)(mmplayer_audio_decoded_data_info_t *stream, void *user_param);
-/**
- * This function is to set play speed for playback.
- *
- * @param player [in] Handle of player.
- * @param ratio [in] Speed for playback.
- * @param streaming [in] If @c true, rate value can be set even if it is streaming playback.
- * @return This function returns zero on success, or negative value with error
- * code
- * @remark The current supported range is from -64x to 64x.
- * But, the quailty is dependent on codec performance.
- * And, the sound is muted under normal speed and more than double speed.
- * @see
- * @since
- */
-int mm_player_set_play_speed(MMHandleType player, float rate, bool streaming);
-
-/**
- * This function set callback function for receiving video stream from player.
- *
- * @param player [in] Handle of player.
- * @param callback [in] Video stream callback function.
- * @param user_param [in] User parameter.
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- * @remark
- * @since
- */
-int mm_player_set_video_decoded_callback(MMHandleType player, mm_player_video_decoded_callback callback, void *user_param);
-
-/**
- * This function set callback function for receiving audio stream from player.
- *
- * @param player [in] Handle of player.
- * @param opt [in] audio extract option.
- * @param callback [in] audio stream callback function.
- * @param user_param [in] User parameter.
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- * @remark
- * @see mm_player_audio_decoded_callback
- * @since
- */
-int mm_player_set_audio_decoded_callback(MMHandleType player, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param);
-
-/**
- * This function is to capture video frame.
- *
- * @param player [in] Handle of player.
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- *
- * @remark Captured buffer is sent asynchronously through message callback with MM_MESSAGE_VIDEO_CAPTURED.
- * And, application should free the captured buffer directly.
- * @see MM_MESSAGE_VIDEO_CAPTURED
- * @since
- */
-int mm_player_do_video_capture(MMHandleType player);
-
-/**
- * This function changes the previous videosink plugin for a new one
- *
- * @param player [in] Handle of player.
- * @param display_surface_type [in] display surface type to set
- * @param display_overlay [in] display overlay to set
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- * @remark
- * @see
- * @since
- */
-int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay);
-
-/**
- @}
- */
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* __MM_PLAYER_INTERNAL_H__ */
#include <tbm_bufmgr.h>
#include <storage.h>
#include "mm_player.h"
-#include "mm_player_internal.h"
#include "mm_player_audioeffect.h"
#include "mm_message.h"
#include "mm_player_ini.h"
#include <dlog.h>
#include "mm_player_es.h"
#include "mm_player_utils.h"
-#include "mm_player_internal.h"
#include <gst/app/gstappsrc.h>
audio_stream.channel_mask = a_buffer->channel_mask;
audio_stream.data_size = a_buffer->data_size;
audio_stream.data = a_buffer->pcm_data;
+ audio_stream.pcm_format = a_buffer->pcm_format;
/* LOGD("[%"G_GUINT64_FORMAT"] send data size:%d, %p", audio_stream.channel_mask, audio_stream.data_size, player->audio_decoded_cb_user_param); */
player->audio_decoded_cb(&audio_stream, player->audio_decoded_cb_user_param);
}
}
- /* create new audio stream data */
+ /* create new audio stream data for newly found audio channel */
a_buffer = (mmplayer_audio_stream_buff_t *)g_try_malloc0(sizeof(mmplayer_audio_stream_buff_t));
if (a_buffer == NULL) {
LOGE("failed to alloc data.");