summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-30 15:59:26 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-30 15:59:26 +0100
commit8889cf7126810fb9b754643a45dcc94ad578125f (patch)
tree682b1d0db6b3c158b5329eedddd423d46ea51ddc /src/lib/image.cc
parent326bf1a5409b2520464ff5df17051d4377955495 (diff)
Update filter graph to new API.
Diffstat (limited to 'src/lib/image.cc')
-rw-r--r--src/lib/image.cc32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 1be41fecf..2d4bc0af0 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -609,9 +609,9 @@ SimpleImage::aligned () const
return _aligned;
}
-FilterBufferImage::FilterBufferImage (AVPixelFormat p, AVFilterBufferRef* b)
- : Image (p)
- , _buffer (b)
+FrameImage::FrameImage (AVFrame* frame)
+ : Image (static_cast<AVPixelFormat> (frame->format))
+ , _frame (frame)
{
_line_size = (int *) av_malloc (4 * sizeof (int));
_line_size[0] = _line_size[1] = _line_size[2] = _line_size[3] = 0;
@@ -621,44 +621,40 @@ FilterBufferImage::FilterBufferImage (AVPixelFormat p, AVFilterBufferRef* b)
}
}
-FilterBufferImage::~FilterBufferImage ()
+FrameImage::~FrameImage ()
{
- avfilter_unref_buffer (_buffer);
+ av_frame_free (&_frame);
av_free (_line_size);
}
uint8_t **
-FilterBufferImage::data () const
+FrameImage::data () const
{
- return _buffer->data;
+ return _frame->data;
}
int *
-FilterBufferImage::line_size () const
+FrameImage::line_size () const
{
return _line_size;
}
int *
-FilterBufferImage::stride () const
+FrameImage::stride () const
{
- /* I've seen images where the _buffer->linesize is larger than the width
- (by a small amount), suggesting that _buffer->linesize is what we call
- stride. But I'm not sure.
- */
- return _buffer->linesize;
+ /* AVFrame's `linesize' is what we call `stride' */
+ return _frame->linesize;
}
libdcp::Size
-FilterBufferImage::size () const
+FrameImage::size () const
{
- return libdcp::Size (_buffer->video->w, _buffer->video->h);
+ return libdcp::Size (_frame->width, _frame->height);
}
bool
-FilterBufferImage::aligned () const
+FrameImage::aligned () const
{
- /* XXX? */
return true;
}