Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc1e0e80 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Add Format_isValid() and Format_isEqual() to NBAIO

This is in preparation for changing the typedef to a struct.

Change-Id: I8eb1c7d98fd12f997641e462359864fdb834abe6
parent 51d53cd9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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 {

+10 −0
Original line number Diff line number Diff line
@@ -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