X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Fvideo_image_frame.cc;h=8399d0b802a491cae86206246ee34eb24a4532e4;hb=eeb20bc392c1aae0545010c6fcf2c7096bb9c650;hp=dffab96ab5fc7470a184b5bdfca6278a42e3c75d;hpb=5d6c986748d77ca9f0cda698113dd19a10ba8fd0;p=ardour.git diff --git a/gtk2_ardour/video_image_frame.cc b/gtk2_ardour/video_image_frame.cc index dffab96ab5..8399d0b802 100644 --- a/gtk2_ardour/video_image_frame.cc +++ b/gtk2_ardour/video_image_frame.cc @@ -20,11 +20,9 @@ #include #include "ardour/tempo.h" -#include "ardour_ui.h" #include "video_image_frame.h" #include "public_editor.h" -#include "utils.h" -#include "canvas/group.h" +#include "canvas/container.h" #include "utils_videotl.h" #include @@ -34,6 +32,7 @@ using namespace std; using namespace ARDOUR; +using namespace VideoUtils; static void freedata_cb (uint8_t *d, void* /*arg*/) { /* later this can be used with libharvid @@ -42,7 +41,7 @@ static void freedata_cb (uint8_t *d, void* /*arg*/) { free (d); } -VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Group& parent, int w, int h, std::string vsurl, std::string vfn) +VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Container& parent, int w, int h, std::string vsurl, std::string vfn) : editor (ed) , _parent(&parent) , clip_width(w) @@ -194,13 +193,13 @@ VideoImageFrame::cut_rightend () } } -void * +static void * http_get_thread (void *arg) { VideoImageFrame *vif = static_cast(arg); char url[2048]; pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - snprintf(url, sizeof(url), "%s?frame=%li&w=%d&h=%di&file=%s&format=bgra", + snprintf(url, sizeof(url), "%s?frame=%li&w=%d&h=%d&file=%s&format=bgra", vif->get_video_server_url().c_str(), (long int) vif->get_req_frame(), vif->get_width(), vif->get_height(), vif->get_video_filename().c_str() @@ -209,8 +208,8 @@ http_get_thread (void *arg) { int timeout = 1000; // * 5ms -> 5sec char *res = NULL; do { - res=curl_http_get(url, &status); - if (status == 503) usleep(5000); // try-again + res=a3_curl_http_get(url, &status); + if (status == 503) Glib::usleep(5000); // try-again } while (status == 503 && --timeout > 0); if (status != 200 || !res) { @@ -249,8 +248,8 @@ VideoImageFrame::http_download_done (char *data){ } exposeimg(); - /* don't request frames rapidly, wait after user has zoomed */ - usleep(20000); + /* don't request frames too quickly, wait after user has zoomed */ + Glib::usleep(40000); if (queued_request) { http_get_again(want_video_frame_number);