diff options
-rw-r--r-- | include/media/nbaio/NBAIO.h | 6 | ||||
-rw-r--r-- | media/libnbaio/NBAIO.cpp | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/media/nbaio/NBAIO.h b/include/media/nbaio/NBAIO.h index 9c9721a..468508c 100644 --- a/include/media/nbaio/NBAIO.h +++ b/include/media/nbaio/NBAIO.h @@ -76,6 +76,12 @@ typedef ssize_t (*writeVia_t)(void *user, void *buffer, size_t count); typedef ssize_t (*readVia_t)(void *user, const void *buffer, size_t count, int64_t readPTS); +// Check whether an NBAIO_Format is valid +bool Format_isValid(const NBAIO_Format& format); + +// Compare two NBAIO_Format values +bool Format_isEqual(const NBAIO_Format& format1, const NBAIO_Format& format2); + // Abstract class (interface) representing a data port. class NBAIO_Port : public RefBase { diff --git a/media/libnbaio/NBAIO.cpp b/media/libnbaio/NBAIO.cpp index 8a8155d..cc12671 100644 --- a/media/libnbaio/NBAIO.cpp +++ b/media/libnbaio/NBAIO.cpp @@ -235,4 +235,14 @@ ssize_t NBAIO_Port::negotiate(const NBAIO_Format offers[], size_t numOffers, return (ssize_t) NEGOTIATE; } +bool Format_isValid(const NBAIO_Format& format) +{ + return format != Format_Invalid; +} + +bool Format_isEqual(const NBAIO_Format& format1, const NBAIO_Format& format2) +{ + return format1 == format2; +} + } // namespace android |