//
//  psgetinfo.h
//  PI_iLiveBase
//
//  Created by sjdd on 10/8/16.
//  Copyright © 2016 PowerInfo. All rights reserved.
//

#ifndef psgetinfo_h
#define psgetinfo_h

#define SUBSTREAM_MAX       16
#define SUBSTREAM_URL_SIZE  1024

#define PS_MSC_SET_CHANNEL_VISIBLE  101

struct PI_progam_info
{
    DWORD   port;
    char    domain[128];
    char    group_id[128];
    char    stream_id[128];
};

struct PI_MSC_CMD
{
    char    cid[32];
    char    cver[32];
    char    token[32];
    char    info[2048];
    int     op;
};

struct PI_MSC_RESPONSE
{
    int     http_code;
    int     error_code;
};

int PI_get_ip(const char *url);

int PI_push_urlparse(const char *url, struct PI_progam_info *info);

int PI_push_msccontrol(struct PI_MSC_CMD *info, struct PI_MSC_RESPONSE *response, int timeout_ms);

int PI_urlparse(const char *url, struct PI_progam_info *info);

int PI_get_childstream_info(int ip, const char *url, int *childstream_num, char *childstream_url[SUBSTREAM_MAX]);

#endif /* psgetinfo_h */
