20 #include <sigc++/bind.h>
26 #include "canvas/container.h"
50 , video_server_url(vsurl)
124 const int rowstride =
img->stride;
131 p = pixels + y * rowstride;
132 p[0] = 255; p[1] = 255; p[2] = 255; p[3] = 255;
139 const int rowstride =
img->stride;
148 p = pixels + y * rowstride + x * 4;
149 p[0] = b; p[1] = g; p[2] = r; p[3] = 255;
158 const int rowstride =
img->stride;
166 p = pixels + y * rowstride + x * 4;
167 p[0] = 192; p[1] = 192; p[2] = 192; p[3] = 255;
168 p = pixels + y * rowstride + (clip_width-x-1) * 4;
169 p[0] = 192; p[1] = 192; p[2] = 192; p[3] = 255;
179 const int rowstride =
img->stride;
184 if (
rightend > clip_width) {
return; }
188 p = pixels + y * rowstride +
rightend * 4;
189 p[0] = 192; p[1] = 192; p[2] = 192; p[3] = 255;
191 p = pixels + y * rowstride + x * 4;
192 p[0] = 0; p[1] = 0; p[2] = 0; p[3] = 0;
201 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
202 pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
203 snprintf(url,
sizeof(url),
"%s?frame=%li&w=%d&h=%d&file=%s&format=bgra",
213 if (status == 503) Glib::usleep(5000);
214 }
while (status == 503 && --timeout > 0);
216 if (status != 200 || !res) {
217 printf(
"no-video frame: video-server returned http-status: %d\n", status);
220 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
244 img->data = (uint8_t*) data;
280 printf(
"thread creation failed. %i\n",rv);
virtual ~VideoImageFrame()
std::string get_video_server_url()
ArdourCanvas::Image * image
char * a3_curl_http_get(const char *u, int *status)
void set_videoframe(framepos_t, int rightend=-1)
Representation of the interface of the Editor class.
virtual double sample_to_pixel(framepos_t frame) const =0
std::string get_video_filename()
a single video-frame to be displayed in the video timeline
pthread_mutex_t queue_lock
boost::shared_ptr< ArdourCanvas::Image::Data > img
pthread_mutex_t request_lock
void http_download_done(char *)
void http_get_again(framepos_t fn)
PBD::Signal0< void > ImgChanged
common functions used for video-file im/export
framepos_t want_video_frame_number
void http_get(framepos_t fn)
framepos_t video_frame_number
static void freedata_cb(uint8_t *d, void *)
void * http_get_thread(void *arg)
virtual bool canvas_videotl_bar_event(GdkEvent *event, ArdourCanvas::Item *)=0
framepos_t get_req_frame()
VideoImageFrame(PublicEditor &, ArdourCanvas::Container &, int, int, std::string, std::string)
void set_position(framepos_t)
framepos_t req_video_frame_number
void fill_frame(const uint8_t r, const uint8_t g, const uint8_t b)
int pthread_create(pthread_t *__restrict thread, __const pthread_attr_t *__restrict attr, void *(*start_routine)(void *), void *__restrict arg)
framepos_t sample_position
ArdourCanvas::Container * _parent