Loading include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ private: int32_t mEncoderDelay; int32_t mEncoderPadding; int32_t mRotationDegrees; bool mChannelMaskPresent; int32_t mChannelMask; Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +17 −2 Original line number Diff line number Diff line Loading @@ -860,8 +860,23 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { displayWidth, displayHeight); } int32_t rotationDegrees; if (!videoInputFormat->findInt32( "rotation-degrees", &rotationDegrees)) { rotationDegrees = 0; } if (rotationDegrees == 90 || rotationDegrees == 270) { notifyListener( MEDIA_SET_VIDEO_SIZE, displayWidth, displayHeight); MEDIA_SET_VIDEO_SIZE, displayHeight, displayWidth); } else { notifyListener( MEDIA_SET_VIDEO_SIZE, displayWidth, displayHeight); } } } else if (what == Decoder::kWhatShutdownCompleted) { ALOGV("%s shutdown completed", audio ? "audio" : "video"); Loading media/libstagefright/ACodec.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ ACodec::ACodec() mExplicitShutdown(false), mEncoderDelay(0), mEncoderPadding(0), mRotationDegrees(0), mChannelMaskPresent(false), mChannelMask(0), mDequeueCounter(0), Loading Loading @@ -591,6 +592,27 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( return err; } if (mRotationDegrees != 0) { uint32_t transform = 0; switch (mRotationDegrees) { case 0: transform = 0; break; case 90: transform = HAL_TRANSFORM_ROT_90; break; case 180: transform = HAL_TRANSFORM_ROT_180; break; case 270: transform = HAL_TRANSFORM_ROT_270; break; default: transform = 0; break; } if (transform > 0) { err = native_window_set_buffers_transform( mNativeWindow.get(), transform); if (err != 0) { ALOGE("native_window_set_buffers_transform failed: %s (%d)", strerror(-err), -err); return err; } } } // Set up the native window. OMX_U32 usage = 0; err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage); Loading Loading @@ -1232,6 +1254,13 @@ status_t ACodec::configureCodec( && push != 0) { mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } int32_t rotationDegrees; if (msg->findInt32("rotation-degrees", &rotationDegrees)) { mRotationDegrees = rotationDegrees; } else { mRotationDegrees = 0; } } if (video) { Loading media/libstagefright/Utils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,11 @@ status_t convertMetaDataToMessage( msg->setInt32("max-input-size", maxInputSize); } int32_t rotationDegrees; if (meta->findInt32(kKeyRotation, &rotationDegrees)) { msg->setInt32("rotation-degrees", rotationDegrees); } uint32_t type; const void *data; size_t size; Loading Loading
include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ private: int32_t mEncoderDelay; int32_t mEncoderPadding; int32_t mRotationDegrees; bool mChannelMaskPresent; int32_t mChannelMask; Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +17 −2 Original line number Diff line number Diff line Loading @@ -860,8 +860,23 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { displayWidth, displayHeight); } int32_t rotationDegrees; if (!videoInputFormat->findInt32( "rotation-degrees", &rotationDegrees)) { rotationDegrees = 0; } if (rotationDegrees == 90 || rotationDegrees == 270) { notifyListener( MEDIA_SET_VIDEO_SIZE, displayWidth, displayHeight); MEDIA_SET_VIDEO_SIZE, displayHeight, displayWidth); } else { notifyListener( MEDIA_SET_VIDEO_SIZE, displayWidth, displayHeight); } } } else if (what == Decoder::kWhatShutdownCompleted) { ALOGV("%s shutdown completed", audio ? "audio" : "video"); Loading
media/libstagefright/ACodec.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ ACodec::ACodec() mExplicitShutdown(false), mEncoderDelay(0), mEncoderPadding(0), mRotationDegrees(0), mChannelMaskPresent(false), mChannelMask(0), mDequeueCounter(0), Loading Loading @@ -591,6 +592,27 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( return err; } if (mRotationDegrees != 0) { uint32_t transform = 0; switch (mRotationDegrees) { case 0: transform = 0; break; case 90: transform = HAL_TRANSFORM_ROT_90; break; case 180: transform = HAL_TRANSFORM_ROT_180; break; case 270: transform = HAL_TRANSFORM_ROT_270; break; default: transform = 0; break; } if (transform > 0) { err = native_window_set_buffers_transform( mNativeWindow.get(), transform); if (err != 0) { ALOGE("native_window_set_buffers_transform failed: %s (%d)", strerror(-err), -err); return err; } } } // Set up the native window. OMX_U32 usage = 0; err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage); Loading Loading @@ -1232,6 +1254,13 @@ status_t ACodec::configureCodec( && push != 0) { mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } int32_t rotationDegrees; if (msg->findInt32("rotation-degrees", &rotationDegrees)) { mRotationDegrees = rotationDegrees; } else { mRotationDegrees = 0; } } if (video) { Loading
media/libstagefright/Utils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,11 @@ status_t convertMetaDataToMessage( msg->setInt32("max-input-size", maxInputSize); } int32_t rotationDegrees; if (meta->findInt32(kKeyRotation, &rotationDegrees)) { msg->setInt32("rotation-degrees", rotationDegrees); } uint32_t type; const void *data; size_t size; Loading