-
Notifications
You must be signed in to change notification settings - Fork 103
/
videofilebuffer_exceptions.cc
56 lines (42 loc) · 1.05 KB
/
videofilebuffer_exceptions.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <cvd/videofilebuffer.h>
#include <sstream>
using namespace std;
namespace CVD
{
using namespace Exceptions::VideoFileBuffer;
//
// EXCEPTIONS
//
Exceptions::VideoFileBuffer::FileOpen::FileOpen(const std::string& name, const string& error)
{
what = "RawVideoFileBuffer: Error opening file \"" + name + "\": " + error;
}
Exceptions::VideoFileBuffer::BadFrameAlloc::BadFrameAlloc()
{
what = "RawVideoFileBuffer: Unable to allocate video frame.";
}
Exceptions::VideoFileBuffer::BadDecode::BadDecode(double t, const string& s)
{
ostringstream os;
os << "RawVideoFileBuffer: Error decoding video frame at time " << t;
if(s == "")
os << ".";
else
os << ": " << s;
what = os.str();
}
Exceptions::VideoFileBuffer::EndOfFile::EndOfFile()
{
what = "RawVideoFileBuffer: Tried to read off the end of the file.";
}
Exceptions::VideoFileBuffer::BadSeek::BadSeek(double t, const string& s)
{
ostringstream os;
os << "RawVideoFileBuffer: Seek to time " << t << "s failed";
if(s == "")
os << ".";
else
os << ": " << s;
what = os.str();
}
}