#endif
#include <glib.h> /* for G_OS_WIN32 */
-#include <gst/gstinfo.h> /* For GST_STR_NULL */
-#include <gst/gst.h>
+
#include "wfdconfigmessage.h"
+
#include <mm_debug.h>
/* FIXME, is currently allocated on the stack */
if(msg->idr_request) {
FREE_STRING(msg->idr_request);
}
-
return WFD_OK;
}
} else {
g_string_append_printf (lines," none");
}
+ } else {
+ g_string_append_printf (lines," none");
}
g_string_append_printf (lines,"\r\n");
}
g_string_append_printf (lines," none");
g_string_append_printf (lines,"\r\n");
}
+
if(msg->client_rtp_ports) {
g_string_append_printf (lines,"wfd_client_rtp_ports");
if(msg->client_rtp_ports->profile) {
static gboolean
wfdconfig_parse_line (WFDMessage * msg, gchar * buffer)
{
- gchar type[8192];
- gchar value[8192];
- gchar temp[8192];
+ gchar type[8192] = {0};
+ gchar value[8192] = {0};
+ gchar temp[8192] = {0};
gchar *p = buffer;
gchar *v = value;
#define WFD_SKIP_SPACE(q) if (*q && g_ascii_isspace (*q)) q++
+ #define WFD_SKIP_EQUAL(q) if (*q && *q == '=') q++
#define WFD_SKIP_COMMA(q) if (*q && g_ascii_ispunct (*q)) q++
#define WFD_READ_STRING(field) read_string_space_ended (temp, sizeof (temp), v); v+=strlen(temp); REPLACE_STRING (field, temp)
#define WFD_READ_CHAR_END_STRING(field, del) read_string_char_ended (temp, sizeof (temp), del, v); v+=strlen(temp); REPLACE_STRING (field, temp)
WFD_READ_UINT32(msg->display_edid->edid_block_count);
WFD_SKIP_SPACE(v);
if(msg->display_edid->edid_block_count) {
+ gchar *edid_string = v;
+ int i=0, j=0;
guint32 payload_size = EDID_BLOCK_SIZE * msg->display_edid->edid_block_count;
msg->display_edid->edid_payload = g_malloc(payload_size);
- memcpy(msg->display_edid->edid_payload, v, payload_size);
- v += payload_size;
+ for (;i<(EDID_BLOCK_SIZE*msg->display_edid->edid_block_count*2); j++) {
+ int k=0,kk=0;
+ if(edid_string[i]>0x29 && edid_string[i]<0x40) k=edid_string[i]-48;
+ else if(edid_string[i]>0x60 && edid_string[i]<0x67) k=edid_string[i]-87;
+ else if(edid_string[i]>0x40 && edid_string[i]<0x47) k=edid_string[i]-55;
+
+ if(edid_string[i+1]>0x29 && edid_string[i+1]<0x40) kk=edid_string[i+1]-48;
+ else if(edid_string[i+1]>0x60 && edid_string[i+1]<0x67) kk=edid_string[i+1]-87;
+ else if(edid_string[i+1]>0x40 && edid_string[i+1]<0x47) kk=edid_string[i+1]-55;
+
+ msg->display_edid->edid_payload[j] = (k<<4)|kk;
+ i+=2;
+ }
+ //memcpy(msg->display_edid->edid_payload, v, payload_size);
+ v += (payload_size*2);
} else v += strlen(v);
}
}
wfdconfig_message_parse_buffer (const guint8 * data, guint size, WFDMessage * msg)
{
gchar *p;
- gchar buffer[MAX_LINE_LEN];
+ gchar buffer[MAX_LINE_LEN] = {0};
guint idx = 0;
g_return_val_if_fail (msg != NULL, WFD_EINVAL);
g_return_val_if_fail (data != NULL, WFD_EINVAL);
g_return_val_if_fail (size != 0, WFD_EINVAL);
- GST_LOG("wfdconfig_message_parse_buffer input: %s\n", data);
-
p = (gchar *) data;
while (TRUE) {
debug_log (" %d\n", msg->client_rtp_ports->rtp_port1);
debug_log (" %s\n", msg->client_rtp_ports->mode);
}
+ debug_log("\r\n");
}
if(msg->route) {
{
g_return_val_if_fail (msg != NULL, WFD_EINVAL);
if(msg->content_protection && msg->content_protection->hdcp2_spec) {
- char *result = NULL;
- gint value= 0;
+ char *result = NULL;
if(!g_strcmp0(msg->content_protection->hdcp2_spec->hdcpversion,"none")) {
- *hdcpversion = WFD_HDCP_NONE;
- *TCPPort = 0;
- return WFD_OK;
+ debug_warning("HDCP none");
+ *hdcpversion = WFD_HDCP_NONE;
+ *TCPPort = 0;
+ return WFD_OK;
}
if(!g_strcmp0(msg->content_protection->hdcp2_spec->hdcpversion,"HDCP2.0")) *hdcpversion = WFD_HDCP_2_0;
else if(!g_strcmp0(msg->content_protection->hdcp2_spec->hdcpversion,"HDCP2.1")) *hdcpversion = WFD_HDCP_2_1;
+ else {
+ debug_warning("Unknown protection type");
+ *hdcpversion = WFD_HDCP_NONE;
+ *TCPPort = 0;
+ return WFD_OK;
+ }
+
result = strtok(msg->content_protection->hdcp2_spec->TCPPort, "=");
while (result !=NULL) {
- result = strtok(NULL, "=");
- *TCPPort = atoi (result);
- break;
+ result = strtok(NULL, "=");
+ *TCPPort = atoi (result);
+ break;
}
} else *hdcpversion = WFD_HDCP_NONE;
return WFD_OK;