projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace dcp::Data with dcp::ArrayData
[dcpomatic.git]
/
src
/
lib
/
ffmpeg_image_proxy.cc
diff --git
a/src/lib/ffmpeg_image_proxy.cc
b/src/lib/ffmpeg_image_proxy.cc
index b54e29d4492c4e3ee1933777f72e5b9e1f932a48..602185bb8b4ade76013935cd6a096a08c957d995 100644
(file)
--- a/
src/lib/ffmpeg_image_proxy.cc
+++ b/
src/lib/ffmpeg_image_proxy.cc
@@
-56,7
+56,7
@@
FFmpegImageProxy::FFmpegImageProxy (boost::filesystem::path path)
}
}
-FFmpegImageProxy::FFmpegImageProxy (dcp::Data data)
+FFmpegImageProxy::FFmpegImageProxy (dcp::
Array
Data data)
: _data (data)
, _pos (0)
{
: _data (data)
, _pos (0)
{
@@
-67,8
+67,8
@@
FFmpegImageProxy::FFmpegImageProxy (shared_ptr<cxml::Node>, shared_ptr<Socket> s
: _pos (0)
{
uint32_t const size = socket->read_uint32 ();
: _pos (0)
{
uint32_t const size = socket->read_uint32 ();
- _data = dcp::Data (size);
- socket->read (_data.data()
.get()
, size);
+ _data = dcp::
Array
Data (size);
+ socket->read (_data.data(), size);
}
static int
}
static int
@@
-86,11
+86,11
@@
avio_seek_wrapper (void* data, int64_t offset, int whence)
int
FFmpegImageProxy::avio_read (uint8_t* buffer, int const amount)
{
int
FFmpegImageProxy::avio_read (uint8_t* buffer, int const amount)
{
- int const to_do = min(
int64_t(amount), _data.size(
) - _pos);
+ int const to_do = min(
static_cast<int64_t>(amount), static_cast<int64_t>(_data.size()
) - _pos);
if (to_do == 0) {
return AVERROR_EOF;
}
if (to_do == 0) {
return AVERROR_EOF;
}
- memcpy (buffer, _data.data()
.get()
+ _pos, to_do);
+ memcpy (buffer, _data.data() + _pos, to_do);
_pos += to_do;
return to_do;
}
_pos += to_do;
return to_do;
}
@@
-115,6
+115,7
@@
FFmpegImageProxy::avio_seek (int64_t const pos, int whence)
return _pos;
}
return _pos;
}
+DCPOMATIC_DISABLE_WARNINGS
ImageProxy::Result
FFmpegImageProxy::image (optional<dcp::Size>) const
ImageProxy::Result
FFmpegImageProxy::image (optional<dcp::Size>) const
@@
-199,6
+200,8
@@
FFmpegImageProxy::image (optional<dcp::Size>) const
return Result (_image, 0);
}
return Result (_image, 0);
}
+DCPOMATIC_ENABLE_WARNINGS
+
void
FFmpegImageProxy::add_metadata (xmlpp::Node* node) const
{
void
FFmpegImageProxy::add_metadata (xmlpp::Node* node) const
{
@@
-209,7
+212,7
@@
void
FFmpegImageProxy::write_to_socket (shared_ptr<Socket> socket) const
{
socket->write (_data.size());
FFmpegImageProxy::write_to_socket (shared_ptr<Socket> socket) const
{
socket->write (_data.size());
- socket->write (_data.data()
.get()
, _data.size());
+ socket->write (_data.data(), _data.size());
}
bool
}
bool
@@
-220,11
+223,7
@@
FFmpegImageProxy::same (shared_ptr<const ImageProxy> other) const
return false;
}
return false;
}
- if (_data.size() != mp->_data.size()) {
- return false;
- }
-
- return memcmp (_data.data().get(), mp->_data.data().get(), _data.size()) == 0;
+ return _data == mp->_data;
}
size_t
}
size_t