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

Commit 19f420ea authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Add Format_isValid() and Format_isEqual() to NBAIO"

parents f74f213c cc1e0e80
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