~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/space_clip/clip_editor.c

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:50:05 UTC
  • mfrom: (14.2.27 sid)
  • Revision ID: siretart@tauware.de-20140531015005-ml6druahuj82nsav
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
504
504
bool ED_space_clip_check_show_trackedit(SpaceClip *sc)
505
505
{
506
506
        if (sc) {
507
 
                return ELEM3(sc->mode, SC_MODE_TRACKING, SC_MODE_RECONSTRUCTION, SC_MODE_DISTORTION);
 
507
                return sc->mode == SC_MODE_TRACKING;
508
508
        }
509
509
 
510
510
        return false;
603
603
        int initial_frame, current_frame, start_frame, end_frame;
604
604
        short render_size, render_flag;
605
605
 
606
 
        short direction;
 
606
        /* If true prefecthing goes forward in time,
 
607
         * othwewise it goes backwards in time (starting from current frame).
 
608
         */
 
609
        bool forward;
607
610
 
608
611
        SpinLock spin;
609
612
 
639
642
 
640
643
        BKE_movieclip_filename_for_frame(clip, &user, name);
641
644
 
642
 
        file = open(name, O_BINARY | O_RDONLY, 0);
 
645
        file = BLI_open(name, O_BINARY | O_RDONLY, 0);
643
646
        if (file < 0) {
644
647
                return NULL;
645
648
        }
707
710
        {
708
711
                int current_frame;
709
712
 
710
 
                if (queue->direction > 0) {
 
713
                if (queue->forward) {
711
714
                        current_frame = prefetch_find_uncached_frame(clip, queue->current_frame + 1, queue->end_frame,
712
715
                                                                     queue->render_size, queue->render_flag, 1);
713
716
                        /* switch direction if read frames from current up to scene end frames */
714
717
                        if (current_frame > queue->end_frame) {
715
718
                                queue->current_frame = queue->initial_frame;
716
 
                                queue->direction = -1;
 
719
                                queue->forward = false;
717
720
                        }
718
721
                }
719
722
 
720
 
                if (queue->direction < 0) {
 
723
                if (!queue->forward) {
721
724
                        current_frame = prefetch_find_uncached_frame(clip, queue->current_frame - 1, queue->start_frame,
722
725
                                                                     queue->render_size, queue->render_flag, -1);
723
726
                }
732
735
 
733
736
                        queue->current_frame = current_frame;
734
737
 
735
 
                        if (queue->direction > 0) {
 
738
                        if (queue->forward) {
736
739
                                frames_processed = queue->current_frame - queue->initial_frame;
737
740
                        }
738
741
                        else {
752
755
static void *do_prefetch_thread(void *data_v)
753
756
{
754
757
        PrefetchThread *data = (PrefetchThread *) data_v;
 
758
        MovieClip *clip = data->clip;
755
759
        unsigned char *mem;
756
760
        size_t size;
757
761
        int current_frame;
761
765
                MovieClipUser user = {0};
762
766
                int flag = IB_rect | IB_alphamode_detect;
763
767
                int result;
 
768
                char *colorspace_name = NULL;
764
769
 
765
770
                user.framenr = current_frame;
766
771
                user.render_size = data->queue->render_size;
767
772
                user.render_flag = data->queue->render_flag;
768
773
 
769
 
                ibuf = IMB_ibImageFromMemory(mem, size, flag, NULL, "prefetch frame");
 
774
                /* Proxies are stored in the display space. */
 
775
                if (data->queue->render_flag & MCLIP_USE_PROXY) {
 
776
                        colorspace_name = clip->colorspace_settings.name;
 
777
                }
 
778
 
 
779
                ibuf = IMB_ibImageFromMemory(mem, size, flag, colorspace_name, "prefetch frame");
770
780
 
771
781
                result = BKE_movieclip_put_frame_if_possible(data->clip, &user, ibuf);
772
782
 
807
817
        queue.end_frame = end_frame;
808
818
        queue.render_size = render_size;
809
819
        queue.render_flag = render_flag;
810
 
        queue.direction = 1;
 
820
        queue.forward = 1;
811
821
 
812
822
        queue.stop = stop;
813
823
        queue.do_update = do_update;
964
974
        int first_uncached_frame, end_frame;
965
975
        int clip_len;
966
976
 
 
977
        if (clip == NULL) {
 
978
                return true;
 
979
        }
 
980
 
967
981
        clip_len = BKE_movieclip_get_duration(clip);
968
982
 
969
983
        /* check whether all the frames from prefetch range are cached */