void hls_server_test(const char* ip, int port) { aio_socket_init(1); http_server_init(); void* http = http_server_create(ip, port); http_server_set_handler(http, hls_server_onhttp, http); // http process while(aio_socket_process(1000) >= 0) { } http_server_destroy(http); http_server_cleanup(); aio_socket_clean(); }
void dash_dynamic_test(const char* ip, int port, const char* file, int width, int height) { std::shared_ptr<dash_playlist_t> live(new dash_playlist_t()); live->mpd = dash_mpd_create(DASH_DYNAMIC, dash_mpd_onsegment, live.get()); live->name = "live"; live->width = width; live->height = height; live->adapation_audio = live->adapation_video = -1; aio_worker_init(4); http_server_t* http = http_server_create(ip, port); http_server_set_handler(http, http_server_route, live.get()); http_server_addroute("/live/", dash_server_onlive); http_server_addroute("/vod/", dash_server_onvod); // live worker dash_live_worker(file, live.get()); http_server_destroy(http); aio_worker_clean(4); dash_mpd_destroy(live->mpd); }