#include <sigc++/bind.h>
#include "ardour/tempo.h"
-#include "ardour_ui.h"
-#include "video_image_frame.h"
-#include "public_editor.h"
-#include "utils.h"
-#include "canvas/container.h"
-#include "utils_videotl.h"
-
#include <gtkmm2ext/utils.h>
#include <pthread.h>
-#include "i18n.h"
+#include "canvas/container.h"
+
+#include "ardour_http.h"
+#include "public_editor.h"
+#include "utils_videotl.h"
+#include "video_image_frame.h"
+
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
image = new ArdourCanvas::Image (_parent, Cairo::FORMAT_ARGB32, clip_width, clip_height);
img = image->get_image();
- fill_frame(0, 0, 0);
+ fill_frame (0, 0, 0);
draw_line();
draw_x();
image->put_image(img);
}
void
-VideoImageFrame::set_position (framepos_t sample)
+VideoImageFrame::set_position (samplepos_t sample)
{
double new_unit_position = editor.sample_to_pixel (sample);
image->move (ArdourCanvas::Duple (new_unit_position - unit_position, 0.0));
}
void
-VideoImageFrame::set_videoframe (framepos_t videoframenumber, int re)
+VideoImageFrame::set_videoframe (samplepos_t videoframenumber, int re)
{
if (video_frame_number == videoframenumber && rightend == re) return;
rightend = re;
img = image->get_image();
- fill_frame(0, 0, 0);
+ fill_frame (0, 0, 0);
draw_x();
draw_line();
cut_rightend();
exposeimg();
/* request video-frame from decoder in background thread */
- http_get(video_frame_number);
+ http_get (video_frame_number);
}
void
}
}
-void *
+static void *
http_get_thread (void *arg) {
VideoImageFrame *vif = static_cast<VideoImageFrame *>(arg);
char url[2048];
int timeout = 1000; // * 5ms -> 5sec
char *res = NULL;
do {
- res=a3_curl_http_get(url, &status);
+ res = ArdourCurl::http_get (url, &status, false);
if (status == 503) Glib::usleep(5000); // try-again
} while (status == 503 && --timeout > 0);
if (!data) {
/* Image request failed (HTTP error or timeout) */
img = image->get_image();
- fill_frame(128, 0, 0);
+ fill_frame (128, 0, 0);
draw_x();
cut_rightend();
draw_line();
void
-VideoImageFrame::http_get(framepos_t fn) {
+VideoImageFrame::http_get (samplepos_t fn) {
if (pthread_mutex_trylock(&request_lock)) {
pthread_mutex_lock(&queue_lock);
queued_request=true;
}
void
-VideoImageFrame::http_get_again(framepos_t /*fn*/) {
+VideoImageFrame::http_get_again(samplepos_t /*fn*/) {
pthread_mutex_lock(&queue_lock);
queued_request=false;
req_video_frame_number=want_video_frame_number;