From 1cce8abd8572be3d175d22bbb6836fc584cbb28a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 20 Feb 2020 16:37:43 +1100 Subject: [PATCH] frame: added bool function returning whether the frame is allocated or not --- app/codec/frame.cpp | 5 +++++ app/codec/frame.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/codec/frame.cpp b/app/codec/frame.cpp index c855d5f4e..ad1b3f7f0 100644 --- a/app/codec/frame.cpp +++ b/app/codec/frame.cpp @@ -145,6 +145,11 @@ void Frame::allocate() } } +bool Frame::is_allocated() const +{ + return !data_.isEmpty(); +} + void Frame::destroy() { data_.clear(); diff --git a/app/codec/frame.h b/app/codec/frame.h index 8e3e79085..135dd8f27 100644 --- a/app/codec/frame.h +++ b/app/codec/frame.h @@ -109,6 +109,11 @@ public: */ void allocate(); + /** + * @brief Return whether the frame is allocated or not + */ + bool is_allocated() const; + /** * @brief Destroy a memory buffer allocated with allocate() */