Merge "Fix supportsNonblockingRead"

gugelfrei
TreeHugger Robot 6 years ago committed by Android (Google) Code Review
commit fd1da15b1b

@ -113,6 +113,12 @@ struct MediaTrack
virtual status_t read(
MediaBufferBase **buffer, const ReadOptions *options = NULL) = 0;
// Returns true if |read| supports nonblocking option, otherwise false.
// |readMultiple| if supported, always allows the nonblocking option.
virtual bool supportNonblockingRead() {
return false;
}
virtual ~MediaTrack();
private:

@ -54,6 +54,10 @@ status_t RemoteMediaSource::read(
return mSource->read(buffer, reinterpret_cast<const MediaSource::ReadOptions*>(options));
}
bool RemoteMediaSource::supportNonblockingRead() {
return mSource->supportNonblockingRead();
}
status_t RemoteMediaSource::pause() {
return ERROR_UNSUPPORTED;
}

@ -37,6 +37,7 @@ public:
virtual status_t read(
MediaBufferBase **buffer,
const MediaSource::ReadOptions *options = NULL);
virtual bool supportNonblockingRead();
virtual status_t pause();
virtual status_t setStopTimeUs(int64_t stopTimeUs);

Loading…
Cancel
Save