-/** XXX: this could be generalised to use any format, but I don't
- * understand how avpicture_fill is supposed to be called with
- * multi-planar images.
- */
-RGBFrameImage::RGBFrameImage (Size s)
- : Image (PIX_FMT_RGB24)
- , _size (s)
-{
- _frame = avcodec_alloc_frame ();
- if (_frame == 0) {
- throw EncodeError ("could not allocate frame");
- }
-
- _data = (uint8_t *) av_malloc (size().width * size().height * 3);
- avpicture_fill ((AVPicture *) _frame, _data, PIX_FMT_RGB24, size().width, size().height);
- _frame->width = size().width;
- _frame->height = size().height;
- _frame->format = PIX_FMT_RGB24;
-}
-
-RGBFrameImage::~RGBFrameImage ()
-{
- av_free (_data);
- av_free (_frame);
-}
-
-uint8_t **
-RGBFrameImage::data () const
-{
- return _frame->data;
-}
-
-int *
-RGBFrameImage::line_size () const
-{
- return _frame->linesize;
-}
-
-int *
-RGBFrameImage::stride () const
-{
- /* XXX? */
- return line_size ();
-}
-
-Size
-RGBFrameImage::size () const
-{
- return _size;
-}