summaryrefslogtreecommitdiff
path: root/src/lib/dcp_video_frame.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-17 23:42:59 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-17 23:42:59 +0000
commitcadd50fe2609a1ad9963389d65d8e91f85226752 (patch)
treef32a9ab4d4336bc3622f2f0e882d9227c3f61cb5 /src/lib/dcp_video_frame.cc
parent039ac5848730d154e0b3f3dd841a55e45ba922d8 (diff)
Sort of works to a first-order approximation.
Diffstat (limited to 'src/lib/dcp_video_frame.cc')
-rw-r--r--src/lib/dcp_video_frame.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc
index 1c408270e..da864ad9f 100644
--- a/src/lib/dcp_video_frame.cc
+++ b/src/lib/dcp_video_frame.cc
@@ -380,6 +380,21 @@ EncodedData::EncodedData (int s)
}
+EncodedData::EncodedData (string file)
+{
+ _size = boost::filesystem::file_size (file);
+ _data = new uint8_t[_size];
+
+ FILE* f = fopen (file.c_str(), "rb");
+ if (!f) {
+ throw FileError ("could not open file for reading", file);
+ }
+
+ fread (_data, 1, _size, f);
+ fclose (f);
+}
+
+
EncodedData::~EncodedData ()
{
delete[] _data;