- decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe, long width,
- long height, void *buffer) :
- _ctx(ctx), _avframe(avframe), _width(width),
- _height(height), _buffer(buffer), _refs(0) { }
-
- virtual long STDMETHODCALLTYPE GetWidth (void) { return _width; }
- virtual long STDMETHODCALLTYPE GetHeight (void) { return _height; }
- virtual long STDMETHODCALLTYPE GetRowBytes (void) { return _width<<1; }
+ decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe) :
+ _ctx(ctx), _avframe(avframe), _refs(1) { }
+
+ virtual long STDMETHODCALLTYPE GetWidth (void) { return _avframe->width; }
+ virtual long STDMETHODCALLTYPE GetHeight (void) { return _avframe->height; }
+ virtual long STDMETHODCALLTYPE GetRowBytes (void) { return _avframe->linesize[0] < 0 ? -_avframe->linesize[0] : _avframe->linesize[0]; }