Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amlcodec: cleanup and simplify 3D handling code #13552

Merged
merged 1 commit into from
Feb 25, 2018

Conversation

codesnake
Copy link
Contributor

Cleanup and simplify AMLCodec 3D handling code.

Description

AMLCodec historically uses AML kernel 3D post process manager for 3D to 2D conversion. In AML kernel 3.10 that worked more or less, but in kernel 3.14 it doesn't work at all and when you select 2D mode for a 3D video it just freezes. Because of that in LibreELEC AML 3D post process manager is disabled. When it is disabled Kodi just emulates 3D to 2D conversion by setting proper destination rectangle for video, displaying only top view for top/bottom (TAB) videos or only left view for left/right (SBS) videos. Because 3D to 2D coversion using AML 3D post process manager is not stable and causes problems I have removed that code from AMLCodec, but 3D to 2D conversion still continues to function properly.

Also I have removed the AMSTREAM_IOC_GET_3D_TYPE IOCTL call because it doesn't have any sense when AML 3D post process manager is disabled, and always returns 0. Moreover AMSTREAM_IOC_GET_3D_TYPE IOCTL was introduced only with kernel 3.14, so Kodi doesn't compile for older AML devices that use kernel 3.10, such as WeTek Core.

Motivation and Context

  • Cleanup and simplify code
  • Kodi doesn't compile for AML devices that use Linux kernel 3.10.

How Has This Been Tested?

Tested by playing TAB and SBS videos in 3D and 2D modes on a WeTek Hub (S905) connected to 3D TV.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@codesnake
Copy link
Contributor Author

Supersedes #13523

@stefansaraev
Copy link
Contributor

perhaps sysinfo should be cleaned up now. http://ix.io/Ltm

@codesnake
Copy link
Contributor Author

Thanks @stefansaraev, I have included your patch into my commit.

@codesnake
Copy link
Contributor Author

Ping @peak3d

@@ -54,8 +54,7 @@

// amcodec include
extern "C" {
#include <codec.h>
#include <amports/amstream.h>
#include <amcodec/codec.h>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

aml_ioctl_get(am_private->vcodec.handle, AMSTREAM_IOC_GET_3D_TYPE, (unsigned long)&decoder_sm);

switch (decoder_sm)
switch (m_processInfo.GetVideoSettings().m_StereoMode)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

}
else
SetVideo3dMode(MODE_3D_DISABLE);
std::string videoStereoMode = GetVideoStereoMode();

This comment was marked as spam.

@codesnake
Copy link
Contributor Author

@peak3d @da-anda As you suggested I have removed CAMLCodec::GetVideoStereoMode() and instead call m_processInfo.GetVideoStereoMode(). From my tests it seems to work correctly.

Copy link
Contributor

@peak3d peak3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peak3d peak3d merged commit ec16dbc into xbmc:master Feb 25, 2018
@Rechi Rechi added this to the L 18.0-alpha1 milestone Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants