Loading media/ndk/NdkMediaCodec.cpp +5 −3 Original line number Original line Diff line number Diff line Loading @@ -452,17 +452,19 @@ media_status_t AMediaCodec_configure( uint32_t flags) { uint32_t flags) { sp<AMessage> nativeFormat; sp<AMessage> nativeFormat; AMediaFormat_getFormat(format, &nativeFormat); AMediaFormat_getFormat(format, &nativeFormat); ALOGV("configure with format: %s", nativeFormat->debugString(0).c_str()); // create our shallow copy, so we aren't victim to any later changes. sp<AMessage> dupNativeFormat = nativeFormat->dup(); ALOGV("configure with format: %s", dupNativeFormat->debugString(0).c_str()); sp<Surface> surface = NULL; sp<Surface> surface = NULL; if (window != NULL) { if (window != NULL) { surface = (Surface*) window; surface = (Surface*) window; } } status_t err = mData->mCodec->configure(nativeFormat, surface, status_t err = mData->mCodec->configure(dupNativeFormat, surface, crypto ? crypto->mCrypto : NULL, flags); crypto ? crypto->mCrypto : NULL, flags); if (err != OK) { if (err != OK) { ALOGE("configure: err(%d), failed with format: %s", ALOGE("configure: err(%d), failed with format: %s", err, nativeFormat->debugString(0).c_str()); err, dupNativeFormat->debugString(0).c_str()); } } return translate_error(err); return translate_error(err); } } Loading Loading
media/ndk/NdkMediaCodec.cpp +5 −3 Original line number Original line Diff line number Diff line Loading @@ -452,17 +452,19 @@ media_status_t AMediaCodec_configure( uint32_t flags) { uint32_t flags) { sp<AMessage> nativeFormat; sp<AMessage> nativeFormat; AMediaFormat_getFormat(format, &nativeFormat); AMediaFormat_getFormat(format, &nativeFormat); ALOGV("configure with format: %s", nativeFormat->debugString(0).c_str()); // create our shallow copy, so we aren't victim to any later changes. sp<AMessage> dupNativeFormat = nativeFormat->dup(); ALOGV("configure with format: %s", dupNativeFormat->debugString(0).c_str()); sp<Surface> surface = NULL; sp<Surface> surface = NULL; if (window != NULL) { if (window != NULL) { surface = (Surface*) window; surface = (Surface*) window; } } status_t err = mData->mCodec->configure(nativeFormat, surface, status_t err = mData->mCodec->configure(dupNativeFormat, surface, crypto ? crypto->mCrypto : NULL, flags); crypto ? crypto->mCrypto : NULL, flags); if (err != OK) { if (err != OK) { ALOGE("configure: err(%d), failed with format: %s", ALOGE("configure: err(%d), failed with format: %s", err, nativeFormat->debugString(0).c_str()); err, dupNativeFormat->debugString(0).c_str()); } } return translate_error(err); return translate_error(err); } } Loading