Loading media/codec2/core/include/C2Config.h +6 −3 Original line number Diff line number Diff line Loading @@ -278,16 +278,19 @@ typedef C2GlobalParam<C2Setting, C2SimpleValueStruct<C2Config::api_level_t>, kPa C2ApiLevelSetting; constexpr char C2_PARAMKEY_API_LEVEL[] = "api.level"; enum C2Config::api_feature_t : uint64_t { C2ENUM(C2Config::api_feature_t, uint64_t, API_REFLECTION = (1U << 0), ///< ability to list supported parameters API_VALUES = (1U << 1), ///< ability to list supported values for each parameter API_CURRENT_VALUES = (1U << 2), ///< ability to list currently supported values for each parameter API_DEPENDENCY = (1U << 3), ///< have a defined parameter dependency API_SAME_INPUT_BUFFER = (1U << 16), ///< supporting multiple input buffers ///< backed by the same allocation API_STREAMS = (1ULL << 32), ///< supporting variable number of streams API_TUNNELING = (1ULL << 48), ///< tunneling API }; API_TUNNELING = (1ULL << 48) ///< tunneling API ) // read-only typedef C2GlobalParam<C2Setting, C2SimpleValueStruct<C2Config::api_feature_t>, kParamIndexApiFeatures> Loading media/codec2/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoEncTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -510,11 +510,11 @@ TEST_P(Codec2VideoEncEncodeTest, EncodeTest) { ASSERT_TRUE(false); } if (!mCsd && (mCompName != vp8 && mCompName != vp9)) { if (!mCsd && (mCompName != vp8 && mCompName != vp9 && mCompName != h263)) { ASSERT_TRUE(false) << "CSD Buffer not received"; } if (mCsd && (mCompName == vp8 || mCompName == vp9)) { if (mCsd && (mCompName == vp8 || mCompName == vp9 || mCompName == h263)) { ASSERT_TRUE(false) << "CSD Buffer not expected"; } Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -1686,6 +1686,9 @@ bool CCodecBufferChannel::handleWork( { Mutexed<Output>::Locked output(mOutput); if (!output->buffers) { return false; } output->buffers->pushToStash( buffer, notifyClient, Loading media/libstagefright/MPEG4Writer.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -2401,8 +2401,8 @@ void MPEG4Writer::onMessageReceived(const sp<AMessage> &msg) { int32_t err; CHECK(msg->findInt32("errno", &err)); // Stop tracks' threads and main writer thread. notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); stop(); notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); break; } // fallocate() failed, hence notify app about it and stop(). Loading @@ -2410,9 +2410,10 @@ void MPEG4Writer::onMessageReceived(const sp<AMessage> &msg) { ALOGE("kWhatFallocateError"); int32_t err; CHECK(msg->findInt32("errno", &err)); // Stop tracks' threads and main writer thread. stop(); //TODO: introduce a suitable MEDIA_RECORDER_ERROR_* instead MEDIA_RECORDER_ERROR_UNKNOWN? notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); stop(); break; } default: Loading media/libstagefright/MediaMuxer.cpp +4 −41 Original line number Diff line number Diff line Loading @@ -48,8 +48,7 @@ static bool isMp4Format(MediaMuxer::OutputFormat format) { MediaMuxer::MediaMuxer(int fd, OutputFormat format) : mFormat(format), mState(UNINITIALIZED), mError(OK) { mState(UNINITIALIZED) { if (isMp4Format(format)) { mWriter = new MPEG4Writer(fd); } else if (format == OUTPUT_FORMAT_WEBM) { Loading @@ -59,7 +58,6 @@ MediaMuxer::MediaMuxer(int fd, OutputFormat format) } if (mWriter != NULL) { mWriter->setMuxerListener(this); mFileMeta = new MetaData; if (format == OUTPUT_FORMAT_HEIF) { // Note that the key uses recorder file types. Loading Loading @@ -157,26 +155,16 @@ status_t MediaMuxer::start() { status_t MediaMuxer::stop() { Mutex::Autolock autoLock(mMuxerLock); if (mState == STARTED || mState == ERROR) { if (mState == STARTED) { mState = STOPPED; for (size_t i = 0; i < mTrackList.size(); i++) { if (mTrackList[i]->stop() != OK) { return INVALID_OPERATION; } } // Unlock this mutex to allow notify to be called during stop process. mMuxerLock.unlock(); status_t err = mWriter->stop(); mMuxerLock.lock(); if (err != OK || mError != OK) { ALOGE("stop err: %d, mError:%d", err, mError); } /* Prioritize mError over err as writer would have got stopped on any * internal error and notified muxer already. Clients might issue * stop again later, and mWriter->stop() would return success. */ if (mError != OK) { err = mError; if (err != OK) { ALOGE("stop() err: %d", err); } return err; } else { Loading Loading @@ -232,29 +220,4 @@ status_t MediaMuxer::writeSampleData(const sp<ABuffer> &buffer, size_t trackInde return currentTrack->pushBuffer(mediaBuffer); } void MediaMuxer::notify(int msg, int ext1, int ext2) { switch (msg) { case MEDIA_RECORDER_EVENT_ERROR: case MEDIA_RECORDER_TRACK_EVENT_ERROR: { Mutex::Autolock autoLock(mMuxerLock); mState = ERROR; mError = ext2; ALOGW("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2); break; } case MEDIA_RECORDER_EVENT_INFO: { if (ext1 == MEDIA_RECORDER_INFO_UNKNOWN) { Mutex::Autolock autoLock(mMuxerLock); mState = ERROR; mError = ext2; ALOGW("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2); } break; } default: // Ignore INFO and other notifications for now. break; } } } // namespace android Loading
media/codec2/core/include/C2Config.h +6 −3 Original line number Diff line number Diff line Loading @@ -278,16 +278,19 @@ typedef C2GlobalParam<C2Setting, C2SimpleValueStruct<C2Config::api_level_t>, kPa C2ApiLevelSetting; constexpr char C2_PARAMKEY_API_LEVEL[] = "api.level"; enum C2Config::api_feature_t : uint64_t { C2ENUM(C2Config::api_feature_t, uint64_t, API_REFLECTION = (1U << 0), ///< ability to list supported parameters API_VALUES = (1U << 1), ///< ability to list supported values for each parameter API_CURRENT_VALUES = (1U << 2), ///< ability to list currently supported values for each parameter API_DEPENDENCY = (1U << 3), ///< have a defined parameter dependency API_SAME_INPUT_BUFFER = (1U << 16), ///< supporting multiple input buffers ///< backed by the same allocation API_STREAMS = (1ULL << 32), ///< supporting variable number of streams API_TUNNELING = (1ULL << 48), ///< tunneling API }; API_TUNNELING = (1ULL << 48) ///< tunneling API ) // read-only typedef C2GlobalParam<C2Setting, C2SimpleValueStruct<C2Config::api_feature_t>, kParamIndexApiFeatures> Loading
media/codec2/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoEncTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -510,11 +510,11 @@ TEST_P(Codec2VideoEncEncodeTest, EncodeTest) { ASSERT_TRUE(false); } if (!mCsd && (mCompName != vp8 && mCompName != vp9)) { if (!mCsd && (mCompName != vp8 && mCompName != vp9 && mCompName != h263)) { ASSERT_TRUE(false) << "CSD Buffer not received"; } if (mCsd && (mCompName == vp8 || mCompName == vp9)) { if (mCsd && (mCompName == vp8 || mCompName == vp9 || mCompName == h263)) { ASSERT_TRUE(false) << "CSD Buffer not expected"; } Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -1686,6 +1686,9 @@ bool CCodecBufferChannel::handleWork( { Mutexed<Output>::Locked output(mOutput); if (!output->buffers) { return false; } output->buffers->pushToStash( buffer, notifyClient, Loading
media/libstagefright/MPEG4Writer.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -2401,8 +2401,8 @@ void MPEG4Writer::onMessageReceived(const sp<AMessage> &msg) { int32_t err; CHECK(msg->findInt32("errno", &err)); // Stop tracks' threads and main writer thread. notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); stop(); notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); break; } // fallocate() failed, hence notify app about it and stop(). Loading @@ -2410,9 +2410,10 @@ void MPEG4Writer::onMessageReceived(const sp<AMessage> &msg) { ALOGE("kWhatFallocateError"); int32_t err; CHECK(msg->findInt32("errno", &err)); // Stop tracks' threads and main writer thread. stop(); //TODO: introduce a suitable MEDIA_RECORDER_ERROR_* instead MEDIA_RECORDER_ERROR_UNKNOWN? notify(MEDIA_RECORDER_EVENT_ERROR, MEDIA_RECORDER_ERROR_UNKNOWN, err); stop(); break; } default: Loading
media/libstagefright/MediaMuxer.cpp +4 −41 Original line number Diff line number Diff line Loading @@ -48,8 +48,7 @@ static bool isMp4Format(MediaMuxer::OutputFormat format) { MediaMuxer::MediaMuxer(int fd, OutputFormat format) : mFormat(format), mState(UNINITIALIZED), mError(OK) { mState(UNINITIALIZED) { if (isMp4Format(format)) { mWriter = new MPEG4Writer(fd); } else if (format == OUTPUT_FORMAT_WEBM) { Loading @@ -59,7 +58,6 @@ MediaMuxer::MediaMuxer(int fd, OutputFormat format) } if (mWriter != NULL) { mWriter->setMuxerListener(this); mFileMeta = new MetaData; if (format == OUTPUT_FORMAT_HEIF) { // Note that the key uses recorder file types. Loading Loading @@ -157,26 +155,16 @@ status_t MediaMuxer::start() { status_t MediaMuxer::stop() { Mutex::Autolock autoLock(mMuxerLock); if (mState == STARTED || mState == ERROR) { if (mState == STARTED) { mState = STOPPED; for (size_t i = 0; i < mTrackList.size(); i++) { if (mTrackList[i]->stop() != OK) { return INVALID_OPERATION; } } // Unlock this mutex to allow notify to be called during stop process. mMuxerLock.unlock(); status_t err = mWriter->stop(); mMuxerLock.lock(); if (err != OK || mError != OK) { ALOGE("stop err: %d, mError:%d", err, mError); } /* Prioritize mError over err as writer would have got stopped on any * internal error and notified muxer already. Clients might issue * stop again later, and mWriter->stop() would return success. */ if (mError != OK) { err = mError; if (err != OK) { ALOGE("stop() err: %d", err); } return err; } else { Loading Loading @@ -232,29 +220,4 @@ status_t MediaMuxer::writeSampleData(const sp<ABuffer> &buffer, size_t trackInde return currentTrack->pushBuffer(mediaBuffer); } void MediaMuxer::notify(int msg, int ext1, int ext2) { switch (msg) { case MEDIA_RECORDER_EVENT_ERROR: case MEDIA_RECORDER_TRACK_EVENT_ERROR: { Mutex::Autolock autoLock(mMuxerLock); mState = ERROR; mError = ext2; ALOGW("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2); break; } case MEDIA_RECORDER_EVENT_INFO: { if (ext1 == MEDIA_RECORDER_INFO_UNKNOWN) { Mutex::Autolock autoLock(mMuxerLock); mState = ERROR; mError = ext2; ALOGW("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2); } break; } default: // Ignore INFO and other notifications for now. break; } } } // namespace android