Loading media/libaudiohal/impl/StreamHalHidl.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ StreamHalHidl::StreamHalHidl(IStream *stream) } } StreamHalHidl::~StreamHalHidl() { // The last step is to flush all binder commands so that the deletion // of IStreamIn / IStreamOut (mStream) is issued with less delay. See b/35394629. hardware::IPCThreadState::self()->flushCommands(); } status_t StreamHalHidl::getSampleRate(uint32_t *rate) { if (!mStream) return NO_INIT; return processReturn("getSampleRate", mStream->getSampleRate(), rate); Loading media/libaudiohal/impl/StreamHalHidl.h +2 −14 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ class StreamHalHidl : public virtual StreamHalInterface, public ConversionHelper // Subclasses can not be constructed directly by clients. explicit StreamHalHidl(IStream *stream); ~StreamHalHidl() override; status_t getCachedBufferSize(size_t *size); bool requestHalThreadPriority(pid_t threadPid, pid_t threadId); Loading Loading @@ -182,13 +184,6 @@ class StreamOutHalHidl : public StreamOutHalInterface, public StreamHalHidl { typedef MessageQueue<uint8_t, hardware::kSynchronizedReadWrite> DataMQ; typedef MessageQueue<WriteStatus, hardware::kSynchronizedReadWrite> StatusMQ; // Do not move the Defer. This should be the first member variable in the class; // thus the last member destructor called upon instance destruction. // // The last step is to flush all binder commands so that the AudioFlinger // may recognize the deletion of IStreamOut (mStream) with less delay. See b/35394629. mediautils::Defer mLast{[]() { hardware::IPCThreadState::self()->flushCommands(); }}; mediautils::atomic_wp<StreamOutHalInterfaceCallback> mCallback; mediautils::atomic_wp<StreamOutHalInterfaceEventCallback> mEventCallback; const sp<IStreamOut> mStream; Loading Loading @@ -247,13 +242,6 @@ class StreamInHalHidl : public StreamInHalInterface, public StreamHalHidl { typedef MessageQueue<uint8_t, hardware::kSynchronizedReadWrite> DataMQ; typedef MessageQueue<ReadStatus, hardware::kSynchronizedReadWrite> StatusMQ; // Do not move the Defer. This should be the first member variable in the class; // thus the last member destructor called upon instance destruction. // // The last step is to flush all binder commands so that the AudioFlinger // may recognize the deletion of IStreamIn (mStream) with less delay. See b/35394629. mediautils::Defer mLast{[]() { hardware::IPCThreadState::self()->flushCommands(); }}; const sp<IStreamIn> mStream; std::unique_ptr<CommandMQ> mCommandMQ; std::unique_ptr<DataMQ> mDataMQ; Loading Loading
media/libaudiohal/impl/StreamHalHidl.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ StreamHalHidl::StreamHalHidl(IStream *stream) } } StreamHalHidl::~StreamHalHidl() { // The last step is to flush all binder commands so that the deletion // of IStreamIn / IStreamOut (mStream) is issued with less delay. See b/35394629. hardware::IPCThreadState::self()->flushCommands(); } status_t StreamHalHidl::getSampleRate(uint32_t *rate) { if (!mStream) return NO_INIT; return processReturn("getSampleRate", mStream->getSampleRate(), rate); Loading
media/libaudiohal/impl/StreamHalHidl.h +2 −14 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ class StreamHalHidl : public virtual StreamHalInterface, public ConversionHelper // Subclasses can not be constructed directly by clients. explicit StreamHalHidl(IStream *stream); ~StreamHalHidl() override; status_t getCachedBufferSize(size_t *size); bool requestHalThreadPriority(pid_t threadPid, pid_t threadId); Loading Loading @@ -182,13 +184,6 @@ class StreamOutHalHidl : public StreamOutHalInterface, public StreamHalHidl { typedef MessageQueue<uint8_t, hardware::kSynchronizedReadWrite> DataMQ; typedef MessageQueue<WriteStatus, hardware::kSynchronizedReadWrite> StatusMQ; // Do not move the Defer. This should be the first member variable in the class; // thus the last member destructor called upon instance destruction. // // The last step is to flush all binder commands so that the AudioFlinger // may recognize the deletion of IStreamOut (mStream) with less delay. See b/35394629. mediautils::Defer mLast{[]() { hardware::IPCThreadState::self()->flushCommands(); }}; mediautils::atomic_wp<StreamOutHalInterfaceCallback> mCallback; mediautils::atomic_wp<StreamOutHalInterfaceEventCallback> mEventCallback; const sp<IStreamOut> mStream; Loading Loading @@ -247,13 +242,6 @@ class StreamInHalHidl : public StreamInHalInterface, public StreamHalHidl { typedef MessageQueue<uint8_t, hardware::kSynchronizedReadWrite> DataMQ; typedef MessageQueue<ReadStatus, hardware::kSynchronizedReadWrite> StatusMQ; // Do not move the Defer. This should be the first member variable in the class; // thus the last member destructor called upon instance destruction. // // The last step is to flush all binder commands so that the AudioFlinger // may recognize the deletion of IStreamIn (mStream) with less delay. See b/35394629. mediautils::Defer mLast{[]() { hardware::IPCThreadState::self()->flushCommands(); }}; const sp<IStreamIn> mStream; std::unique_ptr<CommandMQ> mCommandMQ; std::unique_ptr<DataMQ> mDataMQ; Loading