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

Remove unused Inputstream addon functions and increase max props #17620

Merged
merged 4 commits into from Apr 8, 2020

Conversation

phunkyfish
Copy link
Contributor

@phunkyfish phunkyfish commented Apr 5, 2020

Description

  • Remove the unused function CanPauseStream and CanSeekStream from the Inputstream addon API.
  • Increases the max number of stream properties

Motivation and Context

Not enough properties for inputstream.ffmpegdirect.

How Has This Been Tested?

On inputstream.ffmpegdirect on OSX

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

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

@phunkyfish phunkyfish added Type: Improvement non-breaking change which improves existing functionality Component: Video API change: Binary add-ons v19 Matrix Type: Breaking change fix or feature that will cause existing functionality to change labels Apr 5, 2020
@phunkyfish phunkyfish added this to the Matrix 19.0-alpha 1 milestone Apr 5, 2020
@phunkyfish phunkyfish force-pushed the pause-props branch 2 times, most recently from 0d45cfa to 6d116de Compare April 5, 2020 22:58
@phunkyfish
Copy link
Contributor Author

I plan to merge this (hopefully tonight) once Jenkins is happy.

@@ -2821,6 +2822,22 @@ void CVideoPlayer::HandleMessages()
std::shared_ptr<CInputStreamPVRBase> pvrinputstream = std::static_pointer_cast<CInputStreamPVRBase>(m_pInputStream);
pvrinputstream->Pause(speed == 0);
}

// Inform an inputstream addon with a demuxer that an (un)pause has occurred
if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_ADDON) && speed != m_playSpeed &&
Copy link
Contributor

Choose a reason for hiding this comment

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

this block is nonsense, same applies to the pvr related code above. videoplayer controls reading from demuxer with SetSpeed. if user pauses player and buffers are not full, player continues to read until buffers are full.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is it nonsense? The api docs for pausestream simply state that a pause action has occurred. This happens for inputstreams without a demuxer but not for ones with one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, in hindsight, I agree 👍 this time can be inferred from the demux.

Copy link
Contributor

Choose a reason for hiding this comment

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

btw, wherever you see m_pInputStream->IsStreamType, you can safely assume that it is outdated crap and following this path does more harm than any good.

@FernetMenta
Copy link
Contributor

only used by Inputsream addons for some reason

you should really elaborate on this and make sure the root cause is not in your addon (which is very likely) before changing an API

@phunkyfish
Copy link
Contributor Author

The only inputstream in kodi that uses this API call is the addon inputstream. All the other ignore it.

Is there an issue with supplying a bPaused bool with this?

@phunkyfish
Copy link
Contributor Author

The alternative is create a function only in an Inpustream addon to provide this. But the thinking was why not make the current API more useful.

@AlwinEsch
Copy link
Member

See it that way, this function is not used anywhere else except for Inputstream. In History it was not immediately possible to find out when this was added.

On my part, it can be a good thing to inform an addon about it, especially if the addon also knows the associated time.

Since the function already exists on the addon interface, it would be good to extend it so that it is always called (and not only if addon has no demux).

@phunkyfish
Copy link
Contributor Author

I will revert the PauseTime changes and replace them with a comment stating that PauseStream is only ever called for an inputstream without it's own demuxer.

Thanks for the guidance again @FernetMenta and sorry for the noise.

@phunkyfish phunkyfish changed the title Remove unused Inputstream addon functions, increase max props and PauseStream() call in Video Player Remove unused Inputstream addon functions and increase max props Apr 7, 2020
@phunkyfish
Copy link
Contributor Author

Will merge this much smaller PR in the morning ;) (Hopefully)

@FernetMenta
Copy link
Contributor

See it that way, this function is not used anywhere else except for Inputstream. In History it was not immediately possible to find out when this was added.

I suggest to drop this function from the api. It is outdated and not needed. Inputstream addon started as a clone of pvr and this function was copied though not having been required.

@phunkyfish
Copy link
Contributor Author

phunkyfish commented Apr 8, 2020

I will do a follow up PR removing this function later today. I will need to preserve the functionality in the inputstream addon though as it is used there.

@phunkyfish phunkyfish merged commit 13cecb9 into xbmc:master Apr 8, 2020
@phunkyfish phunkyfish deleted the pause-props branch April 8, 2020 11:02
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Apr 8, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request May 5, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 3, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 5, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
Remove unused Inputstream addon functions and increase max props
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 7, 2020
Remove unused Inputstream addon functions and increase max props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change: Binary add-ons Component: Video Type: Breaking change fix or feature that will cause existing functionality to change Type: Improvement non-breaking change which improves existing functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants