using dcp::raw_convert;
-RawImageProxy::RawImageProxy (shared_ptr<Image> image)
+RawImageProxy::RawImageProxy(shared_ptr<const Image> image)
: _image (image)
{
xml->number_child<int>("Width"), xml->number_child<int>("Height")
);
- _image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, Image::Alignment::PADDED);
- _image->read_from_socket (socket);
+ auto image = make_shared<Image>(static_cast<AVPixelFormat>(xml->number_child<int>("PixelFormat")), size, Image::Alignment::PADDED);
+ image->read_from_socket (socket);
+ _image = image;
}
class RawImageProxy : public ImageProxy
{
public:
- explicit RawImageProxy (std::shared_ptr<Image>);
+ explicit RawImageProxy(std::shared_ptr<const Image>);
RawImageProxy (std::shared_ptr<cxml::Node> xml, std::shared_ptr<Socket> socket);
Result image (
size_t memory_used () const override;
private:
- std::shared_ptr<Image> _image;
+ std::shared_ptr<const Image> _image;
};
/** Take an AVFrame and process it using our configured filters, returning a
* set of Images. Caller handles memory management of the input frame.
*/
-list<pair<shared_ptr<Image>, int64_t>>
+list<pair<shared_ptr<const Image>, int64_t>>
VideoFilterGraph::process (AVFrame* frame)
{
- list<pair<shared_ptr<Image>, int64_t>> images;
+ list<pair<shared_ptr<const Image>, int64_t>> images;
if (_copy) {
images.push_back (make_pair(make_shared<Image>(frame, Image::Alignment::PADDED), frame->best_effort_timestamp));
VideoFilterGraph (dcp::Size s, AVPixelFormat p, dcp::Fraction r);
bool can_process (dcp::Size s, AVPixelFormat p) const;
- std::list<std::pair<std::shared_ptr<Image>, int64_t>> process (AVFrame * frame);
+ std::list<std::pair<std::shared_ptr<const Image>, int64_t>> process (AVFrame * frame);
protected:
std::string src_parameters () const override;