projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix inconsistent session-check
[ardour.git]
/
gtk2_ardour
/
video_image_frame.cc
diff --git
a/gtk2_ardour/video_image_frame.cc
b/gtk2_ardour/video_image_frame.cc
index 861c763665b5faefe6f574cb73b6855453bafe3a..2473da0b4e1f603ada21e2bd96a4941295b4affa 100644
(file)
--- a/
gtk2_ardour/video_image_frame.cc
+++ b/
gtk2_ardour/video_image_frame.cc
@@
-20,17
+20,17
@@
#include <sigc++/bind.h>
#include "ardour/tempo.h"
#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/layout.h"
-#include "utils_videotl.h"
-
#include <gtkmm2ext/utils.h>
#include <pthread.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;
using namespace std;
using namespace ARDOUR;
@@
-43,7
+43,7
@@
static void freedata_cb (uint8_t *d, void* /*arg*/) {
free (d);
}
free (d);
}
-VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::
Layout
& 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)
: editor (ed)
, _parent(&parent)
, clip_width(w)
@@
-63,7
+63,7
@@
VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Layout& parent
image = new ArdourCanvas::Image (_parent, Cairo::FORMAT_ARGB32, clip_width, clip_height);
img = image->get_image();
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);
draw_line();
draw_x();
image->put_image(img);
@@
-80,7
+80,7
@@
VideoImageFrame::~VideoImageFrame ()
}
void
}
void
-VideoImageFrame::set_position (
fram
epos_t sample)
+VideoImageFrame::set_position (
sampl
epos_t sample)
{
double new_unit_position = editor.sample_to_pixel (sample);
image->move (ArdourCanvas::Duple (new_unit_position - unit_position, 0.0));
{
double new_unit_position = editor.sample_to_pixel (sample);
image->move (ArdourCanvas::Duple (new_unit_position - unit_position, 0.0));
@@
-100,7
+100,7
@@
VideoImageFrame::exposeimg () {
}
void
}
void
-VideoImageFrame::set_videoframe (
fram
epos_t videoframenumber, int re)
+VideoImageFrame::set_videoframe (
sampl
epos_t videoframenumber, int re)
{
if (video_frame_number == videoframenumber && rightend == re) return;
{
if (video_frame_number == videoframenumber && rightend == re) return;
@@
-108,7
+108,7
@@
VideoImageFrame::set_videoframe (framepos_t videoframenumber, int re)
rightend = re;
img = image->get_image();
rightend = re;
img = image->get_image();
- fill_frame(0, 0, 0);
+ fill_frame
(0, 0, 0);
draw_x();
draw_line();
cut_rightend();
draw_x();
draw_line();
cut_rightend();
@@
-116,7
+116,7
@@
VideoImageFrame::set_videoframe (framepos_t videoframenumber, int re)
exposeimg();
/* request video-frame from decoder in background thread */
exposeimg();
/* request video-frame from decoder in background thread */
- http_get(video_frame_number);
+ http_get
(video_frame_number);
}
void
}
void
@@
-195,7
+195,7
@@
VideoImageFrame::cut_rightend ()
}
}
}
}
-void *
+
static
void *
http_get_thread (void *arg) {
VideoImageFrame *vif = static_cast<VideoImageFrame *>(arg);
char url[2048];
http_get_thread (void *arg) {
VideoImageFrame *vif = static_cast<VideoImageFrame *>(arg);
char url[2048];
@@
-210,7
+210,7
@@
http_get_thread (void *arg) {
int timeout = 1000; // * 5ms -> 5sec
char *res = NULL;
do {
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 (status == 503) Glib::usleep(5000); // try-again
} while (status == 503 && --timeout > 0);
@@
-234,7
+234,7
@@
VideoImageFrame::http_download_done (char *data){
if (!data) {
/* Image request failed (HTTP error or timeout) */
img = image->get_image();
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();
draw_x();
cut_rightend();
draw_line();
@@
-261,7
+261,7
@@
VideoImageFrame::http_download_done (char *data){
void
void
-VideoImageFrame::http_get
(fram
epos_t fn) {
+VideoImageFrame::http_get
(sampl
epos_t fn) {
if (pthread_mutex_trylock(&request_lock)) {
pthread_mutex_lock(&queue_lock);
queued_request=true;
if (pthread_mutex_trylock(&request_lock)) {
pthread_mutex_lock(&queue_lock);
queued_request=true;
@@
-284,7
+284,7
@@
VideoImageFrame::http_get(framepos_t fn) {
}
void
}
void
-VideoImageFrame::http_get_again(
fram
epos_t /*fn*/) {
+VideoImageFrame::http_get_again(
sampl
epos_t /*fn*/) {
pthread_mutex_lock(&queue_lock);
queued_request=false;
req_video_frame_number=want_video_frame_number;
pthread_mutex_lock(&queue_lock);
queued_request=false;
req_video_frame_number=want_video_frame_number;