Using this patch, 'wfd-audio-formats' parameter have none parameter for video only sink.
Basically, screen mirroring provides video & audio simultaneously.
This patch will make screen mirroring to provide Video only.
-When Video only mirroring mode goes, it makes 'wfd_audio_codecs' messages to 'none'.
If 'sink session mode' in 'mmfw_wfd_sink.ini' is set '2',
screen mirroring runs without audio(that is, video only mirroring)
Change-Id: Ia88fb8a23c2f28cda222075835aa16c4a6bb3987
Signed-off-by: Hyunsoo, Park <hance.park@samsung.com>
if (!g_strcmp0 (attr, GST_STRING_WFD_AUDIO_CODECS)) {
msg->audio_codecs = g_new0 (GstWFDAudioCodeclist, 1);
if (strlen (v)) {
- guint i = 0;
- msg->audio_codecs->count = strlen (v) / 16;
- msg->audio_codecs->list =
+ WFD_SKIP_SPACE (v);
+ if (strncmp (v, "none", 4)) {
+ guint i = 0;
+ msg->audio_codecs->count = strlen (v) / 16;
+ msg->audio_codecs->list =
g_new0 (GstWFDAudioCodec, msg->audio_codecs->count);
- for (; i < msg->audio_codecs->count; i++) {
- WFD_SKIP_SPACE (v);
- WFD_READ_STRING (msg->audio_codecs->list[i].audio_format);
- WFD_SKIP_SPACE (v);
- WFD_READ_UINT32 (msg->audio_codecs->list[i].modes);
- WFD_SKIP_SPACE (v);
- WFD_READ_UINT32 (msg->audio_codecs->list[i].latency);
- WFD_SKIP_COMMA (v);
+ for (; i < msg->audio_codecs->count; i++) {
+ WFD_SKIP_SPACE (v);
+ WFD_READ_STRING (msg->audio_codecs->list[i].audio_format);
+ WFD_SKIP_SPACE (v);
+ WFD_READ_UINT32 (msg->audio_codecs->list[i].modes);
+ WFD_SKIP_SPACE (v);
+ WFD_READ_UINT32 (msg->audio_codecs->list[i].latency);
+ WFD_SKIP_COMMA (v);
+ }
+ } else {
+ msg->audio_codecs->count = 0;
+ msg->audio_codecs->list = NULL;
}
}
} else if (!g_strcmp0 (attr, GST_STRING_WFD_VIDEO_FORMATS)) {
/* list of audio codecs */
if (msg->audio_codecs) {
g_string_append_printf (lines, GST_STRING_WFD_AUDIO_CODECS);
+ g_string_append_printf (lines, ":");
if (msg->audio_codecs->list) {
- g_string_append_printf (lines, ":");
for (i = 0; i < msg->audio_codecs->count; i++) {
g_string_append_printf (lines, " %s",
msg->audio_codecs->list[i].audio_format);
if ((i + 1) < msg->audio_codecs->count)
g_string_append_printf (lines, ",");
}
+ } else {
+ g_string_append_printf (lines, " none");
}
g_string_append_printf (lines, "\r\n");
}
if (!msg->audio_codecs)
msg->audio_codecs = g_new0 (GstWFDAudioCodeclist, 1);
+ if (a_codec == GST_WFD_AUDIO_UNKNOWN) {
+ msg->audio_codecs->list = NULL;
+ msg->audio_codecs->count = 0;
+ return GST_WFD_OK;
+ }
msg->audio_codecs->list = g_new0 (GstWFDAudioCodec, 1);
msg->audio_codecs->count = 1;
if (a_codec == GST_WFD_AUDIO_LPCM) {
gst_wfd_message_as_text (msg));
/* Get the audio formats supported by WFDSink */
- if (msg->audio_codecs) {
+ if (msg->audio_codecs && msg->audio_codecs->count > 0) {
wfd_res =
gst_wfd_message_get_supported_audio_format (msg, &priv->caCodec,
&priv->cFreq, &priv->cChanels, &priv->cBitwidth, &priv->caLatency);
goto error;
}
- taudiocodec =
- wfd_get_preferred_audio_codec (priv->audio_codec, priv->caCodec);
- priv->caCodec = taudiocodec;
+ if (priv->caCodec != GST_WFD_AUDIO_UNKNOWN) {
+ taudiocodec = wfd_get_preferred_audio_codec (priv->audio_codec, priv->caCodec);
+ priv->caCodec = taudiocodec;
+ }
if (!_set_negotiated_audio_codec (client, priv->caCodec)) {
GST_ERROR_OBJECT (client, "Failed to set negotiated "
"audio codec to media factory...");
}
- if (priv->cFreq & GST_WFD_FREQ_48000)
- taudiofreq = GST_WFD_FREQ_48000;
- else if (priv->cFreq & GST_WFD_FREQ_44100)
- taudiofreq = GST_WFD_FREQ_44100;
- priv->cFreq = taudiofreq;
-
- /* TODO-WFD: Currently only 2 channels is present */
- if (priv->cChanels & GST_WFD_CHANNEL_8)
- taudiochannels = GST_WFD_CHANNEL_2;
- else if (priv->cChanels & GST_WFD_CHANNEL_6)
- taudiochannels = GST_WFD_CHANNEL_2;
- else if (priv->cChanels & GST_WFD_CHANNEL_4)
- taudiochannels = GST_WFD_CHANNEL_2;
- else if (priv->cChanels & GST_WFD_CHANNEL_2)
- taudiochannels = GST_WFD_CHANNEL_2;
- priv->cChanels = taudiochannels;
-
+ if (priv->caCodec != GST_WFD_AUDIO_UNKNOWN) {
+ if (priv->cFreq & GST_WFD_FREQ_48000)
+ taudiofreq = GST_WFD_FREQ_48000;
+ else if (priv->cFreq & GST_WFD_FREQ_44100)
+ taudiofreq = GST_WFD_FREQ_44100;
+ priv->cFreq = taudiofreq;
+
+ /* TODO-WFD: Currently only 2 channels is present */
+ if (priv->cChanels & GST_WFD_CHANNEL_8)
+ taudiochannels = GST_WFD_CHANNEL_2;
+ else if (priv->cChanels & GST_WFD_CHANNEL_6)
+ taudiochannels = GST_WFD_CHANNEL_2;
+ else if (priv->cChanels & GST_WFD_CHANNEL_4)
+ taudiochannels = GST_WFD_CHANNEL_2;
+ else if (priv->cChanels & GST_WFD_CHANNEL_2)
+ taudiochannels = GST_WFD_CHANNEL_2;
+ priv->cChanels = taudiochannels;
+ }
wfd_res =
gst_wfd_message_set_preferred_audio_format (msg, taudiocodec, taudiofreq,
taudiochannels, priv->cBitwidth, priv->caLatency);
priv = factory->priv;
+ if (priv->audio_codec == GST_WFD_AUDIO_UNKNOWN) {
+ GST_INFO_OBJECT (factory, "Skip create audio source");
+ return TRUE;
+ }
+
/* create audio src element */
audiosrc = gst_element_factory_make ("pulsesrc", "audiosrc");
if (!audiosrc) {
srcpad = NULL;
}
+ GST_INFO_OBJECT (factory, "Check audio codec... %d", priv->audio_codec);
+
/* create audio source elements & add to pipeline */
if (!_rtsp_media_factory_wfd_create_audio_capture_bin (factory, srcbin))
goto create_error;
- /* request audio sink pad from muxer, which has elementary pid 0x1100 */
- mux_asinkpad = gst_element_get_request_pad (mux, "sink_4352");
- if (!mux_asinkpad) {
- GST_ERROR_OBJECT (factory, "Failed to get sinkpad from muxer...");
- goto create_error;
- }
+ if (priv->audio_codec > GST_WFD_AUDIO_UNKNOWN) {
+ /* request audio sink pad from muxer, which has elementary pid 0x1100 */
+ mux_asinkpad = gst_element_get_request_pad (mux, "sink_4352");
+ if (!mux_asinkpad) {
+ GST_ERROR_OBJECT (factory, "Failed to get sinkpad from muxer...");
+ goto create_error;
+ }
- /* request srcpad from audio queue */
- srcpad = gst_element_get_static_pad (priv->audio_queue, "src");
- if (!srcpad) {
- GST_ERROR_OBJECT (factory, "Failed to get srcpad from audio queue...");
- goto create_error;
- }
+ /* request srcpad from audio queue */
+ srcpad = gst_element_get_static_pad (priv->audio_queue, "src");
+ if (!srcpad) {
+ GST_ERROR_OBJECT (factory, "Failed to get srcpad from audio queue...");
+ goto create_error;
+ }
- /* link audio queue's srcpad & muxer sink pad */
- if (gst_pad_link (srcpad, mux_asinkpad) != GST_PAD_LINK_OK) {
- GST_ERROR_OBJECT (factory,
- "Failed to link audio queue src pad & muxer audio sink pad...");
- goto create_error;
+ /* link audio queue's srcpad & muxer sink pad */
+ if (gst_pad_link (srcpad, mux_asinkpad) != GST_PAD_LINK_OK) {
+ GST_ERROR_OBJECT (factory,
+ "Failed to link audio queue src pad & muxer audio sink pad...");
+ goto create_error;
+ }
+ gst_object_unref (mux_asinkpad);
+ gst_object_unref (srcpad);
}
- gst_object_unref (mux_asinkpad);
- gst_object_unref (srcpad);
if (priv->dump_ts)
{
guint32 width, guint32 height);
void gst_rtsp_media_factory_wfd_set_audio_codec (GstRTSPMediaFactory *factory,
guint audio_codec);
+void gst_rtsp_media_factory_wfd_set_video_codec (GstRTSPMediaFactory * factory,
+ guint video_codec);
void gst_rtsp_media_factory_wfd_set_venc_bitrate (GstRTSPMediaFactory *factory,
gint bitrate);
Name: gst-rtsp-server
Summary: Multimedia Framework Library
Version: 1.6.1
-Release: 8
+Release: 9
Url: http://gstreamer.freedesktop.org/
Group: System/Libraries
License: LGPL-2.0+