return codec;
}
+static guint
+wfd_get_preferred_video_codec (guint8 srcVideoCodec, guint sinkVideoCodec)
+{
+ int i = 0;
+ guint codec = 0;
+ for (i = 0; i < 8; i++) {
+ if (((sinkVideoCodec << i) & 0x80)
+ && ((srcVideoCodec << i) & 0x80)) {
+ codec = (0x01 << (7 - i));
+ break;
+ }
+ }
+ return codec;
+}
+
static guint64
wfd_get_preferred_resolution (guint64 srcResolution,
guint64 sinkResolution,
GstWFDAudioChannels taudiochannels = GST_WFD_CHANNEL_UNKNOWN;
/* Parameters for the preffered video formats */
+ GstWFDVideoCodecs tvideocodec = GST_WFD_VIDEO_UNKNOWN;
GstWFDVideoCEAResolution tcCEAResolution = GST_WFD_CEA_UNKNOWN;
GstWFDVideoVESAResolution tcVESAResolution = GST_WFD_VESA_UNKNOWN;
GstWFDVideoHHResolution tcHHResolution = GST_WFD_HH_UNKNOWN;
}
/* Set the preffered video formats */
- GST_INFO_OBJECT (priv, "Set the video formats. source codec %d, sink codec %d", priv->video_codec, priv->cvCodec);
- /* TODO : need to negotiate video codec between source and sink */
+ tvideocodec = wfd_get_preferred_video_codec (priv->video_codec, priv->cvCodec);
+ GST_INFO_OBJECT (priv, "Set the video formats. source codec %d, sink codec %d, Negotiated code %d",
+ priv->video_codec, priv->cvCodec, tvideocodec);
+ priv->cvCodec = tvideocodec;
+
if (priv->cvCodec != GST_WFD_VIDEO_UNKNOWN) {
priv->cvCodec = GST_WFD_VIDEO_H264;
priv->cProfile = tcProfile = GST_WFD_H264_BASE_PROFILE;