From: SeokHoon Lee Date: Wed, 13 Jul 2016 06:22:46 +0000 (+0900) Subject: Make structure for wfd_video_format X-Git-Tag: submit/tizen/20160718.052709^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df1dab5e7d01eb01faa7c1be667ddd14f992963a;p=platform%2Fcore%2Fmultimedia%2Flibmm-wfd.git Make structure for wfd_video_format Signed-off-by: SeokHoon Lee Change-Id: I043112df93b2acebfe13133f54060da1004eb202 --- diff --git a/config/mmfw_wfd_sink.ini b/config/mmfw_wfd_sink.ini index 5e99eda..fdf47a3 100644 --- a/config/mmfw_wfd_sink.ini +++ b/config/mmfw_wfd_sink.ini @@ -118,10 +118,13 @@ audio sampling frequency=0x3 audio channels=0x1 -[video param] -; 0: H264CBP 1: H264CHP +[wfd video formats] +; 0x0:not support, 0x1:H264 video codec=0x1 +; 0x0:not supoort, 0x1: CHP, 0x2:CBP +video profile=0x1 + video native resolution = 0x20 video cea support=0x84ab;0x194ab diff --git a/src/include/mm_wfd_sink_dlog.h b/src/include/mm_wfd_sink_dlog.h old mode 100755 new mode 100644 index 58082e8..166f712 --- a/src/include/mm_wfd_sink_dlog.h +++ b/src/include/mm_wfd_sink_dlog.h @@ -38,35 +38,35 @@ extern "C" { #define FONT_COLOR_GRAY "\033[37m" #define wfd_sink_debug(fmt, arg...) do { \ - LOGD(FONT_COLOR_RESET""fmt"", ##arg); \ + SLOGD(FONT_COLOR_RESET""fmt"", ##arg); \ } while (0) #define wfd_sink_info(fmt, arg...) do { \ - LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \ + SLOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) #define wfd_sink_error(fmt, arg...) do { \ - LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ + SLOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) #define wfd_sink_warning(fmt, arg...) do { \ - LOGW(FONT_COLOR_YELLOW""fmt""FONT_COLOR_RESET, ##arg); \ + SLOGW(FONT_COLOR_YELLOW""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) #define wfd_sink_debug_fenter() do { \ - LOGD(FONT_COLOR_RESET""); \ + SLOGD(FONT_COLOR_RESET""); \ } while (0) #define wfd_sink_debug_fleave() do { \ - LOGD(FONT_COLOR_RESET""); \ + SLOGD(FONT_COLOR_RESET""); \ } while (0) #define wfd_sink_error_fenter() do { \ - LOGE(FONT_COLOR_RED"NO-ERROR : "FONT_COLOR_RESET); \ + SLOGE(FONT_COLOR_RED"NO-ERROR : "FONT_COLOR_RESET); \ } while (0) #define wfd_sink_error_fleave() do { \ - LOGE(FONT_COLOR_RED"NO-ERROR : "FONT_COLOR_RESET); \ + SLOGE(FONT_COLOR_RED"NO-ERROR : "FONT_COLOR_RESET); \ } while (0) #define wfd_sink_sucure_info(fmt, arg...) do { \ @@ -74,7 +74,7 @@ extern "C" { } while (0) #define wfd_sink_return_if_fail(expr) \ - if(!(expr)) { \ + if (!(expr)) { \ wfd_sink_error(FONT_COLOR_RED"failed [%s]\n"FONT_COLOR_RESET, #expr); \ return; \ } diff --git a/src/include/mm_wfd_sink_ini.h b/src/include/mm_wfd_sink_ini.h index c6438cf..7cf3c4c 100644 --- a/src/include/mm_wfd_sink_ini.h +++ b/src/include/mm_wfd_sink_ini.h @@ -24,8 +24,6 @@ #define __MM_WFD_SINK_INI_H__ #include -#include -#include "mm_wfd_sink_enum.h" #ifdef __cplusplus extern "C" { @@ -44,6 +42,24 @@ extern "C" { #define WFD_SINK_INI_MAX_STRLEN 256 #define WFD_SINK_INI_MAX_ELEMENT 10 + +typedef struct { + guint video_codec; + guint video_native_resolution; + guint video_cea_support; + guint video_vesa_support; + guint video_hh_support; + guint video_profile; + guint video_level; + guint video_latency; + gint video_vertical_resolution; + gint video_horizontal_resolution; + gint video_minimum_slicing; + gint video_slice_enc_param; + gint video_framerate_control_support; + gint video_non_transcoding_support; +} WFDVideoFormats; + typedef struct { guint audio_codec; guint audio_latency; @@ -106,78 +122,12 @@ typedef struct __mm_wfd_sink_ini { WFDAudioCodecs wfd_audio_codecs; /* video parameter for reponse of M3 request */ - guint video_codec; - guint video_native_resolution; - guint video_cea_support; - guint video_vesa_support; - guint video_hh_support; - guint video_profile; - guint video_level; - guint video_latency; - gint video_vertical_resolution; - gint video_horizontal_resolution; - gint video_minimum_slicing; - gint video_slice_enc_param; - gint video_framerate_control_support; + WFDVideoFormats wfd_video_formats; /* hdcp parameter for reponse of M3 request */ WFDHDCPContentProtection wfd_content_protection; } mm_wfd_sink_ini_t; - -/*Default sink ini values*/ -/* General*/ -#define DEFAULT_GST_PARAM "" -#define DEFAULT_STATE_CHANGE_TIMEOUT 5 /* sec */ -#define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */ -#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_AUDIO_SINK_ASYNC FALSE -#define DEFAULT_VIDEO_SINK_ASYNC FALSE -#define DEFAULT_ENABLE_WFDRTSPSRC_PAD_PROBE FALSE - -/* Pipeline */ -#define DEFAULT_NAME_OF_SOURCE "wfdsrc" -#define DEFAULT_NAME_OF_TSDEMUX "" -#define DEFAULT_NAME_OF_AUDIO_HDCP "" -#define DEFAULT_NAME_OF_AAC_PARSER "" -#define DEFAULT_NAME_OF_AAC_DECODER "" -#define DEFAULT_NAME_OF_AC3_PARSER "" -#define DEFAULT_NAME_OF_AC3_DECODER "" -#define DEFAULT_NAME_OF_LPCM_CONVERTER "" -#define DEFAULT_NAME_OF_LPCM_FILTER "" -#define DEFAULT_NAME_OF_AUDIO_RESAMPLER "" -#define DEFAULT_NAME_OF_AUDIO_VOLUME "" -#define DEFAULT_NAME_OF_AUDIO_SPLITTER "" -#define DEFAULT_NAME_OF_AUDIO_SINK "" -#define DEFAULT_NAME_OF_VIDEO_HDCP "" -#define DEFAULT_NAME_OF_VIDEO_CAPSSETTER "" -#define DEFAULT_NAME_OF_VIDEO_CONVERTER "" -#define DEFAULT_NAME_OF_VIDEO_FILTER "" -#define DEFAULT_NAME_OF_VIDEO_SINK "" -#define DEFAULT_NAME_OF_EVAS_VIDEO_SINK "" - -/* 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_1280x720P25 | WFD_CEA_1280x720P24 */ -#define DEFAULT_VIDEO_CEA_SUPPORT 0x84ab -/* 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 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 - #define MM_WFD_SINK_DEFAULT_INI \ " \ [general]\n\ @@ -232,7 +182,7 @@ audio sink async=no\n\ ; if no, go asynchronously to PAUSED without preroll \n\ video sink async=no\n\ \n\ -; user agent that will be sent from DTV\n\ +; user agent\n\ user agent = TIZEN3_0/WFD-SINK\n\ \n\ \n\ @@ -294,7 +244,7 @@ audio channels=0x1\n\ \n\ \n\ \n\ -[video param]\n\ +[wfd video formats]\n\ ; 0: H264CBP 1: H264CHP\n\ video codec=0x1\n\ \n\ diff --git a/src/mm_wfd_sink_ini.c b/src/mm_wfd_sink_ini.c index 7804a10..e29a24e 100644 --- a/src/mm_wfd_sink_ini.c +++ b/src/mm_wfd_sink_ini.c @@ -32,7 +32,16 @@ /*Default sink ini values*/ /* General*/ +#define DEFAULT_GST_PARAM "" +#define DEFAULT_STATE_CHANGE_TIMEOUT 5 /* sec */ #define DEFAULT_ENABLE_RM TRUE +#define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */ +#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_AUDIO_SINK_ASYNC FALSE +#define DEFAULT_VIDEO_SINK_ASYNC FALSE #define DEFAULT_USER_AGENT "TIZEN3_0/WFD-SINK" /* Debug */ @@ -45,8 +54,26 @@ #define DEFAULT_DUMP_RTP_DATA FALSE /* Pipeline */ +#define DEFAULT_NAME_OF_SOURCE "wfdsrc" +#define DEFAULT_NAME_OF_TSDEMUX "" +#define DEFAULT_NAME_OF_AUDIO_HDCP "" +#define DEFAULT_NAME_OF_AAC_PARSER "" +#define DEFAULT_NAME_OF_AAC_DECODER "" +#define DEFAULT_NAME_OF_AC3_PARSER "" +#define DEFAULT_NAME_OF_AC3_DECODER "" +#define DEFAULT_NAME_OF_LPCM_CONVERTER "" +#define DEFAULT_NAME_OF_LPCM_FILTER "" +#define DEFAULT_NAME_OF_AUDIO_RESAMPLER "" +#define DEFAULT_NAME_OF_AUDIO_VOLUME "" +#define DEFAULT_NAME_OF_AUDIO_SINK "" +#define DEFAULT_NAME_OF_VIDEO_HDCP "" #define DEFAULT_NAME_OF_VIDEO_H264_PARSER "" +#define DEFAULT_NAME_OF_VIDEO_CAPSSETTER "" #define DEFAULT_NAME_OF_VIDEO_H264_DECODER "" +#define DEFAULT_NAME_OF_VIDEO_CONVERTER "" +#define DEFAULT_NAME_OF_VIDEO_FILTER "" +#define DEFAULT_NAME_OF_VIDEO_SINK "" +#define DEFAULT_NAME_OF_EVAS_VIDEO_SINK "" /* Audio */ #define DEFAULT_WFD_AUDIO_CODECS_CODEC WFD_AUDIO_LPCM | WFD_AUDIO_AAC @@ -54,6 +81,25 @@ #define DEFAULT_WFD_AUDIO_CODECS_CHANNELS WFD_CHANNEL_2 #define DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY WFD_FREQ_44100 | WFD_FREQ_48000 +/* Video */ +#define DEFAULT_WFD_VIDEO_FORMATS_CODEC WFD_VIDEO_H264 +#define DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION 0x20 +/* CEA : WFD_CEA_640x480P60 | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 | + WFD_CEA_1280x720P25 | WFD_CEA_1280x720P24 */ +#define DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT 0x84ab +/* VESA : WFD_VESA_800x600P30 */ +#define DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT 0x1 +/* HH : WFD_HH_800x480P30 | WFD_HH_854x480P30 | WFD_HH_864x480P30 | WFD_HH_640x360P30 | WFD_HH_960x540P30 | WFD_HH_848x480P30 */ +#define DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT 0x555 +#define DEFAULT_WFD_VIDEO_FORMATS_PROFILE WFD_H264_BASE_PROFILE +#define DEFAULT_WFD_VIDEO_FORMATS_LEVEL WFD_H264_LEVEL_3_2 +#define DEFAULT_WFD_VIDEO_FORMATS_LATENCY 0x0 +#define DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION 720 +#define DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION 1280 +#define DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE 0 +#define DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM 200 +#define DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL 11 + /* HDCP */ #define DEFAULT_ENABLE_HDCP FALSE #define DEFAULT_WFD_HDCP_CONTENT_PROTECTION 0x0 @@ -202,19 +248,19 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path) ini->wfd_audio_codecs.audio_sampling_frequency = iniparser_getint(dict, "wfd audio codecs:audio sampling frequency", DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY); /* video parameter*/ - ini->video_codec = iniparser_getint(dict, "video param:video codec", DEFAULT_VIDEO_CODEC); - ini->video_native_resolution = iniparser_getint(dict, "video param:video native resolution", DEFAULT_VIDEO_NATIVE_RESOLUTION); - ini->video_cea_support = iniparser_getint(dict, "video param:video cea support", DEFAULT_VIDEO_CEA_SUPPORT); - ini->video_vesa_support = iniparser_getint(dict, "video param:video vesa support", DEFAULT_VIDEO_VESA_SUPPORT); - ini->video_hh_support = iniparser_getint(dict, "video param:video hh support", DEFAULT_VIDEO_HH_SUPPORT); - ini->video_profile = iniparser_getint(dict, "video param:video profile", DEFAULT_VIDEO_PROFILE); - ini->video_level = iniparser_getint(dict, "video param:video level", DEFAULT_VIDEO_LEVEL); - ini->video_latency = iniparser_getint(dict, "video param:video latency", DEFAULT_VIDEO_LATENCY); - ini->video_vertical_resolution = iniparser_getint(dict, "video param:video vertical resolution", DEFAULT_VIDEO_VERTICAL_RESOLUTION); - ini->video_horizontal_resolution = iniparser_getint(dict, "video param:video horizontal resolution", DEFAULT_VIDEO_HORIZONTAL_RESOLUTION); - ini->video_minimum_slicing = iniparser_getint(dict, "video param:video minimum slicesize", DEFAULT_VIDEO_MIN_SLICESIZE); - ini->video_slice_enc_param = iniparser_getint(dict, "video param:video slice encoding params", DEFAULT_VIDEO_SLICE_ENC_PARAM); - ini->video_framerate_control_support = iniparser_getint(dict, "video param:video framerate control support", DEFAULT_VIDEO_FRAMERATE_CONTROL); + ini->wfd_video_formats.video_codec = iniparser_getint(dict, "wfd video formats:video codec", DEFAULT_WFD_VIDEO_FORMATS_CODEC); + ini->wfd_video_formats.video_native_resolution = iniparser_getint(dict, "wfd video formats:video native resolution", DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION); + ini->wfd_video_formats.video_cea_support = iniparser_getint(dict, "wfd video formats:video cea support", DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT); + ini->wfd_video_formats.video_vesa_support = iniparser_getint(dict, "wfd video formats:video vesa support", DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT); + ini->wfd_video_formats.video_hh_support = iniparser_getint(dict, "wfd video formats:video hh support", DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT); + ini->wfd_video_formats.video_profile = iniparser_getint(dict, "wfd video formats:video profile", DEFAULT_WFD_VIDEO_FORMATS_PROFILE); + ini->wfd_video_formats.video_level = iniparser_getint(dict, "wfd video formats:video level", DEFAULT_WFD_VIDEO_FORMATS_LEVEL); + ini->wfd_video_formats.video_latency = iniparser_getint(dict, "wfd video formats:video latency", DEFAULT_WFD_VIDEO_FORMATS_LATENCY); + ini->wfd_video_formats.video_vertical_resolution = iniparser_getint(dict, "wfd video formats:video vertical resolution", DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION); + ini->wfd_video_formats.video_horizontal_resolution = iniparser_getint(dict, "wfd video formats:video horizontal resolution", DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION); + ini->wfd_video_formats.video_minimum_slicing = iniparser_getint(dict, "wfd video formats:video minimum slicesize", DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE); + ini->wfd_video_formats.video_slice_enc_param = iniparser_getint(dict, "wfd video formats:video slice encoding params", DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM); + ini->wfd_video_formats.video_framerate_control_support = iniparser_getint(dict, "wfd video formats:video framerate control support", DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL); /* hdcp parameter*/ ini->wfd_content_protection.enable_hdcp = iniparser_getboolean(dict, "wfd hdcp content protection:enable hdcp", DEFAULT_ENABLE_HDCP); @@ -276,19 +322,19 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path) ini->wfd_audio_codecs.audio_sampling_frequency = DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY; /* video parameter*/ - ini->video_codec = DEFAULT_VIDEO_CODEC; - ini->video_native_resolution = DEFAULT_VIDEO_NATIVE_RESOLUTION; - ini->video_cea_support = DEFAULT_VIDEO_CEA_SUPPORT; - ini->video_vesa_support = DEFAULT_VIDEO_VESA_SUPPORT; - ini->video_hh_support = DEFAULT_VIDEO_HH_SUPPORT; - ini->video_profile = DEFAULT_VIDEO_PROFILE; - ini->video_level = DEFAULT_VIDEO_LEVEL; - ini->video_latency = DEFAULT_VIDEO_LATENCY; - ini->video_vertical_resolution = DEFAULT_VIDEO_VERTICAL_RESOLUTION; - ini->video_horizontal_resolution = DEFAULT_VIDEO_HORIZONTAL_RESOLUTION; - ini->video_minimum_slicing = DEFAULT_VIDEO_MIN_SLICESIZE; - ini->video_slice_enc_param = DEFAULT_VIDEO_SLICE_ENC_PARAM; - ini->video_framerate_control_support = DEFAULT_VIDEO_FRAMERATE_CONTROL; + ini->wfd_video_formats.video_codec = DEFAULT_WFD_VIDEO_FORMATS_CODEC; + ini->wfd_video_formats.video_native_resolution = DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION; + ini->wfd_video_formats.video_cea_support = DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT; + ini->wfd_video_formats.video_vesa_support = DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT; + ini->wfd_video_formats.video_hh_support = DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT; + ini->wfd_video_formats.video_profile = DEFAULT_WFD_VIDEO_FORMATS_PROFILE; + ini->wfd_video_formats.video_level = DEFAULT_WFD_VIDEO_FORMATS_LEVEL; + ini->wfd_video_formats.video_latency = DEFAULT_WFD_VIDEO_FORMATS_LATENCY; + ini->wfd_video_formats.video_vertical_resolution = DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION; + ini->wfd_video_formats.video_horizontal_resolution = DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION; + ini->wfd_video_formats.video_minimum_slicing = DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE; + ini->wfd_video_formats.video_slice_enc_param = DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM; + ini->wfd_video_formats.video_framerate_control_support = DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL; /* hdcp parameter*/ ini->wfd_content_protection.enable_hdcp = DEFAULT_ENABLE_HDCP; @@ -309,7 +355,16 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path) wfd_sink_debug("gst_param3 : %s", ini->gst_param[2]); wfd_sink_debug("gst_param4 : %s", ini->gst_param[3]); wfd_sink_debug("gst_param5 : %s", ini->gst_param[4]); + wfd_sink_debug("state_change_timeout(sec) : %d", ini->state_change_timeout); wfd_sink_debug("enable_rm : %d", ini->enable_rm); + wfd_sink_debug("jitter_buffer_latency(msec) : %d", ini->jitter_buffer_latency); + wfd_sink_debug("enable_retransmission : %d", ini->enable_retransmission); + wfd_sink_debug("enable_reset_basetime : %d", ini->enable_reset_basetime); + wfd_sink_debug("video_sink_max_lateness(nsec) : %d", ini->video_sink_max_lateness); + wfd_sink_debug("sink_ts_offset(nsec) : %d", ini->sink_ts_offset); + wfd_sink_debug("audio_sink_async : %d", ini->audio_sink_async); + wfd_sink_debug("video_sink_async : %d", ini->video_sink_async); + wfd_sink_debug("user_agent : %s\n", ini->user_agent); /* debug */ wfd_sink_debug("generate_dot : %d", ini->generate_dot); @@ -320,14 +375,6 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path) wfd_sink_debug("dump_rtsp_message : %d", ini->dump_rtsp_message); wfd_sink_debug("trace_buffers : %d", ini->trace_buffers); wfd_sink_debug("trace_first_buffer : %d", ini->trace_first_buffer); - wfd_sink_debug("state_change_timeout(sec) : %d\n", ini->state_change_timeout); - wfd_sink_debug("jitter_buffer_latency(msec) : %d\n", ini->jitter_buffer_latency); - wfd_sink_debug("enable_retransmission : %d\n", ini->enable_retransmission); - wfd_sink_debug("enable_reset_basetime : %d\n", ini->enable_reset_basetime); - wfd_sink_debug("video_sink_max_lateness(nsec) : %d\n", ini->video_sink_max_lateness); - wfd_sink_debug("sink_ts_offset(nsec) : %d\n", ini->sink_ts_offset); - wfd_sink_debug("audio_sink_async : %d\n", ini->audio_sink_async); - wfd_sink_debug("video_sink_async : %d\n", ini->video_sink_async); wfd_sink_debug("trace_buffers_of_wfdsrc : %d", ini->trace_buffers_of_wfdsrc); wfd_sink_debug("dump_ts_data : %d", ini->dump_ts_data); wfd_sink_debug("dump_rtp_data : %d", ini->dump_rtp_data); @@ -362,19 +409,19 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path) wfd_sink_debug("wfd_audio_codecs.audio_sampling_frequency : %x", ini->wfd_audio_codecs.audio_sampling_frequency); /* video parameter*/ - wfd_sink_debug("video_codec : %x\n", ini->video_codec); - wfd_sink_debug("video_native_resolution : %x\n", ini->video_native_resolution); - wfd_sink_debug("video_cea_support : %x\n", ini->video_cea_support); - wfd_sink_debug("video_vesa_support : %x\n", ini->video_vesa_support); - wfd_sink_debug("video_hh_support : %x\n", ini->video_hh_support); - wfd_sink_debug("video_profile : %x\n", ini->video_profile); - wfd_sink_debug("video_level : %x\n", ini->video_level); - wfd_sink_debug("video_latency : %d\n", ini->video_latency); - wfd_sink_debug("video_vertical_resolution : %d\n", ini->video_vertical_resolution); - wfd_sink_debug("video_horizontal_resolution : %d\n", ini->video_horizontal_resolution); - wfd_sink_debug("video_minimum_slicing : %d\n", ini->video_minimum_slicing); - wfd_sink_debug("video_slice_enc_param : %d\n", ini->video_slice_enc_param); - wfd_sink_debug("video_framerate_control_support : %d\n", ini->video_framerate_control_support); + wfd_sink_debug("wfd_video_formats.video_codec : %x\n", ini->wfd_video_formats.video_codec); + wfd_sink_debug("wfd_video_formats.video_native_resolution : %x\n", ini->wfd_video_formats.video_native_resolution); + wfd_sink_debug("wfd_video_formats.video_cea_support : %x\n", ini->wfd_video_formats.video_cea_support); + wfd_sink_debug("wfd_video_formats.video_vesa_support : %x\n", ini->wfd_video_formats.video_vesa_support); + wfd_sink_debug("wfd_video_formats.video_hh_support : %x\n", ini->wfd_video_formats.video_hh_support); + wfd_sink_debug("wfd_video_formats.video_profile : %x\n", ini->wfd_video_formats.video_profile); + wfd_sink_debug("wfd_video_formats.video_level : %x\n", ini->wfd_video_formats.video_level); + wfd_sink_debug("wfd_video_formats.video_latency : %d\n", ini->wfd_video_formats.video_latency); + wfd_sink_debug("wfd_video_formats.video_vertical_resolution : %d\n", ini->wfd_video_formats.video_vertical_resolution); + wfd_sink_debug("wfd_video_formats.video_horizontal_resolution : %d\n", ini->wfd_video_formats.video_horizontal_resolution); + wfd_sink_debug("wfd_video_formats.video_minimum_slicing : %d\n", ini->wfd_video_formats.video_minimum_slicing); + wfd_sink_debug("wfd_video_formats.video_slice_enc_param : %d\n", ini->wfd_video_formats.video_slice_enc_param); + wfd_sink_debug("wfd_video_formats.video_framerate_control_support : %d\n", ini->wfd_video_formats.video_framerate_control_support); /* hdcp parameter*/ wfd_sink_debug("wfd_content_protection.enable_hdcp : %d", ini->wfd_content_protection.enable_hdcp); diff --git a/src/mm_wfd_sink_priv.c b/src/mm_wfd_sink_priv.c index 6ad2e28..f87f5b7 100644 --- a/src/mm_wfd_sink_priv.c +++ b/src/mm_wfd_sink_priv.c @@ -50,7 +50,6 @@ static int __mm_wfd_sink_set_state(mm_wfd_sink_t *wfd_sink, MMWFDSinkStateType s /* util */ static void __mm_wfd_sink_dump_pipeline_state(mm_wfd_sink_t *wfd_sink); -static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution, guint *VESA_resolution, guint *HH_resolution); int _mm_wfd_sink_create(mm_wfd_sink_t **wfd_sink, const char *ini_path) { @@ -1838,10 +1837,41 @@ __mm_wfd_sink_update_stream_info(GstElement *wfdsrc, GstStructure *str, gpointer wfd_sink_debug_fleave(); } +static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution, + guint *VESA_resolution, guint *HH_resolution) +{ + if (resolution == MM_WFD_SINK_RESOLUTION_UNKNOWN) return; + + *CEA_resolution = 0; + *VESA_resolution = 0; + *HH_resolution = 0; + + if (resolution & MM_WFD_SINK_RESOLUTION_1920x1080_P30) + *CEA_resolution |= WFD_CEA_1920x1080P30; + + if (resolution & MM_WFD_SINK_RESOLUTION_1280x720_P30) + *CEA_resolution |= WFD_CEA_1280x720P30; + + if (resolution & MM_WFD_SINK_RESOLUTION_960x540_P30) + *HH_resolution |= WFD_HH_960x540P30; + + if (resolution & MM_WFD_SINK_RESOLUTION_864x480_P30) + *HH_resolution |= WFD_HH_864x480P30; + + if (resolution & MM_WFD_SINK_RESOLUTION_720x480_P60) + *CEA_resolution |= WFD_CEA_720x480P60; + + if (resolution & MM_WFD_SINK_RESOLUTION_640x480_P60) + *CEA_resolution |= WFD_CEA_640x480P60; + + if (resolution & MM_WFD_SINK_RESOLUTION_640x360_P30) + *HH_resolution |= WFD_HH_640x360P30; +} + static int __mm_wfd_sink_prepare_source(mm_wfd_sink_t *wfd_sink, GstElement *wfdsrc) { GstStructure *wfd_audio_codecs = NULL; - GstStructure *video_param = NULL; + GstStructure *wfd_video_formats = NULL; GstStructure *wfd_content_protection = NULL; gint hdcp_version = 0; gint hdcp_port = 0; @@ -1893,30 +1923,35 @@ static int __mm_wfd_sink_prepare_source(mm_wfd_sink_t *wfd_sink, GstElement *wfd } /* set video parameter for Wi-Fi Display session negotiation */ - CEA_resolution = wfd_sink->ini.video_cea_support; - VESA_resolution = wfd_sink->ini.video_vesa_support; - HH_resolution = wfd_sink->ini.video_hh_support; - - __mm_wfd_sink_prepare_video_resolution(wfd_sink->supportive_resolution, &CEA_resolution, &VESA_resolution, &HH_resolution); - - wfd_sink_debug("set video resolution CEA[%x] VESA[%x] HH[%x]", CEA_resolution, VESA_resolution, HH_resolution); - - video_param = gst_structure_new("video_param", - "video_codec", G_TYPE_UINT, wfd_sink->ini.video_codec, - "video_native_resolution", G_TYPE_UINT, wfd_sink->ini.video_native_resolution, + CEA_resolution = wfd_sink->ini.wfd_video_formats.video_cea_support; + VESA_resolution = wfd_sink->ini.wfd_video_formats.video_vesa_support; + HH_resolution = wfd_sink->ini.wfd_video_formats.video_hh_support; + + __mm_wfd_sink_prepare_video_resolution(wfd_sink->supportive_resolution, + &CEA_resolution, &VESA_resolution, &HH_resolution); + wfd_video_formats = gst_structure_new("wfd_video_formats", + "video_codec", G_TYPE_UINT, wfd_sink->ini.wfd_video_formats.video_codec, + "video_native_resolution", G_TYPE_UINT, wfd_sink->ini.wfd_video_formats.video_native_resolution, "video_cea_support", G_TYPE_UINT, CEA_resolution, "video_vesa_support", G_TYPE_UINT, VESA_resolution, "video_hh_support", G_TYPE_UINT, HH_resolution, - "video_profile", G_TYPE_UINT, wfd_sink->ini.video_profile, - "video_level", G_TYPE_UINT, wfd_sink->ini.video_level, - "video_latency", G_TYPE_UINT, wfd_sink->ini.video_latency, - "video_vertical_resolution", G_TYPE_INT, wfd_sink->ini.video_vertical_resolution, - "video_horizontal_resolution", G_TYPE_INT, wfd_sink->ini.video_horizontal_resolution, - "video_minimum_slicing", G_TYPE_INT, wfd_sink->ini.video_minimum_slicing, - "video_slice_enc_param", G_TYPE_INT, wfd_sink->ini.video_slice_enc_param, - "video_framerate_control_support", G_TYPE_INT, wfd_sink->ini.video_framerate_control_support, + "video_profile", G_TYPE_UINT, wfd_sink->ini.wfd_video_formats.video_profile, + "video_level", G_TYPE_UINT, wfd_sink->ini.wfd_video_formats.video_level, + "video_latency", G_TYPE_UINT, wfd_sink->ini.wfd_video_formats.video_latency, + "video_vertical_resolution", G_TYPE_INT, wfd_sink->ini.wfd_video_formats.video_vertical_resolution, + "video_horizontal_resolution", G_TYPE_INT, wfd_sink->ini.wfd_video_formats.video_horizontal_resolution, + "video_minimum_slicing", G_TYPE_INT, wfd_sink->ini.wfd_video_formats.video_minimum_slicing, + "video_slice_enc_param", G_TYPE_INT, wfd_sink->ini.wfd_video_formats.video_slice_enc_param, + "video_framerate_control_support", G_TYPE_INT, wfd_sink->ini.wfd_video_formats.video_framerate_control_support, NULL); + if (wfd_video_formats) { + if (g_object_class_find_property(klass, "video-param")) /* for common wfdsrc */ + g_object_set(G_OBJECT(wfdsrc), "video-param", wfd_video_formats, NULL); + if (g_object_class_find_property(klass, "wfd-video-formats")) + g_object_set(G_OBJECT(wfdsrc), "wfd-video-formats", wfd_video_formats, NULL); + } + /* set hdcp parameter for Wi-Fi Display session negotiation */ if (wfd_sink->ini.wfd_content_protection.enable_hdcp) { mm_attrs_get_int_by_name(wfd_sink->attrs, "hdcp_version", &hdcp_version); @@ -1936,8 +1971,6 @@ static int __mm_wfd_sink_prepare_source(mm_wfd_sink_t *wfd_sink, GstElement *wfd } } - g_object_set(G_OBJECT(wfdsrc), "video-param", video_param, NULL); - g_signal_connect(wfdsrc, "update-media-info", G_CALLBACK(__mm_wfd_sink_update_stream_info), wfd_sink); g_signal_connect(wfdsrc, "change-av-format", G_CALLBACK(__mm_wfd_sink_change_av_format), wfd_sink); @@ -3174,7 +3207,7 @@ static int __mm_wfd_sink_create_video_decodebin(mm_wfd_sink_t *wfd_sink) return MM_ERROR_NONE; } - /* check audio decodebin could be linked now */ + /* check video decodebin could be linked now */ switch (wfd_sink->stream_info.video_stream_info.codec) { case MM_WFD_SINK_VIDEO_CODEC_H264: video_codec = WFD_VIDEO_H264; @@ -3183,7 +3216,7 @@ static int __mm_wfd_sink_create_video_decodebin(mm_wfd_sink_t *wfd_sink) case MM_WFD_SINK_VIDEO_CODEC_NONE: default: wfd_sink_debug("video decodebin could NOT be linked now, just create"); - video_codec = wfd_sink->ini.video_codec; + video_codec = wfd_sink->ini.wfd_video_formats.video_codec; link = FALSE; break; } @@ -3667,36 +3700,6 @@ 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) -{ - if (resolution == MM_WFD_SINK_RESOLUTION_UNKNOWN) return; - - *CEA_resolution = 0; - *VESA_resolution = 0; - *HH_resolution = 0; - - if (resolution & MM_WFD_SINK_RESOLUTION_1920x1080_P30) - *CEA_resolution |= WFD_CEA_1920x1080P30; - - if (resolution & MM_WFD_SINK_RESOLUTION_1280x720_P30) - *CEA_resolution |= WFD_CEA_1280x720P30; - - if (resolution & MM_WFD_SINK_RESOLUTION_960x540_P30) - *HH_resolution |= WFD_HH_960x540P30; - - if (resolution & MM_WFD_SINK_RESOLUTION_864x480_P30) - *HH_resolution |= WFD_HH_864x480P30; - - if (resolution & MM_WFD_SINK_RESOLUTION_720x480_P60) - *CEA_resolution |= WFD_CEA_720x480P60; - - if (resolution & MM_WFD_SINK_RESOLUTION_640x480_P60) - *CEA_resolution |= WFD_CEA_640x480P60; - - if (resolution & MM_WFD_SINK_RESOLUTION_640x360_P30) - *HH_resolution |= WFD_HH_640x360P30; -} - int _mm_wfd_sink_set_resolution(mm_wfd_sink_t *wfd_sink, MMWFDSinkResolution resolution) { MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;