gchar name_of_video_hdcp[WFD_SINK_INI_MAX_STRLEN];
gchar name_of_video_parser[WFD_SINK_INI_MAX_STRLEN];
+ gchar name_of_video_capssetter[WFD_SINK_INI_MAX_STRLEN];
gchar name_of_video_decoder[WFD_SINK_INI_MAX_STRLEN];
+ gchar name_of_video_converter[WFD_SINK_INI_MAX_STRLEN];
+ gchar name_of_video_filter[WFD_SINK_INI_MAX_STRLEN];
gchar name_of_video_sink[WFD_SINK_INI_MAX_STRLEN];
/* audio parameter for reponse of M3 request */
#define DEFAULT_SET_DEBUG_PROPERTY TRUE
#define DEFAULT_ENABLE_ASM FALSE
#define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */
-#define DEFAULT_ENABLE_RETRANSMISSION TRUE
+#define DEFAULT_ENABLE_RETRANSMISSION FALSE
#define DEFAULT_ENABLE_RESET_BASETIME TRUE
#define DEFAULT_VIDEO_SINK_MAX_LATENESS 20000000 /* nsec */
#define DEFAULT_SINK_TS_OFFSET 150000000 /* nsec */
#define DEFAULT_NAME_OF_AUDIO_SINK ""
#define DEFAULT_NAME_OF_VIDEO_HDCP ""
#define DEFAULT_NAME_OF_VIDEO_PARSER ""
+#define DEFAULT_NAME_OF_VIDEO_CAPSSETTER ""
#define DEFAULT_NAME_OF_VIDEO_DECODER ""
+#define DEFAULT_NAME_OF_VIDEO_CONVERTER ""
+#define DEFAULT_NAME_OF_VIDEO_FILTER ""
#define DEFAULT_NAME_OF_VIDEO_SINK ""
/* Audio */
/* Video */
#define DEFAULT_VIDEO_CODEC WFD_VIDEO_H264
#define DEFAULT_VIDEO_NATIVE_RESOLUTION 0x20
-/* CEA : WFD_CEA_640x480P60 | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |WFD_CEA_1920x1080P30 |
- WFD_CEA_1280x720P25 |WFD_CEA_1920x1080P25 |WFD_CEA_1280x720P24 | WFD_CEA_1920x1080P24 */
-#define DEFAULT_VIDEO_CEA_SUPPORT 0x194ab
-/* VESA : WFD_VESA_800x600P30 |WFD_VESA_1024x768P30 |WFD_VESA_1152x864P30 | WFD_VESA_1280x768P30 | WFD_VESA_1280x800P30 |
- WFD_VESA_1360x768P30 | WFD_VESA_1366x768P30 | WFD_VESA_1280x1024P30 |WFD_VESA_1400x1050P30 | WFD_VESA_1440x900P30 |
- WFD_VESA_1600x900P30 | FD_VESA_1600x1200P30 | WFD_VESA_1680x1024P30 | WFD_VESA_1680x1050P30 | WFD_VESA_1920x1200P30 | */
-#define DEFAULT_VIDEO_VESA_SUPPORT 0x55555555
+/* CEA : WFD_CEA_640x480P60 | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |
+ WFD_CEA_1280x720P25 | WFD_CEA_1280x720P24 */
+#define DEFAULT_VIDEO_CEA_SUPPORT 0x842b
+/* VESA : WFD_VESA_800x600P30 */
+#define DEFAULT_VIDEO_VESA_SUPPORT 0x1
/* HH : WFD_HH_800x480P30 | WFD_HH_854x480P30 | WFD_HH_864x480P30 | WFD_HH_640x360P30 | WFD_HH_960x540P30 | WFD_HH_848x480P30 */
#define DEFAULT_VIDEO_HH_SUPPORT 0x555
#define DEFAULT_VIDEO_PROFILE WFD_H264_BASE_PROFILE
#define DEFAULT_VIDEO_LEVEL WFD_H264_LEVEL_3_2
#define DEFAULT_VIDEO_LATENCY 0x0
-#define DEFAULT_VIDEO_VERTICAL_RESOLUTION 1080
-#define DEFAULT_VIDEO_HORIZONTAL_RESOLUTION 1920
+#define DEFAULT_VIDEO_VERTICAL_RESOLUTION 720
+#define DEFAULT_VIDEO_HORIZONTAL_RESOLUTION 1280
#define DEFAULT_VIDEO_MIN_SLICESIZE 0
#define DEFAULT_VIDEO_SLICE_ENC_PARAM 200
#define DEFAULT_VIDEO_FRAMERATE_CONTROL 11
jitter buffer latency=10\n\
\n\
; for retransmission request enable = yes, disable = no\n\
-enable retransmission = yes\n\
+enable retransmission = no\n\
\n\
; for reset basetime, enable = yes, disable = no\n\
enable reset basetime = yes\n\
\n\
ac3 decoder element =\n\
\n\
-lpcm converter element = audioconvert\n\
+lpcm converter element =\n\
\n\
lpcm filter element = capsfilter\n\
\n\
\n\
audio sink element = pulsesink\n\
\n\
-video parser element = h264parse\n\
+video parser element = ;h264parse\n\
\n\
-video decoder element = omxh264dec\n\
+video capssetter element = capssetter\n\
+\n\
+video decoder element = sprddec_h264;omxh264dec;avdec_h264\n\
+\n\
+video converter element =\n\
+\n\
+video filter element =\n\
\n\
video sink element = xvimagesink\n\
\n\
\n\
video native resolution = 0x20\n\
\n\
-video cea support=0x194ab\n\
+video cea support=0x842b\n\
\n\
-video vesa support=0x5555555\n\
+video vesa support=0x1\n\
\n\
video hh support=0x555\n\
\n\
\n\
video latency=0x0\n\
\n\
-video vertical resolution=1080\n\
+video vertical resolution=720\n\
\n\
-video horizontal resolution=1920\n\
+video horizontal resolution=1280\n\
\n\
video minimum slicesize=0\n\
\n\
MMWfdAttrsSpec wfd_attrs[] = {
{
- "server_ip",
+ (char *)"server_ip",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
(void *)"127.0.0.1",
},
{
- "server_port",
+ (char *)"server_port",
MM_ATTRS_TYPE_STRING,
MM_ATTRS_FLAG_RW,
(void *)"8554",
},
{
- "max_client_count",
+ (char *)"max_client_count",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *)1,
},
/* Initialized with invalid native type, if a valid value is set then only this atribute will be considered */
{
- "native_resolution",
+ (char *)"native_resolution",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *)0,
},
/* Initialized with invalid resolution, if a valid value is set then only this atribute will be considered */
{
- "prefered_resolutions",
+ (char *)"prefered_resolutions",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *)2147483647,
},
/* Initialized with invalid uibc option, if a valid value is set then only this atribute will be considered */
{
- "set_hdcp",
+ (char *)"set_hdcp",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *)2,
2
},
{
- "display_rotate",
+ (char *)"display_rotate",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *)0,
3
},
{
- "display_src_crop_x",
+ (char *)"display_src_crop_x",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_src_crop_y",
+ (char *)"display_src_crop_y",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_src_crop_width",
+ (char *)"display_src_crop_width",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_src_crop_height",
+ (char *)"display_src_crop_height",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_roi_x",
+ (char *)"display_roi_x",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_roi_y",
+ (char *)"display_roi_y",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_roi_width",
+ (char *)"display_roi_width",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 480,
4096
},
{
- "display_roi_height",
+ (char *)"display_roi_height",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 800,
4096
},
{
- "display_roi_mode",
+ (char *)"display_roi_mode",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
},
{
- "display_rotation",
+ (char *)"display_rotation",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) MM_DISPLAY_ROTATION_NONE,
MM_DISPLAY_ROTATION_270
},
{
- "display_visible",
+ (char *)"display_visible",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) TRUE,
1
},
{
- "display_method",
+ (char *)"display_method",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) MM_DISPLAY_METHOD_LETTER_BOX,
MM_DISPLAY_METHOD_CUSTOM_ROI
},
{
- "display_overlay",
+ (char *)"display_overlay",
MM_ATTRS_TYPE_DATA,
MM_ATTRS_FLAG_RW,
(void *) NULL,
0
},
{
- "display_overlay_user_data",
+ (char *)"display_overlay_user_data",
MM_ATTRS_TYPE_DATA,
MM_ATTRS_FLAG_RW,
(void *) NULL,
0
},
{
- "display_zoom",
+ (char *)"display_zoom",
MM_ATTRS_TYPE_DOUBLE,
MM_ATTRS_FLAG_RW,
(void *) 1,
9.0
},
{
- "display_surface_type",
+ (char *)"display_surface_type",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) MM_DISPLAY_SURFACE_NULL,
MM_DISPLAY_SURFACE_X_EXT
},
{
- "display_width", /* dest width of fimcconvert ouput */
+ (char *)"display_width", /* dest width of fimcconvert ouput */
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_height", /* dest height of fimcconvert ouput */
+ (char *)"display_height", /* dest height of fimcconvert ouput */
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_evas_do_scaling",
+ (char *)"display_evas_do_scaling",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) TRUE,
TRUE
},
{
- "display_x",
+ (char *)"display_x",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "display_y",
+ (char *)"display_y",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
4096
},
{
- "hdcp_handle",
+ (char *)"hdcp_handle",
MM_ATTRS_TYPE_DATA,
MM_ATTRS_FLAG_RW,
(void *) NULL,
0
},
{
- "hdcp_version",
+ (char *)"hdcp_version",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
2
},
{
- "hdcp_port",
+ (char *)"hdcp_port",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
(void *) 0,
gchar *str = NULL; \
gint length = 0; \
\
- str = iniparser_getstring(x_dict, x_ini, x_default); \
+ str = iniparser_getstring(x_dict, x_ini, (char *)x_default); \
if (str) { \
length = strlen(str); \
if ((length > 1) && (length < WFD_SINK_INI_MAX_STRLEN)) \
gboolean __generate_sink_default_ini(void)
{
FILE *fp = NULL;
- gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
+ const gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
/* create new file */
MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_sink, "pipeline:audio sink element", DEFAULT_NAME_OF_AUDIO_SINK);
MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_hdcp, "pipeline:video hdcp element", DEFAULT_NAME_OF_VIDEO_HDCP);
MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_parser, "pipeline:video parser element", DEFAULT_NAME_OF_VIDEO_PARSER);
+ MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_capssetter, "pipeline:video capssetter element", DEFAULT_NAME_OF_VIDEO_CAPSSETTER);
MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_decoder, "pipeline:video decoder element", DEFAULT_NAME_OF_VIDEO_DECODER);
+ MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_converter, "pipeline:video converter element", DEFAULT_NAME_OF_VIDEO_CONVERTER);
+ MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_filter, "pipeline:video filter element", DEFAULT_NAME_OF_VIDEO_FILTER);
MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_sink, "pipeline:video sink element", DEFAULT_NAME_OF_VIDEO_SINK);
/* audio parameter*/
strncpy(ini->name_of_audio_sink, DEFAULT_NAME_OF_AUDIO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
strncpy(ini->name_of_video_hdcp, DEFAULT_NAME_OF_VIDEO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
strncpy(ini->name_of_video_parser, DEFAULT_NAME_OF_VIDEO_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
+ strncpy(ini->name_of_video_capssetter, DEFAULT_NAME_OF_VIDEO_CAPSSETTER, WFD_SINK_INI_MAX_STRLEN - 1);
strncpy(ini->name_of_video_decoder, DEFAULT_NAME_OF_VIDEO_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
+ strncpy(ini->name_of_video_converter, DEFAULT_NAME_OF_VIDEO_CONVERTER, WFD_SINK_INI_MAX_STRLEN - 1);
+ strncpy(ini->name_of_video_filter, DEFAULT_NAME_OF_VIDEO_FILTER, WFD_SINK_INI_MAX_STRLEN - 1);
strncpy(ini->name_of_video_sink, DEFAULT_NAME_OF_VIDEO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
/* audio parameter*/
wfd_sink_debug("name_of_lpcm_filter : %s\n", ini->name_of_lpcm_filter);
wfd_sink_debug("name_of_audio_resampler : %s\n", ini->name_of_audio_resampler);
wfd_sink_debug("name_of_audio_volume : %s\n", ini->name_of_audio_volume);
-#ifdef ENABLE_WFD_VD_FEATURES
- wfd_sink_debug("name_of_audio_splitter : %s\n", ini->name_of_audio_splitter);
-#endif
wfd_sink_debug("name_of_audio_sink : %s\n", ini->name_of_audio_sink);
wfd_sink_debug("name_of_video_hdcp : %s\n", ini->name_of_video_hdcp);
wfd_sink_debug("name_of_video_parser : %s\n", ini->name_of_video_parser);
+ wfd_sink_debug("name_of_video_capssetter : %s\n", ini->name_of_video_capssetter);
wfd_sink_debug("name_of_video_decoder : %s\n", ini->name_of_video_decoder);
+ wfd_sink_debug("name_of_video_converter : %s\n", ini->name_of_video_converter);
+ wfd_sink_debug("name_of_video_filter : %s\n", ini->name_of_video_filter);
wfd_sink_debug("name_of_video_sink : %s\n", ini->name_of_video_sink);
/* audio parameter*/
jitter buffer latency=10
; for retransmission request enable = yes, disable = no
-enable retransmission = yes
+enable retransmission = no
; for reset basetime, enable = yes, disable = no
enable reset basetime = yes
ac3 decoder element =
-lpcm converter element = audioconvert
+lpcm converter element =
lpcm filter element = capsfilter
audio sink element = pulsesink
-video parser element = h264parse
+video parser element = ;h264parse
-video decoder element = omxh264dec;avdec_h264
+video capssetter element = capssetter
+
+video decoder element = sprddec_h264;omxh264dec;avdec_h264
+
+video converter element =
+
+video filter element =
video sink element = xvimagesink
video native resolution = 0x20
-video cea support=0x194ab
+video cea support=0x842b;0x194ab
-video vesa support=0x5555555
+video vesa support=0x1;0x5555555
video hh support=0x555
video latency=0x0
-video vertical resolution=1080
+video vertical resolution=720
-video horizontal resolution=1920
+video horizontal resolution=1280
video minimum slicesize=0
Name: libmm-wfd
Summary: Multimedia Framework Wifi-Display Library
-Version: 0.2.171
+Version: 0.2.178
Release: 0
Group: System/Libraries
License: Apache License 2.0
%setup -q
%build
+export CFLAGS+=" -Wextra -Wno-array-bounds"
+export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow"
+export CFLAGS+=" -Wwrite-strings -Wswitch-default"
./autogen.sh
MM_WFD_SINK_STATE_NUM, /**< Number of wifi-display states */
} MMWFDSinkStateType;
+/* audio codec : AAC, AC3, LPCM */
+typedef enum {
+ MM_WFD_SINK_AUDIO_CODEC_NONE,
+ MM_WFD_SINK_AUDIO_CODEC_AAC = 0x0F,
+ MM_WFD_SINK_AUDIO_CODEC_AC3 = 0x81,
+ MM_WFD_SINK_AUDIO_CODEC_LPCM = 0x83
+} MMWFDSinkAudioCodec;
+
+/* video codec : H264 */
+typedef enum {
+ MM_WFD_SINK_VIDEO_CODEC_NONE,
+ MM_WFD_SINK_VIDEO_CODEC_H264 = 0x1b
+} MMWFDSinkVideoCodec;
+
typedef void(*MMWFDMessageCallback)(int error_type, MMWFDSinkStateType state_type, void *user_data);
/**
*/
int mm_wfd_sink_set_resolution(MMHandleType wfd_sink, gint resolution);
+int mm_wfd_sink_get_negotiated_video_codec(MMHandleType wfd_sink, gint *codec);
+int mm_wfd_sink_get_negotiated_video_resolution(MMHandleType wfd_sink, gint *width, gint *height);
+int mm_wfd_sink_get_negotiated_video_frame_rate(MMHandleType wfd_sink, gint *frame_rate);
+int mm_wfd_sink_get_negotiated_audio_codec(MMHandleType wfd_sink, gint *codec);
+int mm_wfd_sink_get_negotiated_audio_channel(MMHandleType wfd_sink, gint *channel);
+int mm_wfd_sink_get_negotiated_audio_sample_rate(MMHandleType wfd_sink, gint *sample_rate);
+int mm_wfd_sink_get_negotiated_audio_bitwidth(MMHandleType wfd_sink, gint *bitwidth);
#endif
WFD_SINK_V_QUEUE,
WFD_SINK_V_HDCP,
WFD_SINK_V_PARSE,
+ WFD_SINK_V_CAPSSETTER,
WFD_SINK_V_DEC,
WFD_SINK_V_CONVERT,
+ WFD_SINK_V_CAPSFILTER,
WFD_SINK_V_SINK,
WFD_SINK_V_NUM
};
-/* audio codec : AAC, AC3, LPCM */
-enum WFDSinkAudioCodec {
- WFD_SINK_AUDIO_CODEC_NONE,
- WFD_SINK_AUDIO_CODEC_AAC = 0x0F,
- WFD_SINK_AUDIO_CODEC_AC3 = 0x81,
- WFD_SINK_AUDIO_CODEC_LPCM = 0x83
-};
-
-/* video codec : H264 */
-enum WFDSinkVideoCodec {
- WFD_SINK_VIDEO_CODEC_NONE,
- WFD_SINK_VIDEO_CODEC_H264 = 0x1b
-};
-
/**
* * Enumerations of wifi-display command.
* */
int _mm_wfd_sink_set_resolution(mm_wfd_sink_t *wfd_sink, MMWFDSinkResolution resolution);
int __mm_wfd_sink_link_audiobin(mm_wfd_sink_t *wfd_sink);
+int __mm_wfd_sink_link_videobin(mm_wfd_sink_t *wfd_sink);
int __mm_wfd_sink_prepare_videobin(mm_wfd_sink_t *wfd_sink);
int __mm_wfd_sink_prepare_audiobin(mm_wfd_sink_t *wfd_sink);
+const gchar *_mm_wfds_sink_get_state_name(MMWFDSinkStateType state);
+
#endif
#define MMWFDSINK_CURRENT_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.state
#define MMWFDSINK_PREVIOUS_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.prev_state
#define MMWFDSINK_PENDING_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.pending_state
-#define MMWFDSINK_STATE_GET_NAME(x_state) __mm_wfds_sink_get_state_name(x_state)
+#define MMWFDSINK_STATE_GET_NAME(x_state) _mm_wfds_sink_get_state_name(x_state)
#define MMWFDSINK_PRINT_STATE(x_wfd_sink) \
wfd_sink_debug("--prev %s, current %s, pending %s--\n", \
return result;
}
+int mm_wfd_sink_get_negotiated_video_codec(MMHandleType wfd_sink, gint *codec)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(codec, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *codec = wfd->stream_info.video_stream_info.codec;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_video_resolution(MMHandleType wfd_sink, gint *width, gint *height)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(width, MM_ERROR_WFD_INVALID_ARGUMENT);
+ wfd_sink_return_val_if_fail(height, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *width = wfd->stream_info.video_stream_info.width;
+ *height = wfd->stream_info.video_stream_info.height;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_video_frame_rate(MMHandleType wfd_sink, gint *frame_rate)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(frame_rate, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *frame_rate = wfd->stream_info.video_stream_info.frame_rate;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_codec(MMHandleType wfd_sink, gint *codec)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(codec, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *codec = wfd->stream_info.audio_stream_info.codec;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_channel(MMHandleType wfd_sink, gint *channel)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(channel, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *channel = wfd->stream_info.audio_stream_info.channels;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_sample_rate(MMHandleType wfd_sink, gint *sample_rate)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_debug_fenter();
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(sample_rate, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *sample_rate = wfd->stream_info.audio_stream_info.sample_rate;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_bitwidth(MMHandleType wfd_sink, gint *bitwidth)
+{
+ int result = MM_ERROR_NONE;
+ mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+ MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+ wfd_sink_debug_fenter();
+
+ wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(bitwidth, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+ MMWFDSINK_CMD_LOCK(wfd);
+
+ MMWFDSINK_PRINT_STATE(wfd);
+ cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+ if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+ cur_state != MM_WFD_SINK_STATE_PLAYING &&
+ cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+ wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+ result = MM_ERROR_WFD_INVALID_STATE;
+ } else {
+ *bitwidth = wfd->stream_info.audio_stream_info.bitwidth;
+ }
+
+ MMWFDSINK_CMD_UNLOCK(wfd);
+
+ wfd_sink_debug_fleave();
+
+ return result;
+}
/* link video bin*/
if (link_video_bin) {
wfd_sink_debug("try to link videobin.");
+ if (MM_ERROR_NONE != __mm_wfd_sink_link_videobin(wfd_sink)) {
+ wfd_sink_error("failed to link videobin.....\n");
+ goto EXIT;
+ }
}
if (set_ready_audio_bin) {
/* util */
static void __mm_wfd_sink_dump_pipeline_state(mm_wfd_sink_t *wfd_sink);
-const gchar *__mm_wfds_sink_get_state_name(MMWFDSinkStateType state);
static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution,
guint *VESA_resolution, guint *HH_resolution);
MMWFDSINK_PENDING_STATE(new_wfd_sink) = MM_WFD_SINK_STATE_NONE;
/* initialize audio/video information */
- new_wfd_sink->stream_info.audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_NONE;
+ new_wfd_sink->stream_info.audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
new_wfd_sink->stream_info.audio_stream_info.channels = 0;
new_wfd_sink->stream_info.audio_stream_info.sample_rate = 0;
new_wfd_sink->stream_info.audio_stream_info.bitwidth = 0;
- new_wfd_sink->stream_info.video_stream_info.codec = WFD_SINK_VIDEO_CODEC_NONE;
+ new_wfd_sink->stream_info.video_stream_info.codec = MM_WFD_SINK_VIDEO_CODEC_NONE;
new_wfd_sink->stream_info.video_stream_info.width = 0;
new_wfd_sink->stream_info.video_stream_info.height = 0;
new_wfd_sink->stream_info.video_stream_info.frame_rate = 0;
wfd_sink_debug_fenter();
- wfd_sink_return_val_if_fail(wfd_sink, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(wfd_sink &&
+ wfd_sink->pipeline &&
+ wfd_sink->pipeline->mainbin &&
+ wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst &&
+ wfd_sink->pipeline->mainbin[WFD_SINK_M_SRC].gst,
+ MM_ERROR_WFD_NOT_INITIALIZED);
/* check current wi-fi display sink state */
MMWFDSINK_CHECK_STATE(wfd_sink, MM_WFD_SINK_COMMAND_RESUME);
wfd_sink_debug_fenter();
- wfd_sink_return_val_if_fail(wfd_sink, MM_ERROR_WFD_NOT_INITIALIZED);
+ wfd_sink_return_val_if_fail(wfd_sink &&
+ wfd_sink->pipeline &&
+ wfd_sink->pipeline->mainbin &&
+ wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst &&
+ wfd_sink->pipeline->mainbin[WFD_SINK_M_SRC].gst,
+ MM_ERROR_WFD_NOT_INITIALIZED);
/* check current wi-fi display sink state */
MMWFDSINK_CHECK_STATE(wfd_sink, MM_WFD_SINK_COMMAND_DISCONNECT);
return result;
}
-static void
-_mm_wfd_sink_correct_pipeline_latency(mm_wfd_sink_t *wfd_sink)
-{
- GstQuery *qlatency;
- GstClockTime min_latency;
-
- qlatency = gst_query_new_latency();
- gst_element_query(wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst, qlatency);
- gst_query_parse_latency(qlatency, NULL, &min_latency, NULL);
-
- debug_msg("Correct manually pipeline latency: current=%"GST_TIME_FORMAT, GST_TIME_ARGS(min_latency));
- g_object_set(wfd_sink->pipeline->videobin[WFD_SINK_V_SINK].gst, "ts-offset", -(gint64)(min_latency * 9 / 10), NULL);
- g_object_set(wfd_sink->pipeline->audiobin[WFD_SINK_A_SINK].gst, "ts-offset", -(gint64)(min_latency * 9 / 10), NULL);
- gst_query_unref(qlatency);
-}
-
static GstBusSyncReply
_mm_wfd_bus_sync_callback(GstBus *bus, GstMessage *message, gpointer data)
{
voldstate = gst_structure_get_value(structure, "old-state");
vnewstate = gst_structure_get_value(structure, "new-state");
vpending = gst_structure_get_value(structure, "pending-state");
+ if (voldstate == NULL || vnewstate == NULL || vpending == NULL)
+ break;
oldstate = (GstState)voldstate->data[0].v_int;
newstate = (GstState)vnewstate->data[0].v_int;
case GST_MESSAGE_ELEMENT: {
const gchar *structure_name = NULL;
- const GstStructure *message_structure = NULL;
- message_structure = gst_message_get_structure(msg);
structure_name = gst_structure_get_name(message_structure);
if (structure_name) {
wfd_sink_debug("got element specific message[%s]\n", GST_STR_NULL(structure_name));
wfd_sink_error("failed to create videobin....\n");
goto ERROR;
}
- } else {
- wfd_sink_debug("videobin is already created.\n");
+ }
+
+ if (!wfd_sink->video_bin_is_linked) {
+ if (MM_ERROR_NONE != __mm_wfd_sink_link_videobin(wfd_sink)) {
+ wfd_sink_error("failed to link video decoder.....\n");
+ goto ERROR;
+ }
}
videobin = wfd_sink->pipeline->videobin[WFD_SINK_V_BIN].gst;
is_valid_audio_format = TRUE;
audio_format = g_strdup(gst_structure_get_string(str, "audio_format"));
if (g_strrstr(audio_format, "AAC"))
- stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_AAC;
+ stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_AAC;
else if (g_strrstr(audio_format, "AC3"))
- stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_AC3;
+ stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_AC3;
else if (g_strrstr(audio_format, "LPCM"))
- stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_LPCM;
+ stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_LPCM;
else {
wfd_sink_error("invalid audio format(%s)...\n", audio_format);
is_valid_audio_format = FALSE;
}
if (is_valid_video_format == TRUE) {
- stream_info->video_stream_info.codec = WFD_SINK_VIDEO_CODEC_H264;
+ stream_info->video_stream_info.codec = MM_WFD_SINK_VIDEO_CODEC_H264;
if (gst_structure_has_field(str, "video_width"))
gst_structure_get_int(str, "video_width", &stream_info->video_stream_info.width);
g_object_set(G_OBJECT(wfdrtspsrc), "debug", wfd_sink->ini.set_debug_property, NULL);
g_object_set(G_OBJECT(wfdrtspsrc), "latency", wfd_sink->ini.jitter_buffer_latency, NULL);
-#if 0
g_object_set(G_OBJECT(wfdrtspsrc), "do-request", wfd_sink->ini.enable_retransmission, NULL);
-#endif
g_object_set(G_OBJECT(wfdrtspsrc), "udp-buffer-size", 2097152, NULL);
g_object_set(G_OBJECT(wfdrtspsrc), "enable-pad-probe", wfd_sink->ini.enable_wfdrtspsrc_pad_probe, NULL);
MMWFDSinkGstElement *audiobin = NULL;
MMWFDSinkGstElement *first_element = NULL;
MMWFDSinkGstElement *last_element = NULL;
- gint audio_codec = WFD_SINK_AUDIO_CODEC_NONE;
+ gint audio_codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
GList *element_bucket = NULL;
GstPad *sinkpad = NULL;
GstPad *srcpad = NULL;
/* check audio codec */
audio_codec = wfd_sink->stream_info.audio_stream_info.codec;
switch (audio_codec) {
- case WFD_SINK_AUDIO_CODEC_LPCM:
+ case MM_WFD_SINK_AUDIO_CODEC_LPCM:
if (audiobin[WFD_SINK_A_LPCM_CONVERTER].gst)
element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_LPCM_CONVERTER]);
if (audiobin[WFD_SINK_A_LPCM_FILTER].gst)
element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_LPCM_FILTER]);
break;
- case WFD_SINK_AUDIO_CODEC_AAC:
+ case MM_WFD_SINK_AUDIO_CODEC_AAC:
if (audiobin[WFD_SINK_A_AAC_PARSE].gst)
element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AAC_PARSE]);
if (audiobin[WFD_SINK_A_AAC_DEC].gst)
element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AAC_DEC]);
break;
- case WFD_SINK_AUDIO_CODEC_AC3:
+ case MM_WFD_SINK_AUDIO_CODEC_AC3:
if (audiobin[WFD_SINK_A_AC3_PARSE].gst)
element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AC3_PARSE]);
if (audiobin[WFD_SINK_A_AC3_DEC].gst)
g_object_set(G_OBJECT(audio_sink), "provide-clock", FALSE, NULL);
g_object_set(G_OBJECT(audio_sink), "buffer-time", 100000LL, NULL);
- g_object_set(G_OBJECT(audio_sink), "query-position-support", FALSE, NULL);
g_object_set(G_OBJECT(audio_sink), "slave-method", 2, NULL);
g_object_set(G_OBJECT(audio_sink), "async", wfd_sink->ini.audio_sink_async, NULL);
g_object_set(G_OBJECT(audio_sink), "ts-offset", (gint64)wfd_sink->ini.sink_ts_offset, NULL);
static int __mm_wfd_sink_create_audiobin(mm_wfd_sink_t *wfd_sink)
{
MMWFDSinkGstElement *audiobin = NULL;
- gint audio_codec = WFD_SINK_AUDIO_CODEC_NONE;
+ gint audio_codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
gboolean link_audio_dec = TRUE;
GList *element_bucket = NULL;
GstPad *pad = NULL;
/* check audio decoder could be linked or not */
switch (wfd_sink->stream_info.audio_stream_info.codec) {
- case WFD_SINK_AUDIO_CODEC_AAC:
+ case MM_WFD_SINK_AUDIO_CODEC_AAC:
audio_codec = WFD_AUDIO_AAC;
break;
- case WFD_SINK_AUDIO_CODEC_AC3:
+ case MM_WFD_SINK_AUDIO_CODEC_AC3:
audio_codec = WFD_AUDIO_AC3;
break;
- case WFD_SINK_AUDIO_CODEC_LPCM:
+ case MM_WFD_SINK_AUDIO_CODEC_LPCM:
audio_codec = WFD_AUDIO_LPCM;
break;
- case WFD_SINK_AUDIO_CODEC_NONE:
+ case MM_WFD_SINK_AUDIO_CODEC_NONE:
default:
wfd_sink_debug("audio decoder could NOT be linked now, just prepare.\n");
audio_codec = wfd_sink->ini.audio_codec;
caps = gst_caps_new_simple("audio/x-raw",
"rate", G_TYPE_INT, 48000,
"channels", G_TYPE_INT, 2,
- "format", G_TYPE_STRING, "S16LE", NULL);
+ "format", G_TYPE_STRING, "S16BE", NULL);
g_object_set(G_OBJECT(audiobin[WFD_SINK_A_LPCM_FILTER].gst), "caps", caps, NULL);
gst_object_unref(GST_OBJECT(caps));
return MM_ERROR_WFD_INTERNAL;
}
+int __mm_wfd_sink_link_videobin(mm_wfd_sink_t *wfd_sink)
+{
+ MMWFDSinkGstElement *videobin = NULL;
+
+ wfd_sink_debug_fenter();
+
+ wfd_sink_return_val_if_fail(wfd_sink &&
+ wfd_sink->pipeline &&
+ wfd_sink->pipeline->videobin &&
+ wfd_sink->pipeline->videobin[WFD_SINK_V_BIN].gst,
+ MM_ERROR_WFD_NOT_INITIALIZED);
+
+ if (wfd_sink->video_bin_is_linked) {
+ wfd_sink_debug("videobin is already linked... nothing to do\n");
+ return MM_ERROR_NONE;
+ }
+
+ /* take videobin */
+ videobin = wfd_sink->pipeline->videobin;
+
+ if (videobin[WFD_SINK_V_CAPSSETTER].gst) {
+ GstCaps *caps = NULL;
+ caps = gst_caps_new_simple("video/x-h264",
+ "width", G_TYPE_INT, wfd_sink->stream_info.video_stream_info.width,
+ "height", G_TYPE_INT, wfd_sink->stream_info.video_stream_info.height,
+ "framerate", GST_TYPE_FRACTION, wfd_sink->stream_info.video_stream_info.frame_rate, 1, NULL);
+ g_object_set(G_OBJECT(videobin[WFD_SINK_V_CAPSSETTER].gst), "caps", caps, NULL);
+ gst_object_unref(GST_OBJECT(caps));
+ }
+
+ wfd_sink->video_bin_is_linked = TRUE;
+
+ wfd_sink_debug_fleave();
+
+ return MM_ERROR_NONE;
+}
+
static int __mm_wfd_sink_prepare_videodec(mm_wfd_sink_t *wfd_sink, GstElement *video_dec)
{
wfd_sink_debug_fenter();
wfd_sink_return_val_if_fail(video_dec, MM_ERROR_WFD_INVALID_ARGUMENT);
wfd_sink_return_val_if_fail(wfd_sink && wfd_sink->attrs, MM_ERROR_WFD_NOT_INITIALIZED);
- g_object_set(G_OBJECT(video_dec), "error-concealment", TRUE, NULL);
-
wfd_sink_debug_fleave();
return MM_ERROR_NONE;
return MM_ERROR_WFD_INTERNAL;
}
break;
+ default: {
+ wfd_sink_error("Not Supported Surface.(default case)");
+ return MM_ERROR_WFD_INTERNAL;
+ }
+ break;
}
g_object_set(G_OBJECT(video_sink), "qos", FALSE, NULL);
MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_PARSE, wfd_sink->ini.name_of_video_parser, "video_parser", TRUE);
MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_PARSE].gst, "sink");
MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_PARSE].gst, "src");
- if (videobin[WFD_SINK_V_PARSE].gst)
- g_object_set(G_OBJECT(videobin[WFD_SINK_V_PARSE].gst), "wfd-mode", TRUE, NULL);
+
+ /* create capssetter */
+ MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CAPSSETTER, wfd_sink->ini.name_of_video_capssetter, "video_capssetter", TRUE);
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSSETTER].gst, "sink");
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSSETTER].gst, "src");
/* create dec */
MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_DEC, wfd_sink->ini.name_of_video_decoder, "video_dec", TRUE);
}
}
+ /* create convert */
+ MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CONVERT, wfd_sink->ini.name_of_video_converter, "video_convert", TRUE);
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CONVERT].gst, "sink");
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CONVERT].gst, "src");
+
+ /* create filter */
+ MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CAPSFILTER, wfd_sink->ini.name_of_video_filter, "video_filter", TRUE);
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSFILTER].gst, "sink");
+ MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSFILTER].gst, "src");
+ if (videobin[WFD_SINK_V_CAPSFILTER].gst) {
+ GstCaps *caps = NULL;
+ caps = gst_caps_new_simple("video/x-raw",
+ "format", G_TYPE_STRING, "SN12", NULL);
+ g_object_set(G_OBJECT(videobin[WFD_SINK_V_CAPSFILTER].gst), "caps", caps, NULL);
+ gst_object_unref(GST_OBJECT(caps));
+ }
+
+
/* create sink */
MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_SINK, wfd_sink->ini.name_of_video_sink, "video_sink", TRUE);
MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_SINK].gst, "sink");
g_list_free(element_bucket);
- wfd_sink->video_bin_is_linked = TRUE;
/* take it */
wfd_sink->pipeline->videobin = videobin;
MMWFDSinkGstElement *audiobin = wfd_sink->pipeline->audiobin;
MMWFDSinkGstElement *videobin = wfd_sink->pipeline->videobin;
+ ret = gst_element_set_state(mainbin[WFD_SINK_M_PIPE].gst, GST_STATE_NULL);
+ if (ret != GST_STATE_CHANGE_SUCCESS) {
+ wfd_sink_error("failed to change state of mainbin to NULL\n");
+ return MM_ERROR_WFD_INTERNAL;
+ }
+
if (MM_ERROR_NONE != __mm_wfd_sink_destroy_videobin(wfd_sink)) {
wfd_sink_error("failed to destroy videobin\n");
return MM_ERROR_WFD_INTERNAL;
return MM_ERROR_WFD_INTERNAL;
}
- ret = gst_element_set_state(mainbin[WFD_SINK_M_PIPE].gst, GST_STATE_NULL);
- if (ret != GST_STATE_CHANGE_SUCCESS) {
- wfd_sink_error("failed to change state of mainbin to NULL\n");
- return MM_ERROR_WFD_INTERNAL;
- }
-
gst_object_unref(GST_OBJECT(mainbin[WFD_SINK_M_PIPE].gst));
MMWFDSINK_FREEIF(audiobin);
case GST_ITERATOR_DONE:
done = TRUE;
break;
+ default:
+ done = TRUE;
+ break;
}
}
}
}
const gchar *
-__mm_wfds_sink_get_state_name(MMWFDSinkStateType state)
+_mm_wfds_sink_get_state_name(MMWFDSinkStateType state)
{
switch (state) {
case MM_WFD_SINK_STATE_NONE:
return "INVAID";
}
}
+
static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution,
guint *VESA_resolution, guint *HH_resolution)
{