• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 14366745472

09 Apr 2025 08:51PM UTC coverage: 13.06% (+0.1%) from 12.935%
14366745472

push

github

paulmthompson
clang format and tidy for points header

0 of 2 new or added lines in 1 file covered. (0.0%)

26 existing lines in 4 files now uncovered.

210 of 1608 relevant lines covered (13.06%)

1.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.75
/src/WhiskerToolbox/DataManager/Media/Video_Data.cpp
1
#include "Media/Video_Data.hpp"
2

3
#include "ffmpeg_wrapper/videodecoder.h"
4

5
VideoData::VideoData()
1✔
6
    : _vd{std::make_unique<ffmpeg_wrapper::VideoDecoder>()} {}
1✔
7

8
VideoData::~VideoData() = default;
1✔
9

10
void VideoData::doLoadMedia(std::string const & name) {
1✔
11
    setFilename(name);
1✔
12
    _vd->createMedia(name);
1✔
13

14
    updateHeight(_vd->getHeight());
1✔
15
    updateWidth(_vd->getWidth());
1✔
16

17
    switch (getFormat()) {
1✔
18
        case DisplayFormat::Gray:
1✔
19
            _vd->setFormat(ffmpeg_wrapper::VideoDecoder::Gray8);
1✔
20
            break;
1✔
21
        case DisplayFormat::Color:
×
22
            _vd->setFormat(ffmpeg_wrapper::VideoDecoder::ARGB);
×
23
            break;
×
24
        default:
×
25
            _vd->setFormat(ffmpeg_wrapper::VideoDecoder::Gray8);
×
26
    }
27

28
    // Set format of video decoder to the format currently
29
    // selected in the MediaData
30
    //setFormat(QImage::Format_Grayscale8);
31

32
    setTotalFrameCount(_vd->getFrameCount());
1✔
33
}
1✔
34

35
void VideoData::doLoadFrame(int frame_id) {
×
36

37
    //In most circumstances, we want to decode forward from
38
    // the current frame without reseeking to a keyframe
39
    bool frame_by_frame = true;
×
40

41
    if ((frame_id == 0) ||
×
42
        (frame_id >= this->getTotalFrameCount() - 1) ||
×
43
        (frame_id <= _last_decoded_frame)) {
×
44
        frame_by_frame = false;
×
45
    }
46

47
    //We load the data associated with the frame
UNCOV
48
    this->setRawData(_vd->getFrame(frame_id, frame_by_frame));
×
UNCOV
49
    _last_decoded_frame = frame_id;
×
50
}
×
51

52
std::string VideoData::GetFrameID(int frame_id) {
×
UNCOV
53
    return std::to_string(frame_id);
×
54
}
55

UNCOV
56
int VideoData::FindNearestSnapFrame(int frame_id) const {
×
UNCOV
57
    return static_cast<int>(_vd->nearest_iframe(frame_id));
×
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc